summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-08-20 06:34:17 -0400
committerOz Linden <oz@lindenlab.com>2011-08-20 06:34:17 -0400
commit50ea915256d8c23c708a27154bb70e052c86ff51 (patch)
tree8e7ab6d46c775e756ac27ebb0511eb3c33fa4e32 /indra/llcommon
parentfd2b0084bf92e34d35a9a7e3a90f15526f390927 (diff)
parente15c97404f1e69745e055beea53aef67f5aa8ccc (diff)
merge changes for storm-1565
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llsdserialize.cpp2
-rw-r--r--indra/llcommon/llsdserialize_xml.cpp23
2 files changed, 14 insertions, 11 deletions
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index 6610daa1e0..bf62600514 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -313,10 +313,8 @@ LLSDParser::LLSDParser()
LLSDParser::~LLSDParser()
{ }
-LLFastTimer::DeclareTimer FTM_SD_PARSE("LLSD Parsing");
S32 LLSDParser::parse(std::istream& istr, LLSD& data, S32 max_bytes)
{
- LLFastTimer _(FTM_SD_PARSE);
mCheckLimits = (LLSDSerialize::SIZE_UNLIMITED == max_bytes) ? false : true;
mMaxBytesLeft = max_bytes;
return doParse(istr, data);
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;