diff --git a/autobuild.xml b/autobuild.xml
index 3743273e0f..56a6ff51fd 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1376,6 +1376,14 @@
llphysicsextensions_source
name
linux64
@@ -1417,26 +1425,18 @@
creds
github
hash
- f652ce0d6aef864689f0ed44255da4d9cd65a43f
+ 56b94c0d0f0b2f221fd13648e99e9569b0490d76
hash_algorithm
sha1
url
- https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851463
+ https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/171617694
name
windows64
- license
- internal
- license_file
- LICENSES/llphysicsextensions.txt
- copyright
- Copyright (c) 2010, Linden Research, Inc.
version
- 1.0.479d20a
- name
- llphysicsextensions_source
+ 1.0.b6dc588
llphysicsextensions_stub
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index f06845f084..743c1745d0 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -164,19 +164,7 @@ LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAv
LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
LLCharacter(),
- mIsDummy(false),
- mTexSkinColor( NULL ),
- mTexHairColor( NULL ),
- mTexEyeColor( NULL ),
- mPelvisToFoot(0.f),
- mHeadOffset(),
- mRoot(NULL),
- mWearableData(wearable_data),
- mNumBones(0),
- mNumCollisionVolumes(0),
- mCollisionVolumes(NULL),
- mIsBuilt(false),
- mInitFlags(0)
+ mWearableData(wearable_data)
{
llassert_always(mWearableData);
mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index c2188d8ac9..1f33ae290e 100644
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -70,7 +70,7 @@ public:
static void initClass();
static void cleanupClass(); // Cleanup data that's only init'd once per class.
virtual void initInstance(); // Called after construction to initialize the instance.
- S32 mInitFlags;
+ S32 mInitFlags{ 0 };
virtual bool loadSkeletonNode();
bool loadMeshNodes();
bool loadLayersets();
@@ -135,8 +135,8 @@ public:
F32 getPelvisToFoot() const { return mPelvisToFoot; }
/*virtual*/ LLJoint* getRootJoint() { return mRoot; }
- LLVector3 mHeadOffset; // current head position
- LLAvatarJoint *mRoot;
+ LLVector3 mHeadOffset{}; // current head position
+ LLAvatarJoint* mRoot{ nullptr };
typedef std::map joint_map_t;
joint_map_t mJointMap;
@@ -167,7 +167,7 @@ protected:
bool buildSkeleton(const LLAvatarSkeletonInfo *info);
void clearSkeleton();
- bool mIsBuilt; // state of deferred character building
+ bool mIsBuilt{ false }; // state of deferred character building
avatar_joint_list_t mSkeleton;
LLVector3OverrideMap mPelvisFixups;
joint_alias_map_t mJointAliasMap;
@@ -184,30 +184,30 @@ public:
LLVector3 mBodySize;
LLVector3 mAvatarOffset;
protected:
- F32 mPelvisToFoot;
+ F32 mPelvisToFoot{ 0.f };
//--------------------------------------------------------------------
// Cached pointers to well known joints
//--------------------------------------------------------------------
public:
- LLJoint* mPelvisp;
- LLJoint* mTorsop;
- LLJoint* mChestp;
- LLJoint* mNeckp;
- LLJoint* mHeadp;
- LLJoint* mSkullp;
- LLJoint* mEyeLeftp;
- LLJoint* mEyeRightp;
- LLJoint* mHipLeftp;
- LLJoint* mHipRightp;
- LLJoint* mKneeLeftp;
- LLJoint* mKneeRightp;
- LLJoint* mAnkleLeftp;
- LLJoint* mAnkleRightp;
- LLJoint* mFootLeftp;
- LLJoint* mFootRightp;
- LLJoint* mWristLeftp;
- LLJoint* mWristRightp;
+ LLJoint* mPelvisp{nullptr};
+ LLJoint* mTorsop{ nullptr };
+ LLJoint* mChestp{ nullptr };
+ LLJoint* mNeckp{ nullptr };
+ LLJoint* mHeadp{ nullptr };
+ LLJoint* mSkullp{ nullptr };
+ LLJoint* mEyeLeftp{ nullptr };
+ LLJoint* mEyeRightp{ nullptr };
+ LLJoint* mHipLeftp{ nullptr };
+ LLJoint* mHipRightp{ nullptr };
+ LLJoint* mKneeLeftp{ nullptr };
+ LLJoint* mKneeRightp{ nullptr };
+ LLJoint* mAnkleLeftp{ nullptr };
+ LLJoint* mAnkleRightp{ nullptr };
+ LLJoint* mFootLeftp{ nullptr };
+ LLJoint* mFootRightp{ nullptr };
+ LLJoint* mWristLeftp{ nullptr };
+ LLJoint* mWristRightp{ nullptr };
//--------------------------------------------------------------------
// XML parse tree
@@ -227,7 +227,7 @@ protected:
** RENDERING
**/
public:
- bool mIsDummy; // for special views and animated object controllers; local to viewer
+ bool mIsDummy{ false }; // for special views and animated object controllers; local to viewer
//--------------------------------------------------------------------
// Morph masks
@@ -290,9 +290,9 @@ public:
LLColor4 getGlobalColor(const std::string& color_name ) const;
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0;
protected:
- LLTexGlobalColor* mTexSkinColor;
- LLTexGlobalColor* mTexHairColor;
- LLTexGlobalColor* mTexEyeColor;
+ LLTexGlobalColor* mTexSkinColor{ nullptr };
+ LLTexGlobalColor* mTexHairColor{ nullptr };
+ LLTexGlobalColor* mTexEyeColor{ nullptr };
//--------------------------------------------------------------------
// Visibility
@@ -315,7 +315,7 @@ public:
virtual bool isWearingWearableType(LLWearableType::EType type ) const;
private:
- LLWearableData* mWearableData;
+ LLWearableData* mWearableData{ nullptr };
/********************************************************************************
** **
@@ -333,11 +333,11 @@ protected:
struct BakedTextureData
{
LLUUID mLastTextureID;
- LLTexLayerSet* mTexLayerSet; // Only exists for self
- bool mIsLoaded;
- bool mIsUsed;
- LLAvatarAppearanceDefines::ETextureIndex mTextureIndex;
- U32 mMaskTexName;
+ LLTexLayerSet* mTexLayerSet{ nullptr }; // Only exists for self
+ bool mIsLoaded{ false };
+ bool mIsUsed{ false };
+ LLAvatarAppearanceDefines::ETextureIndex mTextureIndex{ LLAvatarAppearanceDefines::ETextureIndex::TEX_INVALID };
+ U32 mMaskTexName{ 0 };
// Stores pointers to the joint meshes that this baked texture deals with
avatar_joint_mesh_list_t mJointMeshes;
morph_list_t mMaskedMorphs;
@@ -354,9 +354,9 @@ protected:
// Collision volumes
//--------------------------------------------------------------------
public:
- S32 mNumBones;
- S32 mNumCollisionVolumes;
- LLAvatarJointCollisionVolume* mCollisionVolumes;
+ S32 mNumBones{ 0 };
+ S32 mNumCollisionVolumes{ 0 };
+ LLAvatarJointCollisionVolume* mCollisionVolumes{ nullptr };
protected:
bool allocateCollisionVolumes(U32 num);
diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp
index 29815d22f7..2e933f9357 100644
--- a/indra/llappearance/lldriverparam.cpp
+++ b/indra/llappearance/lldriverparam.cpp
@@ -422,7 +422,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po
S32 LLDriverParam::getDrivenParamsCount() const
{
- return mDriven.size();
+ return static_cast(mDriven.size());
}
const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h
index b7eac80603..59092988dd 100644
--- a/indra/llappearance/lldriverparam.h
+++ b/indra/llappearance/lldriverparam.h
@@ -130,10 +130,10 @@ protected:
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder
entry_list_t mDriven;
- LLViewerVisualParam* mCurrentDistortionParam;
+ LLViewerVisualParam* mCurrentDistortionParam{ nullptr };
// Backlink only; don't make this an LLPointer.
- LLAvatarAppearance* mAvatarAppearance;
- LLWearable* mWearablep;
+ LLAvatarAppearance* mAvatarAppearance{ nullptr };
+ LLWearable* mWearablep{ nullptr };
};
#endif // LL_LLDRIVERPARAM_H
diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp
index 9707f002ee..f743f7b517 100644
--- a/indra/llappearance/lllocaltextureobject.cpp
+++ b/indra/llappearance/lllocaltextureobject.cpp
@@ -109,7 +109,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name)
U32 LLLocalTextureObject::getNumTexLayers() const
{
- return mTexLayers.size();
+ return static_cast(mTexLayers.size());
}
LLUUID LLLocalTextureObject::getID() const
diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index d8109d79c2..068be84441 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -107,7 +107,7 @@ LLPolyMorphData::~LLPolyMorphData()
bool LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
{
S32 numVertices;
- S32 numRead;
+ size_t numRead;
numRead = fread(&numVertices, sizeof(S32), 1, fp);
llendianswizzle(&numVertices, sizeof(S32), 1);
@@ -384,7 +384,7 @@ bool LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
if (!mMorphData)
{
const std::string driven_tag = "_Driven";
- U32 pos = morph_param_name.find(driven_tag);
+ auto pos = morph_param_name.find(driven_tag);
if (pos > 0)
{
morph_param_name = morph_param_name.substr(0,pos);
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index 9c41e3c256..a7e5292fed 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -744,7 +744,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
std::string terse_F32_to_string(F32 f)
{
std::string r = llformat("%.2f", f);
- S32 len = r.length();
+ auto len = r.length();
// "1.20" -> "1.2"
// "24.00" -> "24."
diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp
index a58138c434..7598ed67f3 100644
--- a/indra/llappearance/llwearabledata.cpp
+++ b/indra/llappearance/llwearabledata.cpp
@@ -334,7 +334,7 @@ U32 LLWearableData::getWearableCount(const LLWearableType::EType type) const
return 0;
}
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
- return wearable_vec.size();
+ return static_cast(wearable_vec.size());
}
U32 LLWearableData::getWearableCount(const U32 tex_index) const
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp
index b086e49ba4..a46f9acc63 100755
--- a/indra/llaudio/llaudiodecodemgr.cpp
+++ b/indra/llaudio/llaudiodecodemgr.cpp
@@ -422,7 +422,7 @@ bool LLVorbisDecodeState::finishDecode()
ov_clear(&mVF);
// write "data" chunk length, in little-endian format
- S32 data_length = mWAVBuffer.size() - WAV_HEADER_SIZE;
+ S32 data_length = static_cast(mWAVBuffer.size()) - WAV_HEADER_SIZE;
mWAVBuffer[40] = (data_length) & 0x000000FF;
mWAVBuffer[41] = (data_length >> 8) & 0x000000FF;
mWAVBuffer[42] = (data_length >> 16) & 0x000000FF;
@@ -463,7 +463,7 @@ bool LLVorbisDecodeState::finishDecode()
{
memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/
}
- S32 near_end = mWAVBuffer.size() - (2 * fade_length);
+ S32 near_end = static_cast(mWAVBuffer.size()) - (2 * fade_length);
if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length))
{
memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/
@@ -491,7 +491,7 @@ bool LLVorbisDecodeState::finishDecode()
return true; // we've finished
}
mBytesRead = -1;
- mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, mWAVBuffer.size(),
+ mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, static_cast(mWAVBuffer.size()),
new WriteResponder(this));
}
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp
index 3fcef42a89..264b9a0be1 100644
--- a/indra/llcharacter/llcharacter.cpp
+++ b/indra/llcharacter/llcharacter.cpp
@@ -73,8 +73,8 @@ LLCharacter::~LLCharacter()
delete param;
}
- U32 i ;
- U32 size = sInstances.size() ;
+ size_t i ;
+ size_t size = sInstances.size() ;
for(i = 0 ; i < size ; i++)
{
if(sInstances[i] == this)
diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp
index 151bac7920..b69462ce28 100644
--- a/indra/llcharacter/llgesture.cpp
+++ b/indra/llcharacter/llgesture.cpp
@@ -282,7 +282,7 @@ bool LLGestureList::trigger(KEY key, MASK mask)
U8 *LLGestureList::serialize(U8 *buffer) const
{
// a single S32 serves as the header that tells us how many to read
- U32 count = mList.size();
+ auto count = mList.size();
htolememcpy(buffer, &count, MVT_S32, 4);
buffer += sizeof(count);
diff --git a/indra/llcharacter/llgesture.h b/indra/llcharacter/llgesture.h
index f1b83a4b50..f8504d06d2 100644
--- a/indra/llcharacter/llgesture.h
+++ b/indra/llcharacter/llgesture.h
@@ -90,7 +90,7 @@ public:
bool triggerAndReviseString(const std::string &string, std::string* revised_string);
// Used for construction from UI
- S32 count() const { return mList.size(); }
+ S32 count() const { return static_cast(mList.size()); }
virtual LLGesture* get(S32 i) const { return mList.at(i); }
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
void deleteAll();
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index 34aea19d6c..c2a10d969f 100644
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -76,7 +76,7 @@ void LLVector3OverrideMap::showJointVector3Overrides( std::ostringstream& os ) c
U32 LLVector3OverrideMap::count() const
{
- return m_map.size();
+ return static_cast(m_map.size());
}
void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
@@ -86,7 +86,7 @@ void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
bool LLVector3OverrideMap::remove(const LLUUID& mesh_id)
{
- U32 remove_count = m_map.erase(mesh_id);
+ auto remove_count = m_map.erase(mesh_id);
return (remove_count > 0);
}
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 99ee3198d6..12212efb66 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -430,8 +430,9 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
//-----------------------------------------------------------------------------
LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
: LLMotion(id),
- mJointMotionList(NULL),
- mPelvisp(NULL),
+ mJointMotionList(nullptr),
+ mPelvisp(nullptr),
+ mCharacter(nullptr),
mLastSkeletonSerialNum(0),
mLastUpdateTime(0.f),
mLastLoopedTime(0.f),
@@ -2079,7 +2080,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
JointMotion* joint_motionp = mJointMotionList->getJointMotion(i);
success &= dp.packString(joint_motionp->mJointName, "joint_name");
success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
- success &= dp.packS32(joint_motionp->mRotationCurve.mKeys.size(), "num_rot_keys");
+ success &= dp.packS32(static_cast(joint_motionp->mRotationCurve.mKeys.size()), "num_rot_keys");
LL_DEBUGS("BVH") << "Joint " << i
<< " name: " << joint_motionp->mJointName
@@ -2105,7 +2106,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
LL_DEBUGS("BVH") << " rot: t " << rot_key.mTime << " angles " << rot_angles.mV[VX] <<","<< rot_angles.mV[VY] <<","<< rot_angles.mV[VZ] << LL_ENDL;
}
- success &= dp.packS32(joint_motionp->mPositionCurve.mKeys.size(), "num_pos_keys");
+ success &= dp.packS32(static_cast(joint_motionp->mPositionCurve.mKeys.size()), "num_pos_keys");
for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys)
{
PositionKey& pos_key = pos_pair.second;
@@ -2125,7 +2126,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
}
}
- success &= dp.packS32(mJointMotionList->mConstraints.size(), "num_constraints");
+ success &= dp.packS32(static_cast(mJointMotionList->mConstraints.size()), "num_constraints");
LL_DEBUGS("BVH") << "num_constraints " << mJointMotionList->mConstraints.size() << LL_ENDL;
for (JointConstraintSharedData* shared_constraintp : mJointMotionList->mConstraints)
{
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index edf2308050..d5b27c8102 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -420,7 +420,7 @@ public:
~JointMotionList();
U32 dumpDiagInfo();
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
- U32 getNumJointMotions() const { return mJointMotionArray.size(); }
+ U32 getNumJointMotions() const { return static_cast(mJointMotionArray.size()); }
};
protected:
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 5f99633a58..c204c96f6c 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -156,11 +156,11 @@ LLMotionController::~LLMotionController()
void LLMotionController::incMotionCounts(S32& num_motions, S32& num_loading_motions, S32& num_loaded_motions, S32& num_active_motions, S32& num_deprecated_motions)
{
- num_motions += mAllMotions.size();
- num_loading_motions += mLoadingMotions.size();
- num_loaded_motions += mLoadedMotions.size();
- num_active_motions += mActiveMotions.size();
- num_deprecated_motions += mDeprecatedMotions.size();
+ num_motions += static_cast(mAllMotions.size());
+ num_loading_motions += static_cast(mLoadingMotions.size());
+ num_loaded_motions += static_cast(mLoadedMotions.size());
+ num_active_motions += static_cast(mActiveMotions.size());
+ num_deprecated_motions += static_cast(mDeprecatedMotions.size());
}
//-----------------------------------------------------------------------------
@@ -222,7 +222,7 @@ void LLMotionController::purgeExcessMotions()
}
// clean up all inactive, loaded motions
- for (LLUUID motion_id : motions_to_kill)
+ for (const LLUUID& motion_id : motions_to_kill)
{
// look up the motion again by ID to get canonical instance
// and kill it only if that one is inactive
@@ -233,7 +233,7 @@ void LLMotionController::purgeExcessMotions()
}
}
- U32 loaded_count = mLoadedMotions.size();
+ U32 loaded_count = static_cast(mLoadedMotions.size());
if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge)
{
LL_WARNS_ONCE("Animation") << loaded_count << " Loaded Motions. Amount of motions is over limit." << LL_ENDL;
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 1388e81656..99ca0f740a 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -199,9 +199,9 @@ bool LLApp::parseCommandOptions(int argc, char** argv)
#if LL_WINDOWS
//Windows changed command line parsing. Deal with it.
- S32 slen = value.length() - 1;
- S32 start = 0;
- S32 end = slen;
+ size_t slen = value.length() - 1;
+ size_t start = 0;
+ size_t end = slen;
if (argv[ii][start]=='"')start++;
if (argv[ii][end]=='"')end--;
if (start!=0 || end!=slen)
@@ -264,9 +264,9 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv)
#if LL_WINDOWS
//Windows changed command line parsing. Deal with it.
- S32 slen = value.length() - 1;
- S32 start = 0;
- S32 end = slen;
+ size_t slen = value.length() - 1;
+ size_t start = 0;
+ size_t end = slen;
if (wargv[ii][start]=='"')start++;
if (wargv[ii][end]=='"')end--;
if (start!=0 || end!=slen)
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 17ad37b031..09fcf8a1af 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -215,7 +215,7 @@ private:
private:
U64 mStartTime;
- BlockTimerStackRecord mParentTimerData;
+ BlockTimerStackRecord mParentTimerData{};
public:
// statics
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 1877dd54ed..6fdf58a99b 100644
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -345,7 +345,7 @@ const char *LLFile::tmpdir()
sep = '\\';
std::vector utf16path(MAX_PATH + 1);
- GetTempPathW(utf16path.size(), &utf16path[0]);
+ GetTempPathW(static_cast(utf16path.size()), &utf16path[0]);
utf8path = ll_convert_wide_to_string(&utf16path[0]);
#else
sep = '/';
diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h
index 08a008c19a..2564671b13 100644
--- a/indra/llcommon/llfile.h
+++ b/indra/llcommon/llfile.h
@@ -97,7 +97,7 @@ public:
// no copy
LLUniqueFile(const LLUniqueFile&) = delete;
// move construction
- LLUniqueFile(LLUniqueFile&& other)
+ LLUniqueFile(LLUniqueFile&& other) noexcept
{
mFileHandle = other.mFileHandle;
other.mFileHandle = nullptr;
@@ -118,7 +118,7 @@ public:
// copy assignment deleted
LLUniqueFile& operator=(const LLUniqueFile&) = delete;
// move assignment
- LLUniqueFile& operator=(LLUniqueFile&& other)
+ LLUniqueFile& operator=(LLUniqueFile&& other) noexcept
{
close();
std::swap(mFileHandle, other.mFileHandle);
diff --git a/indra/llcommon/llindexedvector.h b/indra/llcommon/llindexedvector.h
index de3ae0dcc4..0b2e9c76ca 100644
--- a/indra/llcommon/llindexedvector.h
+++ b/indra/llcommon/llindexedvector.h
@@ -47,7 +47,7 @@ public:
typedef typename std::vector::size_type size_type;
protected:
std::vector mVector;
- std::map mIndexMap;
+ std::map mIndexMap;
public:
LLIndexedVector() { mVector.reserve(BlockSize); }
@@ -68,10 +68,10 @@ public:
Type& operator[](const Key& k)
{
- typename std::map::const_iterator iter = mIndexMap.find(k);
+ typename std::map::const_iterator iter = mIndexMap.find(k);
if (iter == mIndexMap.end())
{
- U32 n = mVector.size();
+ auto n = mVector.size();
mIndexMap[k] = n;
mVector.push_back(Type());
llassert(mVector.size() == mIndexMap.size());
@@ -85,7 +85,7 @@ public:
const_iterator find(const Key& k) const
{
- typename std::map::const_iterator iter = mIndexMap.find(k);
+ typename std::map::const_iterator iter = mIndexMap.find(k);
if(iter == mIndexMap.end())
{
return mVector.end();
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index a54408a852..0c5799ad96 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -122,24 +122,6 @@
// Deal with VC6 problems
#if LL_MSVC
-#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4.
-//#pragma warning( 3 : 4018 ) // "signed/unsigned mismatch" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4263 ) // 'function' : member function does not override any base class virtual member function
-#pragma warning( 3 : 4264 ) // "'virtual_function' : no override available for virtual member function from base 'class'; function is hidden"
-#pragma warning( 3 : 4265 ) // "class has virtual functions, but destructor is not virtual"
-#pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden
-#pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored
-//#pragma warning( disable : 4284 ) // silly MS warning deep inside their include file
-
-#if ADDRESS_SIZE == 64
-// That one is all over the place for x64 builds.
-#pragma warning( disable : 4267 ) // 'var' : conversion from 'size_t' to 'type', possible loss of data)
-#endif
-
-#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
-#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
#pragma warning( disable : 4996 ) // warning: deprecated
// Linker optimization with "extern template" generates these warnings
diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp
index 39e8113587..7d77f6f6a9 100644
--- a/indra/llcommon/llqueuedthread.cpp
+++ b/indra/llcommon/llqueuedthread.cpp
@@ -210,7 +210,7 @@ void LLQueuedThread::waitOnPending()
// MAIN thread
void LLQueuedThread::printQueueStats()
{
- U32 size = mRequestQueue.size();
+ auto size = mRequestQueue.size();
if (size > 0)
{
LL_INFOS() << llformat("Pending Requests:%d ", mRequestQueue.size()) << LL_ENDL;
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index 92d9392477..15002580c9 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -1546,7 +1546,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
case LLSD::TypeMap:
{
ostr.put('{');
- U32 size_nbo = htonl(data.size());
+ U32 size_nbo = htonl(static_cast(data.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32));
LLSD::map_const_iterator iter = data.beginMap();
LLSD::map_const_iterator end = data.endMap();
@@ -1563,7 +1563,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
case LLSD::TypeArray:
{
ostr.put('[');
- U32 size_nbo = htonl(data.size());
+ U32 size_nbo = htonl(static_cast(data.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32));
LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray();
@@ -1630,7 +1630,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
{
ostr.put('b');
const std::vector& buffer = data.asBinary();
- U32 size_nbo = htonl(buffer.size());
+ U32 size_nbo = htonl(static_cast(buffer.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32));
if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size());
break;
@@ -1648,7 +1648,7 @@ void LLSDBinaryFormatter::formatString(
const std::string& string,
std::ostream& ostr) const
{
- U32 size_nbo = htonl(string.size());
+ U32 size_nbo = htonl(static_cast(string.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32));
ostr.write(string.c_str(), string.size());
}
diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h
index 61f82a4c03..0a7086e819 100644
--- a/indra/llcommon/llsingleton.h
+++ b/indra/llcommon/llsingleton.h
@@ -528,6 +528,7 @@ public:
classname(),
" -- creating new instance"});
// fall through
+ [[fallthrough]];
case UNINITIALIZED:
case QUEUED:
// QUEUED means some secondary thread has already requested an
diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h
index 67b4c141af..1b52d94258 100644
--- a/indra/llcommon/llstl.h
+++ b/indra/llcommon/llstl.h
@@ -326,7 +326,7 @@ inline bool vector_replace_with_last(std::vector& invec, const T& val)
template
inline T* vector_append(std::vector& invec, S32 N)
{
- U32 sz = invec.size();
+ auto sz = invec.size();
invec.resize(sz+N);
return &(invec[sz]);
}
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 5df0f8702d..514d73b24b 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -809,7 +809,7 @@ std::string ll_convert_wide_to_string(const wchar_t* in, size_t len_in, unsigned
code_page,
0,
in,
- len_in,
+ static_cast(len_in),
NULL,
0,
0,
@@ -824,7 +824,7 @@ std::string ll_convert_wide_to_string(const wchar_t* in, size_t len_in, unsigned
code_page,
0,
in,
- len_in,
+ static_cast(len_in),
pout,
len_out,
0,
@@ -851,8 +851,8 @@ std::wstring ll_convert_string_to_wide(const char* in, size_t len, unsigned int
std::vector w_out(len + 1);
memset(&w_out[0], 0, w_out.size());
- int real_output_str_len = MultiByteToWideChar(code_page, 0, in, len,
- &w_out[0], w_out.size() - 1);
+ int real_output_str_len = MultiByteToWideChar(code_page, 0, in, static_cast(len),
+ &w_out[0], static_cast(w_out.size() - 1));
//looks like MultiByteToWideChar didn't add null terminator to converted string, see EXT-4858.
w_out[real_output_str_len] = 0;
@@ -943,7 +943,7 @@ std::optional llstring_getoptenv(const std::string& key)
auto wkey = ll_convert_string_to_wide(key);
// Take a wild guess as to how big the buffer should be.
std::vector buffer(1024);
- auto n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], buffer.size());
+ auto n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], static_cast(buffer.size()));
// If our initial guess was too short, n will indicate the size (in
// wchar_t's) that buffer should have been, including the terminating nul.
if (n > (buffer.size() - 1))
@@ -951,7 +951,7 @@ std::optional llstring_getoptenv(const std::string& key)
// make it big enough
buffer.resize(n);
// and try again
- n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], buffer.size());
+ n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], static_cast(buffer.size()));
}
// did that (ultimately) succeed?
if (n)
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
index 692bbe5acf..ba7acf9547 100644
--- a/indra/llcommon/lltraceaccumulators.h
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -522,9 +522,9 @@ namespace LLTrace
struct BlockTimerStackRecord
{
- class BlockTimer* mActiveTimer;
- class BlockTimerStatHandle* mTimeBlock;
- U64 mChildTime;
+ class BlockTimer* mActiveTimer{ nullptr };
+ class BlockTimerStatHandle* mTimeBlock{ nullptr };
+ U64 mChildTime{ 0 };
};
struct AccumulatorBufferGroup : public LLRefCount
diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h
index 68c4b05fdc..b382d6b3f9 100644
--- a/indra/llcommon/lluuid.h
+++ b/indra/llcommon/lluuid.h
@@ -82,8 +82,6 @@ public:
// to integers, among other things. Use isNull() or notNull().
// operator bool() const;
- // JC: These must return real bool's (not BOOLs) or else use of the STL
- // will generate bool-to-int performance warnings.
bool operator==(const LLUUID &rhs) const;
bool operator!=(const LLUUID &rhs) const;
bool operator<(const LLUUID &rhs) const;
diff --git a/indra/llcommon/tests/commonmisc_test.cpp b/indra/llcommon/tests/commonmisc_test.cpp
index 3deb864c0c..0057a1f639 100644
--- a/indra/llcommon/tests/commonmisc_test.cpp
+++ b/indra/llcommon/tests/commonmisc_test.cpp
@@ -67,7 +67,7 @@ namespace tut
std::ostringstream resp;
resp << "{'connect':true, 'position':[r128,r128,r128], 'look_at':[r0,r1,r0], 'agent_access':'M', 'region_x':i8192, 'region_y':i8192}";
std::string str = resp.str();
- LLMemoryStream mstr((U8*)str.c_str(), str.size());
+ LLMemoryStream mstr((U8*)str.c_str(), static_cast(str.size()));
LLSD response;
S32 count = LLSDSerialize::fromNotation(response, mstr, str.size());
ensure("stream parsed", response.isDefined());
@@ -252,7 +252,7 @@ namespace tut
resp << "{'label':'short binary test', 'singlebinary':b(1)\"A\", 'singlerawstring':s(1)\"A\", 'endoftest':'end' }";
std::string str = resp.str();
LLSD sd;
- LLMemoryStream mstr((U8*)str.c_str(), str.size());
+ LLMemoryStream mstr((U8*)str.c_str(), static_cast(str.size()));
S32 count = LLSDSerialize::fromNotation(sd, mstr, str.size());
ensure_equals("parse count", count, 5);
ensure("sd created", sd.isDefined());
@@ -456,7 +456,7 @@ namespace tut
void mem_object::test<1>()
{
const char HELLO_WORLD[] = "hello world";
- LLMemoryStream mem((U8*)&HELLO_WORLD[0], strlen(HELLO_WORLD)); /* Flawfinder: ignore */
+ LLMemoryStream mem((U8*)&HELLO_WORLD[0], static_cast(strlen(HELLO_WORLD))); /* Flawfinder: ignore */
std::string hello;
std::string world;
mem >> hello >> world;
diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp
index a99acba848..44f772e322 100644
--- a/indra/llcommon/tests/lleventdispatcher_test.cpp
+++ b/indra/llcommon/tests/lleventdispatcher_test.cpp
@@ -491,7 +491,7 @@ namespace tut
// Partial defaults arrays.
for (LLSD::String a: ab)
{
- LLSD::Integer partition(std::min(partial_offset, dft_array_full[a].size()));
+ LLSD::Integer partition(static_cast(std::min(partial_offset, dft_array_full[a].size())));
dft_array_partial[a] =
llsd_copy_array(dft_array_full[a].beginArray() + partition,
dft_array_full[a].endArray());
@@ -508,7 +508,7 @@ namespace tut
// (params, dft_array_full). Part of the point of using map-style
// defaults is to allow any subset of the target function's
// parameters to be optional, not just the rightmost.
- for (LLSD::Integer ix = 0, ixend = params[a].size(); ix < ixend; ix += 2)
+ for (LLSD::Integer ix = 0, ixend = static_cast(params[a].size()); ix < ixend; ix += 2)
{
dft_map_partial[a][params[a][ix].asString()] = dft_array_full[a][ix];
}
@@ -696,7 +696,7 @@ namespace tut
LLSD zipmap(const LLSD& keys, const LLSD& values)
{
LLSD map;
- for (LLSD::Integer i = 0, iend = keys.size(); i < iend; ++i)
+ for (LLSD::Integer i = 0, iend = static_cast(keys.size()); i < iend; ++i)
{
// Have to select asString() since you can index an LLSD
// object with either String or Integer.
@@ -955,7 +955,7 @@ namespace tut
allreq[a] = zipmap(params[a], LLSD::emptyArray());
// Same for leftreq, save that we use the subset of the params not
// supplied by dft_array_partial[a].
- LLSD::Integer partition(params[a].size() - dft_array_partial[a].size());
+ LLSD::Integer partition(static_cast(params[a].size() - dft_array_partial[a].size()));
leftreq[a] = zipmap(llsd_copy_array(params[a].beginArray(),
params[a].beginArray() + partition),
LLSD::emptyArray());
diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp
index 56fdc51e82..fb2af1d2db 100644
--- a/indra/llcommon/tests/llsdserialize_test.cpp
+++ b/indra/llcommon/tests/llsdserialize_test.cpp
@@ -701,7 +701,7 @@ namespace tut
"cam1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
}
template<> template<>
@@ -721,7 +721,7 @@ namespace tut
"cam1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
v.clear();
v["amy"] = 23;
@@ -734,7 +734,7 @@ namespace tut
"cam1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
v.clear();
v["amy"] = 23;
@@ -751,7 +751,7 @@ namespace tut
"cam1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
v.clear();
v[0] = 23;
@@ -766,7 +766,7 @@ namespace tut
"1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
v.clear();
v[0] = 23;
@@ -782,7 +782,7 @@ namespace tut
"1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
}
template<> template<>
@@ -1405,13 +1405,13 @@ namespace tut
uint32_t size = htonl(1);
memcpy(&vec[1], &size, sizeof(uint32_t));
vec.push_back('k');
- int key_size_loc = vec.size();
+ auto key_size_loc = vec.size();
size = htonl(1); // 1 too short
vec.resize(vec.size() + 4);
memcpy(&vec[key_size_loc], &size, sizeof(uint32_t));
vec.push_back('a'); vec.push_back('m'); vec.push_back('y');
vec.push_back('i');
- int integer_loc = vec.size();
+ auto integer_loc = vec.size();
vec.resize(vec.size() + 4);
uint32_t val_int = htonl(23);
memcpy(&vec[integer_loc], &val_int, sizeof(uint32_t));
@@ -1473,7 +1473,7 @@ namespace tut
memcpy(&vec[1], &size, sizeof(uint32_t));
vec.push_back('"'); vec.push_back('a'); vec.push_back('m');
vec.push_back('y'); vec.push_back('"'); vec.push_back('i');
- int integer_loc = vec.size();
+ auto integer_loc = vec.size();
vec.resize(vec.size() + 4);
uint32_t val_int = htonl(23);
memcpy(&vec[integer_loc], &val_int, sizeof(uint32_t));
diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp
index e646271c84..8ed517ffca 100644
--- a/indra/llcorehttp/_httplibcurl.cpp
+++ b/indra/llcorehttp/_httplibcurl.cpp
@@ -442,7 +442,7 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode
int HttpLibcurl::getActiveCount() const
{
- return mActiveOps.size();
+ return static_cast(mActiveOps.size());
}
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index 5165a6eb62..6186e7a308 100644
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -267,7 +267,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request)
if (mReplyOffset || mReplyLength)
{
// Got an explicit offset/length in response
- response->setRange(mReplyOffset, mReplyLength, mReplyFullLength);
+ response->setRange(mReplyOffset, static_cast(mReplyLength), static_cast(mReplyFullLength));
}
response->setContentType(mReplyConType);
response->setRetries(mPolicyRetries, mPolicy503Retries);
@@ -328,7 +328,7 @@ HttpStatus HttpOpRequest::setupGetByteRange(HttpRequest::policy_t policy_id,
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
setupCommon(policy_id, url, NULL, options, headers);
mReqMethod = HOR_GET;
- mReqOffset = offset;
+ mReqOffset = static_cast(offset);
mReqLength = len;
if (offset || len)
{
@@ -607,7 +607,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
long data_size(0);
if (mReqBody)
{
- data_size = mReqBody->size();
+ data_size = static_cast(mReqBody->size());
}
check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast(NULL));
check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size);
@@ -618,13 +618,14 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
case HOR_PATCH:
check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "PATCH");
// fall through. The rest is the same as PUT
+ [[fallthrough]];
case HOR_PUT:
{
check_curl_easy_setopt(mCurlHandle, CURLOPT_UPLOAD, 1);
long data_size(0);
if (mReqBody)
{
- data_size = mReqBody->size();
+ data_size = static_cast(mReqBody->size());
}
check_curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size);
mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:");
diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp
index 704c8abb93..a39d2f21a9 100644
--- a/indra/llcorehttp/_httppolicy.cpp
+++ b/indra/llcorehttp/_httppolicy.cpp
@@ -98,7 +98,7 @@ HttpPolicy::~HttpPolicy()
HttpRequest::policy_t HttpPolicy::createPolicyClass()
{
- const HttpRequest::policy_t policy_class(mClasses.size());
+ const HttpRequest::policy_t policy_class(static_cast(mClasses.size()));
if (policy_class >= HTTP_POLICY_CLASS_LIMIT)
{
return HttpRequest::INVALID_POLICY_ID;
@@ -432,8 +432,8 @@ int HttpPolicy::getReadyCount(HttpRequest::policy_t policy_class) const
{
if (policy_class < mClasses.size())
{
- return (mClasses[policy_class]->mReadyQueue.size()
- + mClasses[policy_class]->mRetryQueue.size());
+ return static_cast((mClasses[policy_class]->mReadyQueue.size()
+ + mClasses[policy_class]->mRetryQueue.size()));
}
return 0;
}
diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp
index 4d1e52b766..3c7c8ed634 100644
--- a/indra/llcorehttp/examples/http_texture_load.cpp
+++ b/indra/llcorehttp/examples/http_texture_load.cpp
@@ -519,7 +519,7 @@ void WorkingSet::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * r
{
// More success
LLCore::BufferArray * data(response->getBody());
- mByteCount += data ? data->size() : 0;
+ mByteCount += data ? static_cast(data->size()) : 0L;
++mSuccesses;
}
else
@@ -602,7 +602,7 @@ void WorkingSet::loadAssetUuids(FILE * in)
mAssets.push_back(asset);
}
}
- mRemaining = mLimit = mAssets.size();
+ mRemaining = mLimit = static_cast(mAssets.size());
}
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index e94aff2a37..b1b698375a 100644
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -131,7 +131,7 @@ std::string getStartupStateFromLog(std::string& sllog)
std::string startup_state = "STATE_FIRST";
std::string startup_token = "Startup state changing from ";
- int index = sllog.rfind(startup_token);
+ auto index = sllog.rfind(startup_token);
if (index < 0 || index + startup_token.length() > sllog.length()) {
return startup_state;
}
diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp
index cbf4c1ffb8..483ef0fd02 100644
--- a/indra/llfilesystem/lldir.cpp
+++ b/indra/llfilesystem/lldir.cpp
@@ -638,7 +638,7 @@ std::string LLDir::getBaseFileName(const std::string& filepath, bool strip_exten
std::string LLDir::getDirName(const std::string& filepath) const
{
std::size_t offset = filepath.find_last_of(getDirDelimiter());
- S32 len = (offset == std::string::npos) ? 0 : offset;
+ auto len = (offset == std::string::npos) ? 0 : offset;
std::string dirname = filepath.substr(0, len);
return dirname;
}
@@ -883,8 +883,8 @@ std::string LLDir::getScrubbedFileName(const std::string uncleanFileName)
// replace any illegal file chars with and underscore '_'
for( unsigned int i = 0; i < illegalChars.length(); i++ )
{
- int j = -1;
- while((j = name.find(illegalChars[i])) > -1)
+ std::string::size_type j = -1;
+ while((j = name.find(illegalChars[i])) > std::string::npos)
{
name[j] = '_';
}
diff --git a/indra/llfilesystem/lldir_win32.cpp b/indra/llfilesystem/lldir_win32.cpp
index 0fca4004b6..a607c70b44 100644
--- a/indra/llfilesystem/lldir_win32.cpp
+++ b/indra/llfilesystem/lldir_win32.cpp
@@ -233,7 +233,7 @@ LLDir_Win32::LLDir_Win32()
{
w_str[size] = '\0';
mExecutablePathAndName = utf16str_to_utf8str(llutf16string(w_str));
- S32 path_end = mExecutablePathAndName.find_last_of('\\');
+ auto path_end = mExecutablePathAndName.find_last_of('\\');
if (path_end != std::string::npos)
{
mExecutableDir = mExecutablePathAndName.substr(0, path_end);
diff --git a/indra/llfilesystem/lllfsthread.cpp b/indra/llfilesystem/lllfsthread.cpp
index 7d135b4472..6a882f64a8 100644
--- a/indra/llfilesystem/lllfsthread.cpp
+++ b/indra/llfilesystem/lllfsthread.cpp
@@ -45,7 +45,7 @@ void LLLFSThread::initClass(bool local_is_threaded)
//static
S32 LLLFSThread::updateClass(U32 ms_elapsed)
{
- return sLocal->update((F32)ms_elapsed);
+ return static_cast(sLocal->update((F32)ms_elapsed));
}
//static
diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp
index 89299258a6..6b960f9077 100644
--- a/indra/llimage/llimagedxt.cpp
+++ b/indra/llimage/llimagedxt.cpp
@@ -476,7 +476,7 @@ bool LLImageDXT::convertToDXR()
// virtual
S32 LLImageDXT::calcHeaderSize()
{
- return llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t));
+ return static_cast(llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t)));
}
// virtual
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index b168f343e7..063ec3e763 100644
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -1179,7 +1179,7 @@ bool LLImageTGA::decodeAndProcess( LLImageRaw* raw_image, F32 domain, F32 weight
// Reads a .tga file and creates an LLImageTGA with its data.
bool LLImageTGA::loadFile( const std::string& path )
{
- S32 len = path.size();
+ auto len = path.size();
if( len < 5 )
{
return false;
@@ -1206,7 +1206,7 @@ bool LLImageTGA::loadFile( const std::string& path )
}
U8* buffer = allocateData(file_size);
- S32 bytes_read = fread(buffer, 1, file_size, file);
+ S32 bytes_read = static_cast(fread(buffer, 1, file_size, file));
if( bytes_read != file_size )
{
deleteData();
diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp
index a5fb7a3167..79c201b1f4 100644
--- a/indra/llimage/llpngwrapper.cpp
+++ b/indra/llimage/llpngwrapper.cpp
@@ -328,10 +328,10 @@ bool LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSiz
mWriteInfoPtr = png_create_info_struct(mWritePngPtr);
// Setup write function
- PngDataInfo dataPtr;
+ PngDataInfo dataPtr{};
dataPtr.mData = dest;
dataPtr.mOffset = 0;
- dataPtr.mDataSize = destSize;
+ dataPtr.mDataSize = static_cast(destSize);
png_set_write_fn(mWritePngPtr, &dataPtr, &writeDataCallback, &writeFlush);
// Setup image params
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index ef6a187d06..5950474311 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -462,7 +462,7 @@ namespace
// Trim extra tracks.
while (value.size() > LLSettingsDay::TRACK_MAX)
{
- value.erase(value.size() - 1);
+ value.erase(static_cast(value.size()) - 1);
}
S32 framecount(0);
@@ -511,7 +511,7 @@ namespace
}
- int waterTracks = value[0].size();
+ int waterTracks = static_cast(value[0].size());
int skyTracks = framecount - waterTracks;
if (waterTracks < 1)
diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h
index 9db152adf8..11462170fb 100644
--- a/indra/llmath/llsimdtypes.h
+++ b/indra/llmath/llsimdtypes.h
@@ -60,7 +60,7 @@ public:
inline operator bool() const { return static_cast(m_bool); }
private:
- int m_bool;
+ int m_bool{ 0 };
};
#if LL_WINDOWS
@@ -118,7 +118,7 @@ public:
}
private:
- LLQuad mQ;
+ LLQuad mQ{};
};
#endif //LL_SIMD_TYPES_H
diff --git a/indra/llmath/llsphere.cpp b/indra/llmath/llsphere.cpp
index 89349af6c8..5f48764455 100644
--- a/indra/llmath/llsphere.cpp
+++ b/indra/llmath/llsphere.cpp
@@ -185,7 +185,7 @@ LLSphere LLSphere::getBoundingSphere(const std::vector& sphere_list)
// TODO -- improve the accuracy for small collections of spheres
LLSphere bounding_sphere( LLVector3(0.f, 0.f, 0.f), 0.f );
- S32 sphere_count = sphere_list.size();
+ auto sphere_count = sphere_list.size();
if (1 == sphere_count)
{
// trivial case -- single sphere
diff --git a/indra/llmath/lltreenode.h b/indra/llmath/lltreenode.h
index f648a114ca..e3d30206b7 100644
--- a/indra/llmath/lltreenode.h
+++ b/indra/llmath/lltreenode.h
@@ -57,7 +57,7 @@ public:
virtual bool remove(T* data);
virtual void notifyRemoval(T* data);
virtual U32 hasListeners() const { return !mListeners.empty(); }
- virtual U32 getListenerCount() const { return mListeners.size(); }
+ virtual U32 getListenerCount() const { return static_cast(mListeners.size()); }
virtual LLTreeListener* getListener(U32 index) const
{
if (index < mListeners.size())
diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h
index 8f0ee4b739..ea80b33e2d 100644
--- a/indra/llmath/llvector4a.h
+++ b/indra/llmath/llvector4a.h
@@ -322,7 +322,7 @@ public:
inline operator LLQuad() const;
private:
- LLQuad mQ;
+ LLQuad mQ{};
};
inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p)
diff --git a/indra/llmath/llvector4logical.h b/indra/llmath/llvector4logical.h
index d08b5513d9..70759eef5c 100644
--- a/indra/llmath/llvector4logical.h
+++ b/indra/llmath/llvector4logical.h
@@ -120,7 +120,7 @@ public:
private:
- LLQuad mQ;
+ LLQuad mQ{};
};
#endif //LL_VECTOR4ALOGICAL_H
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index e6001626f3..b6f710f979 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2392,7 +2392,7 @@ bool LLVolume::unpackVolumeFaces(U8* in_data, S32 size)
bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
{
{
- U32 face_count = mdl.size();
+ auto face_count = mdl.size();
if (face_count == 0)
{ //no faces unpacked, treat as failed decode
@@ -2424,7 +2424,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
LLSD::Binary idx = mdl[i]["TriangleList"];
//copy out indices
- S32 num_indices = idx.size() / 2;
+ auto num_indices = idx.size() / 2;
const S32 indices_to_discard = num_indices % 3;
if (indices_to_discard > 0)
{
@@ -2432,7 +2432,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
LL_WARNS() << "Incomplete triangle discarded from face! Indices count " << num_indices << " was not divisible by 3. face index: " << i << " Total: " << face_count << LL_ENDL;
num_indices -= indices_to_discard;
}
- face.resizeIndices(num_indices);
+ face.resizeIndices(static_cast(num_indices));
if (num_indices > 2 && !face.mIndices)
{
@@ -2453,7 +2453,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
}
//copy out vertices
- U32 num_verts = pos.size()/(3*2);
+ U32 num_verts = static_cast(pos.size())/(3*2);
face.resizeVertices(num_verts);
if (num_verts > 0 && !face.mPositions)
@@ -5015,13 +5015,13 @@ void LLVolumeFace::remap()
{
// Generate a remap buffer
std::vector remap(mNumVertices);
- S32 remap_vertices_count = LLMeshOptimizer::generateRemapMultiU16(&remap[0],
+ S32 remap_vertices_count = static_cast(LLMeshOptimizer::generateRemapMultiU16(&remap[0],
mIndices,
mNumIndices,
mPositions,
mNormals,
mTexCoords,
- mNumVertices);
+ mNumVertices));
// Allocate new buffers
S32 size = ((mNumIndices * sizeof(U16)) + 0xF) & ~0xF;
@@ -5565,7 +5565,7 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
U32 stream_count = data.w.empty() ? 4 : 5;
- size_t vert_count = meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count);
+ S32 vert_count = static_cast(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count));
if (vert_count < 65535 && vert_count != 0)
{
@@ -6648,8 +6648,8 @@ void LLVolumeFace::pushIndex(const U16& idx)
void LLVolumeFace::fillFromLegacyData(std::vector& v, std::vector& idx)
{
- resizeVertices(v.size());
- resizeIndices(idx.size());
+ resizeVertices(static_cast(v.size()));
+ resizeIndices(static_cast(idx.size()));
for (U32 i = 0; i < v.size(); ++i)
{
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 44a24f8496..e812e5f0cc 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -1019,7 +1019,7 @@ public:
U8 getProfileType() const { return mParams.getProfileParams().getCurveType(); }
U8 getPathType() const { return mParams.getPathParams().getCurveType(); }
S32 getNumFaces() const;
- S32 getNumVolumeFaces() const { return mVolumeFaces.size(); }
+ S32 getNumVolumeFaces() const { return static_cast(mVolumeFaces.size()); }
F32 getDetail() const { return mDetail; }
F32 getSurfaceArea() const { return mSurfaceArea; }
const LLVolumeParams& getParams() const { return mParams; }
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 13fda24e62..b3390451a2 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -1125,7 +1125,7 @@ S32 LLAssetStorage::getNumPending(LLAssetStorage::ERequestType rt) const
S32 num_pending = -1;
if (requests)
{
- num_pending = requests->size();
+ num_pending = static_cast(requests->size());
}
return num_pending;
}
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index a0cd6f93c1..ff7c2f8387 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -240,7 +240,7 @@ void LLAvatarNameCache::handleAvNameCacheSuccess(const LLSD &data, const LLSD &h
// Same logic as error response case
const LLSD& unresolved_agents = data["bad_ids"];
- S32 num_unresolved = unresolved_agents.size();
+ auto num_unresolved = unresolved_agents.size();
if (num_unresolved > 0)
{
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result " << num_unresolved << " unresolved ids; "
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 6fb21957e0..63ac46722a 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -562,13 +562,13 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
{
//boost::regexp was showing up in the crashreporter, so doing
//painfully manual parsing using substr. LF
- S32 open_paren = complete_name.rfind(" (");
- S32 close_paren = complete_name.rfind(')');
+ auto open_paren = complete_name.rfind(" (");
+ auto close_paren = complete_name.rfind(')');
if (open_paren != std::string::npos &&
close_paren == complete_name.length()-1)
{
- S32 length = close_paren - open_paren - 2;
+ auto length = close_paren - open_paren - 2;
std::string legacy_name = complete_name.substr(open_paren+2, length);
if (legacy_name.length() > 0)
@@ -577,7 +577,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
LLStringUtil::toUpper(cap_letter);
legacy_name = cap_letter + legacy_name.substr(1);
- S32 separator = legacy_name.find('.');
+ auto separator = legacy_name.find('.');
if (separator != std::string::npos)
{
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index fa206d9282..bf22f3d3f0 100644
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -781,8 +781,8 @@ void LLCircuitData::checkPacketInID(TPACKETID id, bool receive_resent)
void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
{
F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds();
- S32 count = mPingSet.size();
- S32 cur = 0;
+ size_t count = mPingSet.size();
+ size_t cur = 0;
// Only process each circuit once at most, stop processing if no circuits
while((cur < count) && !mPingSet.empty())
diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp
index 959cfb2762..263670bdac 100644
--- a/indra/llmessage/llcoproceduremanager.cpp
+++ b/indra/llmessage/llcoproceduremanager.cpp
@@ -87,7 +87,7 @@ public:
///
inline S32 count() const
{
- return countPending() + countActive();
+ return static_cast(countPending() + countActive());
}
void close();
diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp
index 134f34aafa..e911150787 100644
--- a/indra/llmessage/lldatapacker.cpp
+++ b/indra/llmessage/lldatapacker.cpp
@@ -237,7 +237,7 @@ bool LLDataPacker::unpackUUIDs(LLUUID *values, S32 count, const char *name)
bool LLDataPackerBinaryBuffer::packString(const std::string& value, const char *name)
{
- S32 length = value.length()+1;
+ S32 length = static_cast(value.length()) + 1;
if (!verifyLength(length, name))
{
@@ -740,7 +740,7 @@ bool LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n
}
else
{
- numCopied = value.length() + 1; /*Flawfinder: ignore*/
+ numCopied = static_cast(value.length()) + 1; /*Flawfinder: ignore*/
}
// snprintf returns number of bytes that would have been written
diff --git a/indra/llmessage/llfiltersd2xmlrpc.cpp b/indra/llmessage/llfiltersd2xmlrpc.cpp
index df78652361..84b56d54bf 100644
--- a/indra/llmessage/llfiltersd2xmlrpc.cpp
+++ b/indra/llmessage/llfiltersd2xmlrpc.cpp
@@ -274,12 +274,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
if(!buffer.empty())
{
// *TODO: convert to LLBase64
- int b64_buffer_length = apr_base64_encode_len(buffer.size());
+ int b64_buffer_length = apr_base64_encode_len(static_cast(buffer.size()));
char* b64_buffer = new char[b64_buffer_length];
b64_buffer_length = apr_base64_encode_binary(
b64_buffer,
&buffer[0],
- buffer.size());
+ static_cast(buffer.size()));
ostr.write(b64_buffer, b64_buffer_length - 1);
delete[] b64_buffer;
}
diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp
index 9791a20743..e562f09844 100644
--- a/indra/llmessage/lliohttpserver.cpp
+++ b/indra/llmessage/lliohttpserver.cpp
@@ -494,7 +494,7 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
LLChangeChannel change(channels.in(), channels.out());
std::for_each(buffer->beginSegment(), buffer->endSegment(), change);
std::string header = ostr.str();
- buffer->prepend(channels.out(), (U8*)header.c_str(), header.size());
+ buffer->prepend(channels.out(), (U8*)header.c_str(), static_cast(header.size()));
PUMP_DEBUG;
return STATUS_DONE;
}
diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp
index a14d10fe5f..f2192acee0 100644
--- a/indra/llmessage/lliosocket.cpp
+++ b/indra/llmessage/lliosocket.cpp
@@ -346,7 +346,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl(
PUMP_DEBUG;
len = READ_BUFFER_SIZE;
status = apr_socket_recv(mSource->getSocket(), read_buf, &len);
- buffer->append(channels.out(), (U8*)read_buf, len);
+ buffer->append(channels.out(), (U8*)read_buf, static_cast(len));
} while((APR_SUCCESS == status) && (READ_BUFFER_SIZE == len));
LL_DEBUGS() << "socket read status: " << status << LL_ENDL;
LLIOPipe::EStatus rv = STATUS_OK;
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index ca027d7675..9e10a356db 100644
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -273,7 +273,7 @@ bool LLMail::send(
std::string good_string = "\n..\n";
while (1)
{
- int index = message.find(bad_string);
+ auto index = message.find(bad_string);
if (index == std::string::npos) break;
message.replace(index, bad_string.size(), good_string);
}
diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp
index 3e1e5daa02..864e68998c 100644
--- a/indra/llmessage/llproxy.cpp
+++ b/indra/llmessage/llproxy.cpp
@@ -123,7 +123,7 @@ S32 LLProxy::proxyHandshake(LLHost proxy)
// The server has requested a username/password combination
std::string socks_username(getSocksUser());
std::string socks_password(getSocksPwd());
- U32 request_size = socks_username.size() + socks_password.size() + 3;
+ U32 request_size = static_cast(socks_username.size() + socks_password.size() + 3);
char * password_auth = new char[request_size];
password_auth[0] = 0x01;
password_auth[1] = (char)(socks_username.size());
diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp
index d3b75cf86b..e1cd70b216 100644
--- a/indra/llmessage/llpumpio.cpp
+++ b/indra/llmessage/llpumpio.cpp
@@ -818,7 +818,7 @@ void LLPumpIO::rebuildPollset()
running_chains_t::iterator run_end = mRunningChains.end();
for(; run_it != run_end; ++run_it)
{
- size += (*run_it).mDescriptors.size();
+ size += static_cast((*run_it).mDescriptors.size());
}
//LL_DEBUGS() << "found " << size << " descriptors." << LL_ENDL;
if(size)
diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h
index 4f23c4d160..2b7ba80a78 100644
--- a/indra/llmessage/llregionflags.h
+++ b/indra/llmessage/llregionflags.h
@@ -28,83 +28,83 @@
#define LL_LLREGIONFLAGS_H
// Can you be hurt here? Should health be on?
-const U64 REGION_FLAGS_ALLOW_DAMAGE = (1 << 0);
+constexpr U64 REGION_FLAGS_ALLOW_DAMAGE = (1ULL << 0);
// Can you make landmarks here?
-const U64 REGION_FLAGS_ALLOW_LANDMARK = (1 << 1);
+constexpr U64 REGION_FLAGS_ALLOW_LANDMARK = (1ULL << 1);
// Do we reset the home position when someone teleports away from here?
-const U64 REGION_FLAGS_ALLOW_SET_HOME = (1 << 2);
+constexpr U64 REGION_FLAGS_ALLOW_SET_HOME = (1ULL << 2);
// Do we reset the home position when someone teleports away from here?
-const U64 REGION_FLAGS_RESET_HOME_ON_TELEPORT = (1 << 3);
+constexpr U64 REGION_FLAGS_RESET_HOME_ON_TELEPORT = (1ULL << 3);
// Does the sun move?
-const U64 REGION_FLAGS_SUN_FIXED = (1 << 4);
+constexpr U64 REGION_FLAGS_SUN_FIXED = (1ULL << 4);
// Does the estate owner allow private parcels?
-const U64 REGION_FLAGS_ALLOW_ACCESS_OVERRIDE = (1 << 5);
+constexpr U64 REGION_FLAGS_ALLOW_ACCESS_OVERRIDE = (1ULL << 5);
// Can't change the terrain heightfield, even on owned parcels,
// but can plant trees and grass.
-const U64 REGION_FLAGS_BLOCK_TERRAFORM = (1 << 6);
+constexpr U64 REGION_FLAGS_BLOCK_TERRAFORM = (1ULL << 6);
// Can't release, sell, or buy land.
-const U64 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7);
+constexpr U64 REGION_FLAGS_BLOCK_LAND_RESELL = (1ULL << 7);
// All content wiped once per night
-const U64 REGION_FLAGS_SANDBOX = (1 << 8);
+constexpr U64 REGION_FLAGS_SANDBOX = (1ULL << 8);
-const U64 REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE = (1 << 9);
+constexpr U64 REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE = (1ULL << 9);
-const U64 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies
-const U64 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13);
-const U64 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics
-const U64 REGION_FLAGS_EXTERNALLY_VISIBLE = (1 << 15);
-const U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1 << 16);
-const U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1 << 17);
-const U64 REGION_FLAGS_BLOCK_DWELL = (1 << 18);
+constexpr U64 REGION_FLAGS_SKIP_COLLISIONS = (1ULL << 12); // Pin all non agent rigid bodies
+constexpr U64 REGION_FLAGS_SKIP_SCRIPTS = (1ULL << 13);
+constexpr U64 REGION_FLAGS_SKIP_PHYSICS = (1ULL << 14); // Skip all physics
+constexpr U64 REGION_FLAGS_EXTERNALLY_VISIBLE = (1ULL << 15);
+constexpr U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1ULL << 16);
+constexpr U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1ULL << 17);
+constexpr U64 REGION_FLAGS_BLOCK_DWELL = (1ULL << 18);
// Is flight allowed?
-const U64 REGION_FLAGS_BLOCK_FLY = (1 << 19);
+constexpr U64 REGION_FLAGS_BLOCK_FLY = (1ULL << 19);
// Is direct teleport (p2p) allowed?
-const U64 REGION_FLAGS_ALLOW_DIRECT_TELEPORT = (1 << 20);
+constexpr U64 REGION_FLAGS_ALLOW_DIRECT_TELEPORT = (1ULL << 20);
// Is there an administrative override on scripts in the region at the
// moment. This is the similar skip scripts, except this flag is
// presisted in the database on an estate level.
-const U64 REGION_FLAGS_ESTATE_SKIP_SCRIPTS = (1 << 21);
+constexpr U64 REGION_FLAGS_ESTATE_SKIP_SCRIPTS = (1ULL << 21);
-const U64 REGION_FLAGS_RESTRICT_PUSHOBJECT = (1 << 22);
+constexpr U64 REGION_FLAGS_RESTRICT_PUSHOBJECT = (1ULL << 22);
-const U64 REGION_FLAGS_DENY_ANONYMOUS = (1 << 23);
+constexpr U64 REGION_FLAGS_DENY_ANONYMOUS = (1ULL << 23);
-const U64 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26);
+constexpr U64 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1ULL << 26);
-const U64 REGION_FLAGS_BLOCK_FLYOVER = (1 << 27);
+constexpr U64 REGION_FLAGS_BLOCK_FLYOVER = (1ULL << 27);
-const U64 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
+constexpr U64 REGION_FLAGS_ALLOW_VOICE = (1ULL << 28);
-const U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29);
-const U64 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30);
+constexpr U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1ULL << 29);
+constexpr U64 REGION_FLAGS_DENY_AGEUNVERIFIED = (1ULL << 30);
-const U64 REGION_FLAGS_DENY_BOTS = (1 << 31);
+constexpr U64 REGION_FLAGS_DENY_BOTS = (1ULL << 31);
-const U64 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
- REGION_FLAGS_ALLOW_SET_HOME |
- REGION_FLAGS_ALLOW_PARCEL_CHANGES |
- REGION_FLAGS_ALLOW_VOICE;
+constexpr U64 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
+ REGION_FLAGS_ALLOW_SET_HOME |
+ REGION_FLAGS_ALLOW_PARCEL_CHANGES |
+ REGION_FLAGS_ALLOW_VOICE;
-const U64 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT;
-const U64 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK
- | REGION_FLAGS_ALLOW_SET_HOME;
+constexpr U64 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT;
+constexpr U64 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK |
+ REGION_FLAGS_ALLOW_SET_HOME;
-const U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE
- | REGION_FLAGS_SUN_FIXED
- | REGION_FLAGS_DENY_ANONYMOUS
- | REGION_FLAGS_DENY_AGEUNVERIFIED;
+constexpr U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE |
+ REGION_FLAGS_SUN_FIXED |
+ REGION_FLAGS_DENY_ANONYMOUS |
+ REGION_FLAGS_DENY_AGEUNVERIFIED;
inline bool is_flag_set(U64 flags, U64 flag)
{
@@ -133,79 +133,75 @@ inline U64 unset_prelude_flags(U64 flags)
}
// Region protocols
-const U64 REGION_PROTOCOLS_AGENT_APPEARANCE_SERVICE = (1 << 0);
+constexpr U64 REGION_PROTOCOLS_AGENT_APPEARANCE_SERVICE = (1ULL << 0);
// estate constants. Need to match first few etries in indra.estate table.
-const U32 ESTATE_ALL = 0; // will not match in db, reserved key for logic
-const U32 ESTATE_MAINLAND = 1;
-const U32 ESTATE_ORIENTATION = 2;
-const U32 ESTATE_INTERNAL = 3;
-const U32 ESTATE_SHOWCASE = 4;
-const U32 ESTATE_TEEN = 5;
-const U32 ESTATE_LAST_LINDEN = 5; // last linden owned/managed estate
+constexpr U32 ESTATE_ALL = 0; // will not match in db, reserved key for logic
+constexpr U32 ESTATE_MAINLAND = 1;
+constexpr U32 ESTATE_ORIENTATION = 2;
+constexpr U32 ESTATE_INTERNAL = 3;
+constexpr U32 ESTATE_SHOWCASE = 4;
+constexpr U32 ESTATE_TEEN = 5;
+constexpr U32 ESTATE_LAST_LINDEN = 5; // last linden owned/managed estate
// for EstateOwnerRequest, setaccess message
-const U32 ESTATE_ACCESS_ALLOWED_AGENTS = 1 << 0;
-const U32 ESTATE_ACCESS_ALLOWED_GROUPS = 1 << 1;
-const U32 ESTATE_ACCESS_BANNED_AGENTS = 1 << 2;
-const U32 ESTATE_ACCESS_MANAGERS = 1 << 3;
+constexpr U32 ESTATE_ACCESS_ALLOWED_AGENTS = 1 << 0;
+constexpr U32 ESTATE_ACCESS_ALLOWED_GROUPS = 1 << 1;
+constexpr U32 ESTATE_ACCESS_BANNED_AGENTS = 1 << 2;
+constexpr U32 ESTATE_ACCESS_MANAGERS = 1 << 3;
//maximum number of access list entries we can fit in one packet
-const S32 ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET = 63;
+constexpr S32 ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET = 63;
// for reply to "getinfo", don't need to forward to all sims in estate
-const U32 ESTATE_ACCESS_SEND_TO_AGENT_ONLY = 1 << 4;
+constexpr U32 ESTATE_ACCESS_SEND_TO_AGENT_ONLY = 1 << 4;
-const U32 ESTATE_ACCESS_ALL = ESTATE_ACCESS_ALLOWED_AGENTS
- | ESTATE_ACCESS_ALLOWED_GROUPS
- | ESTATE_ACCESS_BANNED_AGENTS
- | ESTATE_ACCESS_MANAGERS;
+constexpr U32 ESTATE_ACCESS_ALL = ESTATE_ACCESS_ALLOWED_AGENTS
+ | ESTATE_ACCESS_ALLOWED_GROUPS
+ | ESTATE_ACCESS_BANNED_AGENTS
+ | ESTATE_ACCESS_MANAGERS;
// for EstateOwnerRequest, estateaccessdelta, estateexperiencedelta messages
-const U32 ESTATE_ACCESS_APPLY_TO_ALL_ESTATES = 1U << 0;
-const U32 ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES = 1U << 1;
+constexpr U32 ESTATE_ACCESS_APPLY_TO_ALL_ESTATES = 1U << 0;
+constexpr U32 ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES = 1U << 1;
-const U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1U << 2;
-const U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1U << 3;
-const U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1U << 4;
-const U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1U << 5;
-const U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1U << 6;
-const U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1U << 7;
-const U32 ESTATE_ACCESS_MANAGER_ADD = 1U << 8;
-const U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9;
-const U32 ESTATE_ACCESS_NO_REPLY = 1U << 10;
-const U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11;
+constexpr U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1U << 2;
+constexpr U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1U << 3;
+constexpr U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1U << 4;
+constexpr U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1U << 5;
+constexpr U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1U << 6;
+constexpr U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1U << 7;
+constexpr U32 ESTATE_ACCESS_MANAGER_ADD = 1U << 8;
+constexpr U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9;
+constexpr U32 ESTATE_ACCESS_NO_REPLY = 1U << 10;
+constexpr U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11;
-const S32 ESTATE_MAX_MANAGERS = 20;
-const S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access
-const S32 ESTATE_MAX_BANNED_IDS = 750; // max for banned
-const S32 ESTATE_MAX_GROUP_IDS = (S32) ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET;
+constexpr S32 ESTATE_MAX_MANAGERS = 20;
+constexpr S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access
+constexpr S32 ESTATE_MAX_BANNED_IDS = 750; // max for banned
+constexpr S32 ESTATE_MAX_GROUP_IDS = (S32) ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET;
// 'Sim Wide Delete' flags
-const U32 SWD_OTHERS_LAND_ONLY = (1 << 0);
-const U32 SWD_ALWAYS_RETURN_OBJECTS = (1 << 1);
-const U32 SWD_SCRIPTED_ONLY = (1 << 2);
+constexpr U32 SWD_OTHERS_LAND_ONLY = (1 << 0);
+constexpr U32 SWD_ALWAYS_RETURN_OBJECTS = (1 << 1);
+constexpr U32 SWD_SCRIPTED_ONLY = (1 << 2);
// Controls experience key validity in the estate
-const U32 EXPERIENCE_KEY_TYPE_NONE = 0;
-const U32 EXPERIENCE_KEY_TYPE_BLOCKED = 1;
-const U32 EXPERIENCE_KEY_TYPE_ALLOWED = 2;
-const U32 EXPERIENCE_KEY_TYPE_TRUSTED = 3;
+constexpr U32 EXPERIENCE_KEY_TYPE_NONE = 0;
+constexpr U32 EXPERIENCE_KEY_TYPE_BLOCKED = 1;
+constexpr U32 EXPERIENCE_KEY_TYPE_ALLOWED = 2;
+constexpr U32 EXPERIENCE_KEY_TYPE_TRUSTED = 3;
-const U32 EXPERIENCE_KEY_TYPE_FIRST = EXPERIENCE_KEY_TYPE_BLOCKED;
-const U32 EXPERIENCE_KEY_TYPE_LAST = EXPERIENCE_KEY_TYPE_TRUSTED;
+constexpr U32 EXPERIENCE_KEY_TYPE_FIRST = EXPERIENCE_KEY_TYPE_BLOCKED;
+constexpr U32 EXPERIENCE_KEY_TYPE_LAST = EXPERIENCE_KEY_TYPE_TRUSTED;
//
-const U32 ESTATE_EXPERIENCE_TRUSTED_ADD = 1U << 2;
-const U32 ESTATE_EXPERIENCE_TRUSTED_REMOVE = 1U << 3;
-const U32 ESTATE_EXPERIENCE_ALLOWED_ADD = 1U << 4;
-const U32 ESTATE_EXPERIENCE_ALLOWED_REMOVE = 1U << 5;
-const U32 ESTATE_EXPERIENCE_BLOCKED_ADD = 1U << 6;
-const U32 ESTATE_EXPERIENCE_BLOCKED_REMOVE = 1U << 7;
-
-const S32 ESTATE_MAX_EXPERIENCE_IDS = 8;
-
+constexpr U32 ESTATE_EXPERIENCE_TRUSTED_ADD = 1U << 2;
+constexpr U32 ESTATE_EXPERIENCE_TRUSTED_REMOVE = 1U << 3;
+constexpr U32 ESTATE_EXPERIENCE_ALLOWED_ADD = 1U << 4;
+constexpr U32 ESTATE_EXPERIENCE_ALLOWED_REMOVE = 1U << 5;
+constexpr U32 ESTATE_EXPERIENCE_BLOCKED_ADD = 1U << 6;
+constexpr U32 ESTATE_EXPERIENCE_BLOCKED_REMOVE = 1U << 7;
+constexpr S32 ESTATE_MAX_EXPERIENCE_IDS = 8;
#endif
-
-
diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp
index 8be6158d82..6ade7c0dad 100644
--- a/indra/llmessage/llsdmessagereader.cpp
+++ b/indra/llmessage/llsdmessagereader.cpp
@@ -242,7 +242,7 @@ void LLSDMessageReader::getString(const char *block, const char *var,
return;
}
std::string data = getLLSD(mMessage, block, var, blocknum);
- S32 data_size = data.size();
+ auto data_size = data.size();
if (data_size >= buffer_size)
{
data_size = buffer_size - 1;
@@ -261,7 +261,7 @@ void LLSDMessageReader::getString(const char *block, const char *var,
//virtual
S32 LLSDMessageReader::getNumberOfBlocks(const char *blockname)
{
- return mMessage[blockname].size();
+ return static_cast(mMessage[blockname].size());
}
S32 getElementSize(const LLSD& llsd)
@@ -276,7 +276,7 @@ S32 getElementSize(const LLSD& llsd)
case LLSD::TypeReal:
return sizeof(F64);
case LLSD::TypeString:
- return llsd.size();
+ return static_cast(llsd.size());
case LLSD::TypeUUID:
return sizeof(LLUUID);
case LLSD::TypeDate:
@@ -286,7 +286,7 @@ S32 getElementSize(const LLSD& llsd)
case LLSD::TypeBinary:
{
std::vector data = llsd;
- return data.size() * sizeof(U8);
+ return static_cast(data.size() * sizeof(U8));
}
case LLSD::TypeMap:
case LLSD::TypeArray:
diff --git a/indra/llmessage/lltemplatemessagedispatcher.cpp b/indra/llmessage/lltemplatemessagedispatcher.cpp
index 267c201705..0e709d6c75 100644
--- a/indra/llmessage/lltemplatemessagedispatcher.cpp
+++ b/indra/llmessage/lltemplatemessagedispatcher.cpp
@@ -44,7 +44,7 @@ void LLTemplateMessageDispatcher::dispatch(const std::string& msg_name,
LLHTTPNode::ResponsePtr responsep)
{
std::vector data = message["body"]["binary-template-data"].asBinary();
- U32 size = data.size();
+ auto size = data.size();
if(size == 0)
{
return;
@@ -53,7 +53,7 @@ void LLTemplateMessageDispatcher::dispatch(const std::string& msg_name,
LLHost host;
host = gMessageSystem->getSender();
- bool validate_message = mTemplateMessageReader.validateMessage(&(data[0]), data.size(), host, true);
+ bool validate_message = mTemplateMessageReader.validateMessage(&(data[0]), static_cast(size), host, true);
if (validate_message)
{
diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp
index ad15d5969b..71b910297b 100644
--- a/indra/llmessage/llxfer_file.cpp
+++ b/indra/llmessage/llxfer_file.cpp
@@ -317,7 +317,7 @@ S32 LLXfer_File::flush()
if (mFp)
{
- S32 write_size = fwrite(mBuffer,1,mBufferLength,mFp);
+ S32 write_size = static_cast(fwrite(mBuffer,1,mBufferLength,mFp));
if (write_size != mBufferLength)
{
LL_WARNS("Xfer") << "Non-matching write size, requested " << mBufferLength
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index e705c36ff8..cfa5178fc6 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -2172,7 +2172,7 @@ S32 LLMessageSystem::sendError(
if (LLMessageConfig::getMessageFlavor(ERROR_MESSAGE_NAME) ==
LLMessageConfig::TEMPLATE_FLAVOR)
{
- S32 msg_size = temp.size() + mMessageBuilder->getMessageSize();
+ S32 msg_size = static_cast(temp.size()) + mMessageBuilder->getMessageSize();
if(msg_size >= ETHERNET_MTU_BYTES)
{
pack_data = false;
@@ -2180,7 +2180,7 @@ S32 LLMessageSystem::sendError(
}
if(pack_data)
{
- addBinaryData("Data", (void*)temp.c_str(), temp.size());
+ addBinaryData("Data", (void*)temp.c_str(), static_cast(temp.size()));
}
else
{
diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp
index 2cbc16ceec..085afc0944 100644
--- a/indra/llplugin/llpluginmessagepipe.cpp
+++ b/indra/llplugin/llpluginmessagepipe.cpp
@@ -371,7 +371,7 @@ bool LLPluginMessagePipe::pumpInput(F64 timeout)
void LLPluginMessagePipe::processInput(void)
{
// Look for input delimiter(s) in the input buffer.
- int delim;
+ size_t delim;
mInputMutex.lock();
while((delim = mInput.find(MESSAGE_DELIMITER)) != std::string::npos)
{
diff --git a/indra/llplugin/llpluginsharedmemory.cpp b/indra/llplugin/llpluginsharedmemory.cpp
index a10d251069..28a0f0bf4e 100644
--- a/indra/llplugin/llpluginsharedmemory.cpp
+++ b/indra/llplugin/llpluginsharedmemory.cpp
@@ -450,7 +450,7 @@ bool LLPluginSharedMemory::create(size_t size)
NULL, // default security
PAGE_READWRITE, // read/write access
0, // max. object size
- mSize, // buffer size
+ static_cast(mSize), // buffer size
mName.c_str()); // name of mapping object
if(mImpl->mMapFile == NULL)
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index de5a2fe1fa..9bc6c7092f 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -258,7 +258,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(
// Don't share verts within the same tri, degenerate
//
- U32 indx_size = indices.size();
+ U32 indx_size = static_cast(indices.size());
U32 verts_new_tri = indx_size % 3;
if ((verts_new_tri < 1 || indices[indx_size - 1] != shared_index)
&& (verts_new_tri < 2 || indices[indx_size - 2] != shared_index))
@@ -732,7 +732,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac
{ //for each vertex
if (j > 2)
{
- U32 size = verts.size();
+ auto size = verts.size();
LLVolumeFace::VertexData v0 = verts[size-3];
LLVolumeFace::VertexData v1 = verts[size-1];
@@ -1098,7 +1098,7 @@ bool LLDAELoader::OpenFile(const std::string& filename)
while (model_iter != mModelList.end())
{
LLModel* mdl = *model_iter;
- U32 material_count = mdl->mMaterialList.size();
+ U32 material_count = static_cast(mdl->mMaterialList.size());
LL_INFOS() << "Importing " << mdl->mLabel << " model with " << material_count << " material references" << LL_ENDL;
std::vector::iterator mat_iter = mdl->mMaterialList.begin();
std::vector::iterator end_iter = material_count > LIMIT_MATERIALS_OUTPUT
@@ -1287,11 +1287,11 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
{
//Get the children at this level
daeTArray< daeSmartRef > children = pScene->getChildren();
- S32 childCount = children.getCount();
+ auto childCount = children.getCount();
//Process any children that are joints
//Not all children are joints, some could be ambient lights, cameras, geometry etc..
- for (S32 i = 0; i < childCount; ++i)
+ for (size_t i = 0; i < childCount; ++i)
{
domNode* pNode = daeSafeCast(children[i]);
if (pNode)
@@ -1312,7 +1312,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
if ( pSkeletonRootNode )
{
//Once we have the root node - start acccessing it's joint components
- const int jointCnt = mJointMap.size();
+ const int jointCnt = static_cast(mJointMap.size());
JointMap :: const_iterator jointIt = mJointMap.begin();
//Loop over all the possible joints within the .dae - using the allowed joint list in the ctor.
@@ -1453,9 +1453,9 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
if (t)
{
domListOfFloats& transform = t->getValue();
- S32 count = transform.getCount()/16;
+ auto count = transform.getCount()/16;
- for (S32 k = 0; k < count; ++k)
+ for (size_t k = 0; k < count; ++k)
{
LLMatrix4 mat;
@@ -1531,7 +1531,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
//with the skeleton are not stored in the same order as they are in the exported joint buffer.
//This remaps the skeletal joints to be in the same order as the joints stored in the model.
std::vector :: const_iterator jointIt = model->mSkinInfo.mJointNames.begin();
- const int jointCnt = model->mSkinInfo.mJointNames.size();
+ const int jointCnt = static_cast(model->mSkinInfo.mJointNames.size());
for ( int i=0; imSkinInfo.mAlternateBindMatrix.size();
+ auto bind_count = model->mSkinInfo.mAlternateBindMatrix.size();
if (bind_count > 0 && bind_count != jointCnt)
{
LL_WARNS("Mesh") << "Model " << model->mLabel << " has invalid joint bind matrix list." << LL_ENDL;
@@ -1699,8 +1699,8 @@ void LLDAELoader::buildJointToNodeMappingFromScene( daeElement* pRoot )
if ( pScene )
{
daeTArray< daeSmartRef > children = pScene->getChildren();
- S32 childCount = children.getCount();
- for (S32 i = 0; i < childCount; ++i)
+ auto childCount = children.getCount();
+ for (size_t i = 0; i < childCount; ++i)
{
domNode* pNode = daeSafeCast(children[i]);
processJointToNodeMapping( pNode );
@@ -1745,8 +1745,8 @@ void LLDAELoader::processJointToNodeMapping( domNode* pNode )
void LLDAELoader::processChildJoints( domNode* pParentNode )
{
daeTArray< daeSmartRef > childOfChild = pParentNode->getChildren();
- S32 childOfChildCount = childOfChild.getCount();
- for (S32 i = 0; i < childOfChildCount; ++i)
+ auto childOfChildCount = childOfChild.getCount();
+ for (size_t i = 0; i < childOfChildCount; ++i)
{
domNode* pChildNode = daeSafeCast( childOfChild[i] );
if ( pChildNode )
@@ -1847,7 +1847,7 @@ bool LLDAELoader::verifyController( domController* pController )
{
sum += pVertexWeights->getVcount()->getValue()[i];
}
- result = verifyCount( sum * inputs.getCount(), (domInt) pVertexWeights->getV()->getValue().getCount() );
+ result = verifyCount( sum * static_cast(inputs.getCount()), (domInt) static_cast(pVertexWeights->getV()->getValue().getCount()) );
}
}
@@ -1980,9 +1980,9 @@ void LLDAELoader::processJointNode( domNode* pNode, JointTransformMap& jointTran
//Gather and handle the incoming nodes children
daeTArray< daeSmartRef > childOfChild = pNode->getChildren();
- S32 childOfChildCount = childOfChild.getCount();
+ auto childOfChildCount = childOfChild.getCount();
- for (S32 i = 0; i < childOfChildCount; ++i)
+ for (size_t i = 0; i < childOfChildCount; ++i)
{
domNode* pChildNode = daeSafeCast( childOfChild[i] );
if ( pChildNode )
@@ -2192,8 +2192,8 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
//process children
daeTArray< daeSmartRef > children = element->getChildren();
- int childCount = children.getCount();
- for (S32 i = 0; i < childCount; i++)
+ auto childCount = children.getCount();
+ for (size_t i = 0; i < childCount; i++)
{
processElement(children[i],badElement, dae);
}
@@ -2568,7 +2568,7 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector& mo
ret->remapVolumeFaces();
}
- volume_faces = remainder.size();
+ volume_faces = static_cast(remainder.size());
models_out.push_back(ret);
diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp
index 810b648f17..776f81cc01 100644
--- a/indra/llprimitive/llgltfloader.cpp
+++ b/indra/llprimitive/llgltfloader.cpp
@@ -231,7 +231,7 @@ bool LLGLTFLoader::parseMaterials()
image.numChannels = in_image.component;
image.bytesPerChannel = in_image.bits >> 3; // Convert bits to bytes
image.pixelType = in_image.pixel_type; // Maps exactly, i.e. TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE == GL_UNSIGNED_BYTE, etc
- image.size = in_image.image.size();
+ image.size = static_cast(in_image.image.size());
image.height = in_image.height;
image.width = in_image.width;
image.data = in_image.image.data();
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index 12af568b7e..dd4ab82abc 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -180,7 +180,7 @@ bool LLGLTFMaterial::fromJSON(const std::string& json, std::string& warn_msg, st
tinygltf::Model model_in;
- if (gltf.LoadASCIIFromString(&model_in, &error_msg, &warn_msg, json.c_str(), json.length(), ""))
+ if (gltf.LoadASCIIFromString(&model_in, &error_msg, &warn_msg, json.c_str(), static_cast(json.length()), ""))
{
setFromModel(model_in, 0);
diff --git a/indra/llprimitive/llgltfmaterial_templates.h b/indra/llprimitive/llgltfmaterial_templates.h
index 276cc71b19..4ec7f312af 100644
--- a/indra/llprimitive/llgltfmaterial_templates.h
+++ b/indra/llprimitive/llgltfmaterial_templates.h
@@ -87,12 +87,12 @@ void LLGLTFMaterial::setFromTexture(const tinygltf::Model& model, const T& textu
template
void LLGLTFMaterial::allocateTextureImage(tinygltf::Model& model, T& texture_info, const std::string& uri)
{
- const S32 image_idx = model.images.size();
+ const S32 image_idx = static_cast(model.images.size());
model.images.emplace_back();
model.images[image_idx].uri = uri;
// The texture, not to be confused with the texture info
- const S32 texture_idx = model.textures.size();
+ const S32 texture_idx = static_cast(model.textures.size());
model.textures.emplace_back();
tinygltf::Texture& texture = model.textures[texture_idx];
texture.source = image_idx;
diff --git a/indra/llprimitive/llmediaentry.cpp b/indra/llprimitive/llmediaentry.cpp
index e626a989f6..b5b17c53aa 100644
--- a/indra/llprimitive/llmediaentry.cpp
+++ b/indra/llprimitive/llmediaentry.cpp
@@ -353,7 +353,7 @@ U32 LLMediaEntry::setWhiteList( const std::vector &whitelist )
{
// *NOTE: This code is VERY similar to the setWhitelist below.
// IF YOU CHANGE THIS IMPLEMENTATION, BE SURE TO CHANGE THE OTHER!
- U32 size = 0;
+ size_t size = 0;
U32 count = 0;
// First count to make sure the size constraint is not violated
std::vector::const_iterator iter = whitelist.begin();
@@ -394,7 +394,7 @@ U32 LLMediaEntry::setWhiteList( const LLSD &whitelist )
{
// *NOTE: This code is VERY similar to the setWhitelist above.
// IF YOU CHANGE THIS IMPLEMENTATION, BE SURE TO CHANGE THE OTHER!
- U32 size = 0;
+ size_t size = 0;
U32 count = 0;
// First check to make sure the size and count constraints are not violated
LLSD::array_const_iterator iter = whitelist.beginArray();
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 37917c0c04..6a322bb9ec 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -918,7 +918,7 @@ LLSD LLModel::writeModel(
//copy ostr to binary buffer
std::string data = ostr.str();
const U8* buff = (U8*)data.data();
- U32 bytes = data.size();
+ U32 bytes = static_cast(data.size());
LLSD::Binary w(bytes);
for (U32 j = 0; j < bytes; ++j)
@@ -965,7 +965,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{ //write out skin block
skin = zip_llsd(mdl["skin"]);
- U32 size = skin.size();
+ U32 size = static_cast(skin.size());
if (size > 0)
{
header["skin"]["offset"] = (LLSD::Integer) cur_offset;
@@ -980,7 +980,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{ //write out convex decomposition
decomposition = zip_llsd(mdl["physics_convex"]);
- U32 size = decomposition.size();
+ U32 size = static_cast(decomposition.size());
if (size > 0)
{
header["physics_convex"]["offset"] = (LLSD::Integer) cur_offset;
@@ -1002,7 +1002,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{
out[i] = zip_llsd(mdl[model_names[i]]);
- U32 size = out[i].size();
+ U32 size = static_cast(out[i].size());
header[model_names[i]]["offset"] = (LLSD::Integer) cur_offset;
header[model_names[i]]["size"] = (LLSD::Integer) size;
@@ -1159,7 +1159,7 @@ void LLModel::updateHullCenters()
mCenterOfHullCenters += cur_center;
cur_center *= 1.f/mPhysics.mHull[i].size();
mHullCenter[i] = cur_center;
- mHullPoints += mPhysics.mHull[i].size();
+ mHullPoints += static_cast(mPhysics.mHull[i].size());
}
if (mHullPoints > 0)
@@ -1280,14 +1280,14 @@ bool LLModel::loadModel(std::istream& is)
bool LLModel::isMaterialListSubset( LLModel* ref )
{
- int refCnt = ref->mMaterialList.size();
- int modelCnt = mMaterialList.size();
+ auto refCnt = ref->mMaterialList.size();
+ auto modelCnt = mMaterialList.size();
- for (U32 src = 0; src < modelCnt; ++src)
+ for (size_t src = 0; src < modelCnt; ++src)
{
bool foundRef = false;
- for (U32 dst = 0; dst < refCnt; ++dst)
+ for (size_t dst = 0; dst < refCnt; ++dst)
{
//LL_INFOS()<mMaterialList[dst]<mMaterialList[dst];
@@ -1630,15 +1630,15 @@ U32 LLMeshSkinInfo::sizeBytes() const
{
U32 res = sizeof(LLUUID); // mMeshID
- res += sizeof(std::vector) + sizeof(std::string) * mJointNames.size();
+ res += sizeof(std::vector) + sizeof(std::string) * static_cast(mJointNames.size());
for (U32 i = 0; i < mJointNames.size(); ++i)
{
- res += mJointNames[i].size(); // actual size, not capacity
+ res += static_cast(mJointNames[i].size()); // actual size, not capacity
}
- res += sizeof(std::vector) + sizeof(S32) * mJointNums.size();
- res += sizeof(std::vector) + 16 * sizeof(float) * mInvBindMatrix.size();
- res += sizeof(std::vector) + 16 * sizeof(float) * mAlternateBindMatrix.size();
+ res += sizeof(std::vector) + sizeof(S32) * static_cast(mJointNums.size());
+ res += sizeof(std::vector) + 16 * sizeof(float) * static_cast(mInvBindMatrix.size());
+ res += sizeof(std::vector) + 16 * sizeof(float) * static_cast(mAlternateBindMatrix.size());
res += 16 * sizeof(float); //mBindShapeMatrix
res += sizeof(float) + 3 * sizeof(bool);
@@ -1755,15 +1755,15 @@ U32 LLModel::Decomposition::sizeBytes() const
{
U32 res = sizeof(LLUUID); // mMeshID
- res += sizeof(LLModel::convex_hull_decomposition) + sizeof(std::vector) * mHull.size();
+ res += sizeof(LLModel::convex_hull_decomposition) + sizeof(std::vector) * static_cast(mHull.size());
for (U32 i = 0; i < mHull.size(); ++i)
{
- res += mHull[i].size() * sizeof(LLVector3);
+ res += static_cast(mHull[i].size()) * sizeof(LLVector3);
}
- res += sizeof(LLModel::hull) + sizeof(LLVector3) * mBaseHull.size();
+ res += sizeof(LLModel::hull) + sizeof(LLVector3) * static_cast(mBaseHull.size());
- res += sizeof(std::vector) + sizeof(std::vector) * mMesh.size();
+ res += sizeof(std::vector) + sizeof(std::vector) * static_cast(mMesh.size());
for (U32 i = 0; i < mMesh.size(); ++i)
{
res += mMesh[i].sizeBytes();
@@ -1814,7 +1814,7 @@ LLSD LLModel::Decomposition::asLLSD() const
for (U32 i = 0; i < mHull.size(); ++i)
{
- U32 size = mHull[i].size();
+ U32 size = static_cast(mHull[i].size());
total += size;
hulls[i] = (U8) (size);
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index ae195525ef..b0cba2d655 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -122,8 +122,8 @@ public:
U32 sizeBytes() const
{
U32 res = sizeof(std::vector) * 2;
- res += sizeof(LLVector3) * mPositions.size();
- res += sizeof(LLVector3) * mNormals.size();
+ res += sizeof(LLVector3) * static_cast(mPositions.size());
+ res += sizeof(LLVector3) * static_cast(mNormals.size());
return res;
}
};
@@ -357,7 +357,7 @@ public:
protected:
LLUUID mDiffuseMapID;
- void* mOpaqueData; // allow refs to viewer/platform-specific structs for each material
+ void* mOpaqueData{ nullptr }; // allow refs to viewer/platform-specific structs for each material
// currently only stores an LLPointer< LLViewerFetchedTexture > > to
// maintain refs to textures associated with each material for free
// ref counting.
diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp
index ce4df843ea..68f3f5ffac 100644
--- a/indra/llprimitive/llprimtexturelist.cpp
+++ b/indra/llprimitive/llprimtexturelist.cpp
@@ -83,13 +83,13 @@ void LLPrimTextureList::clear()
void LLPrimTextureList::copy(const LLPrimTextureList& other_list)
{
// compare the sizes
- S32 this_size = mEntryList.size();
- S32 other_size = other_list.mEntryList.size();
+ auto this_size = mEntryList.size();
+ auto other_size = other_list.mEntryList.size();
if (this_size > other_size)
{
// remove the extra entries
- for (S32 index = this_size; index > other_size; --index)
+ for (size_t index = this_size; index > other_size; --index)
{
delete mEntryList[index-1];
}
@@ -97,18 +97,18 @@ void LLPrimTextureList::copy(const LLPrimTextureList& other_list)
this_size = other_size;
}
- S32 index = 0;
+ size_t index = 0;
// copy for the entries that already exist
for ( ; index < this_size; ++index)
{
delete mEntryList[index];
- mEntryList[index] = other_list.getTexture(index)->newCopy();
+ mEntryList[index] = other_list.getTexture(static_cast(index))->newCopy();
}
// add new entires if needed
for ( ; index < other_size; ++index)
{
- mEntryList.push_back( other_list.getTexture(index)->newCopy() );
+ mEntryList.push_back( other_list.getTexture(static_cast(index))->newCopy());
}
}
@@ -127,9 +127,9 @@ void LLPrimTextureList::take(LLPrimTextureList& other_list)
// returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE
S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te)
{
- if (S32(index) >= mEntryList.size())
+ if (size_t(index) >= mEntryList.size())
{
- S32 current_size = mEntryList.size();
+ auto current_size = mEntryList.size();
LL_WARNS() << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << LL_ENDL;
return TEM_CHANGE_NONE;
}
@@ -389,7 +389,7 @@ LLMaterialPtr LLPrimTextureList::getMaterialParams(const U8 index)
S32 LLPrimTextureList::size() const
{
- return mEntryList.size();
+ return static_cast(mEntryList.size());
}
// sets the size of the mEntryList container
@@ -400,12 +400,12 @@ void LLPrimTextureList::setSize(S32 new_size)
new_size = 0;
}
- S32 current_size = mEntryList.size();
+ auto current_size = mEntryList.size();
if (new_size > current_size)
{
mEntryList.resize(new_size);
- for (S32 index = current_size; index < new_size; ++index)
+ for (size_t index = current_size; index < new_size; ++index)
{
if (current_size > 0
&& mEntryList[current_size - 1])
@@ -423,7 +423,7 @@ void LLPrimTextureList::setSize(S32 new_size)
}
else if (new_size < current_size)
{
- for (S32 index = current_size-1; index >= new_size; --index)
+ for (size_t index = current_size-1; index >= new_size; --index)
{
delete mEntryList[index];
}
diff --git a/indra/llprimitive/tests/llprimitive_test.cpp b/indra/llprimitive/tests/llprimitive_test.cpp
index 60960067d0..0213a3e8b6 100644
--- a/indra/llprimitive/tests/llprimitive_test.cpp
+++ b/indra/llprimitive/tests/llprimitive_test.cpp
@@ -109,7 +109,7 @@ void LLPrimTextureList::take(LLPrimTextureList &other_list) { }
void LLPrimTextureList::setSize(S32 new_size) { mEntryList.resize(new_size); }
void LLPrimTextureList::setAllIDs(const LLUUID &id) { }
LLTextureEntry * LLPrimTextureList::getTexture(const U8 index) const { return nullptr; }
-S32 LLPrimTextureList::size() const { return mEntryList.size(); }
+S32 LLPrimTextureList::size() const { return static_cast(mEntryList.size()); }
class PRIMITIVE_TEST_SETUP
{
diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp
index d2c40ad590..46c2e89797 100644
--- a/indra/llrender/llfontbitmapcache.cpp
+++ b/indra/llrender/llfontbitmapcache.cpp
@@ -108,7 +108,7 @@ bool LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp
S32 num_components = getNumComponents(bitmap_type);
mImageRawVec[bitmap_idx].push_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components));
- bitmap_num = mImageRawVec[bitmap_idx].size() - 1;
+ bitmap_num = static_cast(mImageRawVec[bitmap_idx].size()) - 1;
LLImageRaw* image_raw = getImageRaw(bitmap_type, bitmap_num);
if (EFontGlyphType::Grayscale == bitmap_type)
diff --git a/indra/llrender/llfontbitmapcache.h b/indra/llrender/llfontbitmapcache.h
index 6b19ba2154..f2dfd87877 100644
--- a/indra/llrender/llfontbitmapcache.h
+++ b/indra/llrender/llfontbitmapcache.h
@@ -60,7 +60,7 @@ public:
LLImageGL* getImageGL(EFontGlyphType bitmapType, U32 bitmapNum) const;
S32 getMaxCharWidth() const { return mMaxCharWidth; }
- U32 getNumBitmaps(EFontGlyphType bitmapType) const { return (bitmapType < EFontGlyphType::Count) ? mImageRawVec[static_cast(bitmapType)].size() : 0; }
+ U32 getNumBitmaps(EFontGlyphType bitmapType) const { return (bitmapType < EFontGlyphType::Count) ? static_cast(mImageRawVec[static_cast(bitmapType)].size()) : 0U; }
S32 getBitmapWidth() const { return mBitmapWidth; }
S32 getBitmapHeight() const { return mBitmapHeight; }
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 94b576885f..741ed993b0 100644
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -328,7 +328,7 @@ S32 LLFontFreetype::ftOpenFace(const std::string& filename, S32 face_n)
pFtStream = new LLFT_Stream();
pFtStream->base = 0;
pFtStream->pos = 0;
- pFtStream->size = file_size;
+ pFtStream->size = static_cast(file_size);
pFtStream->descriptor.pointer = pFileStream;
pFtStream->read = ft_read_cb;
pFtStream->close = ft_close_cb;
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 25706c77eb..7e10a4e159 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -149,7 +149,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
if(!sDisplayFont) //do not display texts
{
- return wstr.length() ;
+ return static_cast(wstr.length());
}
if (wstr.empty())
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 1651835b59..2caeb1c431 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -621,7 +621,7 @@ bool LLGLSLShader::mapAttributes(const std::vector* attrib
}
mAttribute.clear();
- U32 numAttributes = (attributes == NULL) ? 0 : attributes->size();
+ U32 numAttributes = (attributes == NULL) ? 0U : static_cast(attributes->size());
#if LL_RELEASE_WITH_DEBUG_INFO
mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, { -1, NULL });
#else
@@ -843,7 +843,7 @@ bool LLGLSLShader::mapUniforms(const vector* uniforms)
mTexture.clear();
mValue.clear();
//initialize arrays
- U32 numUniforms = (uniforms == NULL) ? 0 : uniforms->size();
+ U32 numUniforms = (uniforms == NULL) ? 0U : static_cast(uniforms->size());
mUniform.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
mTexture.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 95e8f1168a..698da92877 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -68,8 +68,8 @@ public:
template
struct UniformSetting
{
- S32 mUniform;
- T mValue;
+ S32 mUniform{ 0 };
+ T mValue{};
};
typedef UniformSetting IntSetting;
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 8c05a47c39..bd64ba84fb 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -208,7 +208,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
return true;
}
- U32 offset = mTex.size();
+ U32 offset = static_cast(mTex.size());
if( offset >= 4 )
{
@@ -378,11 +378,11 @@ void LLRenderTarget::release()
if (mFBO && (mTex.size() > 1))
{
glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
- S32 z;
+ size_t z;
for (z = mTex.size() - 1; z >= 1; z--)
{
sBytesAllocated -= mResX*mResY*4;
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+z, LLTexUnit::getInternalType(mUsage), 0, 0);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, static_cast(GL_COLOR_ATTACHMENT0+z), LLTexUnit::getInternalType(mUsage), 0, 0);
LLImageGL::deleteTextures(1, &mTex[z]);
}
glBindFramebuffer(GL_FRAMEBUFFER, sCurFBO);
@@ -426,7 +426,7 @@ void LLRenderTarget::bindTarget()
GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2,
GL_COLOR_ATTACHMENT3};
- glDrawBuffers(mTex.size(), drawbuffers);
+ glDrawBuffers(static_cast(mTex.size()), drawbuffers);
if (mTex.empty())
{ //no color buffer to draw to
@@ -485,7 +485,7 @@ U32 LLRenderTarget::getTexture(U32 attachment) const
U32 LLRenderTarget::getNumTextures() const
{
- return mTex.size();
+ return static_cast(mTex.size());
}
void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options)
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 98bfb38f03..6ac2b62777 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1096,7 +1096,7 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader)
program_binary.resize(binary_info.mBinaryLength);
GLenum error = glGetError(); // Clear current error
- glGetProgramBinary(shader->mProgramObject, program_binary.size() * sizeof(U8), nullptr, &binary_info.mBinaryFormat, program_binary.data());
+ glGetProgramBinary(shader->mProgramObject, static_cast(program_binary.size() * sizeof(U8)), nullptr, &binary_info.mBinaryFormat, program_binary.data());
error = glGetError();
if (error == GL_NO_ERROR)
{
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index 26f5e4fbe2..4682044d6e 100644
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -484,7 +484,7 @@ void LLAccordionCtrl::arrangeMultiple()
if (mFitParent)
{
// All expanded tabs will have equal height
- panel_height = calcExpandedTabHeight(i, panel_top);
+ panel_height = calcExpandedTabHeight(static_cast(i), panel_top);
ctrlSetLeftTopAndSize(accordion_tab, panel_left, panel_top, panel_width, panel_height);
// Try to make accordion tab fit accordion view height.
diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 5132d33bbf..64896ccfcb 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -73,7 +73,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
if (LLAssetType::lookupIsAssetIDKnowable(type))
{
LLWString source = utf8str_to_wstring(src.asString());
- res = addToClipboard(source, 0, source.size());
+ res = addToClipboard(source, 0, static_cast(source.size()));
}
if (res)
{
@@ -87,13 +87,13 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
bool LLClipboard::pasteFromClipboard(std::vector& inv_objects) const
{
bool res = false;
- S32 count = mObjects.size();
+ auto count = mObjects.size();
inv_objects.reserve(inv_objects.size() + count);
if (count > 0)
{
res = true;
inv_objects.clear();
- for (S32 i = 0; i < count; i++)
+ for (size_t i = 0; i < count; i++)
{
inv_objects.push_back(mObjects[i]);
}
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 0d82f29dfb..79dce1c714 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -995,7 +995,7 @@ void LLComboBox::updateSelection()
LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());
LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size());
mTextEntry->setText(wstring_to_utf8str(wtext));
- mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size());
+ mTextEntry->setSelection(static_cast(left_wstring.size()), static_cast(mTextEntry->getWText().size()));
mTextEntry->endSelection();
mTextEntry->setTentative(false);
mHasAutocompletedText = true;
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 270ec86e01..03717da80b 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -107,7 +107,7 @@ LLCommandManager::~LLCommandManager()
U32 LLCommandManager::commandCount() const
{
- return mCommands.size();
+ return static_cast(mCommands.size());
}
LLCommand * LLCommandManager::getCommand(U32 commandIndex)
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index 3b2586a5a1..e6df0d3a4b 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -198,7 +198,7 @@ protected:
void addCommand(LLCommand * command);
private:
- typedef std::map CommandIndexMap;
+ typedef std::map CommandIndexMap;
typedef std::vector CommandVector;
CommandVector mCommands;
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index be100a6fd2..54bb8cbb94 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -147,11 +147,11 @@ void LLConsole::draw()
return;
}
- U32 num_lines=0;
+ size_t num_lines{ 0 };
paragraph_t::reverse_iterator paragraph_it;
paragraph_it = mParagraphs.rbegin();
- U32 paragraph_num=mParagraphs.size();
+ auto paragraph_num=mParagraphs.size();
while (!mParagraphs.empty() && paragraph_it != mParagraphs.rend())
{
@@ -159,7 +159,7 @@ void LLConsole::draw()
if(num_lines > mMaxLines
|| ( (mLinePersistTime > (F32)0.f) && ((*paragraph_it).mAddTime - skip_time)/(mLinePersistTime - mFadeTime) <= (F32)0.f))
{ //All lines above here are done. Lose them.
- for (U32 i=0;i(color_str.length());
mParagraphColorSegments.push_back(color_segment);
}
@@ -310,7 +310,7 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b
skip_chars = 0;
}
- U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
+ U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, static_cast(line_end) - paragraph_offset, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
if (drawable != 0)
{
diff --git a/indra/llui/llemojidictionary.cpp b/indra/llui/llemojidictionary.cpp
index f16c38a11a..925608e47e 100644
--- a/indra/llui/llemojidictionary.cpp
+++ b/indra/llui/llemojidictionary.cpp
@@ -210,7 +210,7 @@ void LLEmojiDictionary::findByShortCode(
std::size_t begin, end;
if (searchInShortCode(begin, end, shortCode, needle))
{
- results[begin].emplace_back(d.Character, shortCode, begin, end);
+ results[static_cast(begin)].emplace_back(d.Character, shortCode, begin, end);
}
}
}
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index b1a95715f1..1799968afb 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -390,7 +390,7 @@ U32 LLFlatListView::size(const bool only_visible_items) const
}
else
{
- return mItemPairs.size();
+ return static_cast(mItemPairs.size());
}
}
@@ -563,7 +563,7 @@ void LLFlatListView::rearrangeItems()
}
// add paddings between items, excluding invisible ones
- height += mItemPad * (mItemPairs.size() - invisible_children_count - 1);
+ height += mItemPad * (static_cast(mItemPairs.size()) - invisible_children_count - 1);
LLRect rc = mItemsPanel->getRect();
S32 width = mItemsNoScrollWidth;
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index b64a9862a2..6d75e9f282 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -264,7 +264,7 @@ public:
void setCommitOnSelectionChange(bool b) { mCommitOnSelectionChange = b; }
/** Get number of selected items in the list */
- U32 numSelected() const {return mSelectedItemPairs.size(); }
+ U32 numSelected() const {return static_cast(mSelectedItemPairs.size()); }
/** Get number of (visible) items in the list */
U32 size(const bool only_visible_items = true) const;
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 47821e38ca..1d4ecbe9c9 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -758,7 +758,7 @@ void LLFolderView::removeSelectedItems()
// items, since the removal will futz with internal data
// structures.
std::vector items;
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
if(count <= 0) return;
LLFolderViewItem* item = NULL;
selected_items_t::iterator item_it;
@@ -803,7 +803,7 @@ void LLFolderView::removeSelectedItems()
setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus());
listeners.reserve(count);
- for(S32 i = 0; i < count; ++i)
+ for(size_t i = 0; i < count; ++i)
{
listener = items[i]->getViewModelItem();
if(listener && (std::find(listeners.begin(), listeners.end(), listener) == listeners.end()))
@@ -922,7 +922,7 @@ void LLFolderView::copy()
{
// *NOTE: total hack to clear the inventory clipboard
LLClipboard::instance().reset();
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
if(getVisible() && getEnabled() && (count > 0))
{
LLFolderViewModelItem* listener = NULL;
@@ -1059,7 +1059,7 @@ void LLFolderView::startRenamingSelectedItem( void )
// make sure selection is visible
scrollToShowSelection();
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
LLFolderViewItem* item = NULL;
if(count > 0)
{
@@ -1414,7 +1414,7 @@ bool LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
std::string current_item_label(search_item->getViewModelItem()->getSearchableName());
LLStringUtil::toUpper(current_item_label);
- S32 search_string_length = llmin(upper_case_string.size(), current_item_label.size());
+ auto search_string_length = llmin(upper_case_string.size(), current_item_label.size());
if (!current_item_label.compare(0, search_string_length, upper_case_string))
{
found = true;
@@ -1454,7 +1454,7 @@ bool LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
mParentPanel.get()->setFocus(true);
bool handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
LLMenuGL* menu = static_cast(mPopupMenuHandle.get());
if (!menu)
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index a0c7407b06..82cd2483e8 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -940,22 +940,22 @@ void LLFolderViewItem::draw()
return;
}
- std::string::size_type filter_string_length = mViewModelItem->hasFilterStringMatch() ? mViewModelItem->getFilterStringSize() : 0;
+ auto filter_string_length = mViewModelItem->hasFilterStringMatch() ? static_cast(mViewModelItem->getFilterStringSize()) : 0;
F32 right_x = 0;
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD;
F32 text_left = (F32)getLabelXPos();
std::string combined_string = mLabel + mLabelSuffix;
const LLFontGL* suffix_font = getLabelFontForStyle(LLFontGL::NORMAL);
- S32 filter_offset = mViewModelItem->getFilterStringOffset();
+ S32 filter_offset = static_cast(mViewModelItem->getFilterStringOffset());
if (filter_string_length > 0)
{
S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD);
S32 top = getRect().getHeight() - TOP_PAD;
if(mLabelSuffix.empty() || (font == suffix_font))
{
- S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2;
- S32 right = left + font->getWidth(combined_string, mViewModelItem->getFilterStringOffset(), filter_string_length) + 2;
+ S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, static_cast(mViewModelItem->getFilterStringOffset())) - 2;
+ S32 right = left + font->getWidth(combined_string, static_cast(mViewModelItem->getFilterStringOffset()), filter_string_length) + 2;
LLUIImage* box_image = default_params.selection_image;
LLRect box_rect(left, top, right, bottom);
@@ -976,7 +976,7 @@ void LLFolderViewItem::draw()
if(suffix_filter_length > 0)
{
S32 suffix_offset = llmax(0, filter_offset - (S32)mLabel.size());
- S32 left = ll_round(text_left) + font->getWidthF32(mLabel, 0, mLabel.size()) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset) - 2;
+ S32 left = ll_round(text_left) + font->getWidthF32(mLabel, 0, static_cast(mLabel.size())) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset) - 2;
S32 right = left + suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length) + 2;
LLUIImage* box_image = default_params.selection_image;
LLRect box_rect(left, top, right, bottom);
@@ -1033,7 +1033,7 @@ void LLFolderViewItem::draw()
if(suffix_filter_length > 0)
{
S32 suffix_offset = llmax(0, filter_offset - (S32)mLabel.size());
- F32 match_string_left = text_left + font->getWidthF32(mLabel, 0, mLabel.size()) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset + suffix_filter_length) - suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length);
+ F32 match_string_left = text_left + font->getWidthF32(mLabel, 0, static_cast(mLabel.size())) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset + suffix_filter_length) - suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length);
F32 yy = (F32)getRect().getHeight() - suffix_font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD;
suffix_font->renderUTF8(mLabelSuffix, suffix_offset, match_string_left, yy, sFilterTextColor,
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index ce644b094c..df446a5d70 100644
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -39,7 +39,7 @@ inline bool LLKeywordToken::isHead(const llwchar* s) const
// strncmp is much faster than string compare
bool res = true;
const llwchar* t = mToken.c_str();
- S32 len = mToken.size();
+ auto len = mToken.size();
for (S32 i=0; i* seg_list, const LLW
return;
}
- S32 text_len = wtext.size() + 1;
+ S32 text_len = static_cast(wtext.size()) + 1;
seg_list->push_back( new LLNormalTextSegment( style, 0, text_len, editor ) );
@@ -707,16 +707,16 @@ void LLKeywords::insertSegments(const LLWString& wtext, std::vector(pos), editor);
text_segment->setToken( cur_token );
insertSegment( seg_list, text_segment, text_len, style, editor);
}
- LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(style, pos);
+ LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(style, static_cast(pos));
text_segment->setToken( cur_token );
insertSegment( seg_list, text_segment, text_len, style, editor);
- seg_start = pos+1;
+ seg_start = static_cast(pos) + 1;
pos = wtext.find('\n',seg_start);
}
diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h
index 9dcdea121b..f498b3ddee 100644
--- a/indra/llui/llkeywords.h
+++ b/indra/llui/llkeywords.h
@@ -82,8 +82,8 @@ public:
{
}
- S32 getLengthHead() const { return mToken.size(); }
- S32 getLengthTail() const { return mDelimiter.size(); }
+ S32 getLengthHead() const { return static_cast(mToken.size()); }
+ S32 getLengthTail() const { return static_cast(mDelimiter.size()); }
bool isHead(const llwchar* s) const;
bool isTail(const llwchar* s) const;
const LLWString& getToken() const { return mToken; }
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index d362d4362c..9e5f8048ba 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -86,7 +86,7 @@ public:
void addPanel(LLLayoutPanel* panel, EAnimate animate = NO_ANIMATE);
void collapsePanel(LLPanel* panel, bool collapsed = true);
- S32 getNumPanels() { return mPanels.size(); }
+ S32 getNumPanels() { return static_cast(mPanels.size()); }
void updateLayout();
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 5ec4c34f57..50bf3f5877 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -590,7 +590,7 @@ const std::string& LLLineEditor::getSuggestion(U32 index) const
U32 LLLineEditor::getSuggestionCount() const
{
- return mSuggestionList.size();
+ return static_cast(mSuggestionList.size());
}
void LLLineEditor::replaceWithSuggestion(U32 index)
@@ -994,7 +994,7 @@ void LLLineEditor::addChar(const llwchar uni_char)
mText.erase(getCursor(), 1);
}
- S32 cur_bytes = mText.getString().size();
+ S32 cur_bytes = static_cast(mText.getString().size());
S32 new_bytes = wchar_utf8_length(new_c);
@@ -1007,7 +1007,7 @@ void LLLineEditor::addChar(const llwchar uni_char)
}
else if (mMaxLengthChars)
{
- S32 wide_chars = mText.getWString().size();
+ auto wide_chars = mText.getWString().size();
if ((wide_chars + 1) > mMaxLengthChars)
{
allow_char = false;
@@ -1332,7 +1332,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
if (mMaxLengthChars)
{
- U32 available_chars = mMaxLengthChars - mText.getWString().size();
+ auto available_chars = mMaxLengthChars - mText.getWString().size();
if (available_chars < clean_string.size())
{
@@ -2300,10 +2300,10 @@ bool LLLineEditor::postvalidateFloat(const std::string &str)
LLWString trimmed = utf8str_to_wstring(str);
LLWStringUtil::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if( 0 < len )
{
- S32 i = 0;
+ size_t i = 0;
// First character can be a negative sign
if( '-' == trimmed[0] )
@@ -2360,7 +2360,7 @@ bool LLLineEditor::evaluateFloat()
if (!success)
{
// Move the cursor to near the error on failure
- setCursor(LLCalc::getInstance()->getLastErrorPos());
+ setCursor(static_cast(LLCalc::getInstance()->getLastErrorPos()));
// *TODO: Translated error message indicating the type of error? Select error text?
}
else
@@ -2501,7 +2501,7 @@ void LLLineEditor::updatePreedit(const LLWString &preedit_string,
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode())
{
mPreeditOverwrittenWString.assign( LLWString( mText, insert_preedit_at, mPreeditWString.length() ) );
- mText.erase(insert_preedit_at, mPreeditWString.length());
+ mText.erase(insert_preedit_at, static_cast(mPreeditWString.length()));
}
else
{
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 279f5628e1..dffaf69a9f 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -187,7 +187,7 @@ LLMenuItemGL::LLMenuItemGL(const LLMenuItemGL::Params& p)
{
mAcceleratorMask |= MASK_SHIFT;
}
- S32 pipe_pos = shortcut.rfind("|");
+ auto pipe_pos = shortcut.rfind("|");
std::string key_str = shortcut.substr(pipe_pos+1);
LLKeyboard::keyFromString(key_str, &mAcceleratorKey);
@@ -545,8 +545,8 @@ void LLMenuItemGL::draw( void )
std::string::size_type offset = upper_case_label.find(mJumpKey);
if (offset != std::string::npos)
{
- S32 x_begin = LEFT_PLAIN_PIXELS + mFont->getWidth(mLabel, 0, offset);
- S32 x_end = LEFT_PLAIN_PIXELS + mFont->getWidth(mLabel, 0, offset + 1);
+ S32 x_begin = LEFT_PLAIN_PIXELS + mFont->getWidth(mLabel, 0, static_cast(offset));
+ S32 x_end = LEFT_PLAIN_PIXELS + mFont->getWidth(mLabel, 0, static_cast(offset) + 1);
gl_line_2d(x_begin, (MENU_ITEM_PADDING / 2) + 1, x_end, (MENU_ITEM_PADDING / 2) + 1);
}
}
@@ -1649,8 +1649,8 @@ void LLMenuItemBranchDownGL::draw( void )
if (offset != std::string::npos)
{
S32 x_offset = ll_round((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f);
- S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, offset);
- S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, offset + 1);
+ S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, static_cast(offset));
+ S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, static_cast(offset) + 1);
gl_line_2d(x_begin, LABEL_BOTTOM_PAD_PIXELS, x_end, LABEL_BOTTOM_PAD_PIXELS);
}
}
@@ -2068,7 +2068,7 @@ bool LLMenuGL::scrollItems(EScrollingDirection direction)
// Otherwise viewer will hang for a time needed to scroll U32_MAX
// times in std::advance(). STORM-659.
size_t nitems = mItems.size();
- U32 scrollable_items = nitems < mMaxScrollableItems ? nitems : mMaxScrollableItems;
+ U32 scrollable_items = nitems < mMaxScrollableItems ? static_cast(nitems) : mMaxScrollableItems;
// Advance by mMaxScrollableItems back from the end of the list
// to make the last item visible.
@@ -2594,7 +2594,7 @@ void LLMenuGL::empty( void )
// erase group of items from menu
void LLMenuGL::erase( S32 begin, S32 end, bool arrange/* = true*/)
{
- S32 items = mItems.size();
+ auto items = mItems.size();
if ( items == 0 || begin >= end || begin < 0 || end > items )
{
@@ -2813,7 +2813,7 @@ void LLMenuGL::setTornOff(bool torn_off)
U32 LLMenuGL::getItemCount()
{
- return mItems.size();
+ return static_cast(mItems.size());
}
LLMenuItemGL* LLMenuGL::getItem(S32 number)
diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h
index 58c253c3f4..177664dde4 100644
--- a/indra/llui/llmodaldialog.h
+++ b/indra/llui/llmodaldialog.h
@@ -66,7 +66,7 @@ public:
static void onAppFocusLost();
static void onAppFocusGained();
- static S32 activeCount() { return sModalStack.size(); }
+ static S32 activeCount() { return static_cast(sModalStack.size()); }
static void shutdownModals();
protected:
diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h
index 630e45dddb..b2bfc8bc84 100644
--- a/indra/llui/llmultislider.h
+++ b/indra/llui/llmultislider.h
@@ -118,7 +118,7 @@ public:
/*virtual*/ void draw() override;
S32 getMaxNumSliders() { return mMaxNumSliders; }
- S32 getCurNumSliders() { return mValue.size(); }
+ S32 getCurNumSliders() { return static_cast(mValue.size()); }
F32 getOverlapThreshold() { return mOverlapThreshold; }
bool canAddSliders() { return mValue.size() < mMaxNumSliders; }
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 74e573bb4e..bee7d5bb3f 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1187,7 +1187,7 @@ bool LLNotificationChannel::isEmpty() const
S32 LLNotificationChannel::size() const
{
- return mItems.size();
+ return static_cast(mItems.size());
}
size_t LLNotificationChannel::size()
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index e7159de94c..d3615b6601 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -249,7 +249,7 @@ public:
void fromLLSD(const LLSD& sd);
LLSD asLLSD() const;
- S32 getNumElements() { return mFormData.size(); }
+ S32 getNumElements() { return static_cast(mFormData.size()); }
LLSD getElement(S32 index) { return mFormData.get(index); }
LLSD getElement(const std::string& element_name);
void getElements(LLSD& elements, S32 offset = 0);
diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h
index 810830ffa4..a24a7c86b2 100644
--- a/indra/llui/llradiogroup.h
+++ b/indra/llui/llradiogroup.h
@@ -87,7 +87,7 @@ public:
LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; };
// LLCtrlSelectionInterface functions
- /*virtual*/ S32 getItemCount() const { return mRadioButtons.size(); }
+ /*virtual*/ S32 getItemCount() const { return static_cast(mRadioButtons.size()); }
/*virtual*/ bool getCanSelect() const { return true; }
/*virtual*/ bool selectFirstItem() { return setSelectedIndex(0); }
/*virtual*/ bool selectNthItem( S32 index ) { return setSelectedIndex(index); }
diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp
index d07aa800d1..21bdf3f8a6 100644
--- a/indra/llui/llresmgr.cpp
+++ b/indra/llui/llresmgr.cpp
@@ -140,7 +140,7 @@ std::string LLResMgr::getMonetaryString( S32 input ) const
S32 output_pos = 0;
cur_group = 0;
- S32 pos = digits.size()-1;
+ auto pos = digits.size()-1;
S32 count_within_group = 0;
while( (pos >= 0) && (groupings[cur_group] >= 0) )
{
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 39e575173d..74a9641836 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -373,7 +373,7 @@ S32 LLScrollListCtrl::isEmpty() const
S32 LLScrollListCtrl::getItemCount() const
{
- return mItemList.size();
+ return static_cast(mItemList.size());
}
bool LLScrollListCtrl::hasSelectedItem() const
@@ -1325,7 +1325,7 @@ bool LLScrollListCtrl::selectItemByPrefix(const LLWString& target, bool case_sen
bool found = false;
LLWString target_trimmed( target );
- S32 target_len = target_trimmed.size();
+ auto target_len = target_trimmed.size();
if( 0 == target_len )
{
@@ -1377,8 +1377,8 @@ bool LLScrollListCtrl::selectItemByPrefix(const LLWString& target, bool case_sen
if (select)
{
// find offset of matching text (might have leading whitespace)
- S32 offset = item_label.find(target_trimmed);
- cellp->highlightText(offset, target_trimmed.size());
+ auto offset = item_label.find(target_trimmed);
+ cellp->highlightText(static_cast(offset), static_cast(target_trimmed.size()));
selectItem(item, -1);
found = true;
break;
@@ -1404,7 +1404,7 @@ U32 LLScrollListCtrl::searchItems(const LLWString& substring, bool case_sensitiv
U32 found = 0;
LLWString substring_trimmed(substring);
- S32 len = substring_trimmed.size();
+ auto len = substring_trimmed.size();
if (0 == len)
{
@@ -1446,7 +1446,7 @@ U32 LLScrollListCtrl::searchItems(const LLWString& substring, bool case_sensitiv
if (found_iter != std::string::npos)
{
// find offset of matching text
- cellp->highlightText(found_iter, substring_trimmed.size());
+ cellp->highlightText(static_cast(found_iter), static_cast(substring_trimmed.size()));
selectItem(item, -1, false);
found++;
@@ -2897,7 +2897,7 @@ void LLScrollListCtrl::copy()
{
buffer += (*itor)->getContentsCSV() + "\n";
}
- LLClipboard::instance().copyToClipboard(utf8str_to_wstring(buffer), 0, buffer.length());
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(buffer), 0, static_cast(buffer.length()));
}
// virtual
@@ -2981,7 +2981,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params
// Add column
mColumns[name] = new LLScrollListColumn(column_params, this);
LLScrollListColumn* new_column = mColumns[name];
- new_column->mIndex = mColumns.size()-1;
+ new_column->mIndex = static_cast(mColumns.size()) - 1;
// Add button
if (new_column->getWidth() > 0 || new_column->mRelWidth > 0 || new_column->mDynamicWidth)
@@ -3177,7 +3177,7 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
if (!item_p.validateBlock() || !new_item) return NULL;
- new_item->setNumColumns(mColumns.size());
+ new_item->setNumColumns(static_cast(mColumns.size()));
// Add any columns we don't already have
S32 col_index = 0;
@@ -3212,7 +3212,7 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS
}
addColumn(new_column);
columnp = mColumns[column];
- new_item->setNumColumns(mColumns.size());
+ new_item->setNumColumns(static_cast(mColumns.size()));
}
S32 index = columnp->mIndex;
@@ -3245,7 +3245,7 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS
new_column.name = "0";
addColumn(new_column);
- new_item->setNumColumns(mColumns.size());
+ new_item->setNumColumns(static_cast(mColumns.size()));
}
LLScrollListCell* cell = LLScrollListCell::create(LLScrollListCell::Params().value(item_p.value));
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index 356d40ce3c..f25ba61fd4 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -178,7 +178,7 @@ public:
virtual bool preProcessChildNode(LLXMLNodePtr child);
virtual LLScrollListColumn* getColumn(S32 index);
virtual LLScrollListColumn* getColumn(const std::string& name);
- virtual S32 getNumColumns() const { return mColumnsIndexed.size(); }
+ virtual S32 getNumColumns() const { return static_cast(mColumnsIndexed.size()); }
// Adds a single element, from an array of:
// "columns" => [ "column" => column name, "value" => value, "type" => type, "font" => font, "font-style" => style ], "id" => uuid
diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp
index 85da55e3e6..0d79d19a37 100644
--- a/indra/llui/llscrolllistitem.cpp
+++ b/indra/llui/llscrolllistitem.cpp
@@ -85,7 +85,7 @@ void LLScrollListItem::addColumn(const LLScrollListCell::Params& p)
void LLScrollListItem::setNumColumns(S32 columns)
{
- S32 prev_columns = mColumns.size();
+ auto prev_columns = mColumns.size();
if (columns < prev_columns)
{
std::for_each(mColumns.begin()+columns, mColumns.end(), DeletePointer());
@@ -93,7 +93,7 @@ void LLScrollListItem::setNumColumns(S32 columns)
mColumns.resize(columns);
- for (S32 col = prev_columns; col < columns; ++col)
+ for (auto col = prev_columns; col < columns; ++col)
{
mColumns[col] = NULL;
}
@@ -115,7 +115,7 @@ void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell )
S32 LLScrollListItem::getNumColumns() const
{
- return mColumns.size();
+ return static_cast(mColumns.size());
}
LLScrollListCell* LLScrollListItem::getColumn(const S32 i) const
diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp
index b8aeb3b91f..1615db5b52 100644
--- a/indra/llui/llspellcheck.cpp
+++ b/indra/llui/llspellcheck.cpp
@@ -94,7 +94,7 @@ S32 LLSpellChecker::getSuggestions(const std::string& word, std::vectorfree_list(&suggestion_list, suggestion_cnt);
}
- return suggestions.size();
+ return static_cast(suggestions.size());
}
const LLSD LLSpellChecker::getDictionaryData(const std::string& dict_language)
diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index f125dda916..adb1d51813 100644
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -455,7 +455,7 @@ void LLStatBar::draw()
if (mDisplayHistory && mStat.valid)
{
- const S32 num_values = frame_recording.getNumRecordedPeriods() - 1;
+ const S32 num_values = static_cast(frame_recording.getNumRecordedPeriods()) - 1;
F32 min_value = 0.f,
max_value = 0.f;
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 752ef47d14..06f584d372 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1298,7 +1298,7 @@ void LLTabContainer::removeTabPanel(LLPanel* child)
if (mCurrentTabIdx >= (S32)mTabList.size())
{
- mCurrentTabIdx = mTabList.size()-1;
+ mCurrentTabIdx = static_cast(mTabList.size()) - 1;
}
selectTab(mCurrentTabIdx);
if (has_focus)
@@ -1377,7 +1377,7 @@ S32 LLTabContainer::getCurrentPanelIndex()
S32 LLTabContainer::getTabCount()
{
- return mTabList.size();
+ return static_cast(mTabList.size());
}
LLPanel* LLTabContainer::getPanelByIndex(S32 index)
@@ -1444,7 +1444,7 @@ void LLTabContainer::selectFirstTab()
void LLTabContainer::selectLastTab()
{
- selectTab( mTabList.size()-1 );
+ selectTab(static_cast(mTabList.size()) - 1);
}
void LLTabContainer::selectNextTab()
@@ -1482,12 +1482,12 @@ void LLTabContainer::selectPrevTab()
}
S32 idx = mCurrentTabIdx-1;
if (idx < 0)
- idx = mTabList.size()-1;
+ idx = static_cast(mTabList.size()) - 1;
while (!selectTab(idx) && idx != mCurrentTabIdx)
{
idx = idx - 1;
if (idx < 0)
- idx = mTabList.size()-1;
+ idx = static_cast(mTabList.size()) - 1;
}
if (tab_has_focus)
{
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 1249461be9..387f2b9810 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -320,12 +320,12 @@ bool LLTextBase::truncate()
if (value.type() == LLSD::TypeString)
{
// save a copy for strings.
- utf8_byte_size = value.size();
+ utf8_byte_size = static_cast(value.size());
}
else
{
// non string LLSDs need explicit conversion to string
- utf8_byte_size = value.asString().size();
+ utf8_byte_size = static_cast(value.asString().size());
}
if ( utf8_byte_size > mMaxTextByteLength )
@@ -335,7 +335,7 @@ bool LLTextBase::truncate()
temp_utf8_text = utf8str_truncate( temp_utf8_text, mMaxTextByteLength );
LLWString text = utf8str_to_wstring( temp_utf8_text );
// remove extra bit of current string, to preserve formatting, etc.
- removeStringNoUndo(text.size(), getWText().size() - text.size());
+ removeStringNoUndo(static_cast(text.size()), static_cast(getWText().size() - text.size()));
did_truncate = true;
}
}
@@ -617,7 +617,7 @@ void LLTextBase::drawText()
}
else if (useLabel())
{
- text_len = mLabel.getWString().length();
+ text_len = static_cast(mLabel.getWString().length());
}
S32 selection_left = -1;
@@ -686,7 +686,7 @@ void LLTextBase::drawText()
// Find the start of the first word
U32 word_start = seg_start, word_end = -1;
- U32 text_length = wstrText.length();
+ U32 text_length = static_cast(wstrText.length());
while ( (word_start < text_length) && (!LLStringOps::isAlpha(wstrText[word_start])) )
{
word_start++;
@@ -845,7 +845,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s
beforeValueChange();
S32 old_len = getLength(); // length() returns character length
- S32 insert_len = wstr.length();
+ S32 insert_len = static_cast(wstr.length());
pos = getEditableIndex(pos, true);
if (pos > old_len)
@@ -916,7 +916,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s
{
LLStyleSP emoji_style;
LLEmojiDictionary* ed = LLEmojiDictionary::instanceExists() ? LLEmojiDictionary::getInstance() : NULL;
- for (S32 text_kitty = 0, text_len = wstr.size(); text_kitty < text_len; text_kitty++)
+ for (S32 text_kitty = 0, text_len = static_cast(wstr.size()); text_kitty < text_len; text_kitty++)
{
llwchar code = wstr[text_kitty];
bool isEmoji = ed ? ed->isEmoji(code) : LLStringOps::isEmoji(code);
@@ -1469,7 +1469,7 @@ const std::string& LLTextBase::getSuggestion(U32 index) const
U32 LLTextBase::getSuggestionCount() const
{
- return mSuggestionList.size();
+ return static_cast(mSuggestionList.size());
}
void LLTextBase::replaceWithSuggestion(U32 index)
@@ -2335,7 +2335,7 @@ void LLTextBase::resetLabel()
style->setColor(mTentativeFgColor);
LLStyleConstSP sp(style);
- LLTextSegmentPtr label = new LLLabelTextSegment(sp, 0, mLabel.getWString().length() + 1, *this);
+ LLTextSegmentPtr label = new LLLabelTextSegment(sp, 0, static_cast(mLabel.getWString().length()) + 1, *this);
insertSegment(label);
}
}
@@ -2395,7 +2395,7 @@ void LLTextBase::appendWidget(const LLInlineViewSegment::Params& params, const s
{
segment_vec_t segments;
LLWString widget_wide_text = utf8str_to_wstring(text);
- segments.push_back(new LLInlineViewSegment(params, getLength(), getLength() + widget_wide_text.size()));
+ segments.push_back(new LLInlineViewSegment(params, getLength(), getLength() + static_cast(widget_wide_text.size())));
insertStringNoUndo(getLength(), widget_wide_text, &segments);
}
@@ -2436,11 +2436,11 @@ void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 hig
{
highlight_params.font.style("NORMAL");
LLStyleConstSP normal_sp(new LLStyle(highlight_params));
- segmentp = new LLOnHoverChangeableTextSegment(sp, normal_sp, cur_length, cur_length + wide_text.size(), *this);
+ segmentp = new LLOnHoverChangeableTextSegment(sp, normal_sp, cur_length, cur_length + static_cast(wide_text.size()), *this);
}
else
{
- segmentp = new LLNormalTextSegment(sp, cur_length, cur_length + wide_text.size(), *this);
+ segmentp = new LLNormalTextSegment(sp, cur_length, cur_length + static_cast(wide_text.size()), *this);
}
segment_vec_t segments;
segments.push_back(segmentp);
@@ -2454,7 +2454,7 @@ void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 hig
segment_vec_t segments;
S32 segment_start = old_length;
- S32 segment_end = old_length + wide_text.size();
+ S32 segment_end = old_length + static_cast(wide_text.size());
LLStyleConstSP sp(new LLStyle(style_params));
if (underline_on_hover_only || mSkipLinkUnderline)
{
@@ -2545,7 +2545,7 @@ void LLTextBase::replaceUrl(const std::string &url,
S32 start = seg->getStart();
S32 end = seg->getEnd();
text = text.substr(0, start) + wlabel + text.substr(end, text.size() - end + 1);
- seg->setEnd(start + wlabel.size());
+ seg->setEnd(start + static_cast(wlabel.size()));
modified = true;
}
@@ -2898,7 +2898,7 @@ bool LLTextBase::setCursor(S32 row, S32 column)
{
if (row < 0 || column < 0) return false;
- S32 n_lines = mLineInfoList.size();
+ S32 n_lines = static_cast(mLineInfoList.size());
for (S32 line = row; line < n_lines; ++line)
{
const line_info& li = mLineInfoList[line];
@@ -3537,7 +3537,7 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
: LLFontGL::ONLY_WORD_BOUNDARIES;
- S32 offsetLength = text.length() - (segment_offset + mStart);
+ S32 offsetLength = static_cast(text.length()) - (segment_offset + mStart);
if(getLength() < segment_offset + mStart)
{
@@ -3617,7 +3617,7 @@ const LLWString& LLLabelTextSegment::getWText() const
/*virtual*/
const S32 LLLabelTextSegment::getLength() const
{
- return mEditor.getWlabel().length();
+ return static_cast(mEditor.getWlabel().length());
}
//
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index f6c7ce6e81..4120d9ea32 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -454,8 +454,8 @@ public:
// force reflow of text
void needsReflow(S32 index = 0);
- S32 getLength() const { return getWText().length(); }
- S32 getLineCount() const { return mLineInfoList.size(); }
+ S32 getLength() const { return static_cast(getWText().length()); }
+ S32 getLineCount() const { return static_cast(mLineInfoList.size()); }
S32 removeFirstLine(); // returns removed length
void addDocumentChild(LLView* view);
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index b4254524ad..dc3026e14d 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -98,13 +98,13 @@ public:
}
virtual S32 undo( LLTextBase* editor )
{
- remove(editor, getPosition(), mWString.length() );
+ remove(editor, getPosition(), static_cast(mWString.length()));
return getPosition();
}
virtual S32 redo( LLTextBase* editor )
{
- insert(editor, getPosition(), mWString );
- return getPosition() + mWString.length();
+ insert(editor, getPosition(), mWString);
+ return getPosition() + static_cast(mWString.length());
}
private:
@@ -151,13 +151,13 @@ public:
}
virtual S32 undo( LLTextBase* editor )
{
- remove(editor, getPosition(), mWString.length() );
+ remove(editor, getPosition(), static_cast(mWString.length()));
return getPosition();
}
virtual S32 redo( LLTextBase* editor )
{
- insert(editor, getPosition(), mWString );
- return getPosition() + mWString.length();
+ insert(editor, getPosition(), mWString);
+ return getPosition() + static_cast(mWString.length());
}
private:
@@ -216,7 +216,7 @@ public:
virtual S32 undo( LLTextBase* editor )
{
insert(editor, getPosition(), mWString);
- return getPosition() + mWString.length();
+ return getPosition() + static_cast(mWString.length());
}
virtual S32 redo( LLTextBase* editor )
{
@@ -365,16 +365,16 @@ void LLTextEditor::selectNext(const std::string& search_text_in, bool case_insen
if (selected_text == search_text)
{
// We already have this word selected, we are searching for the next.
- setCursorPos(mCursorPos + search_text.size());
+ setCursorPos(mCursorPos + static_cast(search_text.size()));
}
}
- S32 loc = text.find(search_text,mCursorPos);
+ S32 loc = static_cast(text.find(search_text,mCursorPos));
// If Maybe we wrapped, search again
if (wrap && (-1 == loc))
{
- loc = text.find(search_text);
+ loc = static_cast(text.find(search_text));
}
// If still -1, then search_text just isn't found.
@@ -1578,8 +1578,8 @@ void LLTextEditor::cleanStringForPaste(LLWString & clean_string)
if( mAllowEmbeddedItems )
{
const llwchar LF = 10;
- S32 len = clean_string.length();
- for( S32 i = 0; i < len; i++ )
+ auto len = clean_string.length();
+ for( size_t i = 0; i < len; i++ )
{
llwchar wc = clean_string[i];
if( (wc < LLFontFreetype::FIRST_CHAR) && (wc != LF) )
@@ -2489,7 +2489,7 @@ void LLTextEditor::appendWidget(const LLInlineViewSegment::Params& params, const
LLWString widget_wide_text = utf8str_to_wstring(text);
- LLTextSegmentPtr segment = new LLInlineViewSegment(params, old_length, old_length + widget_wide_text.size());
+ LLTextSegmentPtr segment = new LLInlineViewSegment(params, old_length, old_length + static_cast(widget_wide_text.size()));
insert(getLength(), widget_wide_text, false, segment);
// Set the cursor and scroll position
@@ -2843,7 +2843,7 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string,
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode())
{
mPreeditOverwrittenWString = getWText().substr(insert_preedit_at, mPreeditWString.length());
- removeStringNoUndo(insert_preedit_at, mPreeditWString.length());
+ removeStringNoUndo(insert_preedit_at, static_cast(mPreeditWString.length()));
}
else
{
diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp
index 8e2bfe6ac2..6a867fc759 100644
--- a/indra/llui/lltextparser.cpp
+++ b/indra/llui/lltextparser.cpp
@@ -73,11 +73,11 @@ S32 LLTextParser::findPattern(const std::string &text, LLSD highlight)
found = (! ltext.find(pattern) ? 0 : std::string::npos);
break;
case ENDS_WITH:
- S32 pos = ltext.rfind(pattern);
+ auto pos = ltext.rfind(pattern);
if (pos >= 0 && (ltext.length()-pattern.length()==pos)) found = pos;
break;
}
- return found;
+ return static_cast(found);
}
LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLColor4 &color, EHighlightPosition part, S32 index)
@@ -99,8 +99,8 @@ LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLC
S32 start = findPattern(text,mHighlights[i]);
if (start >= 0 )
{
- S32 end = std::string(mHighlights[i]["pattern"]).length();
- S32 len = text.length();
+ auto end = std::string(mHighlights[i]["pattern"]).length();
+ auto len = text.length();
EHighlightPosition newpart;
if (start==0)
{
diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp
index 9e27ed6232..f9de6f7386 100644
--- a/indra/llui/lltextvalidate.cpp
+++ b/indra/llui/lltextvalidate.cpp
@@ -73,7 +73,7 @@ class ValidatorFloat : public ValidatorImpl
std::basic_string trimmed = str;
LLStringUtilBase::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
// May be a comma or period, depending on the locale
@@ -118,7 +118,7 @@ class ValidatorInt : public ValidatorImpl
std::basic_string trimmed = str;
LLStringUtilBase::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
S32 i = 0;
@@ -157,7 +157,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
std::basic_string trimmed = str;
LLStringUtilBase::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
CHAR ch = trimmed.front();
@@ -167,7 +167,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
return setError("Validator_ShouldNotBeMinusOrZero", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = trimmed[i];
if (!LLStringOps::isDigit(ch))
@@ -177,7 +177,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
}
}
- S32 val = strtol(trimmed);
+ auto val = strtol(trimmed);
if (val <= 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(trimmed)));
@@ -201,7 +201,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
std::basic_string trimmed = str;
LLStringUtilBase::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
CHAR ch = trimmed.front();
@@ -211,7 +211,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
return setError("Validator_ShouldNotBeMinus", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = trimmed[i];
if (!LLStringOps::isDigit(ch))
@@ -221,7 +221,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
}
}
- S32 val = strtol(trimmed);
+ auto val = strtol(trimmed);
if (val < 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(trimmed)));
@@ -244,7 +244,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
LLLocale locale(LLLocale::USER_LOCALE);
std::basic_string test_str = str;
- S32 len = test_str.length();
+ auto len = test_str.length();
if (0 < len)
{
CHAR ch = test_str.front();
@@ -254,7 +254,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
return setError("Validator_ShouldNotBeMinus", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = test_str[i];
if (!LLStringOps::isDigit(ch) || LLStringOps::isSpace(ch))
@@ -264,7 +264,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
}
}
- S32 val = strtol(test_str);
+ auto val = strtol(test_str);
if (val < 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(test_str)));
@@ -286,7 +286,7 @@ class ValidatorAlphaNum : public ValidatorImpl
{
LLLocale locale(LLLocale::USER_LOCALE);
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -313,7 +313,7 @@ class ValidatorAlphaNumSpace : public ValidatorImpl
{
LLLocale locale(LLLocale::USER_LOCALE);
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -341,7 +341,7 @@ class ValidatorASCIIPrintableNoPipe : public ValidatorImpl
template
bool validate(const std::basic_string& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -368,7 +368,7 @@ class ValidatorASCIIPrintableNoSpace : public ValidatorImpl
template
bool validate(const std::basic_string& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -395,7 +395,7 @@ protected:
template
bool validate(const std::basic_string& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -441,7 +441,7 @@ class ValidatorASCIIWithNewLine : public ValidatorImpl
template
bool validate(const std::basic_string& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp
index f1bf60d262..e2e735b131 100644
--- a/indra/llui/lltimectrl.cpp
+++ b/indra/llui/lltimectrl.cpp
@@ -343,7 +343,7 @@ LLTimeCtrl::EEditingPart LLTimeCtrl::getEditingPart()
S32 cur_pos = mEditor->getCursor();
std::string time_str = mEditor->getText();
- S32 colon_index = time_str.find_first_of(':');
+ auto colon_index = time_str.find_first_of(':');
if (cur_pos <= colon_index)
{
@@ -376,7 +376,7 @@ std::string LLTimeCtrl::getMinutesString(const std::string& str)
size_t colon_index = str.find_first_of(':');
++colon_index;
- int minutes_len = str.length() - colon_index - AMPM_LEN;
+ auto minutes_len = str.length() - colon_index - AMPM_LEN;
std::string minutes_str = str.substr(colon_index, minutes_len);
return minutes_str;
@@ -411,7 +411,7 @@ bool LLTimeCtrl::isMinutesStringValid(const std::string& str)
// static
bool LLTimeCtrl::isPMAMStringValid(const std::string& str)
{
- S32 len = str.length();
+ auto len = str.length();
bool valid = (str[--len] == 'M') && (str[--len] == 'P' || str[len] == 'A');
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index e8ec1e41df..c57c979525 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -178,12 +178,12 @@ public:
protected:
friend class LLUICtrlFactory;
- LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params), mButtonPanel(NULL) {}
+ LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params) {};
private:
reshape_callback_t mReshapeCallback;
- LLToolBarEnums::EToolBarLocation mLocationId;
- LLPanel * mButtonPanel;
+ LLToolBarEnums::EToolBarLocation mLocationId{ LLToolBarEnums::EToolBarLocation::TOOLBAR_NONE };
+ LLPanel * mButtonPanel{ nullptr };
};
struct Params : public LLInitParam::Block