Merge branch 'DRTVWR-600-maint-A' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/llcharacter/llkeyframemotion.cpp
#	indra/llcharacter/llmotioncontroller.cpp
#	indra/llcrashlogger/llcrashlogger.cpp
#	indra/llimage/llimagetga.cpp
#	indra/llmessage/llregionflags.h
#	indra/llprimitive/lldaeloader.cpp
#	indra/llprimitive/llmodel.cpp
#	indra/llrender/llrendertarget.cpp
#	indra/llui/llconsole.cpp
#	indra/llui/llkeywords.cpp
#	indra/llui/llscrolllistctrl.cpp
#	indra/llui/lltextbase.cpp
#	indra/llui/lltexteditor.cpp
#	indra/llui/llurlentry.cpp
#	indra/newview/llappearancemgr.cpp
#	indra/newview/llappviewer.cpp
#	indra/newview/llfloaterworldmap.cpp
#	indra/newview/llgiveinventory.cpp
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llpanelpeople.cpp
#	indra/newview/llpanelpermissions.cpp
#	indra/newview/llpanelteleporthistory.cpp
#	indra/newview/llvocache.cpp
master
Ansariel 2024-06-09 16:11:24 +02:00
commit a17fd2352a
346 changed files with 1444 additions and 1546 deletions

View File

@ -1678,6 +1678,14 @@
</map> </map>
<key>llphysicsextensions_source</key> <key>llphysicsextensions_source</key>
<map> <map>
<key>copyright</key>
<string>Copyright (c) 2010, Linden Research, Inc.</string>
<key>license</key>
<string>internal</string>
<key>license_file</key>
<string>LICENSES/llphysicsextensions.txt</string>
<key>name</key>
<string>llphysicsextensions_source</string>
<key>platforms</key> <key>platforms</key>
<map> <map>
<key>darwin64</key> <key>darwin64</key>
@ -1687,11 +1695,11 @@
<key>creds</key> <key>creds</key>
<string>github</string> <string>github</string>
<key>hash</key> <key>hash</key>
<string>b037cc0b29ea70ee834cfae6dda5b7a25cd57174</string> <string>24256fab0ccf6c0f70dcb536240e7e556f592ebe</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>sha1</string> <string>sha1</string>
<key>url</key> <key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851460</string> <string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/171617692</string>
</map> </map>
<key>name</key> <key>name</key>
<string>darwin64</string> <string>darwin64</string>
@ -1703,11 +1711,11 @@
<key>creds</key> <key>creds</key>
<string>github</string> <string>github</string>
<key>hash</key> <key>hash</key>
<string>bdea1fd5c4da9da5afde088d16188b45d0853e04</string> <string>7d218e641c66a63bb6722b4605d6bcbf78c51c85</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>sha1</string> <string>sha1</string>
<key>url</key> <key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851461</string> <string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/171617691</string>
</map> </map>
<key>name</key> <key>name</key>
<string>linux64</string> <string>linux64</string>
@ -1719,26 +1727,18 @@
<key>creds</key> <key>creds</key>
<string>github</string> <string>github</string>
<key>hash</key> <key>hash</key>
<string>f652ce0d6aef864689f0ed44255da4d9cd65a43f</string> <string>56b94c0d0f0b2f221fd13648e99e9569b0490d76</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>sha1</string> <string>sha1</string>
<key>url</key> <key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851463</string> <string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/171617694</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows64</string> <string>windows64</string>
</map> </map>
</map> </map>
<key>license</key>
<string>internal</string>
<key>license_file</key>
<string>LICENSES/llphysicsextensions.txt</string>
<key>copyright</key>
<string>Copyright (c) 2010, Linden Research, Inc.</string>
<key>version</key> <key>version</key>
<string>1.0.479d20a</string> <string>1.0.b6dc588</string>
<key>name</key>
<string>llphysicsextensions_source</string>
</map> </map>
<key>llphysicsextensions_stub</key> <key>llphysicsextensions_stub</key>
<map> <map>

View File

@ -164,19 +164,7 @@ LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAv
LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) : LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
LLCharacter(), LLCharacter(),
mIsDummy(false), mWearableData(wearable_data)
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)
{ {
llassert_always(mWearableData); llassert_always(mWearableData);
mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES); mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);

View File

@ -70,7 +70,7 @@ public:
static void initClass(); static void initClass();
static void cleanupClass(); // Cleanup data that's only init'd once per class. static void cleanupClass(); // Cleanup data that's only init'd once per class.
virtual void initInstance(); // Called after construction to initialize the instance. virtual void initInstance(); // Called after construction to initialize the instance.
S32 mInitFlags; S32 mInitFlags{ 0 };
virtual bool loadSkeletonNode(); virtual bool loadSkeletonNode();
bool loadMeshNodes(); bool loadMeshNodes();
bool loadLayersets(); bool loadLayersets();
@ -137,8 +137,8 @@ public:
F32 getPelvisToFoot() const { return mPelvisToFoot; } F32 getPelvisToFoot() const { return mPelvisToFoot; }
/*virtual*/ LLJoint* getRootJoint() { return mRoot; } /*virtual*/ LLJoint* getRootJoint() { return mRoot; }
LLVector3 mHeadOffset; // current head position LLVector3 mHeadOffset{}; // current head position
LLAvatarJoint *mRoot; LLAvatarJoint* mRoot{ nullptr };
// <FS:ND> This map gets queried a huge amount of time. // <FS:ND> This map gets queried a huge amount of time.
// typedef std::map<std::string, LLJoint*> joint_map_t; // typedef std::map<std::string, LLJoint*> joint_map_t;
@ -178,7 +178,7 @@ protected:
bool buildSkeleton(const LLAvatarSkeletonInfo *info); bool buildSkeleton(const LLAvatarSkeletonInfo *info);
void clearSkeleton(); void clearSkeleton();
bool mIsBuilt; // state of deferred character building bool mIsBuilt{ false }; // state of deferred character building
avatar_joint_list_t mSkeleton; avatar_joint_list_t mSkeleton;
LLVector3OverrideMap mPelvisFixups; LLVector3OverrideMap mPelvisFixups;
joint_alias_map_t mJointAliasMap; joint_alias_map_t mJointAliasMap;
@ -195,30 +195,30 @@ public:
LLVector3 mBodySize; LLVector3 mBodySize;
LLVector3 mAvatarOffset; LLVector3 mAvatarOffset;
protected: protected:
F32 mPelvisToFoot; F32 mPelvisToFoot{ 0.f };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Cached pointers to well known joints // Cached pointers to well known joints
//-------------------------------------------------------------------- //--------------------------------------------------------------------
public: public:
LLJoint* mPelvisp; LLJoint* mPelvisp{nullptr};
LLJoint* mTorsop; LLJoint* mTorsop{ nullptr };
LLJoint* mChestp; LLJoint* mChestp{ nullptr };
LLJoint* mNeckp; LLJoint* mNeckp{ nullptr };
LLJoint* mHeadp; LLJoint* mHeadp{ nullptr };
LLJoint* mSkullp; LLJoint* mSkullp{ nullptr };
LLJoint* mEyeLeftp; LLJoint* mEyeLeftp{ nullptr };
LLJoint* mEyeRightp; LLJoint* mEyeRightp{ nullptr };
LLJoint* mHipLeftp; LLJoint* mHipLeftp{ nullptr };
LLJoint* mHipRightp; LLJoint* mHipRightp{ nullptr };
LLJoint* mKneeLeftp; LLJoint* mKneeLeftp{ nullptr };
LLJoint* mKneeRightp; LLJoint* mKneeRightp{ nullptr };
LLJoint* mAnkleLeftp; LLJoint* mAnkleLeftp{ nullptr };
LLJoint* mAnkleRightp; LLJoint* mAnkleRightp{ nullptr };
LLJoint* mFootLeftp; LLJoint* mFootLeftp{ nullptr };
LLJoint* mFootRightp; LLJoint* mFootRightp{ nullptr };
LLJoint* mWristLeftp; LLJoint* mWristLeftp{ nullptr };
LLJoint* mWristRightp; LLJoint* mWristRightp{ nullptr };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// XML parse tree // XML parse tree
@ -242,7 +242,7 @@ public:
** RENDERING ** RENDERING
**/ **/
public: 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 // Morph masks
@ -313,9 +313,9 @@ public:
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake) = 0; virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake) = 0;
// </FS:Ansariel> [Legacy Bake] // </FS:Ansariel> [Legacy Bake]
protected: protected:
LLTexGlobalColor* mTexSkinColor; LLTexGlobalColor* mTexSkinColor{ nullptr };
LLTexGlobalColor* mTexHairColor; LLTexGlobalColor* mTexHairColor{ nullptr };
LLTexGlobalColor* mTexEyeColor; LLTexGlobalColor* mTexEyeColor{ nullptr };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Visibility // Visibility
@ -338,7 +338,7 @@ public:
virtual bool isWearingWearableType(LLWearableType::EType type ) const; virtual bool isWearingWearableType(LLWearableType::EType type ) const;
private: private:
LLWearableData* mWearableData; LLWearableData* mWearableData{ nullptr };
/******************************************************************************** /********************************************************************************
** ** ** **
@ -356,11 +356,11 @@ protected:
struct BakedTextureData struct BakedTextureData
{ {
LLUUID mLastTextureID; LLUUID mLastTextureID;
LLTexLayerSet* mTexLayerSet; // Only exists for self LLTexLayerSet* mTexLayerSet{ nullptr }; // Only exists for self
bool mIsLoaded; bool mIsLoaded{ false };
bool mIsUsed; bool mIsUsed{ false };
LLAvatarAppearanceDefines::ETextureIndex mTextureIndex; LLAvatarAppearanceDefines::ETextureIndex mTextureIndex{ LLAvatarAppearanceDefines::ETextureIndex::TEX_INVALID };
U32 mMaskTexName; U32 mMaskTexName{ 0 };
// Stores pointers to the joint meshes that this baked texture deals with // Stores pointers to the joint meshes that this baked texture deals with
avatar_joint_mesh_list_t mJointMeshes; avatar_joint_mesh_list_t mJointMeshes;
morph_list_t mMaskedMorphs; morph_list_t mMaskedMorphs;
@ -377,9 +377,9 @@ protected:
// Collision volumes // Collision volumes
//-------------------------------------------------------------------- //--------------------------------------------------------------------
public: public:
S32 mNumBones; S32 mNumBones{ 0 };
S32 mNumCollisionVolumes; S32 mNumCollisionVolumes{ 0 };
LLAvatarJointCollisionVolume* mCollisionVolumes; LLAvatarJointCollisionVolume* mCollisionVolumes{ nullptr };
protected: protected:
bool allocateCollisionVolumes(U32 num); bool allocateCollisionVolumes(U32 num);

View File

@ -435,7 +435,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po
S32 LLDriverParam::getDrivenParamsCount() const S32 LLDriverParam::getDrivenParamsCount() const
{ {
return mDriven.size(); return static_cast<S32>(mDriven.size());
} }
const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const

View File

@ -138,10 +138,10 @@ protected:
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder
entry_list_t mDriven; entry_list_t mDriven;
LLViewerVisualParam* mCurrentDistortionParam; LLViewerVisualParam* mCurrentDistortionParam{ nullptr };
// Backlink only; don't make this an LLPointer. // Backlink only; don't make this an LLPointer.
LLAvatarAppearance* mAvatarAppearance; LLAvatarAppearance* mAvatarAppearance{ nullptr };
LLWearable* mWearablep; LLWearable* mWearablep{ nullptr };
}; };
#endif // LL_LLDRIVERPARAM_H #endif // LL_LLDRIVERPARAM_H

View File

@ -109,7 +109,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name)
U32 LLLocalTextureObject::getNumTexLayers() const U32 LLLocalTextureObject::getNumTexLayers() const
{ {
return mTexLayers.size(); return static_cast<U32>(mTexLayers.size());
} }
LLUUID LLLocalTextureObject::getID() const LLUUID LLLocalTextureObject::getID() const

View File

@ -107,7 +107,7 @@ LLPolyMorphData::~LLPolyMorphData()
bool LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) bool LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
{ {
S32 numVertices; S32 numVertices;
S32 numRead; size_t numRead;
numRead = fread(&numVertices, sizeof(S32), 1, fp); numRead = fread(&numVertices, sizeof(S32), 1, fp);
llendianswizzle(&numVertices, sizeof(S32), 1); llendianswizzle(&numVertices, sizeof(S32), 1);
@ -386,8 +386,8 @@ bool LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
if (!mMorphData) if (!mMorphData)
{ {
const std::string driven_tag = "_Driven"; 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) if (pos != std::string::npos)
{ {
morph_param_name = morph_param_name.substr(0,pos); morph_param_name = morph_param_name.substr(0,pos);
mMorphData = mMesh->getMorphData(morph_param_name); mMorphData = mMesh->getMorphData(morph_param_name);

View File

@ -763,7 +763,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
std::string terse_F32_to_string(F32 f) std::string terse_F32_to_string(F32 f)
{ {
std::string r = llformat("%.2f", f); std::string r = llformat("%.2f", f);
S32 len = r.length(); auto len = r.length();
// "1.20" -> "1.2" // "1.20" -> "1.2"
// "24.00" -> "24." // "24.00" -> "24."

View File

@ -346,7 +346,7 @@ U32 LLWearableData::getWearableCount(const LLWearableType::EType type) const
return 0; return 0;
} }
const wearableentry_vec_t& wearable_vec = wearable_iter->second; const wearableentry_vec_t& wearable_vec = wearable_iter->second;
return wearable_vec.size(); return static_cast<U32>(wearable_vec.size());
} }
U32 LLWearableData::getWearableCount(const U32 tex_index) const U32 LLWearableData::getWearableCount(const U32 tex_index) const

View File

@ -422,7 +422,7 @@ bool LLVorbisDecodeState::finishDecode()
ov_clear(&mVF); ov_clear(&mVF);
// write "data" chunk length, in little-endian format // write "data" chunk length, in little-endian format
S32 data_length = mWAVBuffer.size() - WAV_HEADER_SIZE; S32 data_length = static_cast<S32>(mWAVBuffer.size()) - WAV_HEADER_SIZE;
mWAVBuffer[40] = (data_length) & 0x000000FF; mWAVBuffer[40] = (data_length) & 0x000000FF;
mWAVBuffer[41] = (data_length >> 8) & 0x000000FF; mWAVBuffer[41] = (data_length >> 8) & 0x000000FF;
mWAVBuffer[42] = (data_length >> 16) & 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*/ memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/
} }
S32 near_end = mWAVBuffer.size() - (2 * fade_length); S32 near_end = static_cast<S32>(mWAVBuffer.size()) - (2 * fade_length);
if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length)) if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length))
{ {
memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/ memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/
@ -491,7 +491,7 @@ bool LLVorbisDecodeState::finishDecode()
return true; // we've finished return true; // we've finished
} }
mBytesRead = -1; mBytesRead = -1;
mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, mWAVBuffer.size(), mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, static_cast<S32>(mWAVBuffer.size()),
new WriteResponder(this)); new WriteResponder(this));
} }

View File

