summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llmessage/lldatapacker.cpp556
-rw-r--r--indra/llmessage/lldatapacker.h312
-rw-r--r--indra/newview/llphysicsmotion.cpp4
3 files changed, 436 insertions, 436 deletions
diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp
index 9f7768f78e..b3113cd5d8 100644
--- a/indra/llmessage/lldatapacker.cpp
+++ b/indra/llmessage/lldatapacker.cpp
@@ -45,7 +45,7 @@ const S32 DP_BUFSIZE = 512;
static char DUMMY_BUFFER[128]; /*Flawfinder: ignore*/
-LLDataPacker::LLDataPacker() : mPassFlags(0), mWriteEnabled(FALSE)
+LLDataPacker::LLDataPacker() : mPassFlags(0), mWriteEnabled(false)
{
}
@@ -61,10 +61,10 @@ void LLDataPacker::dumpBufferToLog()
LL_ERRS() << "dumpBufferToLog not implemented for this type!" << LL_ENDL;
}
-BOOL LLDataPacker::packFixed(const F32 value, const char *name,
- const BOOL is_signed, const U32 int_bits, const U32 frac_bits)
+bool LLDataPacker::packFixed(const F32 value, const char *name,
+ const bool is_signed, const U32 int_bits, const U32 frac_bits)
{
- BOOL success = TRUE;
+ bool success = true;
S32 unsigned_bits = int_bits + frac_bits;
S32 total_bits = unsigned_bits;
@@ -113,10 +113,10 @@ BOOL LLDataPacker::packFixed(const F32 value, const char *name,
return success;
}
-BOOL LLDataPacker::unpackFixed(F32 &value, const char *name,
- const BOOL is_signed, const U32 int_bits, const U32 frac_bits)
+bool LLDataPacker::unpackFixed(F32 &value, const char *name,
+ const bool is_signed, const U32 int_bits, const U32 frac_bits)
{
- BOOL success = TRUE;
+ bool success = true;
//LL_INFOS() << "unpackFixed:" << name << " int:" << int_bits << " frac:" << frac_bits << LL_ENDL;
S32 unsigned_bits = int_bits + frac_bits;
S32 total_bits = unsigned_bits;
@@ -166,82 +166,82 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name,
return success;
}
-BOOL LLDataPacker::unpackU16s(U16 *values, S32 count, const char *name)
+bool LLDataPacker::unpackU16s(U16 *values, S32 count, const char *name)
{
for (S32 idx = 0; idx < count; ++idx)
{
if (!unpackU16(values[idx], name))
{
LL_WARNS("DATAPACKER") << "Buffer overflow reading Unsigned 16s \"" << name << "\" at index " << idx << "!" << LL_ENDL;
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
-BOOL LLDataPacker::unpackS16s(S16 *values, S32 count, const char *name)
+bool LLDataPacker::unpackS16s(S16 *values, S32 count, const char *name)
{
for (S32 idx = 0; idx < count; ++idx)
{
if (!unpackS16(values[idx], name))
{
LL_WARNS("DATAPACKER") << "Buffer overflow reading Signed 16s \"" << name << "\" at index " << idx << "!" << LL_ENDL;
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
-BOOL LLDataPacker::unpackF32s(F32 *values, S32 count, const char *name)
+bool LLDataPacker::unpackF32s(F32 *values, S32 count, const char *name)
{
for (S32 idx = 0; idx < count; ++idx)
{
if (!unpackF32(values[idx], name))
{
LL_WARNS("DATAPACKER") << "Buffer overflow reading Float 32s \"" << name << "\" at index " << idx << "!" << LL_ENDL;
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
-BOOL LLDataPacker::unpackColor4Us(LLColor4U *values, S32 count, const char *name)
+bool LLDataPacker::unpackColor4Us(LLColor4U *values, S32 count, const char *name)
{
for (S32 idx = 0; idx < count; ++idx)
{
if (!unpackColor4U(values[idx], name))
{
LL_WARNS("DATAPACKER") << "Buffer overflow reading Float 32s \"" << name << "\" at index " << idx << "!" << LL_ENDL;
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
-BOOL LLDataPacker::unpackUUIDs(LLUUID *values, S32 count, const char *name)
+bool LLDataPacker::unpackUUIDs(LLUUID *values, S32 count, const char *name)
{
for (S32 idx = 0; idx < count; ++idx)
{
if (!unpackUUID(values[idx], name))
{
LL_WARNS("DATAPACKER") << "Buffer overflow reading UUIDs \"" << name << "\" at index " << idx << "!" << LL_ENDL;
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
//---------------------------------------------------------------------------
// LLDataPackerBinaryBuffer implementation
//---------------------------------------------------------------------------
-BOOL LLDataPackerBinaryBuffer::packString(const std::string& value, const char *name)
+bool LLDataPackerBinaryBuffer::packString(const std::string& value, const char *name)
{
S32 length = value.length()+1;
if (!verifyLength(length, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -249,30 +249,30 @@ BOOL LLDataPackerBinaryBuffer::packString(const std::string& value, const char *
htolememcpy(mCurBufferp, value.c_str(), MVT_VARIABLE, length);
}
mCurBufferp += length;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackString(std::string& value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackString(std::string& value, const char *name)
{
S32 length = (S32)strlen((char *)mCurBufferp) + 1; /*Flawfinder: ignore*/
if (!verifyLength(length, name))
{
- return FALSE;
+ return false;
}
value = std::string((char*)mCurBufferp); // We already assume NULL termination calling strlen()
mCurBufferp += length;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packBinaryData(const U8 *value, S32 size, const char *name)
+bool LLDataPackerBinaryBuffer::packBinaryData(const U8 *value, S32 size, const char *name)
{
if (!verifyLength(size + 4, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -285,16 +285,16 @@ BOOL LLDataPackerBinaryBuffer::packBinaryData(const U8 *value, S32 size, const c
htolememcpy(mCurBufferp, value, MVT_VARIABLE, size);
}
mCurBufferp += size;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char *name)
+bool LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char *name)
{
if (!verifyLength(4, name))
{
LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << LL_ENDL;
- return FALSE;
+ return false;
}
htolememcpy(&size, mCurBufferp, MVT_S32, 4);
@@ -303,21 +303,21 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char
if (!verifyLength(size, name))
{
LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << LL_ENDL;
- return FALSE;
+ return false;
}
htolememcpy(value, mCurBufferp, MVT_VARIABLE, size);
mCurBufferp += size;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packBinaryDataFixed(const U8 *value, S32 size, const char *name)
+bool LLDataPackerBinaryBuffer::packBinaryDataFixed(const U8 *value, S32 size, const char *name)
{
if (!verifyLength(size, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -325,27 +325,27 @@ BOOL LLDataPackerBinaryBuffer::packBinaryDataFixed(const U8 *value, S32 size, co
htolememcpy(mCurBufferp, value, MVT_VARIABLE, size);
}
mCurBufferp += size;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const char *name)
+bool LLDataPackerBinaryBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const char *name)
{
if (!verifyLength(size, name))
{
- return FALSE;
+ return false;
}
htolememcpy(value, mCurBufferp, MVT_VARIABLE, size);
mCurBufferp += size;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packU8(const U8 value, const char *name)
+bool LLDataPackerBinaryBuffer::packU8(const U8 value, const char *name)
{
if (!verifyLength(sizeof(U8), name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -353,28 +353,28 @@ BOOL LLDataPackerBinaryBuffer::packU8(const U8 value, const char *name)
*mCurBufferp = value;
}
mCurBufferp++;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackU8(U8 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackU8(U8 &value, const char *name)
{
if (!verifyLength(sizeof(U8), name))
{
- return FALSE;
+ return false;
}
value = *mCurBufferp;
mCurBufferp++;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packU16(const U16 value, const char *name)
+bool LLDataPackerBinaryBuffer::packU16(const U16 value, const char *name)
{
if (!verifyLength(sizeof(U16), name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -382,25 +382,25 @@ BOOL LLDataPackerBinaryBuffer::packU16(const U16 value, const char *name)
htolememcpy(mCurBufferp, &value, MVT_U16, 2);
}
mCurBufferp += 2;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackU16(U16 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackU16(U16 &value, const char *name)
{
if (!verifyLength(sizeof(U16), name))
{
- return FALSE;
+ return false;
}
htolememcpy(&value, mCurBufferp, MVT_U16, 2);
mCurBufferp += 2;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packS16(const S16 value, const char *name)
+bool LLDataPackerBinaryBuffer::packS16(const S16 value, const char *name)
{
- BOOL success = verifyLength(sizeof(S16), name);
+ bool success = verifyLength(sizeof(S16), name);
if (mWriteEnabled && success)
{
@@ -410,9 +410,9 @@ BOOL LLDataPackerBinaryBuffer::packS16(const S16 value, const char *name)
return success;
}
-BOOL LLDataPackerBinaryBuffer::unpackS16(S16 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackS16(S16 &value, const char *name)
{
- BOOL success = verifyLength(sizeof(S16), name);
+ bool success = verifyLength(sizeof(S16), name);
if (success)
{
@@ -422,11 +422,11 @@ BOOL LLDataPackerBinaryBuffer::unpackS16(S16 &value, const char *name)
return success;
}
-BOOL LLDataPackerBinaryBuffer::packU32(const U32 value, const char *name)
+bool LLDataPackerBinaryBuffer::packU32(const U32 value, const char *name)
{
if (!verifyLength(sizeof(U32), name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -434,28 +434,28 @@ BOOL LLDataPackerBinaryBuffer::packU32(const U32 value, const char *name)
htolememcpy(mCurBufferp, &value, MVT_U32, 4);
}
mCurBufferp += 4;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackU32(U32 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackU32(U32 &value, const char *name)
{
if (!verifyLength(sizeof(U32), name))
{
- return FALSE;
+ return false;
}
htolememcpy(&value, mCurBufferp, MVT_U32, 4);
mCurBufferp += 4;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packS32(const S32 value, const char *name)
+bool LLDataPackerBinaryBuffer::packS32(const S32 value, const char *name)
{
if (!verifyLength(sizeof(S32), name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -463,28 +463,28 @@ BOOL LLDataPackerBinaryBuffer::packS32(const S32 value, const char *name)
htolememcpy(mCurBufferp, &value, MVT_S32, 4);
}
mCurBufferp += 4;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackS32(S32 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackS32(S32 &value, const char *name)
{
if(!verifyLength(sizeof(S32), name))
{
- return FALSE;
+ return false;
}
htolememcpy(&value, mCurBufferp, MVT_S32, 4);
mCurBufferp += 4;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packF32(const F32 value, const char *name)
+bool LLDataPackerBinaryBuffer::packF32(const F32 value, const char *name)
{
if (!verifyLength(sizeof(F32), name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -492,28 +492,28 @@ BOOL LLDataPackerBinaryBuffer::packF32(const F32 value, const char *name)
htolememcpy(mCurBufferp, &value, MVT_F32, 4);
}
mCurBufferp += 4;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackF32(F32 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackF32(F32 &value, const char *name)
{
if (!verifyLength(sizeof(F32), name))
{
- return FALSE;
+ return false;
}
htolememcpy(&value, mCurBufferp, MVT_F32, 4);
mCurBufferp += 4;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packColor4(const LLColor4 &value, const char *name)
+bool LLDataPackerBinaryBuffer::packColor4(const LLColor4 &value, const char *name)
{
if (!verifyLength(16, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -521,28 +521,28 @@ BOOL LLDataPackerBinaryBuffer::packColor4(const LLColor4 &value, const char *nam
htolememcpy(mCurBufferp, value.mV, MVT_LLVector4, 16);
}
mCurBufferp += 16;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackColor4(LLColor4 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackColor4(LLColor4 &value, const char *name)
{
if (!verifyLength(16, name))
{
- return FALSE;
+ return false;
}
htolememcpy(value.mV, mCurBufferp, MVT_LLVector4, 16);
mCurBufferp += 16;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packColor4U(const LLColor4U &value, const char *name)
+bool LLDataPackerBinaryBuffer::packColor4U(const LLColor4U &value, const char *name)
{
if (!verifyLength(4, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -550,29 +550,29 @@ BOOL LLDataPackerBinaryBuffer::packColor4U(const LLColor4U &value, const char *n
htolememcpy(mCurBufferp, value.mV, MVT_VARIABLE, 4);
}
mCurBufferp += 4;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackColor4U(LLColor4U &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackColor4U(LLColor4U &value, const char *name)
{
if (!verifyLength(4, name))
{
- return FALSE;
+ return false;
}
htolememcpy(value.mV, mCurBufferp, MVT_VARIABLE, 4);
mCurBufferp += 4;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packVector2(const LLVector2 &value, const char *name)
+bool LLDataPackerBinaryBuffer::packVector2(const LLVector2 &value, const char *name)
{
if (!verifyLength(8, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -581,29 +581,29 @@ BOOL LLDataPackerBinaryBuffer::packVector2(const LLVector2 &value, const char *n
htolememcpy(mCurBufferp+4, &value.mV[1], MVT_F32, 4);
}
mCurBufferp += 8;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackVector2(LLVector2 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackVector2(LLVector2 &value, const char *name)
{
if (!verifyLength(8, name))
{
- return FALSE;
+ return false;
}
htolememcpy(&value.mV[0], mCurBufferp, MVT_F32, 4);
htolememcpy(&value.mV[1], mCurBufferp+4, MVT_F32, 4);
mCurBufferp += 8;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packVector3(const LLVector3 &value, const char *name)
+bool LLDataPackerBinaryBuffer::packVector3(const LLVector3 &value, const char *name)
{
if (!verifyLength(12, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -611,27 +611,27 @@ BOOL LLDataPackerBinaryBuffer::packVector3(const LLVector3 &value, const char *n
htolememcpy(mCurBufferp, value.mV, MVT_LLVector3, 12);
}
mCurBufferp += 12;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackVector3(LLVector3 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackVector3(LLVector3 &value, const char *name)
{
if (!verifyLength(12, name))
{
- return FALSE;
+ return false;
}
htolememcpy(value.mV, mCurBufferp, MVT_LLVector3, 12);
mCurBufferp += 12;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packVector4(const LLVector4 &value, const char *name)
+bool LLDataPackerBinaryBuffer::packVector4(const LLVector4 &value, const char *name)
{
if (!verifyLength(16, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -639,27 +639,27 @@ BOOL LLDataPackerBinaryBuffer::packVector4(const LLVector4 &value, const char *n
htolememcpy(mCurBufferp, value.mV, MVT_LLVector4, 16);
}
mCurBufferp += 16;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackVector4(LLVector4 &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackVector4(LLVector4 &value, const char *name)
{
if (!verifyLength(16, name))
{
- return FALSE;
+ return false;
}
htolememcpy(value.mV, mCurBufferp, MVT_LLVector4, 16);
mCurBufferp += 16;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::packUUID(const LLUUID &value, const char *name)
+bool LLDataPackerBinaryBuffer::packUUID(const LLUUID &value, const char *name)
{
if (!verifyLength(16, name))
{
- return FALSE;
+ return false;
}
if (mWriteEnabled)
@@ -667,20 +667,20 @@ BOOL LLDataPackerBinaryBuffer::packUUID(const LLUUID &value, const char *name)
htolememcpy(mCurBufferp, value.mData, MVT_LLUUID, 16);
}
mCurBufferp += 16;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerBinaryBuffer::unpackUUID(LLUUID &value, const char *name)
+bool LLDataPackerBinaryBuffer::unpackUUID(LLUUID &value, const char *name)
{
if (!verifyLength(16, name))
{
- return FALSE;
+ return false;
}
htolememcpy(value.mData, mCurBufferp, MVT_LLUUID, 16);
mCurBufferp += 16;
- return TRUE;
+ return true;
}
const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLDataPackerBinaryBuffer &a)
@@ -722,9 +722,9 @@ void LLDataPackerBinaryBuffer::dumpBufferToLog()
//---------------------------------------------------------------------------
// LLDataPackerAsciiBuffer implementation
//---------------------------------------------------------------------------
-BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *name)
+bool LLDataPackerAsciiBuffer::packString(const std::string& value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -752,21 +752,21 @@ BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n
return success;
}
-BOOL LLDataPackerAsciiBuffer::unpackString(std::string& value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackString(std::string& value, const char *name)
{
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore*/
if (!getValueStr(name, valuestr, DP_BUFSIZE)) // NULL terminated
{
- return FALSE;
+ return false;
}
value = valuestr;
- return TRUE;
+ return true;
}
-BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const char *name)
+bool LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
@@ -789,7 +789,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
S32 i;
- BOOL bBufferFull = FALSE;
+ bool bBufferFull = false;
for (i = 0; i < size && !bBufferFull; i++)
{
numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */
@@ -797,7 +797,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
{
numCopied = getBufferSize()-getCurrentSize();
LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << LL_ENDL;
- bBufferFull = TRUE;
+ bBufferFull = true;
}
mCurBufferp += numCopied;
}
@@ -829,13 +829,13 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
}
-BOOL LLDataPackerAsciiBuffer::unpackBinaryData(U8 *value, S32 &size, const char *name)
+bool LLDataPackerAsciiBuffer::unpackBinaryData(U8 *value, S32 &size, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
char *cur_pos = &valuestr[0];
@@ -854,16 +854,16 @@ BOOL LLDataPackerAsciiBuffer::unpackBinaryData(U8 *value, S32 &size, const char
}
-BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, const char *name)
+bool LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mWriteEnabled)
{
S32 i;
int numCopied = 0;
- BOOL bBufferFull = FALSE;
+ bool bBufferFull = false;
for (i = 0; i < size && !bBufferFull; i++)
{
numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */
@@ -871,7 +871,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con
{
numCopied = getBufferSize()-getCurrentSize();
LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << LL_ENDL;
- bBufferFull = TRUE;
+ bBufferFull = true;
}
mCurBufferp += numCopied;
@@ -901,13 +901,13 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con
}
-BOOL LLDataPackerAsciiBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const char *name)
+bool LLDataPackerAsciiBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
char *cur_pos = &valuestr[0];
@@ -925,9 +925,9 @@ BOOL LLDataPackerAsciiBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const c
-BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name)
+bool LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -958,13 +958,13 @@ BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::unpackU8(U8 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackU8(U8 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
S32 in_val;
@@ -973,9 +973,9 @@ BOOL LLDataPackerAsciiBuffer::unpackU8(U8 &value, const char *name)
return success;
}
-BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name)
+bool LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1005,13 +1005,13 @@ BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::unpackU16(U16 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackU16(U16 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
S32 in_val;
@@ -1020,9 +1020,9 @@ BOOL LLDataPackerAsciiBuffer::unpackU16(U16 &value, const char *name)
return success;
}
-BOOL LLDataPackerAsciiBuffer::packS16(const S16 value, const char *name)
+bool LLDataPackerAsciiBuffer::packS16(const S16 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1052,13 +1052,13 @@ BOOL LLDataPackerAsciiBuffer::packS16(const S16 value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::unpackS16(S16 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackS16(S16 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
S32 in_val;
@@ -1067,9 +1067,9 @@ BOOL LLDataPackerAsciiBuffer::unpackS16(S16 &value, const char *name)
return success;
}
-BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name)
+bool LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1097,13 +1097,13 @@ BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::unpackU32(U32 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackU32(U32 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%u", &value);
@@ -1111,9 +1111,9 @@ BOOL LLDataPackerAsciiBuffer::unpackU32(U32 &value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name)
+bool LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1141,13 +1141,13 @@ BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::unpackS32(S32 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackS32(S32 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%d", &value);
@@ -1155,9 +1155,9 @@ BOOL LLDataPackerAsciiBuffer::unpackS32(S32 &value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name)
+bool LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1185,13 +1185,13 @@ BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::unpackF32(F32 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackF32(F32 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f", &value);
@@ -1199,9 +1199,9 @@ BOOL LLDataPackerAsciiBuffer::unpackF32(F32 &value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name)
+bool LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1229,22 +1229,22 @@ BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name
}
-BOOL LLDataPackerAsciiBuffer::unpackColor4(LLColor4 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackColor4(LLColor4 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]);
return success;
}
-BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *name)
+bool LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1272,13 +1272,13 @@ BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *na
}
-BOOL LLDataPackerAsciiBuffer::unpackColor4U(LLColor4U &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackColor4U(LLColor4U &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
S32 r, g, b, a;
@@ -1292,9 +1292,9 @@ BOOL LLDataPackerAsciiBuffer::unpackColor4U(LLColor4U &value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *name)
+bool LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1322,13 +1322,13 @@ BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *na
}
-BOOL LLDataPackerAsciiBuffer::unpackVector2(LLVector2 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackVector2(LLVector2 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f %f", &value.mV[0], &value.mV[1]);
@@ -1336,9 +1336,9 @@ BOOL LLDataPackerAsciiBuffer::unpackVector2(LLVector2 &value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *name)
+bool LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1366,22 +1366,22 @@ BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *na
}
-BOOL LLDataPackerAsciiBuffer::unpackVector3(LLVector3 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackVector3(LLVector3 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f %f %f", &value.mV[0], &value.mV[1], &value.mV[2]);
return success;
}
-BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *name)
+bool LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
if (mWriteEnabled)
@@ -1409,13 +1409,13 @@ BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *na
}
-BOOL LLDataPackerAsciiBuffer::unpackVector4(LLVector4 &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackVector4(LLVector4 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]);
@@ -1423,9 +1423,9 @@ BOOL LLDataPackerAsciiBuffer::unpackVector4(LLVector4 &value, const char *name)
}
-BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name)
+bool LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
int numCopied = 0;
@@ -1449,20 +1449,20 @@ BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name)
{
numCopied = getBufferSize()-getCurrentSize();
LL_WARNS() << "LLDataPackerAsciiBuffer::packUUID: truncated: " << LL_ENDL;
- success = FALSE;
+ success = false;
}
mCurBufferp += numCopied;
return success;
}
-BOOL LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name)
+bool LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
char tmp_str[64]; /* Flawfinder: ignore */
@@ -1507,9 +1507,9 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name)
}
}
-BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 value_len)
+bool LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 value_len)
{
- BOOL success = TRUE;
+ bool success = true;
char buffer[DP_BUFSIZE]; /* Flawfinder: ignore */
char keyword[DP_BUFSIZE]; /* Flawfinder: ignore */
char value[DP_BUFSIZE]; /* Flawfinder: ignore */
@@ -1530,7 +1530,7 @@ BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32
if (strcmp(keyword, name))
{
LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL;
- return FALSE;
+ return false;
}
}
else
@@ -1565,9 +1565,9 @@ std::string convertF32ToString(F32 val)
//---------------------------------------------------------------------------
// LLDataPackerAsciiFile implementation
//---------------------------------------------------------------------------
-BOOL LLDataPackerAsciiFile::packString(const std::string& value, const char *name)
+bool LLDataPackerAsciiFile::packString(const std::string& value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1580,22 +1580,22 @@ BOOL LLDataPackerAsciiFile::packString(const std::string& value, const char *nam
return success;
}
-BOOL LLDataPackerAsciiFile::unpackString(std::string& value, const char *name)
+bool LLDataPackerAsciiFile::unpackString(std::string& value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
value = valuestr;
return success;
}
-BOOL LLDataPackerAsciiFile::packBinaryData(const U8 *value, S32 size, const char *name)
+bool LLDataPackerAsciiFile::packBinaryData(const U8 *value, S32 size, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
@@ -1627,13 +1627,13 @@ BOOL LLDataPackerAsciiFile::packBinaryData(const U8 *value, S32 size, const char
}
-BOOL LLDataPackerAsciiFile::unpackBinaryData(U8 *value, S32 &size, const char *name)
+bool LLDataPackerAsciiFile::unpackBinaryData(U8 *value, S32 &size, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore*/
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
char *cur_pos = &valuestr[0];
@@ -1652,9 +1652,9 @@ BOOL LLDataPackerAsciiFile::unpackBinaryData(U8 *value, S32 &size, const char *n
}
-BOOL LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const char *name)
+bool LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
@@ -1681,13 +1681,13 @@ BOOL LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const
}
-BOOL LLDataPackerAsciiFile::unpackBinaryDataFixed(U8 *value, S32 size, const char *name)
+bool LLDataPackerAsciiFile::unpackBinaryDataFixed(U8 *value, S32 size, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore*/
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
char *cur_pos = &valuestr[0];
@@ -1705,9 +1705,9 @@ BOOL LLDataPackerAsciiFile::unpackBinaryDataFixed(U8 *value, S32 size, const cha
-BOOL LLDataPackerAsciiFile::packU8(const U8 value, const char *name)
+bool LLDataPackerAsciiFile::packU8(const U8 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1723,13 +1723,13 @@ BOOL LLDataPackerAsciiFile::packU8(const U8 value, const char *name)
}
-BOOL LLDataPackerAsciiFile::unpackU8(U8 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackU8(U8 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
S32 in_val;
@@ -1738,9 +1738,9 @@ BOOL LLDataPackerAsciiFile::unpackU8(U8 &value, const char *name)
return success;
}
-BOOL LLDataPackerAsciiFile::packU16(const U16 value, const char *name)
+bool LLDataPackerAsciiFile::packU16(const U16 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1754,13 +1754,13 @@ BOOL LLDataPackerAsciiFile::packU16(const U16 value, const char *name)
}
-BOOL LLDataPackerAsciiFile::unpackU16(U16 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackU16(U16 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
S32 in_val;
@@ -1769,9 +1769,9 @@ BOOL LLDataPackerAsciiFile::unpackU16(U16 &value, const char *name)
return success;
}
-BOOL LLDataPackerAsciiFile::packS16(const S16 value, const char *name)
+bool LLDataPackerAsciiFile::packS16(const S16 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1785,13 +1785,13 @@ BOOL LLDataPackerAsciiFile::packS16(const S16 value, const char *name)
}
-BOOL LLDataPackerAsciiFile::unpackS16(S16 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackS16(S16 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
S32 in_val;
@@ -1800,9 +1800,9 @@ BOOL LLDataPackerAsciiFile::unpackS16(S16 &value, const char *name)
return success;
}
-BOOL LLDataPackerAsciiFile::packU32(const U32 value, const char *name)
+bool LLDataPackerAsciiFile::packU32(const U32 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1816,13 +1816,13 @@ BOOL LLDataPackerAsciiFile::packU32(const U32 value, const char *name)
}
-BOOL LLDataPackerAsciiFile::unpackU32(U32 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackU32(U32 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%u", &value);
@@ -1830,9 +1830,9 @@ BOOL LLDataPackerAsciiFile::unpackU32(U32 &value, const char *name)
}
-BOOL LLDataPackerAsciiFile::packS32(const S32 value, const char *name)
+bool LLDataPackerAsciiFile::packS32(const S32 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1846,13 +1846,13 @@ BOOL LLDataPackerAsciiFile::packS32(const S32 value, const char *name)
}
-BOOL LLDataPackerAsciiFile::unpackS32(S32 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackS32(S32 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%d", &value);
@@ -1860,9 +1860,9 @@ BOOL LLDataPackerAsciiFile::unpackS32(S32 &value, const char *name)
}
-BOOL LLDataPackerAsciiFile::packF32(const F32 value, const char *name)
+bool LLDataPackerAsciiFile::packF32(const F32 value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1876,13 +1876,13 @@ BOOL LLDataPackerAsciiFile::packF32(const F32 value, const char *name)
}
-BOOL LLDataPackerAsciiFile::unpackF32(F32 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackF32(F32 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f", &value);
@@ -1890,9 +1890,9 @@ BOOL LLDataPackerAsciiFile::unpackF32(F32 &value, const char *name)
}
-BOOL LLDataPackerAsciiFile::packColor4(const LLColor4 &value, const char *name)
+bool LLDataPackerAsciiFile::packColor4(const LLColor4 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1906,22 +1906,22 @@ BOOL LLDataPackerAsciiFile::packColor4(const LLColor4 &value, const char *name)
}
-BOOL LLDataPackerAsciiFile::unpackColor4(LLColor4 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackColor4(LLColor4 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]);
return success;
}
-BOOL LLDataPackerAsciiFile::packColor4U(const LLColor4U &value, const char *name)
+bool LLDataPackerAsciiFile::packColor4U(const LLColor4U &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1935,13 +1935,13 @@ BOOL LLDataPackerAsciiFile::packColor4U(const LLColor4U &value, const char *name
}
-BOOL LLDataPackerAsciiFile::unpackColor4U(LLColor4U &value, const char *name)
+bool LLDataPackerAsciiFile::unpackColor4U(LLColor4U &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
S32 r, g, b, a;
@@ -1955,9 +1955,9 @@ BOOL LLDataPackerAsciiFile::unpackColor4U(LLColor4U &value, const char *name)
}
-BOOL LLDataPackerAsciiFile::packVector2(const LLVector2 &value, const char *name)
+bool LLDataPackerAsciiFile::packVector2(const LLVector2 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -1971,13 +1971,13 @@ BOOL LLDataPackerAsciiFile::packVector2(const LLVector2 &value, const char *name
}
-BOOL LLDataPackerAsciiFile::unpackVector2(LLVector2 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackVector2(LLVector2 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f %f", &value.mV[0], &value.mV[1]);
@@ -1985,9 +1985,9 @@ BOOL LLDataPackerAsciiFile::unpackVector2(LLVector2 &value, const char *name)
}
-BOOL LLDataPackerAsciiFile::packVector3(const LLVector3 &value, const char *name)
+bool LLDataPackerAsciiFile::packVector3(const LLVector3 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -2001,22 +2001,22 @@ BOOL LLDataPackerAsciiFile::packVector3(const LLVector3 &value, const char *name
}
-BOOL LLDataPackerAsciiFile::unpackVector3(LLVector3 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackVector3(LLVector3 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f %f %f", &value.mV[0], &value.mV[1], &value.mV[2]);
return success;
}
-BOOL LLDataPackerAsciiFile::packVector4(const LLVector4 &value, const char *name)
+bool LLDataPackerAsciiFile::packVector4(const LLVector4 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
if (mFP)
{
@@ -2030,13 +2030,13 @@ BOOL LLDataPackerAsciiFile::packVector4(const LLVector4 &value, const char *name
}
-BOOL LLDataPackerAsciiFile::unpackVector4(LLVector4 &value, const char *name)
+bool LLDataPackerAsciiFile::unpackVector4(LLVector4 &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]);
@@ -2044,9 +2044,9 @@ BOOL LLDataPackerAsciiFile::unpackVector4(LLVector4 &value, const char *name)
}
-BOOL LLDataPackerAsciiFile::packUUID(const LLUUID &value, const char *name)
+bool LLDataPackerAsciiFile::packUUID(const LLUUID &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
writeIndentedName(name);
std::string tmp_str;
value.toString(tmp_str);
@@ -2062,13 +2062,13 @@ BOOL LLDataPackerAsciiFile::packUUID(const LLUUID &value, const char *name)
}
-BOOL LLDataPackerAsciiFile::unpackUUID(LLUUID &value, const char *name)
+bool LLDataPackerAsciiFile::unpackUUID(LLUUID &value, const char *name)
{
- BOOL success = TRUE;
+ bool success = true;
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */
if (!getValueStr(name, valuestr, DP_BUFSIZE))
{
- return FALSE;
+ return false;
}
char tmp_str[64]; /*Flawfinder: ignore */
@@ -2100,9 +2100,9 @@ void LLDataPackerAsciiFile::writeIndentedName(const char *name)
}
}
-BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 value_len)
+bool LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 value_len)
{
- BOOL success = FALSE;
+ bool success = false;
char buffer[DP_BUFSIZE]; /*Flawfinder: ignore*/
char keyword[DP_BUFSIZE]; /*Flawfinder: ignore*/
char value[DP_BUFSIZE]; /*Flawfinder: ignore*/
@@ -2117,7 +2117,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
if (0 != fgetpos(mFP, &last_pos)) // 0==success for fgetpos
{
LL_WARNS() << "Data packer failed to fgetpos" << LL_ENDL;
- return FALSE;
+ return false;
}
if (fgets(buffer, DP_BUFSIZE, mFP) == NULL)
@@ -2131,20 +2131,20 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
{
LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL;
fsetpos(mFP, &last_pos);
- return FALSE;
+ return false;
}
if (strcmp(keyword, name))
{
LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL;
fsetpos(mFP, &last_pos);
- return FALSE;
+ return false;
}
S32 in_value_len = (S32)strlen(value)+1; /*Flawfinder: ignore*/
S32 min_len = llmin(in_value_len, value_len);
memcpy(out_value, value, min_len); /*Flawfinder: ignore*/
out_value[min_len-1] = 0;
- success = TRUE;
+ success = true;
}
else if (mInputStream)
{
@@ -2154,19 +2154,19 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
if (!keyword[0])
{
LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL;
- return FALSE;
+ return false;
}
if (strcmp(keyword, name))
{
LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL;
- return FALSE;
+ return false;
}
S32 in_value_len = (S32)strlen(value)+1; /*Flawfinder: ignore*/
S32 min_len = llmin(in_value_len, value_len);
memcpy(out_value, value, min_len); /*Flawfinder: ignore*/
out_value[min_len-1] = 0;
- success = TRUE;
+ success = true;
}
return success;
diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h
index ac28cadbce..8e980d8611 100644
--- a/indra/llmessage/lldatapacker.h
+++ b/indra/llmessage/lldatapacker.h
@@ -43,72 +43,72 @@ public:
virtual void reset();
virtual void dumpBufferToLog();
- virtual BOOL hasNext() const = 0;
+ virtual bool hasNext() const = 0;
- virtual BOOL packString(const std::string& value, const char *name) = 0;
- virtual BOOL unpackString(std::string& value, const char *name) = 0;
+ virtual bool packString(const std::string& value, const char *name) = 0;
+ virtual bool unpackString(std::string& value, const char *name) = 0;
- virtual BOOL packBinaryData(const U8 *value, S32 size, const char *name) = 0;
- virtual BOOL unpackBinaryData(U8 *value, S32 &size, const char *name) = 0;
+ virtual bool packBinaryData(const U8 *value, S32 size, const char *name) = 0;
+ virtual bool unpackBinaryData(U8 *value, S32 &size, const char *name) = 0;
// Constant size binary data packing
- virtual BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name) = 0;
- virtual BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name) = 0;
+ virtual bool packBinaryDataFixed(const U8 *value, S32 size, const char *name) = 0;
+ virtual bool unpackBinaryDataFixed(U8 *value, S32 size, const char *name) = 0;
- virtual BOOL packU8(const U8 value, const char *name) = 0;
- virtual BOOL unpackU8(U8 &value, const char *name) = 0;
+ virtual bool packU8(const U8 value, const char *name) = 0;
+ virtual bool unpackU8(U8 &value, const char *name) = 0;
- virtual BOOL packU16(const U16 value, const char *name) = 0;
- virtual BOOL unpackU16(U16 &value, const char *name) = 0;
- BOOL unpackU16s(U16 *value, S32 count, const char *name);
+ virtual bool packU16(const U16 value, const char *name) = 0;
+ virtual bool unpackU16(U16 &value, const char *name) = 0;
+ bool unpackU16s(U16 *value, S32 count, const char *name);
- virtual BOOL packS16(const S16 value, const char *name) = 0;
- virtual BOOL unpackS16(S16 &value, const char *name) = 0;
- BOOL unpackS16s(S16 *value, S32 count, const char *name);
+ virtual bool packS16(const S16 value, const char *name) = 0;
+ virtual bool unpackS16(S16 &value, const char *name) = 0;
+ bool unpackS16s(S16 *value, S32 count, const char *name);
- virtual BOOL packU32(const U32 value, const char *name) = 0;
- virtual BOOL unpackU32(U32 &value, const char *name) = 0;
+ virtual bool packU32(const U32 value, const char *name) = 0;
+ virtual bool unpackU32(U32 &value, const char *name) = 0;
- virtual BOOL packS32(const S32 value, const char *name) = 0;
- virtual BOOL unpackS32(S32 &value, const char *name) = 0;
+ virtual bool packS32(const S32 value, const char *name) = 0;
+ virtual bool unpackS32(S32 &value, const char *name) = 0;
- virtual BOOL packF32(const F32 value, const char *name) = 0;
- virtual BOOL unpackF32(F32 &value, const char *name) = 0;
- BOOL unpackF32s(F32 *values, S32 count, const char *name);
+ virtual bool packF32(const F32 value, const char *name) = 0;
+ virtual bool unpackF32(F32 &value, const char *name) = 0;
+ bool unpackF32s(F32 *values, S32 count, const char *name);
// Packs a float into an integer, using the given size
// and picks the right U* data type to pack into.
- BOOL packFixed(const F32 value, const char *name,
- const BOOL is_signed, const U32 int_bits, const U32 frac_bits);
- BOOL unpackFixed(F32 &value, const char *name,
- const BOOL is_signed, const U32 int_bits, const U32 frac_bits);
+ bool packFixed(const F32 value, const char *name,
+ const bool is_signed, const U32 int_bits, const U32 frac_bits);
+ bool unpackFixed(F32 &value, const char *name,
+ const bool is_signed, const U32 int_bits, const U32 frac_bits);
- virtual BOOL packColor4(const LLColor4 &value, const char *name) = 0;
- virtual BOOL unpackColor4(LLColor4 &value, const char *name) = 0;
+ virtual bool packColor4(const LLColor4 &value, const char *name) = 0;
+ virtual bool unpackColor4(LLColor4 &value, const char *name) = 0;
- virtual BOOL packColor4U(const LLColor4U &value, const char *name) = 0;
- virtual BOOL unpackColor4U(LLColor4U &value, const char *name) = 0;
- BOOL unpackColor4Us(LLColor4U *values, S32 count, const char *name);
+ virtual bool packColor4U(const LLColor4U &value, const char *name) = 0;
+ virtual bool unpackColor4U(LLColor4U &value, const char *name) = 0;
+ bool unpackColor4Us(LLColor4U *values, S32 count, const char *name);
- virtual BOOL packVector2(const LLVector2 &value, const char *name) = 0;
- virtual BOOL unpackVector2(LLVector2 &value, const char *name) = 0;
+ virtual bool packVector2(const LLVector2 &value, const char *name) = 0;
+ virtual bool unpackVector2(LLVector2 &value, const char *name) = 0;
- virtual BOOL packVector3(const LLVector3 &value, const char *name) = 0;
- virtual BOOL unpackVector3(LLVector3 &value, const char *name) = 0;
+ virtual bool packVector3(const LLVector3 &value, const char *name) = 0;
+ virtual bool unpackVector3(LLVector3 &value, const char *name) = 0;
- virtual BOOL packVector4(const LLVector4 &value, const char *name) = 0;
- virtual BOOL unpackVector4(LLVector4 &value, const char *name) = 0;
+ virtual bool packVector4(const LLVector4 &value, const char *name) = 0;
+ virtual bool unpackVector4(LLVector4 &value, const char *name) = 0;
- virtual BOOL packUUID(const LLUUID &value, const char *name) = 0;
- virtual BOOL unpackUUID(LLUUID &value, const char *name) = 0;
- BOOL unpackUUIDs(LLUUID *values, S32 count, const char *name);
+ virtual bool packUUID(const LLUUID &value, const char *name) = 0;
+ virtual bool unpackUUID(LLUUID &value, const char *name) = 0;
+ bool unpackUUIDs(LLUUID *values, S32 count, const char *name);
U32 getPassFlags() const { return mPassFlags; }
void setPassFlags(U32 flags) { mPassFlags = flags; }
protected:
LLDataPacker();
protected:
U32 mPassFlags;
- BOOL mWriteEnabled; // disable this to do things like determine filesize without actually copying data
+ bool mWriteEnabled; // disable this to do things like determine filesize without actually copying data
};
class LLDataPackerBinaryBuffer : public LLDataPacker
@@ -120,7 +120,7 @@ public:
mCurBufferp(bufferp),
mBufferSize(size)
{
- mWriteEnabled = TRUE;
+ mWriteEnabled = true;
}
LLDataPackerBinaryBuffer()
@@ -131,58 +131,58 @@ public:
{
}
- /*virtual*/ BOOL packString(const std::string& value, const char *name);
- /*virtual*/ BOOL unpackString(std::string& value, const char *name);
+ /*virtual*/ bool packString(const std::string& value, const char *name);
+ /*virtual*/ bool unpackString(std::string& value, const char *name);
- /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name);
+ /*virtual*/ bool packBinaryData(const U8 *value, S32 size, const char *name);
+ /*virtual*/ bool unpackBinaryData(U8 *value, S32 &size, const char *name);
// Constant size binary data packing
- /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name);
+ /*virtual*/ bool packBinaryDataFixed(const U8 *value, S32 size, const char *name);
+ /*virtual*/ bool unpackBinaryDataFixed(U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL packU8(const U8 value, const char *name);
- /*virtual*/ BOOL unpackU8(U8 &value, const char *name);
+ /*virtual*/ bool packU8(const U8 value, const char *name);
+ /*virtual*/ bool unpackU8(U8 &value, const char *name);
- /*virtual*/ BOOL packU16(const U16 value, const char *name);
- /*virtual*/ BOOL unpackU16(U16 &value, const char *name);
+ /*virtual*/ bool packU16(const U16 value, const char *name);
+ /*virtual*/ bool unpackU16(U16 &value, const char *name);
- /*virtual*/ BOOL packS16(const S16 value, const char *name);
- /*virtual*/ BOOL unpackS16(S16 &value, const char *name);
+ /*virtual*/ bool packS16(const S16 value, const char *name);
+ /*virtual*/ bool unpackS16(S16 &value, const char *name);
- /*virtual*/ BOOL packU32(const U32 value, const char *name);
- /*virtual*/ BOOL unpackU32(U32 &value, const char *name);
+ /*virtual*/ bool packU32(const U32 value, const char *name);
+ /*virtual*/ bool unpackU32(U32 &value, const char *name);
- /*virtual*/ BOOL packS32(const S32 value, const char *name);
- /*virtual*/ BOOL unpackS32(S32 &value, const char *name);
+ /*virtual*/ bool packS32(const S32 value, const char *name);
+ /*virtual*/ bool unpackS32(S32 &value, const char *name);
- /*virtual*/ BOOL packF32(const F32 value, const char *name);
- /*virtual*/ BOOL unpackF32(F32 &value, const char *name);
+ /*virtual*/ bool packF32(const F32 value, const char *name);
+ /*virtual*/ bool unpackF32(F32 &value, const char *name);
- /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name);
- /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name);
+ /*virtual*/ bool packColor4(const LLColor4 &value, const char *name);
+ /*virtual*/ bool unpackColor4(LLColor4 &value, const char *name);
- /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name);
- /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name);
+ /*virtual*/ bool packColor4U(const LLColor4U &value, const char *name);
+ /*virtual*/ bool unpackColor4U(LLColor4U &value, const char *name);
- /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name);
- /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name);
+ /*virtual*/ bool packVector2(const LLVector2 &value, const char *name);
+ /*virtual*/ bool unpackVector2(LLVector2 &value, const char *name);
- /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name);
- /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name);
+ /*virtual*/ bool packVector3(const LLVector3 &value, const char *name);
+ /*virtual*/ bool unpackVector3(LLVector3 &value, const char *name);
- /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name);
- /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name);
+ /*virtual*/ bool packVector4(const LLVector4 &value, const char *name);
+ /*virtual*/ bool unpackVector4(LLVector4 &value, const char *name);
- /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name);
- /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name);
+ /*virtual*/ bool packUUID(const LLUUID &value, const char *name);
+ /*virtual*/ bool unpackUUID(LLUUID &value, const char *name);
S32 getCurrentSize() const { return (S32)(mCurBufferp - mBufferp); }
S32 getBufferSize() const { return mBufferSize; }
const U8* getBuffer() const { return mBufferp; }
void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); }
void shift(S32 offset) { reset(); mCurBufferp += offset;}
- void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; }
+ void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = false; }
void assignBuffer(U8 *bufferp, S32 size)
{
if(mBufferp && mBufferp != bufferp)
@@ -192,31 +192,31 @@ public:
mBufferp = bufferp;
mCurBufferp = bufferp;
mBufferSize = size;
- mWriteEnabled = TRUE;
+ mWriteEnabled = true;
}
const LLDataPackerBinaryBuffer& operator=(const LLDataPackerBinaryBuffer &a);
- /*virtual*/ BOOL hasNext() const { return getCurrentSize() < getBufferSize(); }
+ /*virtual*/ bool hasNext() const { return getCurrentSize() < getBufferSize(); }
/*virtual*/ void dumpBufferToLog();
protected:
- inline BOOL verifyLength(const S32 data_size, const char *name);
+ inline bool verifyLength(const S32 data_size, const char *name);
U8 *mBufferp;
U8 *mCurBufferp;
S32 mBufferSize;
};
-inline BOOL LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const char *name)
+inline bool LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const char *name)
{
if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size)
{
LL_WARNS() << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << LL_ENDL;
LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
class LLDataPackerAsciiBuffer : public LLDataPacker
@@ -228,8 +228,8 @@ public:
mCurBufferp = bufferp;
mBufferSize = size;
mPassFlags = 0;
- mIncludeNames = FALSE;
- mWriteEnabled = TRUE;
+ mIncludeNames = false;
+ mWriteEnabled = true;
}
LLDataPackerAsciiBuffer()
@@ -238,57 +238,57 @@ public:
mCurBufferp = NULL;
mBufferSize = 0;
mPassFlags = 0;
- mIncludeNames = FALSE;
- mWriteEnabled = FALSE;
+ mIncludeNames = false;
+ mWriteEnabled = false;
}
- /*virtual*/ BOOL packString(const std::string& value, const char *name);
- /*virtual*/ BOOL unpackString(std::string& value, const char *name);
+ /*virtual*/ bool packString(const std::string& value, const char *name);
+ /*virtual*/ bool unpackString(std::string& value, const char *name);
- /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name);
+ /*virtual*/ bool packBinaryData(const U8 *value, S32 size, const char *name);
+ /*virtual*/ bool unpackBinaryData(U8 *value, S32 &size, const char *name);
// Constant size binary data packing
- /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name);
+ /*virtual*/ bool packBinaryDataFixed(const U8 *value, S32 size, const char *name);
+ /*virtual*/ bool unpackBinaryDataFixed(U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL packU8(const U8 value, const char *name);
- /*virtual*/ BOOL unpackU8(U8 &value, const char *name);
+ /*virtual*/ bool packU8(const U8 value, const char *name);
+ /*virtual*/ bool unpackU8(U8 &value, const char *name);
- /*virtual*/ BOOL packU16(const U16 value, const char *name);
- /*virtual*/ BOOL unpackU16(U16 &value, const char *name);
+ /*virtual*/ bool packU16(const U16 value, const char *name);
+ /*virtual*/ bool unpackU16(U16 &value, const char *name);
- /*virtual*/ BOOL packS16(const S16 value, const char *name);
- /*virtual*/ BOOL unpackS16(S16 &value, const char *name);
+ /*virtual*/ bool packS16(const S16 value, const char *name);
+ /*virtual*/ bool unpackS16(S16 &value, const char *name);
- /*virtual*/ BOOL packU32(const U32 value, const char *name);
- /*virtual*/ BOOL unpackU32(U32 &value, const char *name);
+ /*virtual*/ bool packU32(const U32 value, const char *name);
+ /*virtual*/ bool unpackU32(U32 &value, const char *name);
- /*virtual*/ BOOL packS32(const S32 value, const char *name);
- /*virtual*/ BOOL unpackS32(S32 &value, const char *name);
+ /*virtual*/ bool packS32(const S32 value, const char *name);
+ /*virtual*/ bool unpackS32(S32 &value, const char *name);
- /*virtual*/ BOOL packF32(const F32 value, const char *name);
- /*virtual*/ BOOL unpackF32(F32 &value, const char *name);
+ /*virtual*/ bool packF32(const F32 value, const char *name);
+ /*virtual*/ bool unpackF32(F32 &value, const char *name);
- /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name);
- /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name);
+ /*virtual*/ bool packColor4(const LLColor4 &value, const char *name);
+ /*virtual*/ bool unpackColor4(LLColor4 &value, const char *name);
- /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name);
- /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name);
+ /*virtual*/ bool packColor4U(const LLColor4U &value, const char *name);
+ /*virtual*/ bool unpackColor4U(LLColor4U &value, const char *name);
- /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name);
- /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name);
+ /*virtual*/ bool packVector2(const LLVector2 &value, const char *name);
+ /*virtual*/ bool unpackVector2(LLVector2 &value, const char *name);
- /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name);
- /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name);
+ /*virtual*/ bool packVector3(const LLVector3 &value, const char *name);
+ /*virtual*/ bool unpackVector3(LLVector3 &value, const char *name);
- /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name);
- /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name);
+ /*virtual*/ bool packVector4(const LLVector4 &value, const char *name);
+ /*virtual*/ bool unpackVector4(LLVector4 &value, const char *name);
- /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name);
- /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name);
+ /*virtual*/ bool packUUID(const LLUUID &value, const char *name);
+ /*virtual*/ bool unpackUUID(LLUUID &value, const char *name);
- void setIncludeNames(BOOL b) { mIncludeNames = b; }
+ void setIncludeNames(bool b) { mIncludeNames = b; }
// Include the trailing NULL so it's always a valid string
S32 getCurrentSize() const { return (S32)(mCurBufferp - mBufferp) + 1; }
@@ -296,7 +296,7 @@ public:
S32 getBufferSize() const { return mBufferSize; }
/*virtual*/ void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); }
- /*virtual*/ BOOL hasNext() const { return getCurrentSize() < getBufferSize(); }
+ /*virtual*/ bool hasNext() const { return getCurrentSize() < getBufferSize(); }
inline void freeBuffer();
inline void assignBuffer(char* bufferp, S32 size);
@@ -304,15 +304,15 @@ public:
protected:
void writeIndentedName(const char *name);
- BOOL getValueStr(const char *name, char *out_value, const S32 value_len);
+ bool getValueStr(const char *name, char *out_value, const S32 value_len);
protected:
- inline BOOL verifyLength(const S32 data_size, const char *name);
+ inline bool verifyLength(const S32 data_size, const char *name);
char *mBufferp;
char *mCurBufferp;
S32 mBufferSize;
- BOOL mIncludeNames; // useful for debugging, print the name of each field
+ bool mIncludeNames; // useful for debugging, print the name of each field
};
inline void LLDataPackerAsciiBuffer::freeBuffer()
@@ -320,7 +320,7 @@ inline void LLDataPackerAsciiBuffer::freeBuffer()
delete [] mBufferp;
mBufferp = mCurBufferp = NULL;
mBufferSize = 0;
- mWriteEnabled = FALSE;
+ mWriteEnabled = false;
}
inline void LLDataPackerAsciiBuffer::assignBuffer(char* bufferp, S32 size)
@@ -328,19 +328,19 @@ inline void LLDataPackerAsciiBuffer::assignBuffer(char* bufferp, S32 size)
mBufferp = bufferp;
mCurBufferp = bufferp;
mBufferSize = size;
- mWriteEnabled = TRUE;
+ mWriteEnabled = true;
}
-inline BOOL LLDataPackerAsciiBuffer::verifyLength(const S32 data_size, const char *name)
+inline bool LLDataPackerAsciiBuffer::verifyLength(const S32 data_size, const char *name)
{
if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size)
{
LL_WARNS() << "Buffer overflow in AsciiBuffer length verify, field name " << name << "!" << LL_ENDL;
LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
class LLDataPackerAsciiFile : public LLDataPacker
@@ -362,7 +362,7 @@ public:
mOutputStream(&output_stream),
mInputStream(NULL)
{
- mWriteEnabled = TRUE;
+ mWriteEnabled = true;
}
LLDataPackerAsciiFile(std::istream& input_stream, const S32 indent = 2)
@@ -374,55 +374,55 @@ public:
{
}
- /*virtual*/ BOOL packString(const std::string& value, const char *name);
- /*virtual*/ BOOL unpackString(std::string& value, const char *name);
+ /*virtual*/ bool packString(const std::string& value, const char *name);
+ /*virtual*/ bool unpackString(std::string& value, const char *name);
- /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name);
+ /*virtual*/ bool packBinaryData(const U8 *value, S32 size, const char *name);
+ /*virtual*/ bool unpackBinaryData(U8 *value, S32 &size, const char *name);
- /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name);
+ /*virtual*/ bool packBinaryDataFixed(const U8 *value, S32 size, const char *name);
+ /*virtual*/ bool unpackBinaryDataFixed(U8 *value, S32 size, const char *name);
- /*virtual*/ BOOL packU8(const U8 value, const char *name);
- /*virtual*/ BOOL unpackU8(U8 &value, const char *name);
+ /*virtual*/ bool packU8(const U8 value, const char *name);
+ /*virtual*/ bool unpackU8(U8 &value, const char *name);
- /*virtual*/ BOOL packU16(const U16 value, const char *name);
- /*virtual*/ BOOL unpackU16(U16 &value, const char *name);
+ /*virtual*/ bool packU16(const U16 value, const char *name);
+ /*virtual*/ bool unpackU16(U16 &value, const char *name);
- /*virtual*/ BOOL packS16(const S16 value, const char *name);
- /*virtual*/ BOOL unpackS16(S16 &value, const char *name);
+ /*virtual*/ bool packS16(const S16 value, const char *name);
+ /*virtual*/ bool unpackS16(S16 &value, const char *name);
- /*virtual*/ BOOL packU32(const U32 value, const char *name);
- /*virtual*/ BOOL unpackU32(U32 &value, const char *name);
+ /*virtual*/ bool packU32(const U32 value, const char *name);
+ /*virtual*/ bool unpackU32(U32 &value, const char *name);
- /*virtual*/ BOOL packS32(const S32 value, const char *name);
- /*virtual*/ BOOL unpackS32(S32 &value, const char *name);
+ /*virtual*/ bool packS32(const S32 value, const char *name);
+ /*virtual*/ bool unpackS32(S32 &value, const char *name);
- /*virtual*/ BOOL packF32(const F32 value, const char *name);
- /*virtual*/ BOOL unpackF32(F32 &value, const char *name);
+ /*virtual*/ bool packF32(const F32 value, const char *name);
+ /*virtual*/ bool unpackF32(F32 &value, const char *name);
- /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name);
- /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name);
+ /*virtual*/ bool packColor4(const LLColor4 &value, const char *name);
+ /*virtual*/ bool unpackColor4(LLColor4 &value, const char *name);
- /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name);
- /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name);
+ /*virtual*/ bool packColor4U(const LLColor4U &value, const char *name);
+ /*virtual*/ bool unpackColor4U(LLColor4U &value, const char *name);
- /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name);
- /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name);
+ /*virtual*/ bool packVector2(const LLVector2 &value, const char *name);
+ /*virtual*/ bool unpackVector2(LLVector2 &value, const char *name);
- /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name);
- /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name);
+ /*virtual*/ bool packVector3(const LLVector3 &value, const char *name);
+ /*virtual*/ bool unpackVector3(LLVector3 &value, const char *name);
- /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name);
- /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name);
+ /*virtual*/ bool packVector4(const LLVector4 &value, const char *name);
+ /*virtual*/ bool unpackVector4(LLVector4 &value, const char *name);
- /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name);
- /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name);
+ /*virtual*/ bool packUUID(const LLUUID &value, const char *name);
+ /*virtual*/ bool unpackUUID(LLUUID &value, const char *name);
protected:
void writeIndentedName(const char *name);
- BOOL getValueStr(const char *name, char *out_value, const S32 value_len);
+ bool getValueStr(const char *name, char *out_value, const S32 value_len);
- /*virtual*/ BOOL hasNext() const { return true; }
+ /*virtual*/ bool hasNext() const { return true; }
protected:
S32 mIndent;
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp
index 98b8919660..3ac07626b0 100644
--- a/indra/newview/llphysicsmotion.cpp
+++ b/indra/newview/llphysicsmotion.cpp
@@ -460,7 +460,7 @@ bool LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask)
return true;
}
- BOOL update_visuals = false;
+ bool update_visuals = false;
for (motion_vec_t::iterator iter = mMotions.begin();
iter != mMotions.end();
++iter)
@@ -707,7 +707,7 @@ bool LLPhysicsMotion::onUpdate(F32 time)
const F32 min_delta = (1.0001f-lod_factor)*0.4f;
if (llabs(position_diff_local) > min_delta)
{
- update_visuals = TRUE;
+ update_visuals = true;
mPositionLastUpdate_local = position_new_local;
}
}