summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2025-10-27 02:55:56 -0400
committerRye <rye@alchemyviewer.org>2025-10-27 04:59:16 -0400
commite803bbc0db695abe73de9797510ba22646528e23 (patch)
treea3aa818fa4768b40df9223fb5922aa27ac2a21a7 /indra/llcharacter
parentb1a96885492b65fe0636bf1184f5a8fbfe7b3930 (diff)
Modernize viewer alignment macros to use alignas and fix misaligned class issues reported by ubsan/asan
Signed-off-by: Rye <rye@alchemyviewer.org>
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/lleditingmotion.h15
-rw-r--r--indra/llcharacter/lljoint.h7
-rw-r--r--indra/llcharacter/llkeyframestandmotion.h5
-rw-r--r--indra/llcharacter/llpose.h7
-rw-r--r--indra/llcharacter/llvisualparam.h5
5 files changed, 17 insertions, 22 deletions
diff --git a/indra/llcharacter/lleditingmotion.h b/indra/llcharacter/lleditingmotion.h
index f94756d43d..a3c0ee94b7 100644
--- a/indra/llcharacter/lleditingmotion.h
+++ b/indra/llcharacter/lleditingmotion.h
@@ -42,8 +42,7 @@
//-----------------------------------------------------------------------------
// class LLEditingMotion
//-----------------------------------------------------------------------------
-LL_ALIGN_PREFIX(16)
-class LLEditingMotion :
+class alignas(16) LLEditingMotion :
public LLMotion
{
LL_ALIGN_NEW
@@ -110,11 +109,11 @@ public:
//-------------------------------------------------------------------------
// joint states to be animated
//-------------------------------------------------------------------------
- LL_ALIGN_16(LLJoint mParentJoint);
- LL_ALIGN_16(LLJoint mShoulderJoint);
- LL_ALIGN_16(LLJoint mElbowJoint);
- LL_ALIGN_16(LLJoint mWristJoint);
- LL_ALIGN_16(LLJoint mTarget);
+ LLJoint mParentJoint;
+ LLJoint mShoulderJoint;
+ LLJoint mElbowJoint;
+ LLJoint mWristJoint;
+ LLJoint mTarget;
LLJointSolverRP3 mIKSolver;
LLCharacter *mCharacter;
@@ -129,7 +128,7 @@ public:
static S32 sHandPose;
static S32 sHandPosePriority;
LLVector3 mLastSelectPt;
-} LL_ALIGN_POSTFIX(16);
+};
#endif // LL_LLKEYFRAMEMOTION_H
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index b58dc797f8..481fb0a1bb 100644
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -86,8 +86,7 @@ inline bool operator!=(const LLVector3OverrideMap& a, const LLVector3OverrideMap
//-----------------------------------------------------------------------------
// class LLJoint
//-----------------------------------------------------------------------------
-LL_ALIGN_PREFIX(16)
-class LLJoint
+class alignas(16) LLJoint
{
LL_ALIGN_NEW
public:
@@ -118,7 +117,7 @@ public:
};
protected:
// explicit transformation members
- LL_ALIGN_16(LLMatrix4a mWorldMatrix);
+ LLMatrix4a mWorldMatrix;
LLXformMatrix mXform;
std::string mName;
@@ -302,6 +301,6 @@ public:
// These are used in checks of whether a pos/scale override is considered significant.
bool aboveJointPosThreshold(const LLVector3& pos) const;
bool aboveJointScaleThreshold(const LLVector3& scale) const;
-} LL_ALIGN_POSTFIX(16);
+};
#endif // LL_LLJOINT_H
diff --git a/indra/llcharacter/llkeyframestandmotion.h b/indra/llcharacter/llkeyframestandmotion.h
index df458c7a0c..7d1acb7c5a 100644
--- a/indra/llcharacter/llkeyframestandmotion.h
+++ b/indra/llcharacter/llkeyframestandmotion.h
@@ -37,8 +37,7 @@
//-----------------------------------------------------------------------------
// class LLKeyframeStandMotion
//-----------------------------------------------------------------------------
-LL_ALIGN_PREFIX(16)
-class LLKeyframeStandMotion :
+class alignas(16) LLKeyframeStandMotion :
public LLKeyframeMotion
{
LL_ALIGN_NEW
@@ -112,7 +111,7 @@ public:
bool mTrackAnkles;
S32 mFrameNum;
-} LL_ALIGN_POSTFIX(16);
+};
#endif // LL_LLKEYFRAMESTANDMOTION_H
diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h
index f2032220e0..fbcd482211 100644
--- a/indra/llcharacter/llpose.h
+++ b/indra/llcharacter/llpose.h
@@ -80,8 +80,7 @@ public:
const S32 JSB_NUM_JOINT_STATES = 6;
-LL_ALIGN_PREFIX(16)
-class LLJointStateBlender
+class alignas(16) LLJointStateBlender
{
LL_ALIGN_NEW
protected:
@@ -98,8 +97,8 @@ public:
void resetCachedJoint();
public:
- LL_ALIGN_16(LLJoint mJointCache);
-} LL_ALIGN_POSTFIX(16);
+ LLJoint mJointCache;
+};
class LLMotion;
diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h
index 3caddb9c62..c99577ed80 100644
--- a/indra/llcharacter/llvisualparam.h
+++ b/indra/llcharacter/llvisualparam.h
@@ -100,8 +100,7 @@ protected:
// An interface class for a generalized parametric modification of the avatar mesh
// Contains data that is specific to each Avatar
//-----------------------------------------------------------------------------
-LL_ALIGN_PREFIX(16)
-class LLVisualParam
+class alignas(16) LLVisualParam
{
public:
typedef boost::function<LLVisualParam*(S32)> visual_param_mapper;
@@ -180,6 +179,6 @@ protected:
S32 mID; // id for storing weight/morphtarget compares compactly
LLVisualParamInfo *mInfo;
EParamLocation mParamLocation; // where does this visual param live?
-} LL_ALIGN_POSTFIX(16);
+};
#endif // LL_LLVisualParam_H