@ -73,8 +73,8 @@ LLCharacter::~LLCharacter()
delete param; delete param;
} }
U32 i ; size_t i ;
U32 size = sInstances.size() ; size_t size = sInstances.size() ;
for(i = 0 ; i < size ; i++) for(i = 0 ; i < size ; i++)
{ {
if(sInstances[i] == this) if(sInstances[i] == this)

View File

@ -282,7 +282,7 @@ bool LLGestureList::trigger(KEY key, MASK mask)
U8 *LLGestureList::serialize(U8 *buffer) const U8 *LLGestureList::serialize(U8 *buffer) const
{ {
// a single S32 serves as the header that tells us how many to read // 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); htolememcpy(buffer, &count, MVT_S32, 4);
buffer += sizeof(count); buffer += sizeof(count);

View File

@ -90,7 +90,7 @@ public:
bool triggerAndReviseString(const std::string &string, std::string* revised_string); bool triggerAndReviseString(const std::string &string, std::string* revised_string);
// Used for construction from UI // Used for construction from UI
S32 count() const { return mList.size(); } S32 count() const { return static_cast<S32>(mList.size()); }
virtual LLGesture* get(S32 i) const { return mList.at(i); } virtual LLGesture* get(S32 i) const { return mList.at(i); }
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); } virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
void deleteAll(); void deleteAll();

View File

@ -47,7 +47,7 @@ JointKey JointKey::construct(const std::string& aName)
return { aName, itr->second }; return { aName, itr->second };
} }
U32 size = mpStringToKeys.size() + 1; U32 size = static_cast<U32>(mpStringToKeys.size()) + 1;
mpStringToKeys.try_emplace(aName, size); mpStringToKeys.try_emplace(aName, size);
return { aName, size }; return { aName, size };
} }
@ -94,7 +94,7 @@ void LLVector3OverrideMap::showJointVector3Overrides( std::ostringstream& os ) c
U32 LLVector3OverrideMap::count() const U32 LLVector3OverrideMap::count() const
{ {
return m_map.size(); return static_cast<U32>(m_map.size());
} }
void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos) void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
@ -104,7 +104,7 @@ void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
bool LLVector3OverrideMap::remove(const LLUUID& mesh_id) 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); return (remove_count > 0);
} }

View File

@ -432,9 +432,9 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id) LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
: LLMotion(id), : LLMotion(id),
mJointMotionList(NULL), mJointMotionList(nullptr),
mPelvisp(NULL), mPelvisp(nullptr),
mCharacter(NULL), // <FS:Ansariel> Uninitialized pointer fix by Drake Arconis mCharacter(nullptr),
mLastSkeletonSerialNum(0), mLastSkeletonSerialNum(0),
mLastUpdateTime(0.f), mLastUpdateTime(0.f),
mLastLoopedTime(0.f), mLastLoopedTime(0.f),
@ -2082,7 +2082,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
JointMotion* joint_motionp = mJointMotionList->getJointMotion(i); JointMotion* joint_motionp = mJointMotionList->getJointMotion(i);
success &= dp.packString(joint_motionp->mJointName, "joint_name"); success &= dp.packString(joint_motionp->mJointName, "joint_name");
success &= dp.packS32(joint_motionp->mPriority, "joint_priority"); success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
success &= dp.packS32(joint_motionp->mRotationCurve.mKeys.size(), "num_rot_keys"); success &= dp.packS32(static_cast<S32>(joint_motionp->mRotationCurve.mKeys.size()), "num_rot_keys");
LL_DEBUGS("BVH") << "Joint " << i LL_DEBUGS("BVH") << "Joint " << i
<< " name: " << joint_motionp->mJointName << " name: " << joint_motionp->mJointName
@ -2108,7 +2108,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; 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<S32>(joint_motionp->mPositionCurve.mKeys.size()), "num_pos_keys");
for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys) for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys)
{ {
PositionKey& pos_key = pos_pair.second; PositionKey& pos_key = pos_pair.second;
@ -2128,7 +2128,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
} }
} }
success &= dp.packS32(mJointMotionList->mConstraints.size(), "num_constraints"); success &= dp.packS32(static_cast<S32>(mJointMotionList->mConstraints.size()), "num_constraints");
LL_DEBUGS("BVH") << "num_constraints " << mJointMotionList->mConstraints.size() << LL_ENDL; LL_DEBUGS("BVH") << "num_constraints " << mJointMotionList->mConstraints.size() << LL_ENDL;
for (JointConstraintSharedData* shared_constraintp : mJointMotionList->mConstraints) for (JointConstraintSharedData* shared_constraintp : mJointMotionList->mConstraints)
{ {

View File

@ -420,7 +420,7 @@ public:
~JointMotionList(); ~JointMotionList();
U32 dumpDiagInfo(); U32 dumpDiagInfo();
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; } JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
U32 getNumJointMotions() const { return mJointMotionArray.size(); } U32 getNumJointMotions() const { return static_cast<U32>(mJointMotionArray.size()); }
}; };
protected: protected:

View File

@ -157,11 +157,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) 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_motions += static_cast<S32>(mAllMotions.size());
num_loading_motions += mLoadingMotions.size(); num_loading_motions += static_cast<S32>(mLoadingMotions.size());
num_loaded_motions += mLoadedMotions.size(); num_loaded_motions += static_cast<S32>(mLoadedMotions.size());
num_active_motions += mActiveMotions.size(); num_active_motions += static_cast<S32>(mActiveMotions.size());
num_deprecated_motions += mDeprecatedMotions.size(); num_deprecated_motions += static_cast<S32>(mDeprecatedMotions.size());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -223,7 +223,7 @@ void LLMotionController::purgeExcessMotions()
} }
// clean up all inactive, loaded motions // 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 // look up the motion again by ID to get canonical instance
// and kill it only if that one is inactive // and kill it only if that one is inactive
@ -234,7 +234,7 @@ void LLMotionController::purgeExcessMotions()
} }
} }
U32 loaded_count = mLoadedMotions.size(); U32 loaded_count = static_cast<U32>(mLoadedMotions.size());
// <FS:Ansariel> Can't do anything about it anyway - stop spamming the log // <FS:Ansariel> Can't do anything about it anyway - stop spamming the log
//if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge) //if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge)
//{ //{

View File

@ -199,9 +199,9 @@ bool LLApp::parseCommandOptions(int argc, char** argv)
#if LL_WINDOWS #if LL_WINDOWS
//Windows changed command line parsing. Deal with it. //Windows changed command line parsing. Deal with it.
S32 slen = value.length() - 1; size_t slen = value.length() - 1;
S32 start = 0; size_t start = 0;
S32 end = slen; size_t end = slen;
if (argv[ii][start]=='"')start++; if (argv[ii][start]=='"')start++;
if (argv[ii][end]=='"')end--; if (argv[ii][end]=='"')end--;
if (start!=0 || end!=slen) if (start!=0 || end!=slen)
@ -264,9 +264,9 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv)
#if LL_WINDOWS #if LL_WINDOWS
//Windows changed command line parsing. Deal with it. //Windows changed command line parsing. Deal with it.
S32 slen = value.length() - 1; size_t slen = value.length() - 1;
S32 start = 0; size_t start = 0;
S32 end = slen; size_t end = slen;
if (wargv[ii][start]=='"')start++; if (wargv[ii][start]=='"')start++;
if (wargv[ii][end]=='"')end--; if (wargv[ii][end]=='"')end--;
if (start!=0 || end!=slen) if (start!=0 || end!=slen)

View File

@ -221,7 +221,7 @@ private:
private: private:
U64 mStartTime; U64 mStartTime;
BlockTimerStackRecord mParentTimerData; BlockTimerStackRecord mParentTimerData{};
public: public:
// statics // statics

View File

@ -389,7 +389,7 @@ const char *LLFile::tmpdir()
sep = '\\'; sep = '\\';
std::vector<wchar_t> utf16path(MAX_PATH + 1); std::vector<wchar_t> utf16path(MAX_PATH + 1);
GetTempPathW(utf16path.size(), &utf16path[0]); GetTempPathW(static_cast<DWORD>(utf16path.size()), &utf16path[0]);
utf8path = ll_convert_wide_to_string(&utf16path[0]); utf8path = ll_convert_wide_to_string(&utf16path[0]);
#else #else
sep = '/'; sep = '/';

View File

