Show
Ignore:
Timestamp:
06/25/09 18:07:49 (5 years ago)
Author:
robert
Message:

From Mathias Froehlich, "We are currently getting issues with locale settings and some osg plugins.
Therefore I have changed all the occurances of atof by asciiToFloat or
asciiToDouble.

I believe that it is safe to do so at least for all the plugins.
Included here are also asciiToFloat conversion of environment variables. One
might argue that these should be locale dependent. But IMO these should be
set and interpreted by osg independent of the current locale.
"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/bsp/VBSPEntity.cpp

    r9475 r10415  
    182182Vec3f VBSPEntity::getVector(std::string str) 
    183183{ 
    184     double x, y, z; 
     184    float x, y, z; 
    185185 
    186186    // Look for the first non-whitespace 
     
    191191 
    192192    if ((end > start) && (start != std::string::npos)) 
    193         x = atof(str.substr(start, end-start).c_str()); 
     193        x = osg::asciiToFloat(str.substr(start, end-start).c_str()); 
    194194    else 
    195195        return Vec3f(); 
     
    202202 
    203203    if ((end > start) && (start != std::string::npos)) 
    204         y = atof(str.substr(start, end-start).c_str()); 
     204        y = osg::asciiToFloat(str.substr(start, end-start).c_str()); 
    205205    else 
    206206        return Vec3f(); 
     
    215215 
    216216    if ((end > start) && (start != std::string::npos)) 
    217         z = atof(str.substr(start, end-start).c_str()); 
     217        z = osg::asciiToFloat(str.substr(start, end-start).c_str()); 
    218218    else 
    219219        return Vec3f();