diff options
author | Richard Linden <none@none> | 2011-08-19 11:27:03 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2011-08-19 11:27:03 -0700 |
commit | e15c97404f1e69745e055beea53aef67f5aa8ccc (patch) | |
tree | c83bec119067cbbf4d23c4b13d12eafdd31db5c2 /indra/llcommon/llsdserialize_xml.cpp | |
parent | f40d2c5afb78f4a17b4753c42f6756dbd76a18c8 (diff) | |
parent | cc4e708848ce0be958353b8aa16d0c41c2a265bb (diff) |
Automated merge with http://hg.secondlife.com/viewer-development
Diffstat (limited to 'indra/llcommon/llsdserialize_xml.cpp')
-rw-r--r-- | indra/llcommon/llsdserialize_xml.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index d8213c4477..bf216d41bf 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -720,6 +720,7 @@ void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name) case ELEMENT_INTEGER: { S32 i; + // sscanf okay here with different locales - ints don't change for different locale settings like floats do. if ( sscanf(mCurrentContent.c_str(), "%d", &i ) == 1 ) { // See if sscanf works - it's faster value = i; @@ -733,15 +734,19 @@ void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name) case ELEMENT_REAL: { - F64 r; - if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 ) - { // See if sscanf works - it's faster - value = r; - } - else - { - value = LLSD(mCurrentContent).asReal(); - } + value = LLSD(mCurrentContent).asReal(); + // removed since this breaks when locale has decimal separator that isn't '.' + // investigated changing local to something compatible each time but deemed higher + // risk that just using LLSD.asReal() each time. + //F64 r; + //if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 ) + //{ // See if sscanf works - it's faster + // value = r; + //} + //else + //{ + // value = LLSD(mCurrentContent).asReal(); + //} } break; |