@ -97,7 +97,7 @@ public:
// no copy // no copy
LLUniqueFile(const LLUniqueFile&) = delete; LLUniqueFile(const LLUniqueFile&) = delete;
// move construction // move construction
LLUniqueFile(LLUniqueFile&& other) LLUniqueFile(LLUniqueFile&& other) noexcept
{ {
mFileHandle = other.mFileHandle; mFileHandle = other.mFileHandle;
other.mFileHandle = nullptr; other.mFileHandle = nullptr;
@ -118,7 +118,7 @@ public:
// copy assignment deleted // copy assignment deleted
LLUniqueFile& operator=(const LLUniqueFile&) = delete; LLUniqueFile& operator=(const LLUniqueFile&) = delete;
// move assignment // move assignment
LLUniqueFile& operator=(LLUniqueFile&& other) LLUniqueFile& operator=(LLUniqueFile&& other) noexcept
{ {
close(); close();
std::swap(mFileHandle, other.mFileHandle); std::swap(mFileHandle, other.mFileHandle);

View File

@ -47,7 +47,7 @@ public:
typedef typename std::vector<Type>::size_type size_type; typedef typename std::vector<Type>::size_type size_type;
protected: protected:
std::vector<Type> mVector; std::vector<Type> mVector;
std::map<Key, U32> mIndexMap; std::map<Key, size_t> mIndexMap;
public: public:
LLIndexedVector() { mVector.reserve(BlockSize); } LLIndexedVector() { mVector.reserve(BlockSize); }
@ -68,10 +68,10 @@ public:
Type& operator[](const Key& k) Type& operator[](const Key& k)
{ {
typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k); typename std::map<Key, size_t>::const_iterator iter = mIndexMap.find(k);
if (iter == mIndexMap.end()) if (iter == mIndexMap.end())
{ {
U32 n = mVector.size(); auto n = mVector.size();
mIndexMap[k] = n; mIndexMap[k] = n;
mVector.push_back(Type()); mVector.push_back(Type());
llassert(mVector.size() == mIndexMap.size()); llassert(mVector.size() == mIndexMap.size());
@ -85,7 +85,7 @@ public:
const_iterator find(const Key& k) const const_iterator find(const Key& k) const
{ {
typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k); typename std::map<Key, size_t>::const_iterator iter = mIndexMap.find(k);
if(iter == mIndexMap.end()) if(iter == mIndexMap.end())
{ {
return mVector.end(); return mVector.end();

View File

@ -138,24 +138,6 @@
// Deal with VC6 problems // Deal with VC6 problems
#if LL_MSVC #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 <map> 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 #pragma warning( disable : 4996 ) // warning: deprecated
// Linker optimization with "extern template" generates these warnings // Linker optimization with "extern template" generates these warnings

View File

@ -210,7 +210,7 @@ void LLQueuedThread::waitOnPending()
// MAIN thread // MAIN thread
void LLQueuedThread::printQueueStats() void LLQueuedThread::printQueueStats()
{ {
U32 size = mRequestQueue.size(); auto size = mRequestQueue.size();
if (size > 0) if (size > 0)
{ {
LL_INFOS() << llformat("Pending Requests:%d ", mRequestQueue.size()) << LL_ENDL; LL_INFOS() << llformat("Pending Requests:%d ", mRequestQueue.size()) << LL_ENDL;

View File

@ -1547,7 +1547,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
case LLSD::TypeMap: case LLSD::TypeMap:
{ {
ostr.put('{'); ostr.put('{');
U32 size_nbo = htonl(data.size()); U32 size_nbo = htonl(static_cast<u_long>(data.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32)); ostr.write((const char*)(&size_nbo), sizeof(U32));
LLSD::map_const_iterator iter = data.beginMap(); LLSD::map_const_iterator iter = data.beginMap();
LLSD::map_const_iterator end = data.endMap(); LLSD::map_const_iterator end = data.endMap();
@ -1564,7 +1564,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
case LLSD::TypeArray: case LLSD::TypeArray:
{ {
ostr.put('['); ostr.put('[');
U32 size_nbo = htonl(data.size()); U32 size_nbo = htonl(static_cast<u_long>(data.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32)); ostr.write((const char*)(&size_nbo), sizeof(U32));
LLSD::array_const_iterator iter = data.beginArray(); LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray(); LLSD::array_const_iterator end = data.endArray();
@ -1631,7 +1631,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
{ {
ostr.put('b'); ostr.put('b');
const std::vector<U8>& buffer = data.asBinary(); const std::vector<U8>& buffer = data.asBinary();
U32 size_nbo = htonl(buffer.size()); U32 size_nbo = htonl(static_cast<u_long>(buffer.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32)); ostr.write((const char*)(&size_nbo), sizeof(U32));
if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size()); if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size());
break; break;
@ -1649,7 +1649,7 @@ void LLSDBinaryFormatter::formatString(
const std::string& string, const std::string& string,
std::ostream& ostr) const std::ostream& ostr) const
{ {
U32 size_nbo = htonl(string.size()); U32 size_nbo = htonl(static_cast<u_long>(string.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32)); ostr.write((const char*)(&size_nbo), sizeof(U32));
ostr.write(string.c_str(), string.size()); ostr.write(string.c_str(), string.size());
} }

View File

@ -569,6 +569,7 @@ public:
classname<DERIVED_TYPE>(), classname<DERIVED_TYPE>(),
" -- creating new instance"}); " -- creating new instance"});
// fall through // fall through
[[fallthrough]];
case UNINITIALIZED: case UNINITIALIZED:
case QUEUED: case QUEUED:
// QUEUED means some secondary thread has already requested an // QUEUED means some secondary thread has already requested an

View File

@ -301,7 +301,7 @@ inline bool vector_replace_with_last(std::vector<T>& invec, const T& val)
template <typename T> template <typename T>
inline T* vector_append(std::vector<T>& invec, S32 N) inline T* vector_append(std::vector<T>& invec, S32 N)
{ {
U32 sz = invec.size(); auto sz = invec.size();
invec.resize(sz+N); invec.resize(sz+N);
return &(invec[sz]); return &(invec[sz]);
} }

View File

@ -565,7 +565,7 @@ std::string utf8str_truncate(const std::string& utf8str, const S32 max_len)
} }
// [RLVa:KB] - Checked: RLVa-2.1.0 // [RLVa:KB] - Checked: RLVa-2.1.0
std::string utf8str_substr(const std::string& utf8str, const S32 index, const S32 max_len) std::string utf8str_substr(const std::string& utf8str, const size_t index, const size_t max_len)
{ {
if (0 == max_len) if (0 == max_len)
{ {
@ -577,7 +577,7 @@ std::string utf8str_substr(const std::string& utf8str, const S32 index, const S3
} }
else else
{ {
S32 cur_char = max_len; size_t cur_char = max_len;
// If we're ASCII, we don't need to do anything // If we're ASCII, we don't need to do anything
if ((U8)utf8str[index + cur_char] > 0x7f) if ((U8)utf8str[index + cur_char] > 0x7f)
@ -881,7 +881,7 @@ std::string ll_convert_wide_to_string(const wchar_t* in, size_t len_in, unsigned
code_page, code_page,
0, 0,
in, in,
len_in, static_cast<int>(len_in),
NULL, NULL,
0, 0,
0, 0,
@ -896,7 +896,7 @@ std::string ll_convert_wide_to_string(const wchar_t* in, size_t len_in, unsigned
code_page, code_page,
0, 0,
in, in,
len_in, static_cast<int>(len_in),
pout, pout,
len_out, len_out,
0, 0,
@ -923,8 +923,8 @@ std::wstring ll_convert_string_to_wide(const char* in, size_t len, unsigned int
std::vector<wchar_t> w_out(len + 1); std::vector<wchar_t> w_out(len + 1);
memset(&w_out[0], 0, w_out.size()); memset(&w_out[0], 0, w_out.size());
int real_output_str_len = MultiByteToWideChar(code_page, 0, in, len, int real_output_str_len = MultiByteToWideChar(code_page, 0, in, static_cast<int>(len),
&w_out[0], w_out.size() - 1); &w_out[0], static_cast<int>(w_out.size() - 1));
//looks like MultiByteToWideChar didn't add null terminator to converted string, see EXT-4858. //looks like MultiByteToWideChar didn't add null terminator to converted string, see EXT-4858.
w_out[real_output_str_len] = 0; w_out[real_output_str_len] = 0;
@ -1015,7 +1015,7 @@ std::optional<std::wstring> llstring_getoptenv(const std::string& key)
auto wkey = ll_convert_string_to_wide(key); auto wkey = ll_convert_string_to_wide(key);
// Take a wild guess as to how big the buffer should be. // Take a wild guess as to how big the buffer should be.
std::vector<wchar_t> buffer(1024); std::vector<wchar_t> buffer(1024);
auto n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], buffer.size()); auto n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], static_cast<DWORD>(buffer.size()));
// If our initial guess was too short, n will indicate the size (in // 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. // wchar_t's) that buffer should have been, including the terminating nul.
if (n > (buffer.size() - 1)) if (n > (buffer.size() - 1))
@ -1023,7 +1023,7 @@ std::optional<std::wstring> llstring_getoptenv(const std::string& key)
// make it big enough // make it big enough
buffer.resize(n); buffer.resize(n);
// and try again // and try again
n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], buffer.size()); n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], static_cast<DWORD>(buffer.size()));
} }
// did that (ultimately) succeed? // did that (ultimately) succeed?
if (n) if (n)

View File

@ -719,7 +719,7 @@ LL_COMMON_API S32 wstring_wstring_length_from_utf16_length(const LLWString & wst
LL_COMMON_API std::string utf8str_truncate(const std::string& utf8str, const S32 max_len); LL_COMMON_API std::string utf8str_truncate(const std::string& utf8str, const S32 max_len);
// [RLVa:KB] - Checked: RLVa-2.1.0 // [RLVa:KB] - Checked: RLVa-2.1.0
LL_COMMON_API std::string utf8str_substr(const std::string& utf8str, const S32 index, const S32 max_len); LL_COMMON_API std::string utf8str_substr(const std::string& utf8str, const size_t index, const size_t max_len);
LL_COMMON_API void utf8str_split(std::list<std::string>& split_list, const std::string& utf8str, size_t maxlen, char split_token); LL_COMMON_API void utf8str_split(std::list<std::string>& split_list, const std::string& utf8str, size_t maxlen, char split_token);
// [/RLVa:KB] // [/RLVa:KB]

View File

@ -522,9 +522,9 @@ namespace LLTrace
struct BlockTimerStackRecord struct BlockTimerStackRecord
{ {
class BlockTimer* mActiveTimer; class BlockTimer* mActiveTimer{ nullptr };
class BlockTimerStatHandle* mTimeBlock; class BlockTimerStatHandle* mTimeBlock{ nullptr };
U64 mChildTime; U64 mChildTime{ 0 };
}; };
struct AccumulatorBufferGroup : public LLRefCount struct AccumulatorBufferGroup : public LLRefCount

View File

@ -82,8 +82,6 @@ public:
// to integers, among other things. Use isNull() or notNull(). // to integers, among other things. Use isNull() or notNull().
// operator bool() const; // 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; bool operator!=(const LLUUID &rhs) const;
bool operator<(const LLUUID &rhs) const; bool operator<(const LLUUID &rhs) const;

View File

@ -67,7 +67,7 @@ namespace tut
std::ostringstream resp; std::ostringstream resp;
resp << "{'connect':true, 'position':[r128,r128,r128], 'look_at':[r0,r1,r0], 'agent_access':'M', 'region_x':i8192, 'region_y':i8192}"; 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(); std::string str = resp.str();
LLMemoryStream mstr((U8*)str.c_str(), str.size()); LLMemoryStream mstr((U8*)str.c_str(), static_cast<S32>(str.size()));
LLSD response; LLSD response;
S32 count = LLSDSerialize::fromNotation(response, mstr, str.size()); S32 count = LLSDSerialize::fromNotation(response, mstr, str.size());
ensure("stream parsed", response.isDefined()); 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' }"; resp << "{'label':'short binary test', 'singlebinary':b(1)\"A\", 'singlerawstring':s(1)\"A\", 'endoftest':'end' }";
std::string str = resp.str(); std::string str = resp.str();
LLSD sd; LLSD sd;
LLMemoryStream mstr((U8*)str.c_str(), str.size()); LLMemoryStream mstr((U8*)str.c_str(), static_cast<S32>(str.size()));
S32 count = LLSDSerialize::fromNotation(sd, mstr, str.size()); S32 count = LLSDSerialize::fromNotation(sd, mstr, str.size());
ensure_equals("parse count", count, 5); ensure_equals("parse count", count, 5);
ensure("sd created", sd.isDefined()); ensure("sd created", sd.isDefined());
@ -456,7 +456,7 @@ namespace tut
void mem_object::test<1>() void mem_object::test<1>()
{ {
const char HELLO_WORLD[] = "hello world"; 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<S32>(strlen(HELLO_WORLD))); /* Flawfinder: ignore */
std::string hello; std::string hello;
std::string world; std::string world;
mem >> hello >> world; mem >> hello >> world;

View File

@ -491,7 +491,7 @@ namespace tut
// Partial defaults arrays. // Partial defaults arrays.
for (LLSD::String a: ab) for (LLSD::String a: ab)
{ {
LLSD::Integer partition(std::min(partial_offset, dft_array_full[a].size())); LLSD::Integer partition(static_cast<LLSD::Integer>(std::min(partial_offset, dft_array_full[a].size())));
dft_array_partial[a] = dft_array_partial[a] =
llsd_copy_array(dft_array_full[a].beginArray() + partition, llsd_copy_array(dft_array_full[a].beginArray() + partition,
dft_array_full[a].endArray()); dft_array_full[a].endArray());
@ -508,7 +508,7 @@ namespace tut
// (params, dft_array_full). Part of the point of using map-style // (params, dft_array_full). Part of the point of using map-style
// defaults is to allow any subset of the target function's // defaults is to allow any subset of the target function's
// parameters to be optional, not just the rightmost. // 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<LLSD::Integer>(params[a].size()); ix < ixend; ix += 2)
{ {
dft_map_partial[a][params[a][ix].asString()] = dft_array_full[a][ix]; 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 zipmap(const LLSD& keys, const LLSD& values)
{ {
LLSD map; LLSD map;
for (LLSD::Integer i = 0, iend = keys.size(); i < iend; ++i) for (LLSD::Integer i = 0, iend = static_cast<LLSD::Integer>(keys.size()); i < iend; ++i)
{ {
// Have to select asString() since you can index an LLSD // Have to select asString() since you can index an LLSD
// object with either String or Integer. // object with either String or Integer.
@ -955,7 +955,7 @@ namespace tut
allreq[a] = zipmap(params[a], LLSD::emptyArray()); allreq[a] = zipmap(params[a], LLSD::emptyArray());
// Same for leftreq, save that we use the subset of the params not // Same for leftreq, save that we use the subset of the params not
// supplied by dft_array_partial[a]. // supplied by dft_array_partial[a].
LLSD::Integer partition(params[a].size() - dft_array_partial[a].size()); LLSD::Integer partition(static_cast<LLSD::Integer>(params[a].size() - dft_array_partial[a].size()));
leftreq[a] = zipmap(llsd_copy_array(params[a].beginArray(), leftreq[a] = zipmap(llsd_copy_array(params[a].beginArray(),
params[a].beginArray() + partition), params[a].beginArray() + partition),
LLSD::emptyArray()); LLSD::emptyArray());

View File

@ -701,7 +701,7 @@ namespace tut
"<key>cam</key><real>1.23</real>" "<key>cam</key><real>1.23</real>"
"</map></llsd>", "</map></llsd>",
v, v,
v.size() + 1); static_cast<S32>(v.size()) + 1);
} }
template<> template<> template<> template<>
@ -721,7 +721,7 @@ namespace tut
"<key>cam</key><real>1.23</real>" "<key>cam</key><real>1.23</real>"
"</map></llsd>", "</map></llsd>",
v, v,
v.size() + 1); static_cast<S32>(v.size()) + 1);
v.clear(); v.clear();
v["amy"] = 23; v["amy"] = 23;
@ -734,7 +734,7 @@ namespace tut
"<key>cam</key><real>1.23</real>" "<key>cam</key><real>1.23</real>"
"</map></llsd>", "</map></llsd>",
v, v,
v.size() + 1); static_cast<S32>(v.size()) + 1);
v.clear(); v.clear();
v["amy"] = 23; v["amy"] = 23;
@ -751,7 +751,7 @@ namespace tut
"<key>cam</key><real>1.23</real>" "<key>cam</key><real>1.23</real>"
"</map></llsd>", "</map></llsd>",
v, v,
v.size() + 1); static_cast<S32>(v.size()) + 1);
v.clear(); v.clear();
v[0] = 23; v[0] = 23;
@ -766,7 +766,7 @@ namespace tut
"<real>1.23</real>" "<real>1.23</real>"
"</array></llsd>", "</array></llsd>",
v, v,
v.size() + 1); static_cast<S32>(v.size()) + 1);
v.clear(); v.clear();
v[0] = 23; v[0] = 23;
@ -782,7 +782,7 @@ namespace tut
"<real>1.23</real>" "<real>1.23</real>"
"</array></llsd>", "</array></llsd>",
v, v,
v.size() + 1); static_cast<S32>(v.size()) + 1);
} }
template<> template<> template<> template<>
@ -1405,13 +1405,13 @@ namespace tut
uint32_t size = htonl(1); uint32_t size = htonl(1);
memcpy(&vec[1], &size, sizeof(uint32_t)); memcpy(&vec[1], &size, sizeof(uint32_t));
vec.push_back('k'); vec.push_back('k');
int key_size_loc = vec.size(); auto key_size_loc = vec.size();
size = htonl(1); // 1 too short size = htonl(1); // 1 too short
vec.resize(vec.size() + 4); vec.resize(vec.size() + 4);
memcpy(&vec[key_size_loc], &size, sizeof(uint32_t)); memcpy(&vec[key_size_loc], &size, sizeof(uint32_t));
vec.push_back('a'); vec.push_back('m'); vec.push_back('y'); vec.push_back('a'); vec.push_back('m'); vec.push_back('y');
vec.push_back('i'); vec.push_back('i');
int integer_loc = vec.size(); auto integer_loc = vec.size();
vec.resize(vec.size() + 4); vec.resize(vec.size() + 4);
uint32_t val_int = htonl(23); uint32_t val_int = htonl(23);
memcpy(&vec[integer_loc], &val_int, sizeof(uint32_t)); memcpy(&vec[integer_loc], &val_int, sizeof(uint32_t));
@ -1473,7 +1473,7 @@ namespace tut
memcpy(&vec[1], &size, sizeof(uint32_t)); memcpy(&vec[1], &size, sizeof(uint32_t));
vec.push_back('"'); vec.push_back('a'); vec.push_back('m'); vec.push_back('"'); vec.push_back('a'); vec.push_back('m');
vec.push_back('y'); vec.push_back('"'); vec.push_back('i'); 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); vec.resize(vec.size() + 4);
uint32_t val_int = htonl(23); uint32_t val_int = htonl(23);
memcpy(&vec[integer_loc], &val_int, sizeof(uint32_t)); memcpy(&vec[integer_loc], &val_int, sizeof(uint32_t));

View File

@ -413,30 +413,30 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode
// If not, we assume http pipelining havng gone out of sync. If yes, yield a 503 status and switch // If not, we assume http pipelining havng gone out of sync. If yes, yield a 503 status and switch
// pipelining off. // pipelining off.
bool bFailed = false; bool bFailed = false;
if( op->mXLLURL.size() ) if (op->mXLLURL.size())
{ {
std::string strURI = op->mReqURL; std::string strURI = op->mReqURL;
int i = strURI.find( "://" ); size_t i = strURI.find("://");
if( i > 0 ) if (i != std::string::npos)
i = strURI.find( "/", i+3 ); i = strURI.find("/", i + 3);
if( i > 0 ) if (i != std::string::npos)
strURI = strURI.substr( i ); strURI = strURI.substr(i);
if( strURI != op->mXLLURL ) if (strURI != op->mXLLURL)
{ {
LL_WARNS() << "HTTP pipelining out of sync! Asked for: " << strURI << " got " << op->mXLLURL << LL_ENDL; LL_WARNS() << "HTTP pipelining out of sync! Asked for: " << strURI << " got " << op->mXLLURL << LL_ENDL;
op->mStatus = HttpStatus(HTTP_SERVICE_UNAVAILABLE); op->mStatus = HttpStatus(HTTP_SERVICE_UNAVAILABLE);
bFailed = true; bFailed = true;
} }
} }
if ( !bFailed && (op->mReqOffset || op->mReqLength) ) if (!bFailed && (op->mReqOffset || op->mReqLength))
{ {
if( op->mReqOffset != op->mReplyOffset || ( op->mReqLength && op->mReqLength < op->mReplyLength ) ) if (op->mReqOffset != op->mReplyOffset || (op->mReqLength && op->mReqLength < op->mReplyLength))
{ {
std::stringstream strm; std::stringstream strm;
strm << "HTTP pipelining possibly out of sync, request wanted: " << op->mReqOffset << "-"; strm << "HTTP pipelining possibly out of sync, request wanted: " << op->mReqOffset << "-";
if( op->mReqLength ) if (op->mReqLength)
strm << op->mReqLength + op->mReqLength -1; strm << op->mReqLength + op->mReqLength -1;
strm << " got: " << op->mReplyOffset << "-" << op->mReplyOffset+op->mReplyLength-1; strm << " got: " << op->mReplyOffset << "-" << op->mReplyOffset+op->mReplyLength-1;
strm << " url: " << op->mReqURL; strm << " url: " << op->mReqURL;
@ -445,19 +445,19 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode
bFailed = true; bFailed = true;
} }
} }
if( bFailed ) if (bFailed)
{ {
HttpPolicy & policy(mService->getPolicy()); HttpPolicy & policy(mService->getPolicy());
for( int i = 0; i < mPolicyCount; ++ i ) for (int i = 0; i < mPolicyCount; ++ i)
{ {
HttpPolicyClass & options(policy.getClassOptions(i)); HttpPolicyClass & options(policy.getClassOptions(i));
long lVal; long lVal;
if( options.get( LLCore::HttpRequest::PO_PIPELINING_DEPTH, &lVal ) && lVal ) if (options.get(LLCore::HttpRequest::PO_PIPELINING_DEPTH, &lVal) && lVal)
{ {
options.set( LLCore::HttpRequest::PO_PIPELINING_DEPTH, 0 ); options.set(LLCore::HttpRequest::PO_PIPELINING_DEPTH, 0);
mDirtyPolicy[ i ] = true; mDirtyPolicy[i] = true;
policyUpdated( i ); policyUpdated(i);
} }
} }
} }
@ -496,7 +496,7 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode
int HttpLibcurl::getActiveCount() const int HttpLibcurl::getActiveCount() const
{ {
return mActiveOps.size(); return static_cast<int>(mActiveOps.size());
} }

View File

@ -269,7 +269,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request)
if (mReplyOffset || mReplyLength) if (mReplyOffset || mReplyLength)
{ {
// Got an explicit offset/length in response // Got an explicit offset/length in response
response->setRange(mReplyOffset, mReplyLength, mReplyFullLength); response->setRange(mReplyOffset, static_cast<unsigned int>(mReplyLength), static_cast<unsigned int>(mReplyFullLength));
} }
response->setContentType(mReplyConType); response->setContentType(mReplyConType);
response->setRetries(mPolicyRetries, mPolicy503Retries); response->setRetries(mPolicyRetries, mPolicy503Retries);
@ -330,7 +330,7 @@ HttpStatus HttpOpRequest::setupGetByteRange(HttpRequest::policy_t policy_id,
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
setupCommon(policy_id, url, NULL, options, headers); setupCommon(policy_id, url, NULL, options, headers);
mReqMethod = HOR_GET; mReqMethod = HOR_GET;
mReqOffset = offset; mReqOffset = static_cast<off_t>(offset);
mReqLength = len; mReqLength = len;
if (offset || len) if (offset || len)
{ {
@ -625,7 +625,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
long data_size(0); long data_size(0);
if (mReqBody) if (mReqBody)
{ {
data_size = mReqBody->size(); data_size = static_cast<long>(mReqBody->size());
} }
check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast<void *>(NULL)); check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast<void *>(NULL));
check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size); check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size);
@ -636,13 +636,14 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
case HOR_PATCH: case HOR_PATCH:
check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "PATCH"); check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "PATCH");
// fall through. The rest is the same as PUT // fall through. The rest is the same as PUT
[[fallthrough]];
case HOR_PUT: case HOR_PUT:
{ {
check_curl_easy_setopt(mCurlHandle, CURLOPT_UPLOAD, 1); check_curl_easy_setopt(mCurlHandle, CURLOPT_UPLOAD, 1);
long data_size(0); long data_size(0);
if (mReqBody) if (mReqBody)
{ {
data_size = mReqBody->size(); data_size = static_cast<long>(mReqBody->size());
} }
check_curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size); check_curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size);
mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:"); mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:");

