summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2024-06-01 15:49:26 +0200
committerAnsariel <ansariel.hiller@phoenixviewer.com>2024-06-01 15:49:26 +0200
commitb42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 (patch)
treed73404c2fbacce379a57e2d03a6cd54558590859 /indra/llcharacter
parentcb3bd8865aa0f9fb8a247ea595cf1973057ba91f (diff)
Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/llcharacter.cpp4
-rw-r--r--indra/llcharacter/llgesture.cpp2
-rw-r--r--indra/llcharacter/llgesture.h2
-rw-r--r--indra/llcharacter/lljoint.cpp4
-rw-r--r--indra/llcharacter/llkeyframemotion.cpp11
-rw-r--r--indra/llcharacter/llkeyframemotion.h2
-rw-r--r--indra/llcharacter/llmotioncontroller.cpp14
7 files changed, 20 insertions, 19 deletions
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp
index 3fcef42a89..264b9a0be1 100644
--- a/indra/llcharacter/llcharacter.cpp
+++ b/indra/llcharacter/llcharacter.cpp
@@ -73,8 +73,8 @@ LLCharacter::~LLCharacter()
delete param;
}
- U32 i ;
- U32 size = sInstances.size() ;
+ size_t i ;
+ size_t size = sInstances.size() ;
for(i = 0 ; i < size ; i++)
{
if(sInstances[i] == this)
diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp
index 151bac7920..b69462ce28 100644
--- a/indra/llcharacter/llgesture.cpp
+++ b/indra/llcharacter/llgesture.cpp
@@ -282,7 +282,7 @@ bool LLGestureList::trigger(KEY key, MASK mask)
U8 *LLGestureList::serialize(U8 *buffer) const
{
// a single S32 serves as the header that tells us how many to read
- U32 count = mList.size();
+ auto count = mList.size();
htolememcpy(buffer, &count, MVT_S32, 4);
buffer += sizeof(count);
diff --git a/indra/llcharacter/llgesture.h b/indra/llcharacter/llgesture.h
index f1b83a4b50..f8504d06d2 100644
--- a/indra/llcharacter/llgesture.h
+++ b/indra/llcharacter/llgesture.h
@@ -90,7 +90,7 @@ public:
bool triggerAndReviseString(const std::string &string, std::string* revised_string);
// Used for construction from UI
- S32 count() const { return mList.size(); }
+ S32 count() const { return static_cast<S32>(mList.size()); }
virtual LLGesture* get(S32 i) const { return mList.at(i); }
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
void deleteAll();
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index 34aea19d6c..c2a10d969f 100644
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -76,7 +76,7 @@ void LLVector3OverrideMap::showJointVector3Overrides( std::ostringstream& os ) c
U32 LLVector3OverrideMap::count() const
{
- return m_map.size();
+ return static_cast<U32>(m_map.size());
}
void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
@@ -86,7 +86,7 @@ void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
bool LLVector3OverrideMap::remove(const LLUUID& mesh_id)
{
- U32 remove_count = m_map.erase(mesh_id);
+ auto remove_count = m_map.erase(mesh_id);
return (remove_count > 0);
}
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 99ee3198d6..12212efb66 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -430,8 +430,9 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
//-----------------------------------------------------------------------------
LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
: LLMotion(id),
- mJointMotionList(NULL),
- mPelvisp(NULL),
+ mJointMotionList(nullptr),
+ mPelvisp(nullptr),
+ mCharacter(nullptr),
mLastSkeletonSerialNum(0),
mLastUpdateTime(0.f),
mLastLoopedTime(0.f),
@@ -2079,7 +2080,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
JointMotion* joint_motionp = mJointMotionList->getJointMotion(i);
success &= dp.packString(joint_motionp->mJointName, "joint_name");
success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
- success &= dp.packS32(joint_motionp->mRotationCurve.mKeys.size(), "num_rot_keys");
+ success &= dp.packS32(static_cast<S32>(joint_motionp->mRotationCurve.mKeys.size()), "num_rot_keys");
LL_DEBUGS("BVH") << "Joint " << i
<< " name: " << joint_motionp->mJointName
@@ -2105,7 +2106,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
LL_DEBUGS("BVH") << " rot: t " << rot_key.mTime << " angles " << rot_angles.mV[VX] <<","<< rot_angles.mV[VY] <<","<< rot_angles.mV[VZ] << LL_ENDL;
}
- success &= dp.packS32(joint_motionp->mPositionCurve.mKeys.size(), "num_pos_keys");
+ success &= dp.packS32(static_cast<S32>(joint_motionp->mPositionCurve.mKeys.size()), "num_pos_keys");
for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys)
{
PositionKey& pos_key = pos_pair.second;
@@ -2125,7 +2126,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
}
}
- success &= dp.packS32(mJointMotionList->mConstraints.size(), "num_constraints");
+ success &= dp.packS32(static_cast<S32>(mJointMotionList->mConstraints.size()), "num_constraints");
LL_DEBUGS("BVH") << "num_constraints " << mJointMotionList->mConstraints.size() << LL_ENDL;
for (JointConstraintSharedData* shared_constraintp : mJointMotionList->mConstraints)
{
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index edf2308050..d5b27c8102 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -420,7 +420,7 @@ public:
~JointMotionList();
U32 dumpDiagInfo();
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
- U32 getNumJointMotions() const { return mJointMotionArray.size(); }
+ U32 getNumJointMotions() const { return static_cast<U32>(mJointMotionArray.size()); }
};
protected:
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 5f99633a58..c204c96f6c 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -156,11 +156,11 @@ LLMotionController::~LLMotionController()
void LLMotionController::incMotionCounts(S32& num_motions, S32& num_loading_motions, S32& num_loaded_motions, S32& num_active_motions, S32& num_deprecated_motions)
{
- num_motions += mAllMotions.size();
- num_loading_motions += mLoadingMotions.size();
- num_loaded_motions += mLoadedMotions.size();
- num_active_motions += mActiveMotions.size();
- num_deprecated_motions += mDeprecatedMotions.size();
+ num_motions += static_cast<S32>(mAllMotions.size());
+ num_loading_motions += static_cast<S32>(mLoadingMotions.size());
+ num_loaded_motions += static_cast<S32>(mLoadedMotions.size());
+ num_active_motions += static_cast<S32>(mActiveMotions.size());
+ num_deprecated_motions += static_cast<S32>(mDeprecatedMotions.size());
}
//-----------------------------------------------------------------------------
@@ -222,7 +222,7 @@ void LLMotionController::purgeExcessMotions()
}
// clean up all inactive, loaded motions
- for (LLUUID motion_id : motions_to_kill)
+ for (const LLUUID& motion_id : motions_to_kill)
{
// look up the motion again by ID to get canonical instance
// and kill it only if that one is inactive
@@ -233,7 +233,7 @@ void LLMotionController::purgeExcessMotions()
}
}
- U32 loaded_count = mLoadedMotions.size();
+ U32 loaded_count = static_cast<U32>(mLoadedMotions.size());
if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge)
{
LL_WARNS_ONCE("Animation") << loaded_count << " Loaded Motions. Amount of motions is over limit." << LL_ENDL;