summaryrefslogtreecommitdiff
path: root/indra/llcommon/llkeybind.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-11-03 14:58:32 -0400
committerNat Goodspeed <nat@lindenlab.com>2022-11-03 14:58:32 -0400
commit9522a0b7c16414fce2103cf58bfdd63aaf0cb01b (patch)
tree3384f6bbf9dac0e86fa8f39d98d483f1aaf09575 /indra/llcommon/llkeybind.cpp
parent206993f8439ee83f7d010860f421d1e0106daca0 (diff)
DRTVWR-575: Fix llcommon assumptions that size_t fits in 4 bytes.
It's a little distressing how often we have historically coded S32 or U32 to pass a length or index. There are more such assumptions in other viewer subdirectories, but this is a start.
Diffstat (limited to 'indra/llcommon/llkeybind.cpp')
-rw-r--r--indra/llcommon/llkeybind.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/indra/llcommon/llkeybind.cpp b/indra/llcommon/llkeybind.cpp
index 38696c2258..f47ba41bae 100644
--- a/indra/llcommon/llkeybind.cpp
+++ b/indra/llcommon/llkeybind.cpp
@@ -180,10 +180,10 @@ LLKeyBind::LLKeyBind(const LLSD &key_bind)
bool LLKeyBind::operator==(const LLKeyBind& rhs)
{
- U32 size = mData.size();
+ auto size = mData.size();
if (size != rhs.mData.size()) return false;
- for (U32 i = 0; i < size; i++)
+ for (size_t i = 0; i < size; i++)
{
if (mData[i] != rhs.mData[i]) return false;
}
@@ -193,7 +193,7 @@ bool LLKeyBind::operator==(const LLKeyBind& rhs)
bool LLKeyBind::operator!=(const LLKeyBind& rhs)
{
- U32 size = mData.size();
+ auto size = mData.size();
if (size != rhs.mData.size()) return true;
for (U32 i = 0; i < size; i++)
@@ -215,7 +215,7 @@ bool LLKeyBind::isEmpty() const
LLSD LLKeyBind::asLLSD() const
{
- S32 last = mData.size() - 1;
+ auto last = mData.size() - 1;
while (mData[last].empty())
{
last--;
@@ -380,7 +380,7 @@ void LLKeyBind::resetKeyData(S32 index)
void LLKeyBind::trimEmpty()
{
- S32 last = mData.size() - 1;
+ auto last = mData.size() - 1;
while (last >= 0 && mData[last].empty())
{
mData.erase(mData.begin() + last);
@@ -388,7 +388,7 @@ void LLKeyBind::trimEmpty()
}
}
-U32 LLKeyBind::getDataCount()
+size_t LLKeyBind::getDataCount()
{
return mData.size();
}