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/osg/DisplaySettings.cpp

    r9973 r10415  
    1414#include <osg/ArgumentParser> 
    1515#include <osg/ApplicationUsage> 
     16#include <osg/Math> 
    1617#include <osg/Notify> 
    1718#include <osg/ref_ptr> 
     
    269270    if( (ptr = getenv("OSG_EYE_SEPARATION")) != 0) 
    270271    { 
    271         _eyeSeparation = atof(ptr); 
     272        _eyeSeparation = osg::asciiToFloat(ptr); 
    272273    } 
    273274 
    274275    if( (ptr = getenv("OSG_SCREEN_WIDTH")) != 0) 
    275276    { 
    276         _screenWidth = atof(ptr); 
     277        _screenWidth = osg::asciiToFloat(ptr); 
    277278    } 
    278279 
    279280    if( (ptr = getenv("OSG_SCREEN_HEIGHT")) != 0) 
    280281    { 
    281         _screenHeight = atof(ptr); 
     282        _screenHeight = osg::asciiToFloat(ptr); 
    282283    } 
    283284 
    284285    if( (ptr = getenv("OSG_SCREEN_DISTANCE")) != 0) 
    285286    { 
    286         _screenDistance = atof(ptr); 
     287        _screenDistance = osg::asciiToFloat(ptr); 
    287288    } 
    288289