View File

@ -98,7 +98,7 @@ HttpPolicy::~HttpPolicy()
HttpRequest::policy_t HttpPolicy::createPolicyClass() HttpRequest::policy_t HttpPolicy::createPolicyClass()
{ {
const HttpRequest::policy_t policy_class(mClasses.size()); const HttpRequest::policy_t policy_class(static_cast<HttpRequest::policy_t>(mClasses.size()));
if (policy_class >= HTTP_POLICY_CLASS_LIMIT) if (policy_class >= HTTP_POLICY_CLASS_LIMIT)
{ {
return HttpRequest::INVALID_POLICY_ID; return HttpRequest::INVALID_POLICY_ID;
@ -433,8 +433,8 @@ int HttpPolicy::getReadyCount(HttpRequest::policy_t policy_class) const
{ {
if (policy_class < mClasses.size()) if (policy_class < mClasses.size())
{ {
return (mClasses[policy_class]->mReadyQueue.size() return static_cast<int>((mClasses[policy_class]->mReadyQueue.size()
+ mClasses[policy_class]->mRetryQueue.size()); + mClasses[policy_class]->mRetryQueue.size()));
} }
return 0; return 0;
} }

View File

@ -519,7 +519,7 @@ void WorkingSet::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * r
{ {
// More success // More success
LLCore::BufferArray * data(response->getBody()); LLCore::BufferArray * data(response->getBody());
mByteCount += data ? data->size() : 0; mByteCount += data ? static_cast<long>(data->size()) : 0L;
++mSuccesses; ++mSuccesses;
} }
else else
@ -602,7 +602,7 @@ void WorkingSet::loadAssetUuids(FILE * in)
mAssets.push_back(asset); mAssets.push_back(asset);
} }
} }
mRemaining = mLimit = mAssets.size(); mRemaining = mLimit = static_cast<int>(mAssets.size());
} }

View File

@ -146,7 +146,7 @@ std::string getStartupStateFromLog(std::string& sllog)
std::string startup_state = "STATE_FIRST"; std::string startup_state = "STATE_FIRST";
std::string startup_token = "Startup state changing from "; std::string startup_token = "Startup state changing from ";
size_t index = sllog.rfind(startup_token); auto index = sllog.rfind(startup_token);
if (index != std::string::npos || index + startup_token.length() > sllog.length()) { if (index != std::string::npos || index + startup_token.length() > sllog.length()) {
return startup_state; return startup_state;
} }

View File

