summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-28 12:48:48 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-28 12:48:48 -0800
commit5a34cf1af83314774f11b0d24279794794bc9147 (patch)
tree720b576c642646f27d3e5b4f7ccba91b9e708371 /indra/llcommon
parent2795661869e3dbbfe1e6becec1d6bb3635eafd3b (diff)
parentfc8e185fafcfea1ead8b9c064ed38d5ac65f81b6 (diff)
Merge from viewer2 trunk.
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llallocator_heap_profile.cpp31
-rw-r--r--indra/llcommon/llchat.h4
-rw-r--r--indra/llcommon/lldate.cpp3
-rw-r--r--indra/llcommon/llprocessor.cpp3
-rw-r--r--indra/llcommon/llstring.h1
-rw-r--r--indra/llcommon/lluri.cpp15
6 files changed, 38 insertions, 19 deletions
diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp
index 0a807702d0..e50d59fd4b 100644
--- a/indra/llcommon/llallocator_heap_profile.cpp
+++ b/indra/llcommon/llallocator_heap_profile.cpp
@@ -113,21 +113,24 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text)
++j;
while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens
- llassert_always(j != line_elems.end());
- ++j; // skip the '@'
-
- mLines.push_back(line(live_count, live_size, tot_count, tot_size));
- line & current_line = mLines.back();
-
- for(; j != line_elems.end(); ++j)
- {
- if(!j->empty()) {
- U32 marker = boost::lexical_cast<U32>(*j);
- current_line.mTrace.push_back(marker);
- }
- }
+ llassert(j != line_elems.end());
+ if (j != line_elems.end())
+ {
+ ++j; // skip the '@'
+
+ mLines.push_back(line(live_count, live_size, tot_count, tot_size));
+ line & current_line = mLines.back();
+
+ for(; j != line_elems.end(); ++j)
+ {
+ if(!j->empty())
+ {
+ U32 marker = boost::lexical_cast<U32>(*j);
+ current_line.mTrace.push_back(marker);
+ }
+ }
+ }
}
-
// *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it
}
diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h
index 5af7991006..46456882ba 100644
--- a/indra/llcommon/llchat.h
+++ b/indra/llcommon/llchat.h
@@ -87,7 +87,8 @@ public:
mTimeStr(),
mPosAgent(),
mURL(),
- mChatStyle(CHAT_STYLE_NORMAL)
+ mChatStyle(CHAT_STYLE_NORMAL),
+ mSessionID()
{ }
std::string mText; // UTF-8 line of text
@@ -102,6 +103,7 @@ public:
LLVector3 mPosAgent;
std::string mURL;
EChatStyle mChatStyle;
+ LLUUID mSessionID;
};
#endif
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp
index ca7e471bf2..de7f2ead74 100644
--- a/indra/llcommon/lldate.cpp
+++ b/indra/llcommon/lldate.cpp
@@ -152,7 +152,8 @@ void LLDate::toStream(std::ostream& s) const
s << '.' << std::setw(2)
<< (int)(exp_time.tm_usec / (LL_APR_USEC_PER_SEC / 100));
}
- s << 'Z';
+ s << 'Z'
+ << std::setfill(' ');
}
bool LLDate::split(S32 *year, S32 *month, S32 *day, S32 *hour, S32 *min, S32 *sec) const
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 469e544b16..8a4a4a8f9a 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -281,7 +281,8 @@ bool CProcessor::AnalyzeIntelProcessor()
// already have a string here from GetCPUInfo(). JC
if ( CPUInfo.uiBrandID < LL_ARRAY_SIZE(INTEL_BRAND) )
{
- strcpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID]);
+ strncpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID], sizeof(CPUInfo.strBrandID)-1);
+ CPUInfo.strBrandID[sizeof(CPUInfo.strBrandID)-1]='\0';
if (CPUInfo.uiBrandID == 3 && CPUInfo.uiModel == 6)
{
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 31e70e0fe4..62cedcde4e 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -882,6 +882,7 @@ void LLStringUtilBase<T>::addCRLF(std::basic_string<T>& string)
}
string.assign(t, size);
+ delete[] t;
}
}
diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp
index f6e8f01f0e..9d4f3a98f0 100644
--- a/indra/llcommon/lluri.cpp
+++ b/indra/llcommon/lluri.cpp
@@ -46,10 +46,21 @@
void encode_character(std::ostream& ostr, std::string::value_type val)
{
- ostr << "%" << std::uppercase << std::hex << std::setw(2) << std::setfill('0')
+ ostr << "%"
+
+ << std::uppercase
+ << std::hex
+ << std::setw(2)
+ << std::setfill('0')
+
// VWR-4010 Cannot cast to U32 because sign-extension on
// chars > 128 will result in FFFFFFC3 instead of F3.
- << static_cast<S32>(static_cast<U8>(val));
+ << static_cast<S32>(static_cast<U8>(val))
+
+ // reset stream state
+ << std::nouppercase
+ << std::dec
+ << std::setfill(' ');
}
// static