summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsys.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-11-12 18:59:21 -1000
committerNat Goodspeed <nat@lindenlab.com>2022-11-12 18:59:21 -1000
commit4349cb6165e983ff6bdd45ad1b82bb98bfc0436f (patch)
treeeeb39af41808a4846a16a558118a4b929abe71bb /indra/llcommon/llsys.cpp
parentcd997f21c272987e954f5890ed14fcc327eb734e (diff)
DRTVWR-575: Address review comments on Xcode 14.1 type tweaks.
Introduce LLSD template constructors and assignment operators to disambiguate construction or assignment from any integer type to Integer, likewise any floating point type to Real. Use new narrow() function to validate conversions. For LLSD method parameters converted from LLSD::Integer to size_t, where the method previously checked for a negative argument, make it now check for size_t converted from negative: in other words, more than S32_MAX. The risk of having a parameter forced from negative to unsigned exceeds the risk of a valid length or index over that max. In lltracerecording.cpp's PeriodicRecording, now that mCurPeriod and mNumRecordedPeriods are size_t instead of S32, defend against subtracting 1 from 0. Use narrow() to validate newly-introduced narrowing conversions. Make llclamp() return the type of the raw input value, even if the types of the boundary values differ. std::ostream::tellp() no longer returns a value we can directly report as a number. Cast to U64.
Diffstat (limited to 'indra/llcommon/llsys.cpp')
-rw-r--r--indra/llcommon/llsys.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 1951ca6843..7a545843c0 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -909,7 +909,7 @@ void LLMemoryInfo::stream(std::ostream& s) const
// Now stream stats
BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap))
{
- s << pfx << std::setw(int(key_width+1)) << (pair.first + ':') << ' ';
+ s << pfx << std::setw(narrow(key_width+1)) << (pair.first + ':') << ' ';
LLSD value(pair.second);
if (value.isInteger())
s << std::setw(12) << value.asInteger();