@ -693,7 +693,7 @@ std::string LLDir::getBaseFileName(const std::string& filepath, bool strip_exten
std::string LLDir::getDirName(const std::string& filepath) const std::string LLDir::getDirName(const std::string& filepath) const
{ {
std::size_t offset = filepath.find_last_of(getDirDelimiter()); 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); std::string dirname = filepath.substr(0, len);
return dirname; return dirname;
} }
@ -948,8 +948,8 @@ std::string LLDir::getScrubbedFileName(const std::string uncleanFileName)
// replace any illegal file chars with and underscore '_' // replace any illegal file chars with and underscore '_'
for( unsigned int i = 0; i < illegalChars.length(); i++ ) for( unsigned int i = 0; i < illegalChars.length(); i++ )
{ {
int j = -1; std::string::size_type j = -1;
while((j = name.find(illegalChars[i])) > -1) while((j = name.find(illegalChars[i])) > std::string::npos)
{ {
name[j] = '_'; name[j] = '_';
} }

View File

@ -232,7 +232,7 @@ LLDir_Win32::LLDir_Win32()
{ {
w_str[size] = '\0'; w_str[size] = '\0';
mExecutablePathAndName = utf16str_to_utf8str(llutf16string(w_str)); 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) if (path_end != std::string::npos)
{ {
mExecutableDir = mExecutablePathAndName.substr(0, path_end); mExecutableDir = mExecutablePathAndName.substr(0, path_end);

View File

@ -212,7 +212,7 @@ bool LLFileSystem::read(U8* buffer, S32 bytes)
{ {
if (fseek(file, mPosition, SEEK_SET) == 0) if (fseek(file, mPosition, SEEK_SET) == 0)
{ {
mBytesRead = fread(buffer, 1, bytes, file); mBytesRead = static_cast<S32>(fread(buffer, 1, bytes, file));
fclose(file); fclose(file);
mPosition += mBytesRead; mPosition += mBytesRead;
@ -306,7 +306,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
LLFILE* ofs = LLFile::fopen(filename, "a+b"); LLFILE* ofs = LLFile::fopen(filename, "a+b");
if (ofs) if (ofs)
{ {
S32 bytes_written = fwrite(buffer, 1, bytes, ofs); S32 bytes_written = static_cast<S32>(fwrite(buffer, 1, bytes, ofs));
mPosition = ftell(ofs); mPosition = ftell(ofs);
fclose(ofs); fclose(ofs);
success = (bytes_written == bytes); success = (bytes_written == bytes);
@ -319,7 +319,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
{ {
if (fseek(ofs, mPosition, SEEK_SET) == 0) if (fseek(ofs, mPosition, SEEK_SET) == 0)
{ {
S32 bytes_written = fwrite(buffer, 1, bytes, ofs); S32 bytes_written = static_cast<S32>(fwrite(buffer, 1, bytes, ofs));
mPosition = ftell(ofs); mPosition = ftell(ofs);
fclose(ofs); fclose(ofs);
success = (bytes_written == bytes); success = (bytes_written == bytes);
@ -330,7 +330,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
ofs = LLFile::fopen(filename, "wb"); ofs = LLFile::fopen(filename, "wb");
if (ofs) if (ofs)
{ {
S32 bytes_written = fwrite(buffer, 1, bytes, ofs); S32 bytes_written = static_cast<S32>(fwrite(buffer, 1, bytes, ofs));
mPosition = ftell(ofs); mPosition = ftell(ofs);
fclose(ofs); fclose(ofs);
success = (bytes_written == bytes); success = (bytes_written == bytes);
@ -342,7 +342,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
LLFILE* ofs = LLFile::fopen(filename, "wb"); LLFILE* ofs = LLFile::fopen(filename, "wb");
if (ofs) if (ofs)
{ {
S32 bytes_written = fwrite(buffer, 1, bytes, ofs); S32 bytes_written = static_cast<S32>(fwrite(buffer, 1, bytes, ofs));
mPosition = ftell(ofs); mPosition = ftell(ofs);
fclose(ofs); fclose(ofs);
success = (bytes_written == bytes); success = (bytes_written == bytes);

View File

@ -45,7 +45,7 @@ void LLLFSThread::initClass(bool local_is_threaded)
//static //static
S32 LLLFSThread::updateClass(U32 ms_elapsed) S32 LLLFSThread::updateClass(U32 ms_elapsed)
{ {
return sLocal->update((F32)ms_elapsed); return static_cast<S32>(sLocal->update((F32)ms_elapsed));
} }
//static //static

View File

@ -476,7 +476,7 @@ bool LLImageDXT::convertToDXR()
// virtual // virtual
S32 LLImageDXT::calcHeaderSize() S32 LLImageDXT::calcHeaderSize()
{ {
return llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t)); return static_cast<S32>(llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t)));
} }
// virtual // virtual

View File

@ -1195,7 +1195,7 @@ bool LLImageTGA::decodeAndProcess( LLImageRaw* raw_image, F32 domain, F32 weight
// Reads a .tga file and creates an LLImageTGA with its data. // Reads a .tga file and creates an LLImageTGA with its data.
bool LLImageTGA::loadFile( const std::string& path ) bool LLImageTGA::loadFile( const std::string& path )
{ {
S32 len = path.size(); auto len = path.size();
if( len < 5 ) if( len < 5 )
{ {
return false; return false;
@ -1238,7 +1238,7 @@ bool LLImageTGA::loadFile( const std::string& path )
return false; return false;
} }
S32 bytes_read = fread(buffer, 1, file_size, file); S32 bytes_read = static_cast<S32>(fread(buffer, 1, file_size, file));
if( bytes_read != file_size ) if( bytes_read != file_size )
{ {
deleteData(); deleteData();

View File

@ -328,10 +328,10 @@ bool LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSiz
mWriteInfoPtr = png_create_info_struct(mWritePngPtr); mWriteInfoPtr = png_create_info_struct(mWritePngPtr);
// Setup write function // Setup write function
PngDataInfo dataPtr; PngDataInfo dataPtr{};
dataPtr.mData = dest; dataPtr.mData = dest;
dataPtr.mOffset = 0; dataPtr.mOffset = 0;
dataPtr.mDataSize = destSize; dataPtr.mDataSize = static_cast<S32>(destSize);
png_set_write_fn(mWritePngPtr, &dataPtr, &writeDataCallback, &writeFlush); png_set_write_fn(mWritePngPtr, &dataPtr, &writeDataCallback, &writeFlush);
// Setup image params // Setup image params

View File

@ -463,7 +463,7 @@ namespace
// Trim extra tracks. // Trim extra tracks.
while (value.size() > LLSettingsDay::TRACK_MAX) while (value.size() > LLSettingsDay::TRACK_MAX)
{ {
value.erase(value.size() - 1); value.erase(static_cast<LLSD::Integer>(value.size()) - 1);
} }
S32 framecount(0); S32 framecount(0);
@ -512,7 +512,7 @@ namespace
} }
int waterTracks = value[0].size(); int waterTracks = static_cast<int>(value[0].size());
int skyTracks = framecount - waterTracks; int skyTracks = framecount - waterTracks;
if (waterTracks < 1) if (waterTracks < 1)

View File

@ -60,7 +60,7 @@ public:
inline operator bool() const { return static_cast<const bool&>(m_bool); } inline operator bool() const { return static_cast<const bool&>(m_bool); }
private: private:
int m_bool; int m_bool{ 0 };
}; };
#if LL_WINDOWS #if LL_WINDOWS
@ -118,7 +118,7 @@ public:
} }
private: private:
LLQuad mQ; LLQuad mQ{};
}; };
#endif //LL_SIMD_TYPES_H #endif //LL_SIMD_TYPES_H

View File

@ -185,7 +185,7 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<LLSphere>& sphere_list)
// TODO -- improve the accuracy for small collections of spheres // TODO -- improve the accuracy for small collections of spheres
LLSphere bounding_sphere( LLVector3(0.f, 0.f, 0.f), 0.f ); 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) if (1 == sphere_count)
{ {
// trivial case -- single sphere // trivial case -- single sphere

View File

@ -57,7 +57,7 @@ public:
virtual bool remove(T* data); virtual bool remove(T* data);
virtual void notifyRemoval(T* data); virtual void notifyRemoval(T* data);
virtual U32 hasListeners() const { return !mListeners.empty(); } virtual U32 hasListeners() const { return !mListeners.empty(); }
virtual U32 getListenerCount() const { return mListeners.size(); } virtual U32 getListenerCount() const { return static_cast<U32>(mListeners.size()); }
virtual LLTreeListener<T>* getListener(U32 index) const virtual LLTreeListener<T>* getListener(U32 index) const
{ {
if (index < mListeners.size()) if (index < mListeners.size())

View File

@ -322,7 +322,7 @@ public:
inline operator LLQuad() const; inline operator LLQuad() const;
private: private:
LLQuad mQ; LLQuad mQ{};
}; };
inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p) inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p)

View File

@ -120,7 +120,7 @@ public:
private: private:
LLQuad mQ; LLQuad mQ{};
}; };
#endif //LL_VECTOR4ALOGICAL_H #endif //LL_VECTOR4ALOGICAL_H

View File

@ -2412,7 +2412,7 @@ bool LLVolume::unpackVolumeFaces(U8* in_data, S32 size)
bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl) bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
{ {
{ {
U32 face_count = mdl.size(); auto face_count = mdl.size();
if (face_count == 0) if (face_count == 0)
{ //no faces unpacked, treat as failed decode { //no faces unpacked, treat as failed decode
@ -2444,7 +2444,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
LLSD::Binary idx = mdl[i]["TriangleList"]; LLSD::Binary idx = mdl[i]["TriangleList"];
//copy out indices //copy out indices
S32 num_indices = idx.size() / 2; auto num_indices = idx.size() / 2;
const S32 indices_to_discard = num_indices % 3; const S32 indices_to_discard = num_indices % 3;
if (indices_to_discard > 0) if (indices_to_discard > 0)
{ {
@ -2452,7 +2452,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; 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; num_indices -= indices_to_discard;
} }
face.resizeIndices(num_indices); face.resizeIndices(static_cast<S32>(num_indices));
if (num_indices > 2 && !face.mIndices) if (num_indices > 2 && !face.mIndices)
{ {
@ -2473,7 +2473,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
} }
//copy out vertices //copy out vertices
U32 num_verts = pos.size()/(3*2); U32 num_verts = static_cast<U32>(pos.size())/(3*2);
face.resizeVertices(num_verts); face.resizeVertices(num_verts);
if (num_verts > 0 && !face.mPositions) if (num_verts > 0 && !face.mPositions)
@ -5064,13 +5064,13 @@ void LLVolumeFace::remap()
{ {
// Generate a remap buffer // Generate a remap buffer
std::vector<unsigned int> remap(mNumVertices); std::vector<unsigned int> remap(mNumVertices);
S32 remap_vertices_count = LLMeshOptimizer::generateRemapMultiU16(&remap[0], S32 remap_vertices_count = static_cast<S32>(LLMeshOptimizer::generateRemapMultiU16(&remap[0],
mIndices, mIndices,
mNumIndices, mNumIndices,
mPositions, mPositions,
mNormals, mNormals,
mTexCoords, mTexCoords,
mNumVertices); mNumVertices));
// Allocate new buffers // Allocate new buffers
S32 size = ((mNumIndices * sizeof(U16)) + 0xF) & ~0xF; S32 size = ((mNumIndices * sizeof(U16)) + 0xF) & ~0xF;
@ -5603,7 +5603,7 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
U32 stream_count = data.w.empty() ? 4 : 5; 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<S32>(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count));
if (vert_count < 65535 && vert_count != 0) if (vert_count < 65535 && vert_count != 0)
{ {
@ -6695,8 +6695,8 @@ void LLVolumeFace::pushIndex(const U16& idx)
void LLVolumeFace::fillFromLegacyData(std::vector<LLVolumeFace::VertexData>& v, std::vector<U16>& idx) void LLVolumeFace::fillFromLegacyData(std::vector<LLVolumeFace::VertexData>& v, std::vector<U16>& idx)
{ {
resizeVertices(v.size()); resizeVertices(static_cast<S32>(v.size()));
resizeIndices(idx.size()); resizeIndices(static_cast<S32>(idx.size()));
for (U32 i = 0; i < v.size(); ++i) for (U32 i = 0; i < v.size(); ++i)
{ {

View File

@ -1022,7 +1022,7 @@ public:
U8 getProfileType() const { return mParams.getProfileParams().getCurveType(); } U8 getProfileType() const { return mParams.getProfileParams().getCurveType(); }
U8 getPathType() const { return mParams.getPathParams().getCurveType(); } U8 getPathType() const { return mParams.getPathParams().getCurveType(); }
S32 getNumFaces() const; S32 getNumFaces() const;
S32 getNumVolumeFaces() const { return mVolumeFaces.size(); } S32 getNumVolumeFaces() const { return static_cast<S32>(mVolumeFaces.size()); }
F32 getDetail() const { return mDetail; } F32 getDetail() const { return mDetail; }
F32 getSurfaceArea() const { return mSurfaceArea; } F32 getSurfaceArea() const { return mSurfaceArea; }
const LLVolumeParams& getParams() const { return mParams; } const LLVolumeParams& getParams() const { return mParams; }

View File

@ -1125,7 +1125,7 @@ S32 LLAssetStorage::getNumPending(LLAssetStorage::ERequestType rt) const
S32 num_pending = -1; S32 num_pending = -1;
if (requests) if (requests)
{ {
num_pending = requests->size(); num_pending = static_cast<S32>(requests->size());
} }
return num_pending; return num_pending;
} }

View File

@ -255,7 +255,7 @@ void LLAvatarNameCache::handleAvNameCacheSuccess(const LLSD &data, const LLSD &h
// Same logic as error response case // Same logic as error response case
const LLSD& unresolved_agents = data["bad_ids"]; const LLSD& unresolved_agents = data["bad_ids"];
S32 num_unresolved = unresolved_agents.size(); auto num_unresolved = unresolved_agents.size();
if (num_unresolved > 0) if (num_unresolved > 0)
{ {
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result " << num_unresolved << " unresolved ids; " LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result " << num_unresolved << " unresolved ids; "

View File

@ -616,13 +616,13 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
{ {
//boost::regexp was showing up in the crashreporter, so doing //boost::regexp was showing up in the crashreporter, so doing
//painfully manual parsing using substr. LF //painfully manual parsing using substr. LF
S32 open_paren = complete_name.rfind(" ("); auto open_paren = complete_name.rfind(" (");
S32 close_paren = complete_name.rfind(')'); auto close_paren = complete_name.rfind(')');
if (open_paren != std::string::npos && if (open_paren != std::string::npos &&
close_paren == complete_name.length()-1) 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); std::string legacy_name = complete_name.substr(open_paren+2, length);
if (legacy_name.length() > 0) if (legacy_name.length() > 0)
@ -631,7 +631,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
LLStringUtil::toUpper(cap_letter); LLStringUtil::toUpper(cap_letter);
legacy_name = cap_letter + legacy_name.substr(1); legacy_name = cap_letter + legacy_name.substr(1);
S32 separator = legacy_name.find('.'); auto separator = legacy_name.find('.');
if (separator != std::string::npos) if (separator != std::string::npos)
{ {

View File

@ -801,8 +801,8 @@ void LLCircuitData::checkPacketInID(TPACKETID id, bool receive_resent)
void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys) void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
{ {
F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds(); F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds();
S32 count = mPingSet.size(); size_t count = mPingSet.size();
S32 cur = 0; size_t cur = 0;
// Only process each circuit once at most, stop processing if no circuits // Only process each circuit once at most, stop processing if no circuits
while((cur < count) && !mPingSet.empty()) while((cur < count) && !mPingSet.empty())

View File

@ -87,7 +87,7 @@ public:
/// ///
inline S32 count() const inline S32 count() const
{ {
return countPending() + countActive(); return static_cast<S32>(countPending() + countActive());
} }
void close(); void close();

View File

@ -237,7 +237,7 @@ bool LLDataPacker::unpackUUIDs(LLUUID *values, S32 count, const char *name)
bool LLDataPackerBinaryBuffer::packString(const std::string& value, const char *name) bool LLDataPackerBinaryBuffer::packString(const std::string& value, const char *name)
{ {
S32 length = value.length()+1; S32 length = static_cast<S32>(value.length()) + 1;
if (!verifyLength(length, name)) if (!verifyLength(length, name))
{ {
@ -740,7 +740,7 @@ bool LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n
} }
else else
{ {
numCopied = value.length() + 1; /*Flawfinder: ignore*/ numCopied = static_cast<S32>(value.length()) + 1; /*Flawfinder: ignore*/
} }
// snprintf returns number of bytes that would have been written // snprintf returns number of bytes that would have been written

View File

@ -283,12 +283,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
if(!buffer.empty()) if(!buffer.empty())
{ {
// *TODO: convert to LLBase64 // *TODO: convert to LLBase64
int b64_buffer_length = apr_base64_encode_len(buffer.size()); int b64_buffer_length = apr_base64_encode_len(static_cast<int>(buffer.size()));
char* b64_buffer = new char[b64_buffer_length]; char* b64_buffer = new char[b64_buffer_length];
b64_buffer_length = apr_base64_encode_binary( b64_buffer_length = apr_base64_encode_binary(
b64_buffer, b64_buffer,
&buffer[0], &buffer[0],
buffer.size()); static_cast<int>(buffer.size()));
ostr.write(b64_buffer, b64_buffer_length - 1); ostr.write(b64_buffer, b64_buffer_length - 1);
delete[] b64_buffer; delete[] b64_buffer;
} }

View File

@ -494,7 +494,7 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
LLChangeChannel change(channels.in(), channels.out()); LLChangeChannel change(channels.in(), channels.out());
std::for_each(buffer->beginSegment(), buffer->endSegment(), change); std::for_each(buffer->beginSegment(), buffer->endSegment(), change);
std::string header = ostr.str(); 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<S32>(header.size()));
PUMP_DEBUG; PUMP_DEBUG;
return STATUS_DONE; return STATUS_DONE;
} }

View File

@ -352,7 +352,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl(
PUMP_DEBUG; PUMP_DEBUG;
len = READ_BUFFER_SIZE; len = READ_BUFFER_SIZE;
status = apr_socket_recv(mSource->getSocket(), read_buf, &len); 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<S32>(len));
} while((APR_SUCCESS == status) && (READ_BUFFER_SIZE == len)); } while((APR_SUCCESS == status) && (READ_BUFFER_SIZE == len));
LL_DEBUGS() << "socket read status: " << status << LL_ENDL; LL_DEBUGS() << "socket read status: " << status << LL_ENDL;
LLIOPipe::EStatus rv = STATUS_OK; LLIOPipe::EStatus rv = STATUS_OK;

View File

@ -273,7 +273,7 @@ bool LLMail::send(
std::string good_string = "\n..\n"; std::string good_string = "\n..\n";
while (1) while (1)
{ {
int index = message.find(bad_string); auto index = message.find(bad_string);
if (index == std::string::npos) break; if (index == std::string::npos) break;
message.replace(index, bad_string.size(), good_string); message.replace(index, bad_string.size(), good_string);
} }

View File

@ -123,7 +123,7 @@ S32 LLProxy::proxyHandshake(LLHost proxy)
// The server has requested a username/password combination // The server has requested a username/password combination
std::string socks_username(getSocksUser()); std::string socks_username(getSocksUser());
std::string socks_password(getSocksPwd()); std::string socks_password(getSocksPwd());
U32 request_size = socks_username.size() + socks_password.size() + 3; U32 request_size = static_cast<S32>(socks_username.size() + socks_password.size() + 3);
char * password_auth = new char[request_size]; char * password_auth = new char[request_size];
password_auth[0] = 0x01; password_auth[0] = 0x01;
password_auth[1] = (char)(socks_username.size()); password_auth[1] = (char)(socks_username.size());

View File

@ -818,7 +818,7 @@ void LLPumpIO::rebuildPollset()
running_chains_t::iterator run_end = mRunningChains.end(); running_chains_t::iterator run_end = mRunningChains.end();
for(; run_it != run_end; ++run_it) for(; run_it != run_end; ++run_it)
{ {
size += (*run_it).mDescriptors.size(); size += static_cast<U32>((*run_it).mDescriptors.size());
} }
//LL_DEBUGS() << "found " << size << " descriptors." << LL_ENDL; //LL_DEBUGS() << "found " << size << " descriptors." << LL_ENDL;
if(size) if(size)

View File

@ -28,83 +28,83 @@
#define LL_LLREGIONFLAGS_H #define LL_LLREGIONFLAGS_H
// Can you be hurt here? Should health be on? // 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? // 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? // 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? // 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? // 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? // 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, // Can't change the terrain heightfield, even on owned parcels,
// but can plant trees and grass. // 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. // 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 // 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 constexpr U64 REGION_FLAGS_SKIP_COLLISIONS = (1ULL << 12); // Pin all non agent rigid bodies
const U64 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13); constexpr U64 REGION_FLAGS_SKIP_SCRIPTS = (1ULL << 13);
const U64 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics constexpr U64 REGION_FLAGS_SKIP_PHYSICS = (1ULL << 14); // Skip all physics
const U64 REGION_FLAGS_EXTERNALLY_VISIBLE = (1 << 15); constexpr U64 REGION_FLAGS_EXTERNALLY_VISIBLE = (1ULL << 15);
const U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1 << 16); constexpr U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1ULL << 16);
const U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1 << 17); constexpr U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1ULL << 17);
const U64 REGION_FLAGS_BLOCK_DWELL = (1 << 18); constexpr U64 REGION_FLAGS_BLOCK_DWELL = (1ULL << 18);
// Is flight allowed? // Is flight allowed?
const U64 REGION_FLAGS_BLOCK_FLY = (1 << 19); constexpr U64 REGION_FLAGS_BLOCK_FLY = (1ULL << 19);
// Is direct teleport (p2p) allowed? // 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 // Is there an administrative override on scripts in the region at the
// moment. This is the similar skip scripts, except this flag is // moment. This is the similar skip scripts, except this flag is
// presisted in the database on an estate level. // 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); constexpr U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1ULL << 29);
const U64 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30); 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 | constexpr U64 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
REGION_FLAGS_ALLOW_SET_HOME | REGION_FLAGS_ALLOW_SET_HOME |
REGION_FLAGS_ALLOW_PARCEL_CHANGES | REGION_FLAGS_ALLOW_PARCEL_CHANGES |
REGION_FLAGS_ALLOW_VOICE; REGION_FLAGS_ALLOW_VOICE;
const U64 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT; constexpr U64 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT;
const U64 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK constexpr U64 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK |
| REGION_FLAGS_ALLOW_SET_HOME; REGION_FLAGS_ALLOW_SET_HOME;
const U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE constexpr U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE |
| REGION_FLAGS_SUN_FIXED REGION_FLAGS_SUN_FIXED |
| REGION_FLAGS_DENY_ANONYMOUS REGION_FLAGS_DENY_ANONYMOUS |
| REGION_FLAGS_DENY_AGEUNVERIFIED; REGION_FLAGS_DENY_AGEUNVERIFIED;
inline bool is_flag_set(U64 flags, U64 flag) inline bool is_flag_set(U64 flags, U64 flag)
{ {
@ -133,81 +133,77 @@ inline U64 unset_prelude_flags(U64 flags)
} }
// Region protocols // 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. // 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 constexpr U32 ESTATE_ALL = 0; // will not match in db, reserved key for logic
const U32 ESTATE_MAINLAND = 1; constexpr U32 ESTATE_MAINLAND = 1;
const U32 ESTATE_ORIENTATION = 2; constexpr U32 ESTATE_ORIENTATION = 2;
const U32 ESTATE_INTERNAL = 3; constexpr U32 ESTATE_INTERNAL = 3;
const U32 ESTATE_SHOWCASE = 4; constexpr U32 ESTATE_SHOWCASE = 4;
const U32 ESTATE_TEEN = 5; constexpr U32 ESTATE_TEEN = 5;
const U32 ESTATE_LAST_LINDEN = 5; // last linden owned/managed estate constexpr U32 ESTATE_LAST_LINDEN = 5; // last linden owned/managed estate
// for EstateOwnerRequest, setaccess message // for EstateOwnerRequest, setaccess message
const U32 ESTATE_ACCESS_ALLOWED_AGENTS = 1 << 0; constexpr U32 ESTATE_ACCESS_ALLOWED_AGENTS = 1 << 0;
const U32 ESTATE_ACCESS_ALLOWED_GROUPS = 1 << 1; constexpr U32 ESTATE_ACCESS_ALLOWED_GROUPS = 1 << 1;
const U32 ESTATE_ACCESS_BANNED_AGENTS = 1 << 2; constexpr U32 ESTATE_ACCESS_BANNED_AGENTS = 1 << 2;
const U32 ESTATE_ACCESS_MANAGERS = 1 << 3; constexpr U32 ESTATE_ACCESS_MANAGERS = 1 << 3;
//maximum number of access list entries we can fit in one packet //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 // 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 constexpr U32 ESTATE_ACCESS_ALL = ESTATE_ACCESS_ALLOWED_AGENTS
| ESTATE_ACCESS_ALLOWED_GROUPS | ESTATE_ACCESS_ALLOWED_GROUPS
| ESTATE_ACCESS_BANNED_AGENTS | ESTATE_ACCESS_BANNED_AGENTS
| ESTATE_ACCESS_MANAGERS; | ESTATE_ACCESS_MANAGERS;
// for EstateOwnerRequest, estateaccessdelta, estateexperiencedelta messages // for EstateOwnerRequest, estateaccessdelta, estateexperiencedelta messages
const U32 ESTATE_ACCESS_APPLY_TO_ALL_ESTATES = 1U << 0; constexpr 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_MANAGED_ESTATES = 1U << 1;
const U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1U << 2; constexpr U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1U << 2;
const U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1U << 3; constexpr U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1U << 3;
const U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1U << 4; constexpr U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1U << 4;
const U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1U << 5; constexpr U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1U << 5;
const U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1U << 6; constexpr U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1U << 6;
const U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1U << 7; constexpr U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1U << 7;
const U32 ESTATE_ACCESS_MANAGER_ADD = 1U << 8; constexpr U32 ESTATE_ACCESS_MANAGER_ADD = 1U << 8;
const U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9; constexpr U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9;
const U32 ESTATE_ACCESS_NO_REPLY = 1U << 10; constexpr U32 ESTATE_ACCESS_NO_REPLY = 1U << 10;
const U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11; constexpr U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11;
const S32 ESTATE_MAX_MANAGERS = 20; constexpr S32 ESTATE_MAX_MANAGERS = 20;
const S32 ESTATE_MAX_MANAGERS_OS = 15; // <FS:Ansariel> OpenSim constexpr S32 ESTATE_MAX_MANAGERS_OS = 15; // <FS:Ansariel> OpenSim
const S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access constexpr S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access
const S32 ESTATE_MAX_BANNED_IDS = 750; // max for banned constexpr S32 ESTATE_MAX_BANNED_IDS = 750; // max for banned
const S32 ESTATE_MAX_BANNED_IDS_OS = 500; // max for banned // <FS:Ansariel> OpenSim constexpr S32 ESTATE_MAX_BANNED_IDS_OS = 500; // max for banned // <FS:Ansariel> OpenSim
const S32 ESTATE_MAX_GROUP_IDS = (S32) ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET; constexpr S32 ESTATE_MAX_GROUP_IDS = (S32) ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET;
// 'Sim Wide Delete' flags // 'Sim Wide Delete' flags
const U32 SWD_OTHERS_LAND_ONLY = (1 << 0); constexpr U32 SWD_OTHERS_LAND_ONLY = (1 << 0);
const U32 SWD_ALWAYS_RETURN_OBJECTS = (1 << 1); constexpr U32 SWD_ALWAYS_RETURN_OBJECTS = (1 << 1);
const U32 SWD_SCRIPTED_ONLY = (1 << 2); constexpr U32 SWD_SCRIPTED_ONLY = (1 << 2);
// Controls experience key validity in the estate // Controls experience key validity in the estate
const U32 EXPERIENCE_KEY_TYPE_NONE = 0; constexpr U32 EXPERIENCE_KEY_TYPE_NONE = 0;
const U32 EXPERIENCE_KEY_TYPE_BLOCKED = 1; constexpr U32 EXPERIENCE_KEY_TYPE_BLOCKED = 1;
const U32 EXPERIENCE_KEY_TYPE_ALLOWED = 2; constexpr U32 EXPERIENCE_KEY_TYPE_ALLOWED = 2;
const U32 EXPERIENCE_KEY_TYPE_TRUSTED = 3; constexpr U32 EXPERIENCE_KEY_TYPE_TRUSTED = 3;
const U32 EXPERIENCE_KEY_TYPE_FIRST = EXPERIENCE_KEY_TYPE_BLOCKED; constexpr U32 EXPERIENCE_KEY_TYPE_FIRST = EXPERIENCE_KEY_TYPE_BLOCKED;
const U32 EXPERIENCE_KEY_TYPE_LAST = EXPERIENCE_KEY_TYPE_TRUSTED; constexpr U32 EXPERIENCE_KEY_TYPE_LAST = EXPERIENCE_KEY_TYPE_TRUSTED;
// //
const U32 ESTATE_EXPERIENCE_TRUSTED_ADD = 1U << 2; constexpr U32 ESTATE_EXPERIENCE_TRUSTED_ADD = 1U << 2;
const U32 ESTATE_EXPERIENCE_TRUSTED_REMOVE = 1U << 3; constexpr U32 ESTATE_EXPERIENCE_TRUSTED_REMOVE = 1U << 3;
const U32 ESTATE_EXPERIENCE_ALLOWED_ADD = 1U << 4; constexpr U32 ESTATE_EXPERIENCE_ALLOWED_ADD = 1U << 4;
const U32 ESTATE_EXPERIENCE_ALLOWED_REMOVE = 1U << 5; constexpr U32 ESTATE_EXPERIENCE_ALLOWED_REMOVE = 1U << 5;
const U32 ESTATE_EXPERIENCE_BLOCKED_ADD = 1U << 6; constexpr U32 ESTATE_EXPERIENCE_BLOCKED_ADD = 1U << 6;
const U32 ESTATE_EXPERIENCE_BLOCKED_REMOVE = 1U << 7; constexpr U32 ESTATE_EXPERIENCE_BLOCKED_REMOVE = 1U << 7;
const S32 ESTATE_MAX_EXPERIENCE_IDS = 8;
constexpr S32 ESTATE_MAX_EXPERIENCE_IDS = 8;
#endif #endif

View File

@ -242,7 +242,7 @@ void LLSDMessageReader::getString(const char *block, const char *var,
return; return;
} }
std::string data = getLLSD(mMessage, block, var, blocknum); std::string data = getLLSD(mMessage, block, var, blocknum);
S32 data_size = data.size(); auto data_size = data.size();
if (data_size >= buffer_size) if (data_size >= buffer_size)
{ {
data_size = buffer_size - 1; data_size = buffer_size - 1;
@ -261,7 +261,7 @@ void LLSDMessageReader::getString(const char *block, const char *var,
//virtual //virtual
S32 LLSDMessageReader::getNumberOfBlocks(const char *blockname) S32 LLSDMessageReader::getNumberOfBlocks(const char *blockname)
{ {
return mMessage[blockname].size(); return static_cast<S32>(mMessage[blockname].size());
} }
S32 getElementSize(const LLSD& llsd) S32 getElementSize(const LLSD& llsd)
@ -276,7 +276,7 @@ S32 getElementSize(const LLSD& llsd)
case LLSD::TypeReal: case LLSD::TypeReal:
return sizeof(F64); return sizeof(F64);
case LLSD::TypeString: case LLSD::TypeString:
return llsd.size(); return static_cast<S32>(llsd.size());
case LLSD::TypeUUID: case LLSD::TypeUUID:
return sizeof(LLUUID); return sizeof(LLUUID);
case LLSD::TypeDate: case LLSD::TypeDate:
@ -286,7 +286,7 @@ S32 getElementSize(const LLSD& llsd)
case LLSD::TypeBinary: case LLSD::TypeBinary:
{ {
std::vector<U8> data = llsd; std::vector<U8> data = llsd;
return data.size() * sizeof(U8); return static_cast<S32>(data.size() * sizeof(U8));
} }
case LLSD::TypeMap: case LLSD::TypeMap:
case LLSD::TypeArray: case LLSD::TypeArray:

View File

@ -45,7 +45,7 @@ void LLTemplateMessageDispatcher::dispatch(const std::string& msg_name,
LLHTTPNode::ResponsePtr responsep) LLHTTPNode::ResponsePtr responsep)
{ {
std::vector<U8> data = message["body"]["binary-template-data"].asBinary(); std::vector<U8> data = message["body"]["binary-template-data"].asBinary();
U32 size = data.size(); auto size = data.size();
if(size == 0) if(size == 0)
{ {
return; return;
@ -54,7 +54,7 @@ void LLTemplateMessageDispatcher::dispatch(const std::string& msg_name,
LLHost host; LLHost host;
host = gMessageSystem->getSender(); host = gMessageSystem->getSender();
bool validate_message = mTemplateMessageReader.validateMessage(&(data[0]), data.size(), host, true); bool validate_message = mTemplateMessageReader.validateMessage(&(data[0]), static_cast<S32>(size), host, true);
if (validate_message) if (validate_message)
{ {

View File

@ -317,7 +317,7 @@ S32 LLXfer_File::flush()
if (mFp) if (mFp)
{ {
S32 write_size = fwrite(mBuffer,1,mBufferLength,mFp); S32 write_size = static_cast<S32>(fwrite(mBuffer,1,mBufferLength,mFp));
if (write_size != mBufferLength) if (write_size != mBufferLength)
{ {
LL_WARNS("Xfer") << "Non-matching write size, requested " << mBufferLength LL_WARNS("Xfer") << "Non-matching write size, requested " << mBufferLength

View File

@ -2183,7 +2183,7 @@ S32 LLMessageSystem::sendError(
if (LLMessageConfig::getMessageFlavor(ERROR_MESSAGE_NAME) == if (LLMessageConfig::getMessageFlavor(ERROR_MESSAGE_NAME) ==
LLMessageConfig::TEMPLATE_FLAVOR) LLMessageConfig::TEMPLATE_FLAVOR)
{ {
S32 msg_size = temp.size() + mMessageBuilder->getMessageSize(); S32 msg_size = static_cast<S32>(temp.size()) + mMessageBuilder->getMessageSize();
if(msg_size >= ETHERNET_MTU_BYTES) if(msg_size >= ETHERNET_MTU_BYTES)
{ {
pack_data = false; pack_data = false;
@ -2191,7 +2191,7 @@ S32 LLMessageSystem::sendError(
} }
if(pack_data) if(pack_data)
{ {
addBinaryData("Data", (void*)temp.c_str(), temp.size()); addBinaryData("Data", (void*)temp.c_str(), static_cast<S32>(temp.size()));
} }
else else
{ {

View File

@ -371,7 +371,7 @@ bool LLPluginMessagePipe::pumpInput(F64 timeout)
void LLPluginMessagePipe::processInput(void) void LLPluginMessagePipe::processInput(void)
{ {
// Look for input delimiter(s) in the input buffer. // Look for input delimiter(s) in the input buffer.
int delim; size_t delim;
mInputMutex.lock(); mInputMutex.lock();
while((delim = mInput.find(MESSAGE_DELIMITER)) != std::string::npos) while((delim = mInput.find(MESSAGE_DELIMITER)) != std::string::npos)
{ {

View File

@ -450,7 +450,7 @@ bool LLPluginSharedMemory::create(size_t size)
NULL, // default security NULL, // default security
PAGE_READWRITE, // read/write access PAGE_READWRITE, // read/write access
0, // max. object size 0, // max. object size
mSize, // buffer size static_cast<DWORD>(mSize), // buffer size
mName.c_str()); // name of mapping object mName.c_str()); // name of mapping object
if(mImpl->mMapFile == NULL) if(mImpl->mMapFile == NULL)

View File

@ -306,7 +306,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(
// Don't share verts within the same tri, degenerate // Don't share verts within the same tri, degenerate
// //
U32 indx_size = indices.size(); U32 indx_size = static_cast<U32>(indices.size());
U32 verts_new_tri = indx_size % 3; U32 verts_new_tri = indx_size % 3;
if ((verts_new_tri < 1 || indices[indx_size - 1] != shared_index) if ((verts_new_tri < 1 || indices[indx_size - 1] != shared_index)
&& (verts_new_tri < 2 || indices[indx_size - 2] != shared_index)) && (verts_new_tri < 2 || indices[indx_size - 2] != shared_index))
@ -780,7 +780,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
{ //for each vertex { //for each vertex
if (j > 2) if (j > 2)
{ {
U32 size = verts.size(); auto size = verts.size();
LLVolumeFace::VertexData v0 = verts[size-3]; LLVolumeFace::VertexData v0 = verts[size-3];
LLVolumeFace::VertexData v1 = verts[size-1]; LLVolumeFace::VertexData v1 = verts[size-1];
@ -1162,7 +1162,7 @@ bool LLDAELoader::OpenFile(const std::string& filename)
while (model_iter != mModelList.end()) while (model_iter != mModelList.end())
{ {
LLModel* mdl = *model_iter; LLModel* mdl = *model_iter;
U32 material_count = mdl->mMaterialList.size(); U32 material_count = static_cast<U32>(mdl->mMaterialList.size());
LL_INFOS() << "Importing " << mdl->mLabel << " model with " << material_count << " material references" << LL_ENDL; LL_INFOS() << "Importing " << mdl->mLabel << " model with " << material_count << " material references" << LL_ENDL;
std::vector<std::string>::iterator mat_iter = mdl->mMaterialList.begin(); std::vector<std::string>::iterator mat_iter = mdl->mMaterialList.begin();
std::vector<std::string>::iterator end_iter = material_count > LIMIT_MATERIALS_OUTPUT std::vector<std::string>::iterator end_iter = material_count > LIMIT_MATERIALS_OUTPUT
@ -1351,11 +1351,11 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
{ {
//Get the children at this level //Get the children at this level
daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren(); daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren();
S32 childCount = children.getCount(); auto childCount = children.getCount();
//Process any children that are joints //Process any children that are joints
//Not all children are joints, some could be ambient lights, cameras, geometry etc.. //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<domNode>(children[i]); domNode* pNode = daeSafeCast<domNode>(children[i]);
if (pNode) if (pNode)
@ -1376,7 +1376,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
if ( pSkeletonRootNode ) if ( pSkeletonRootNode )
{ {
//Once we have the root node - start acccessing it's joint components //Once we have the root node - start acccessing it's joint components
const int jointCnt = mJointMap.size(); const int jointCnt = static_cast<int>(mJointMap.size());
JointMap :: const_iterator jointIt = mJointMap.begin(); JointMap :: const_iterator jointIt = mJointMap.begin();
//Loop over all the possible joints within the .dae - using the allowed joint list in the ctor. //Loop over all the possible joints within the .dae - using the allowed joint list in the ctor.
@ -1523,9 +1523,9 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
if (t) if (t)
{ {
domListOfFloats& transform = t->getValue(); 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; LLMatrix4 mat;
@ -1611,7 +1611,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
std::vector<std::string> ::const_iterator jointIt = jointNames.begin(); std::vector<std::string> ::const_iterator jointIt = jointNames.begin();
// </FS:ND> // </FS:ND>
const int jointCnt = model->mSkinInfo.mJointNames.size(); const int jointCnt = static_cast<int>(model->mSkinInfo.mJointNames.size());
for ( int i=0; i<jointCnt; ++i, ++jointIt ) for ( int i=0; i<jointCnt; ++i, ++jointIt )
{ {
std::string lookingForJoint = (*jointIt).c_str(); std::string lookingForJoint = (*jointIt).c_str();
@ -1630,7 +1630,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
} }
} }
U32 bind_count = model->mSkinInfo.mAlternateBindMatrix.size(); auto bind_count = model->mSkinInfo.mAlternateBindMatrix.size();
if (bind_count > 0 && bind_count != jointCnt) if (bind_count > 0 && bind_count != jointCnt)
{ {
LL_WARNS("Mesh") << "Model " << model->mLabel << " has invalid joint bind matrix list." << LL_ENDL; LL_WARNS("Mesh") << "Model " << model->mLabel << " has invalid joint bind matrix list." << LL_ENDL;
@ -1779,8 +1779,8 @@ void LLDAELoader::buildJointToNodeMappingFromScene( daeElement* pRoot )
if ( pScene ) if ( pScene )
{ {
daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren(); daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren();
S32 childCount = children.getCount(); auto childCount = children.getCount();
for (S32 i = 0; i < childCount; ++i) for (size_t i = 0; i < childCount; ++i)
{ {
domNode* pNode = daeSafeCast<domNode>(children[i]); domNode* pNode = daeSafeCast<domNode>(children[i]);
processJointToNodeMapping( pNode ); processJointToNodeMapping( pNode );
@ -1825,8 +1825,8 @@ void LLDAELoader::processJointToNodeMapping( domNode* pNode )
void LLDAELoader::processChildJoints( domNode* pParentNode ) void LLDAELoader::processChildJoints( domNode* pParentNode )
{ {
daeTArray< daeSmartRef<daeElement> > childOfChild = pParentNode->getChildren(); daeTArray< daeSmartRef<daeElement> > childOfChild = pParentNode->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<domNode>( childOfChild[i] ); domNode* pChildNode = daeSafeCast<domNode>( childOfChild[i] );
if ( pChildNode ) if ( pChildNode )
@ -1927,7 +1927,7 @@ bool LLDAELoader::verifyController( domController* pController )
{ {
sum += pVertexWeights->getVcount()->getValue()[i]; sum += pVertexWeights->getVcount()->getValue()[i];
} }
result = verifyCount( sum * inputs.getCount(), (domInt) pVertexWeights->getV()->getValue().getCount() ); result = verifyCount( sum * static_cast<U32>(inputs.getCount()), (domInt) static_cast<int>(pVertexWeights->getV()->getValue().getCount()) );
} }
} }
@ -2060,9 +2060,9 @@ void LLDAELoader::processJointNode( domNode* pNode, JointTransformMap& jointTran
//Gather and handle the incoming nodes children //Gather and handle the incoming nodes children
daeTArray< daeSmartRef<daeElement> > childOfChild = pNode->getChildren(); daeTArray< daeSmartRef<daeElement> > 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<domNode>( childOfChild[i] ); domNode* pChildNode = daeSafeCast<domNode>( childOfChild[i] );
if ( pChildNode ) if ( pChildNode )
@ -2281,8 +2281,8 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
//process children //process children
daeTArray< daeSmartRef<daeElement> > children = element->getChildren(); daeTArray< daeSmartRef<daeElement> > children = element->getChildren();
int childCount = children.getCount(); auto childCount = children.getCount();
for (S32 i = 0; i < childCount; i++) for (size_t i = 0; i < childCount; i++)
{ {
processElement(children[i],badElement, dae); processElement(children[i],badElement, dae);
} }
@ -2713,7 +2713,7 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& mo
ret->remapVolumeFaces(); ret->remapVolumeFaces();
} }
volume_faces = remainder.size(); volume_faces = static_cast<U32>(remainder.size());
models_out.push_back(ret); models_out.push_back(ret);

View File

@ -231,7 +231,7 @@ bool LLGLTFLoader::parseMaterials()
image.numChannels = in_image.component; image.numChannels = in_image.component;
image.bytesPerChannel = in_image.bits >> 3; // Convert bits to bytes 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.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<U32>(in_image.image.size());
image.height = in_image.height; image.height = in_image.height;
image.width = in_image.width; image.width = in_image.width;
image.data = in_image.image.data(); image.data = in_image.image.data();

View File

@ -180,7 +180,7 @@ bool LLGLTFMaterial::fromJSON(const std::string& json, std::string& warn_msg, st
tinygltf::Model model_in; 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<unsigned int>(json.length()), ""))
{ {
setFromModel(model_in, 0); setFromModel(model_in, 0);

View File

@ -87,12 +87,12 @@ void LLGLTFMaterial::setFromTexture(const tinygltf::Model& model, const T& textu
template<typename T> template<typename T>
void LLGLTFMaterial::allocateTextureImage(tinygltf::Model& model, T& texture_info, const std::string& uri) 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<S32>(model.images.size());
model.images.emplace_back(); model.images.emplace_back();
model.images[image_idx].uri = uri; model.images[image_idx].uri = uri;
// The texture, not to be confused with the texture info // The texture, not to be confused with the texture info
const S32 texture_idx = model.textures.size(); const S32 texture_idx = static_cast<S32>(model.textures.size());
model.textures.emplace_back(); model.textures.emplace_back();
tinygltf::Texture& texture = model.textures[texture_idx]; tinygltf::Texture& texture = model.textures[texture_idx];
texture.source = image_idx; texture.source = image_idx;

View File

@ -353,7 +353,7 @@ U32 LLMediaEntry::setWhiteList( const std::vector<std::string> &whitelist )
{ {
// *NOTE: This code is VERY similar to the setWhitelist below. // *NOTE: This code is VERY similar to the setWhitelist below.
// IF YOU CHANGE THIS IMPLEMENTATION, BE SURE TO CHANGE THE OTHER! // IF YOU CHANGE THIS IMPLEMENTATION, BE SURE TO CHANGE THE OTHER!
U32 size = 0; size_t size = 0;
U32 count = 0; U32 count = 0;
// First count to make sure the size constraint is not violated // First count to make sure the size constraint is not violated
std::vector<std::string>::const_iterator iter = whitelist.begin(); std::vector<std::string>::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. // *NOTE: This code is VERY similar to the setWhitelist above.
// IF YOU CHANGE THIS IMPLEMENTATION, BE SURE TO CHANGE THE OTHER! // IF YOU CHANGE THIS IMPLEMENTATION, BE SURE TO CHANGE THE OTHER!
U32 size = 0; size_t size = 0;
U32 count = 0; U32 count = 0;
// First check to make sure the size and count constraints are not violated // First check to make sure the size and count constraints are not violated
LLSD::array_const_iterator iter = whitelist.beginArray(); LLSD::array_const_iterator iter = whitelist.beginArray();

View File

@ -933,7 +933,7 @@ LLSD LLModel::writeModel(
//copy ostr to binary buffer //copy ostr to binary buffer
std::string data = ostr.str(); std::string data = ostr.str();
const U8* buff = (U8*)data.data(); const U8* buff = (U8*)data.data();
U32 bytes = data.size(); U32 bytes = static_cast<U32>(data.size());
LLSD::Binary w(bytes); LLSD::Binary w(bytes);
for (U32 j = 0; j < bytes; ++j) for (U32 j = 0; j < bytes; ++j)
@ -980,7 +980,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{ //write out skin block { //write out skin block
skin = zip_llsd(mdl["skin"]); skin = zip_llsd(mdl["skin"]);
U32 size = skin.size(); U32 size = static_cast<U32>(skin.size());
if (size > 0) if (size > 0)
{ {
header["skin"]["offset"] = (LLSD::Integer) cur_offset; header["skin"]["offset"] = (LLSD::Integer) cur_offset;
@ -995,7 +995,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{ //write out convex decomposition { //write out convex decomposition
decomposition = zip_llsd(mdl["physics_convex"]); decomposition = zip_llsd(mdl["physics_convex"]);
U32 size = decomposition.size(); U32 size = static_cast<U32>(decomposition.size());
if (size > 0) if (size > 0)
{ {
header["physics_convex"]["offset"] = (LLSD::Integer) cur_offset; header["physics_convex"]["offset"] = (LLSD::Integer) cur_offset;
@ -1017,7 +1017,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{ {
out[i] = zip_llsd(mdl[model_names[i]]); out[i] = zip_llsd(mdl[model_names[i]]);
U32 size = out[i].size(); U32 size = static_cast<U32>(out[i].size());
header[model_names[i]]["offset"] = (LLSD::Integer) cur_offset; header[model_names[i]]["offset"] = (LLSD::Integer) cur_offset;
header[model_names[i]]["size"] = (LLSD::Integer) size; header[model_names[i]]["size"] = (LLSD::Integer) size;
@ -1177,7 +1177,7 @@ void LLModel::updateHullCenters()
mCenterOfHullCenters += cur_center; mCenterOfHullCenters += cur_center;
cur_center *= 1.f/mPhysics.mHull[i].size(); cur_center *= 1.f/mPhysics.mHull[i].size();
mHullCenter[i] = cur_center; mHullCenter[i] = cur_center;
mHullPoints += mPhysics.mHull[i].size(); mHullPoints += static_cast<U32>(mPhysics.mHull[i].size());
} }
if (mHullPoints > 0) if (mHullPoints > 0)
@ -1298,8 +1298,8 @@ bool LLModel::loadModel(std::istream& is)
bool LLModel::isMaterialListSubset( LLModel* ref ) bool LLModel::isMaterialListSubset( LLModel* ref )
{ {
int refCnt = ref->mMaterialList.size(); auto refCnt = ref->mMaterialList.size();
int modelCnt = mMaterialList.size(); auto modelCnt = mMaterialList.size();
// <FS:Beq> FIRE-30965 Cleanup braindead mesh parsing error handlers // <FS:Beq> FIRE-30965 Cleanup braindead mesh parsing error handlers
if(modelCnt > refCnt) if(modelCnt > refCnt)
{ {
@ -1307,11 +1307,11 @@ bool LLModel::isMaterialListSubset( LLModel* ref )
return false; return false;
} }
// </FS:Beq> // </FS:Beq>
for (U32 src = 0; src < modelCnt; ++src) for (size_t src = 0; src < modelCnt; ++src)
{ {
bool foundRef = false; bool foundRef = false;
for (U32 dst = 0; dst < refCnt; ++dst) for (size_t dst = 0; dst < refCnt; ++dst)
{ {
//LL_INFOS()<<mMaterialList[src]<<" "<<ref->mMaterialList[dst]<<LL_ENDL; //LL_INFOS()<<mMaterialList[src]<<" "<<ref->mMaterialList[dst]<<LL_ENDL;
foundRef = mMaterialList[src] == ref->mMaterialList[dst]; foundRef = mMaterialList[src] == ref->mMaterialList[dst];
@ -1665,18 +1665,18 @@ U32 LLMeshSkinInfo::sizeBytes() const
{ {
U32 res = sizeof(LLUUID); // mMeshID U32 res = sizeof(LLUUID); // mMeshID
res += sizeof(std::vector<std::string>) + sizeof(std::string) * mJointNames.size(); res += sizeof(std::vector<std::string>) + sizeof(std::string) * static_cast<U32>(mJointNames.size());
for (U32 i = 0; i < mJointNames.size(); ++i) for (U32 i = 0; i < mJointNames.size(); ++i)
{ {
// <FS> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup // <FS> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//res += mJointNames[i].size(); // actual size, not capacity //res += static_cast<U32>(mJointNames[i].size()); // actual size, not capacity
res += mJointNames[i].mName.size(); // actual size, not capacity res += static_cast<U32>(mJointNames[i].mName.size()); // actual size, not capacity
// </FS> // </FS>
} }
res += sizeof(std::vector<S32>) + sizeof(S32) * mJointNums.size(); res += sizeof(std::vector<S32>) + sizeof(S32) * static_cast<U32>(mJointNums.size());
res += sizeof(std::vector<LLMatrix4>) + 16 * sizeof(float) * mInvBindMatrix.size(); res += sizeof(std::vector<LLMatrix4>) + 16 * sizeof(float) * static_cast<U32>(mInvBindMatrix.size());
res += sizeof(std::vector<LLMatrix4>) + 16 * sizeof(float) * mAlternateBindMatrix.size(); res += sizeof(std::vector<LLMatrix4>) + 16 * sizeof(float) * static_cast<U32>(mAlternateBindMatrix.size());
res += 16 * sizeof(float); //mBindShapeMatrix res += 16 * sizeof(float); //mBindShapeMatrix
res += sizeof(float) + 3 * sizeof(bool); res += sizeof(float) + 3 * sizeof(bool);
@ -1793,15 +1793,15 @@ U32 LLModel::Decomposition::sizeBytes() const
{ {
U32 res = sizeof(LLUUID); // mMeshID U32 res = sizeof(LLUUID); // mMeshID
res += sizeof(LLModel::convex_hull_decomposition) + sizeof(std::vector<LLVector3>) * mHull.size(); res += sizeof(LLModel::convex_hull_decomposition) + sizeof(std::vector<LLVector3>) * static_cast<U32>(mHull.size());
for (U32 i = 0; i < mHull.size(); ++i) for (U32 i = 0; i < mHull.size(); ++i)
{ {
res += mHull[i].size() * sizeof(LLVector3); res += static_cast<U32>(mHull[i].size()) * sizeof(LLVector3);
} }
res += sizeof(LLModel::hull) + sizeof(LLVector3) * mBaseHull.size(); res += sizeof(LLModel::hull) + sizeof(LLVector3) * static_cast<U32>(mBaseHull.size());
res += sizeof(std::vector<LLModel::PhysicsMesh>) + sizeof(std::vector<LLModel::PhysicsMesh>) * mMesh.size(); res += sizeof(std::vector<LLModel::PhysicsMesh>) + sizeof(std::vector<LLModel::PhysicsMesh>) * static_cast<U32>(mMesh.size());
for (U32 i = 0; i < mMesh.size(); ++i) for (U32 i = 0; i < mMesh.size(); ++i)
{ {
res += mMesh[i].sizeBytes(); res += mMesh[i].sizeBytes();
@ -1852,7 +1852,7 @@ LLSD LLModel::Decomposition::asLLSD() const
for (U32 i = 0; i < mHull.size(); ++i) for (U32 i = 0; i < mHull.size(); ++i)
{ {
U32 size = mHull[i].size(); U32 size = static_cast<U32>(mHull[i].size());
total += size; total += size;
hulls[i] = (U8) (size); hulls[i] = (U8) (size);

View File

@ -127,8 +127,8 @@ public:
U32 sizeBytes() const U32 sizeBytes() const
{ {
U32 res = sizeof(std::vector<LLVector3>) * 2; U32 res = sizeof(std::vector<LLVector3>) * 2;
res += sizeof(LLVector3) * mPositions.size(); res += sizeof(LLVector3) * static_cast<U32>(mPositions.size());
res += sizeof(LLVector3) * mNormals.size(); res += sizeof(LLVector3) * static_cast<U32>(mNormals.size());
return res; return res;
} }
}; };
@ -362,7 +362,7 @@ public:
protected: protected:
LLUUID mDiffuseMapID; 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 // currently only stores an LLPointer< LLViewerFetchedTexture > > to
// maintain refs to textures associated with each material for free // maintain refs to textures associated with each material for free
// ref counting. // ref counting.

View File

@ -83,13 +83,13 @@ void LLPrimTextureList::clear()
void LLPrimTextureList::copy(const LLPrimTextureList& other_list) void LLPrimTextureList::copy(const LLPrimTextureList& other_list)
{ {
// compare the sizes // compare the sizes
S32 this_size = mEntryList.size(); auto this_size = mEntryList.size();
S32 other_size = other_list.mEntryList.size(); auto other_size = other_list.mEntryList.size();
if (this_size > other_size) if (this_size > other_size)
{ {
// remove the extra entries // 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]; delete mEntryList[index-1];
} }
@ -97,18 +97,18 @@ void LLPrimTextureList::copy(const LLPrimTextureList& other_list)
this_size = other_size; this_size = other_size;
} }
S32 index = 0; size_t index = 0;
// copy for the entries that already exist // copy for the entries that already exist
for ( ; index < this_size; ++index) for ( ; index < this_size; ++index)
{ {
delete mEntryList[index]; delete mEntryList[index];
mEntryList[index] = other_list.getTexture(index)->newCopy(); mEntryList[index] = other_list.getTexture(static_cast<U8>(index))->newCopy();
} }
// add new entires if needed // add new entires if needed
for ( ; index < other_size; ++index) for ( ; index < other_size; ++index)
{ {
mEntryList.push_back( other_list.getTexture(index)->newCopy() ); mEntryList.push_back( other_list.getTexture(static_cast<U8>(index))->newCopy());
} }
} }
@ -127,9 +127,9 @@ void LLPrimTextureList::take(LLPrimTextureList& other_list)
// returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE // returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE
S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te) 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; LL_WARNS() << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << LL_ENDL;
return TEM_CHANGE_NONE; return TEM_CHANGE_NONE;
} }
@ -394,7 +394,7 @@ LLMaterialPtr LLPrimTextureList::getMaterialParams(const U8 index)
S32 LLPrimTextureList::size() const S32 LLPrimTextureList::size() const
{ {
return mEntryList.size(); return static_cast<S32>(mEntryList.size());
} }
// sets the size of the mEntryList container // sets the size of the mEntryList container
@ -405,12 +405,12 @@ void LLPrimTextureList::setSize(S32 new_size)
new_size = 0; new_size = 0;
} }
S32 current_size = mEntryList.size(); auto current_size = mEntryList.size();
if (new_size > current_size) if (new_size > current_size)
{ {
mEntryList.resize(new_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 if (current_size > 0
&& mEntryList[current_size - 1]) && mEntryList[current_size - 1])
@ -428,7 +428,7 @@ void LLPrimTextureList::setSize(S32 new_size)
} }
else if (new_size < current_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]; delete mEntryList[index];
} }

View File

@ -109,7 +109,7 @@ void LLPrimTextureList::take(LLPrimTextureList &other_list) { }
void LLPrimTextureList::setSize(S32 new_size) { mEntryList.resize(new_size); } void LLPrimTextureList::setSize(S32 new_size) { mEntryList.resize(new_size); }
void LLPrimTextureList::setAllIDs(const LLUUID &id) { } void LLPrimTextureList::setAllIDs(const LLUUID &id) { }
LLTextureEntry * LLPrimTextureList::getTexture(const U8 index) const { return nullptr; } LLTextureEntry * LLPrimTextureList::getTexture(const U8 index) const { return nullptr; }
S32 LLPrimTextureList::size() const { return mEntryList.size(); } S32 LLPrimTextureList::size() const { return static_cast<S32>(mEntryList.size()); }
class PRIMITIVE_TEST_SETUP class PRIMITIVE_TEST_SETUP
{ {

View File

@ -108,7 +108,7 @@ bool LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp
S32 num_components = getNumComponents(bitmap_type); S32 num_components = getNumComponents(bitmap_type);
mImageRawVec[bitmap_idx].push_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components)); mImageRawVec[bitmap_idx].push_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components));
bitmap_num = mImageRawVec[bitmap_idx].size() - 1; bitmap_num = static_cast<U32>(mImageRawVec[bitmap_idx].size()) - 1;
LLImageRaw* image_raw = getImageRaw(bitmap_type, bitmap_num); LLImageRaw* image_raw = getImageRaw(bitmap_type, bitmap_num);
if (EFontGlyphType::Grayscale == bitmap_type) if (EFontGlyphType::Grayscale == bitmap_type)

View File

@ -60,7 +60,7 @@ public:
LLImageGL* getImageGL(EFontGlyphType bitmapType, U32 bitmapNum) const; LLImageGL* getImageGL(EFontGlyphType bitmapType, U32 bitmapNum) const;
S32 getMaxCharWidth() const { return mMaxCharWidth; } S32 getMaxCharWidth() const { return mMaxCharWidth; }
U32 getNumBitmaps(EFontGlyphType bitmapType) const { return (bitmapType < EFontGlyphType::Count) ? mImageRawVec[static_cast<U32>(bitmapType)].size() : 0; } U32 getNumBitmaps(EFontGlyphType bitmapType) const { return (bitmapType < EFontGlyphType::Count) ? static_cast<U32>(mImageRawVec[static_cast<U32>(bitmapType)].size()) : 0U; }
S32 getBitmapWidth() const { return mBitmapWidth; } S32 getBitmapWidth() const { return mBitmapWidth; }
S32 getBitmapHeight() const { return mBitmapHeight; } S32 getBitmapHeight() const { return mBitmapHeight; }

View File

@ -382,7 +382,7 @@ S32 LLFontFreetype::ftOpenFace(const std::string& filename, S32 face_n)
pFtStream = new LLFT_Stream(); pFtStream = new LLFT_Stream();
pFtStream->base = 0; pFtStream->base = 0;
pFtStream->pos = 0; pFtStream->pos = 0;
pFtStream->size = file_size; pFtStream->size = static_cast<unsigned long>(file_size);
pFtStream->descriptor.pointer = pFileStream; pFtStream->descriptor.pointer = pFileStream;
pFtStream->read = ft_read_cb; pFtStream->read = ft_read_cb;
pFtStream->close = ft_close_cb; pFtStream->close = ft_close_cb;

View File

@ -149,7 +149,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
if(!sDisplayFont) //do not display texts if(!sDisplayFont) //do not display texts
{ {
return wstr.length() ; return static_cast<S32>(wstr.length());
} }
if (wstr.empty()) if (wstr.empty())

View File

@ -621,7 +621,7 @@ bool LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString>* attrib
} }
mAttribute.clear(); mAttribute.clear();
U32 numAttributes = (attributes == NULL) ? 0 : attributes->size(); U32 numAttributes = (attributes == NULL) ? 0U : static_cast<U32>(attributes->size());
#if LL_RELEASE_WITH_DEBUG_INFO #if LL_RELEASE_WITH_DEBUG_INFO
mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, { -1, NULL }); mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, { -1, NULL });
#else #else
@ -843,7 +843,7 @@ bool LLGLSLShader::mapUniforms(const vector<LLStaticHashedString>* uniforms)
mTexture.clear(); mTexture.clear();
mValue.clear(); mValue.clear();
//initialize arrays //initialize arrays
U32 numUniforms = (uniforms == NULL) ? 0 : uniforms->size(); U32 numUniforms = (uniforms == NULL) ? 0U : static_cast<U32>(uniforms->size());
mUniform.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1); mUniform.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
mTexture.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1); mTexture.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);

View File

@ -68,8 +68,8 @@ public:
template<typename T> template<typename T>
struct UniformSetting struct UniformSetting
{ {
S32 mUniform; S32 mUniform{ 0 };
T mValue; T mValue{};
}; };
typedef UniformSetting<S32> IntSetting; typedef UniformSetting<S32> IntSetting;

View File

@ -208,7 +208,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
return true; return true;
} }
U32 offset = mTex.size(); U32 offset = static_cast<U32>(mTex.size());
if( offset >= 4 ) if( offset >= 4 )
{ {
@ -378,11 +378,11 @@ void LLRenderTarget::release()
if (mFBO && (mTex.size() > 1)) if (mFBO && (mTex.size() > 1))
{ {
glBindFramebuffer(GL_FRAMEBUFFER, mFBO); glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
S32 z; size_t z;
for (z = mTex.size() - 1; z >= 1; z--) for (z = mTex.size() - 1; z >= 1; z--)
{ {
sBytesAllocated -= mResX*mResY*4; sBytesAllocated -= mResX*mResY*4;
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+z, LLTexUnit::getInternalType(mUsage), 0, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, static_cast<GLenum>(GL_COLOR_ATTACHMENT0+z), LLTexUnit::getInternalType(mUsage), 0, 0);
LLImageGL::deleteTextures(1, &mTex[z]); LLImageGL::deleteTextures(1, &mTex[z]);
} }
glBindFramebuffer(GL_FRAMEBUFFER, sCurFBO); glBindFramebuffer(GL_FRAMEBUFFER, sCurFBO);
@ -426,7 +426,7 @@ void LLRenderTarget::bindTarget()
GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT2,
GL_COLOR_ATTACHMENT3}; GL_COLOR_ATTACHMENT3};
glDrawBuffers(mTex.size(), drawbuffers); glDrawBuffers(static_cast<GLsizei>(mTex.size()), drawbuffers);
if (mTex.empty()) if (mTex.empty())
{ //no color buffer to draw to { //no color buffer to draw to
@ -485,7 +485,7 @@ U32 LLRenderTarget::getTexture(U32 attachment) const
U32 LLRenderTarget::getNumTextures() const U32 LLRenderTarget::getNumTextures() const
{ {
return mTex.size(); return static_cast<U32>(mTex.size());
} }
void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options) void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options)

View File

@ -1102,7 +1102,7 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader)
program_binary.resize(binary_info.mBinaryLength); program_binary.resize(binary_info.mBinaryLength);
GLenum error = glGetError(); // Clear current error 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<GLsizei>(program_binary.size() * sizeof(U8)), nullptr, &binary_info.mBinaryFormat, program_binary.data());
error = glGetError(); error = glGetError();
if (error == GL_NO_ERROR) if (error == GL_NO_ERROR)
{ {

View File

@ -495,7 +495,7 @@ void LLAccordionCtrl::arrangeMultiple()
if (mFitParent) if (mFitParent)
{ {
// All expanded tabs will have equal height // All expanded tabs will have equal height
panel_height = calcExpandedTabHeight(i, panel_top); panel_height = calcExpandedTabHeight(static_cast<S32>(i), panel_top);
ctrlSetLeftTopAndSize(accordion_tab, panel_left, panel_top, panel_width, panel_height); ctrlSetLeftTopAndSize(accordion_tab, panel_left, panel_top, panel_width, panel_height);
// Try to make accordion tab fit accordion view height. // Try to make accordion tab fit accordion view height.

View File

@ -73,7 +73,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
if (LLAssetType::lookupIsAssetIDKnowable(type)) if (LLAssetType::lookupIsAssetIDKnowable(type))
{ {
LLWString source = utf8str_to_wstring(src.asString()); LLWString source = utf8str_to_wstring(src.asString());
res = addToClipboard(source, 0, source.size()); res = addToClipboard(source, 0, static_cast<S32>(source.size()));
} }
if (res) if (res)
{ {
@ -87,13 +87,13 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
bool LLClipboard::pasteFromClipboard(std::vector<LLUUID>& inv_objects) const bool LLClipboard::pasteFromClipboard(std::vector<LLUUID>& inv_objects) const
{ {
bool res = false; bool res = false;
S32 count = mObjects.size(); auto count = mObjects.size();
inv_objects.reserve(inv_objects.size() + count); inv_objects.reserve(inv_objects.size() + count);
if (count > 0) if (count > 0)
{ {
res = true; res = true;
inv_objects.clear(); inv_objects.clear();
for (S32 i = 0; i < count; i++) for (size_t i = 0; i < count; i++)
{ {
inv_objects.push_back(mObjects[i]); inv_objects.push_back(mObjects[i]);
} }

View File

@ -1023,7 +1023,7 @@ void LLComboBox::updateSelection()
LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel()); LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());
LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size()); LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size());
mTextEntry->setText(wstring_to_utf8str(wtext)); mTextEntry->setText(wstring_to_utf8str(wtext));
mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size()); mTextEntry->setSelection(static_cast<S32>(left_wstring.size()), static_cast<S32>(mTextEntry->getWText().size()));
mTextEntry->endSelection(); mTextEntry->endSelection();
mTextEntry->setTentative(false); mTextEntry->setTentative(false);
mHasAutocompletedText = true; mHasAutocompletedText = true;
@ -1034,7 +1034,7 @@ void LLComboBox::updateSelection()
{ {
LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel()); LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());
mTextEntry->setText(wstring_to_utf8str(left_wstring) + " (" + getSelectedItemLabel() + ")"); mTextEntry->setText(wstring_to_utf8str(left_wstring) + " (" + getSelectedItemLabel() + ")");
mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size()); mTextEntry->setSelection(static_cast<S32>(left_wstring.size()), static_cast<S32>(mTextEntry->getWText().size()));
mTextEntry->endSelection(); mTextEntry->endSelection();
mTextEntry->setTentative(false); mTextEntry->setTentative(false);
mHasAutocompletedText = true; mHasAutocompletedText = true;

View File

@ -111,7 +111,7 @@ LLCommandManager::~LLCommandManager()
U32 LLCommandManager::commandCount() const U32 LLCommandManager::commandCount() const
{ {
return mCommands.size(); return static_cast<U32>(mCommands.size());
} }
LLCommand * LLCommandManager::getCommand(U32 commandIndex) LLCommand * LLCommandManager::getCommand(U32 commandIndex)

View File

@ -214,7 +214,7 @@ protected:
void addCommand(LLCommand * command); void addCommand(LLCommand * command);
private: private:
typedef std::map<LLUUID, U32> CommandIndexMap; typedef std::map<LLUUID, size_t> CommandIndexMap;
typedef std::vector<LLCommand *> CommandVector; typedef std::vector<LLCommand *> CommandVector;
CommandVector mCommands; CommandVector mCommands;

View File

@ -180,11 +180,11 @@ void LLConsole::draw()
{ {
// This is done in update() if session support is enabled // This is done in update() if session support is enabled
// </FS:Ansariel> // </FS:Ansariel>
U32 num_lines=0; size_t num_lines{ 0 };
paragraph_t::reverse_iterator paragraph_it; paragraph_t::reverse_iterator paragraph_it;
paragraph_it = mParagraphs.rbegin(); paragraph_it = mParagraphs.rbegin();
U32 paragraph_num=mParagraphs.size(); auto paragraph_num=mParagraphs.size();
while (!mParagraphs.empty() && paragraph_it != mParagraphs.rend()) while (!mParagraphs.empty() && paragraph_it != mParagraphs.rend())
{ {
@ -192,7 +192,7 @@ void LLConsole::draw()
if(num_lines > mMaxLines if(num_lines > mMaxLines
|| ( (mLinePersistTime > (F32)0.f) && ((*paragraph_it).mAddTime - skip_time)/(mLinePersistTime - mFadeTime) <= (F32)0.f)) || ( (mLinePersistTime > (F32)0.f) && ((*paragraph_it).mAddTime - skip_time)/(mLinePersistTime - mFadeTime) <= (F32)0.f))
{ //All lines above here are done. Lose them. { //All lines above here are done. Lose them.
for (U32 i=0;i<paragraph_num;i++) for (size_t i = 0; i < paragraph_num; i++)
{ {
if (!mParagraphs.empty()) if (!mParagraphs.empty())
mParagraphs.pop_front(); mParagraphs.pop_front();
@ -292,7 +292,7 @@ void LLConsole::draw()
static const F32 padding_vert = 5; static const F32 padding_vert = 5;
S32 total_width = 0; S32 total_width = 0;
S32 total_height = 0; S32 total_height = 0;
S32 lines_drawn = 0; size_t lines_drawn = 0;
paragraph_t::reverse_iterator paragraphs_end = mParagraphs.rend(); paragraph_t::reverse_iterator paragraphs_end = mParagraphs.rend();
for (paragraph_it = mParagraphs.rbegin(); paragraph_it != paragraphs_end; ++paragraph_it) for (paragraph_it = mParagraphs.rbegin(); paragraph_it != paragraphs_end; ++paragraph_it)
@ -383,7 +383,7 @@ void LLConsole::draw()
} }
else else
{ {
S32 lines_drawn = 0; size_t lines_drawn = 0;
paragraph_t::reverse_iterator paragraphs_end = mParagraphs.rend(); paragraph_t::reverse_iterator paragraphs_end = mParagraphs.rend();
for(paragraph_it = mParagraphs.rbegin(); paragraph_it != paragraphs_end; paragraph_it++) for(paragraph_it = mParagraphs.rbegin(); paragraph_it != paragraphs_end; paragraph_it++)
@ -540,7 +540,7 @@ void LLConsole::Paragraph::makeParagraphColorSegments (const LLColor4 &color)
ParagraphColorSegment color_segment; ParagraphColorSegment color_segment;
color_segment.mColor.setValue(color_llsd); color_segment.mColor.setValue(color_llsd);
color_segment.mNumChars = color_str.length(); color_segment.mNumChars = static_cast<S32>(color_str.length());
mParagraphColorSegments.push_back(color_segment); mParagraphColorSegments.push_back(color_segment);
} }
@ -597,14 +597,14 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, L
// skip_chars = 0; // 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<S32>(line_end) - paragraph_offset, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
if (line_end == LLWString::npos) if (line_end == LLWString::npos)
{ {
line_end = mParagraphText.size(); line_end = mParagraphText.size();
} }
S32 skip_chars = 0; // skip '\n' S32 skip_chars = 0; // skip '\n'
U32 line_length = line_end - paragraph_offset; S32 line_length = static_cast<S32>(line_end) - paragraph_offset;
U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_length, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_length, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
// </FS> // </FS>

View File

@ -210,7 +210,7 @@ void LLEmojiDictionary::findByShortCode(
std::size_t begin, end; std::size_t begin, end;
if (searchInShortCode(begin, end, shortCode, needle)) if (searchInShortCode(begin, end, shortCode, needle))
{ {
results[begin].emplace_back(d.Character, shortCode, begin, end); results[static_cast<llwchar>(begin)].emplace_back(d.Character, shortCode, begin, end);
} }
} }
} }

View File

@ -399,7 +399,7 @@ U32 LLFlatListView::size(const bool only_visible_items) const
} }
else else
{ {
return mItemPairs.size(); return static_cast<U32>(mItemPairs.size());
} }
} }
@ -573,7 +573,7 @@ void LLFlatListView::rearrangeItems()
} }
// add paddings between items, excluding invisible ones // add paddings between items, excluding invisible ones
height += mItemPad * (mItemPairs.size() - invisible_children_count - 1); height += mItemPad * (static_cast<S32>(mItemPairs.size()) - invisible_children_count - 1);
LLRect rc = mItemsPanel->getRect(); LLRect rc = mItemsPanel->getRect();
S32 width = mItemsNoScrollWidth; S32 width = mItemsNoScrollWidth;

View File

@ -272,7 +272,7 @@ public:
void setCommitOnSelectionChange(bool b) { mCommitOnSelectionChange = b; } void setCommitOnSelectionChange(bool b) { mCommitOnSelectionChange = b; }
/** Get number of selected items in the list */ /** Get number of selected items in the list */
U32 numSelected() const {return mSelectedItemPairs.size(); } U32 numSelected() const {return static_cast<U32>(mSelectedItemPairs.size()); }
/** Get number of (visible) items in the list */ /** Get number of (visible) items in the list */
U32 size(const bool only_visible_items = true) const; U32 size(const bool only_visible_items = true) const;

View File

@ -778,7 +778,7 @@ void LLFolderView::removeSelectedItems()
// items, since the removal will futz with internal data // items, since the removal will futz with internal data
// structures. // structures.
std::vector<LLFolderViewItem*> items; std::vector<LLFolderViewItem*> items;
S32 count = mSelectedItems.size(); auto count = mSelectedItems.size();
if(count <= 0) return; if(count <= 0) return;
LLFolderViewItem* item = NULL; LLFolderViewItem* item = NULL;
selected_items_t::iterator item_it; selected_items_t::iterator item_it;
@ -823,7 +823,7 @@ void LLFolderView::removeSelectedItems()
setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus()); setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus());
listeners.reserve(count); listeners.reserve(count);
for(S32 i = 0; i < count; ++i) for(size_t i = 0; i < count; ++i)
{ {
listener = items[i]->getViewModelItem(); listener = items[i]->getViewModelItem();
if(listener && (std::find(listeners.begin(), listeners.end(), listener) == listeners.end())) if(listener && (std::find(listeners.begin(), listeners.end(), listener) == listeners.end()))
@ -942,7 +942,7 @@ void LLFolderView::copy()
{ {
// *NOTE: total hack to clear the inventory clipboard // *NOTE: total hack to clear the inventory clipboard
LLClipboard::instance().reset(); LLClipboard::instance().reset();
S32 count = mSelectedItems.size(); auto count = mSelectedItems.size();
if(getVisible() && getEnabled() && (count > 0)) if(getVisible() && getEnabled() && (count > 0))
{ {
LLFolderViewModelItem* listener = NULL; LLFolderViewModelItem* listener = NULL;
@ -1096,7 +1096,7 @@ void LLFolderView::startRenamingSelectedItem( void )
// make sure selection is visible // make sure selection is visible
scrollToShowSelection(); scrollToShowSelection();
S32 count = mSelectedItems.size(); auto count = mSelectedItems.size();
LLFolderViewItem* item = NULL; LLFolderViewItem* item = NULL;
if(count > 0) if(count > 0)
{ {
@ -1353,7 +1353,7 @@ bool LLFolderView::handleKeyHere( KEY key, MASK mask )
// <FS:Ansariel> FIRE-19933: Open context menu on context menu key press // <FS:Ansariel> FIRE-19933: Open context menu on context menu key press
case KEY_CONTEXT_MENU: case KEY_CONTEXT_MENU:
S32 count = mSelectedItems.size(); auto count = mSelectedItems.size();
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
if (( count > 0 && (hasVisibleChildren()) ) // show menu only if selected items are visible if (( count > 0 && (hasVisibleChildren()) ) // show menu only if selected items are visible
&& menu ) && menu )
@ -1508,7 +1508,7 @@ bool LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
std::string current_item_label(search_item->getViewModelItem()->getSearchableName()); std::string current_item_label(search_item->getViewModelItem()->getSearchableName());
LLStringUtil::toUpper(current_item_label); 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)) if (!current_item_label.compare(0, search_string_length, upper_case_string))
{ {
found = true; found = true;
@ -1548,7 +1548,7 @@ bool LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
mParentPanel.get()->setFocus(true); mParentPanel.get()->setFocus(true);
bool handled = childrenHandleRightMouseDown(x, y, mask) != NULL; bool handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
S32 count = mSelectedItems.size(); auto count = mSelectedItems.size();
LLMenuGL* menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get()); LLMenuGL* menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get());
if (!menu) if (!menu)

Some files were not shown because too many files have changed in this diff Show More