From b42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 1 Jun 2024 15:49:26 +0200 Subject: Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings --- indra/newview/llvoavatar.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a109de6aa5..1c970895c9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2327,7 +2327,7 @@ void LLVOAvatar::updateMeshData() S32 f_num = 0 ; const U32 VERTEX_NUMBER_THRESHOLD = 128 ;//small number of this means each part of an avatar has its own vertex buffer. - const S32 num_parts = mMeshLOD.size(); + const auto num_parts = mMeshLOD.size(); // this order is determined by number of LODS // if a mesh earlier in this list changed LODs while a later mesh doesn't, @@ -5718,7 +5718,7 @@ void LLVOAvatar::checkTextureLoading() return ; //have not been invisible for enough time. } - mLoadedCallbackTextures = pause ? mCallbackTextureList.size() : 0; + mLoadedCallbackTextures = pause ? static_cast(mCallbackTextureList.size()) : 0; for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin(); iter != mCallbackTextureList.end(); ++iter) @@ -6597,8 +6597,8 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::setisMesh() && pSkinData ) { - const int bindCnt = pSkinData->mAlternateBindMatrix.size(); - const int jointCnt = pSkinData->mJointNames.size(); + const int bindCnt = static_cast(pSkinData->mAlternateBindMatrix.size()); + const int jointCnt = static_cast(pSkinData->mJointNames.size()); if ((bindCnt > 0) && (bindCnt != jointCnt)) { LL_WARNS_ONCE() << "invalid mesh, bindCnt " << bindCnt << "!= jointCnt " << jointCnt << ", joint overrides will be ignored." << LL_ENDL; @@ -7945,7 +7945,7 @@ LLVOAvatar* LLVOAvatar::findAvatarFromAttachment( LLViewerObject* obj ) S32 LLVOAvatar::getAttachmentCount() const { - S32 count = 0; + size_t count = 0; for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) { @@ -7953,7 +7953,7 @@ S32 LLVOAvatar::getAttachmentCount() const count += pAttachment->mAttachedObjects.size(); } - return count; + return static_cast(count); } bool LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const @@ -8982,7 +8982,7 @@ void LLVOAvatar::addChat(const LLChat& chat) mChats.push_back(chat); - S32 chat_length = 0; + size_t chat_length = 0; for( chat_iter = mChats.begin(); chat_iter != mChats.end(); ++chat_iter) { chat_length += chat_iter->mText.size(); @@ -9594,7 +9594,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } // SUNSHINE CLEANUP - is this case OK now? - S32 num_params = contents->mParamWeights.size(); + auto num_params = contents->mParamWeights.size(); if (num_params <= 1) { // In this case, we have no reliable basis for knowing @@ -9638,7 +9638,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& contents, bool slam_params) { - S32 num_params = contents.mParamWeights.size(); + auto num_params = contents.mParamWeights.size(); ESex old_sex = getSex(); if (applyParsedTEMessage(contents.mTEContents) > 0 && isChanged(TEXTURE)) @@ -9689,7 +9689,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte bool interp_params = false; S32 params_changed_count = 0; - for( S32 i = 0; i < num_params; i++ ) + for( size_t i = 0; i < num_params; i++ ) { LLVisualParam* param = contents.mParams[i]; F32 newWeight = contents.mParamWeights[i]; @@ -11138,7 +11138,7 @@ void LLVOAvatar::accountRenderComplexityForObject( attached_object->mRiggedAttachedWarned = true; } - hud_object_complexity.texturesCount += textures.size(); + hud_object_complexity.texturesCount += static_cast(textures.size()); for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); volume_texture != textures.end(); -- cgit v1.2.3 From c0fad3028fd55c2067ce6a0ae4382cffe1014284 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 10 Jun 2024 16:42:43 +0200 Subject: Re-enable compiler warnings C4018, C4100, C4231 and C4506 --- indra/newview/llvoavatar.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1c970895c9..37d7e0d2e4 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6597,8 +6597,8 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::setisMesh() && pSkinData ) { - const int bindCnt = static_cast(pSkinData->mAlternateBindMatrix.size()); - const int jointCnt = static_cast(pSkinData->mJointNames.size()); + const unsigned int bindCnt = static_cast(pSkinData->mAlternateBindMatrix.size()); + const unsigned int jointCnt = static_cast(pSkinData->mJointNames.size()); if ((bindCnt > 0) && (bindCnt != jointCnt)) { LL_WARNS_ONCE() << "invalid mesh, bindCnt " << bindCnt << "!= jointCnt " << jointCnt << ", joint overrides will be ignored." << LL_ENDL; @@ -6625,10 +6625,10 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::setgetID() << LL_ENDL; } - bool fullRig = jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG; + bool fullRig = jointCnt >= JOINT_COUNT_REQUIRED_FOR_FULLRIG; if ( fullRig && !mesh_overrides_loaded ) { - for ( int i=0; imJointNames[i].c_str(); LLJoint* pJoint = getJoint( lookingForJoint ); @@ -7499,7 +7499,7 @@ S32 LLVOAvatar::getMaxAttachments() const //----------------------------------------------------------------------------- bool LLVOAvatar::canAttachMoreObjects(U32 n) const { - return (getNumAttachments() + n) <= getMaxAttachments(); + return (getNumAttachments() + n) <= (U32)getMaxAttachments(); } //----------------------------------------------------------------------------- @@ -7533,7 +7533,7 @@ S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const //----------------------------------------------------------------------------- bool LLVOAvatar::canAttachMoreAnimatedObjects(U32 n) const { - return (getNumAnimatedObjectAttachments() + n) <= getMaxAnimatedObjectAttachments(); + return (getNumAnimatedObjectAttachments() + n) <= (U32)getMaxAnimatedObjectAttachments(); } //----------------------------------------------------------------------------- -- cgit v1.2.3