Feature #118

Centralize atoi-like functions

Added by kervala over 10 years ago. Updated over 8 years ago.

Status:Closed Start date:09/19/2008
Priority:High Due date:
Assignee:kervala % Done:

100%

Category:NeL: General
Target version:Version 0.7.0 Estimated time:5.00 hours

Description

common.h, mem_stream.h and some other files are implementing atoi-like conversion functions.

We should centralize them all in common.h and common.cpp, and be sure strings could be converted to all integer types of NeL (signed and unsigned 8, 16, 32 and 64 bits).

History

#1 Updated by kaetemi over 10 years ago

Wasn't there a fromString(blah, blah) or something function for this already?

#2 Updated by kervala over 10 years ago

You're right (in string_common.h) but fonctions declared in other files are useless in this case... several functions to do the same thing :s

#3 Updated by kervala over 10 years ago

  • Status changed from Assigned to Closed

Useless issue, because all functions have different uses...

fromString and toString have to be privilegied for NeL projects :)

#4 Updated by kervala over 10 years ago

Make sure fromString methods are returning 0 in case of error.

atoi returns INT_MAX or INT_MIN when values are out of range and 0 when the string could not be converted.

sscanf doesn't change the value when an error occured so we need ton explicity set it to 0.

#5 Updated by kervala about 10 years ago

  • % Done changed from 0 to 100

#6 Updated by kervala over 8 years ago

  • Project changed from NeL to Ryzom
  • Category deleted (Misc)
  • Target version deleted (Version 0.7.0)

#7 Updated by kervala over 8 years ago

  • Category set to NeL: General
  • Target version set to Version 0.7.0

Also available in: Atom PDF