diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 0000000000..b3d81dab9e
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,8 @@
+# Replace tabs with spaces
+1b68f71348ecf3983b76b40d7940da8377f049b7
+# Trim trailing whitespace
+a0b3021bdcf76859054fda8e30abb3ed47749e83
+# Wrong line endings
+1b67dd855c41f5a0cda7ec2a68d98071986ca703
+6cc7dd09d5e69cf57e6de7fb568a0ad2693f9c9a
+e2e37cced861b98de8c1a7c9c0d3a50d2d90e433
diff --git a/.github/labeler.yaml b/.github/labeler.yaml
index d31a361baf..a334536389 100644
--- a/.github/labeler.yaml
+++ b/.github/labeler.yaml
@@ -1,6 +1,6 @@
llappearance:
- indra/llappearance/**/*
-
+
llaudio:
- indra/llaudio/**/*
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 8d1c6b63e6..57faafc042 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -312,7 +312,7 @@ jobs:
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
needs: build
- runs-on: windows
+ runs-on: windows-large
steps:
- name: Sign and package Windows viewer
if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID
@@ -412,7 +412,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
pattern: "*-metadata"
-
+
- name: Rename metadata
run: |
cp Windows-metadata/autobuild-package.xml Windows-autobuild-package.xml
@@ -441,7 +441,7 @@ jobs:
append_body: true
fail_on_unmatched_files: true
files: |
- macOS-installer/*.dmg
+ macOS-installer/*.dmg
Windows-installer/*.exe
*-autobuild-package.xml
*-viewer_version.txt
diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml
index 6d0eaacca5..85138c7bcd 100644
--- a/.github/workflows/stale.yaml
+++ b/.github/workflows/stale.yaml
@@ -1,4 +1,4 @@
-name: Stale PRs
+name: Stale PRs
on:
workflow_dispatch:
schedule:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d40f02dc0c..1dd7c8c800 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,5 +1,5 @@
repos:
- - repo: https://github.com/secondlife/git-hooks.git
+ - repo: https://github.com/secondlife/git-hooks.git
rev: v1.0.2
hooks:
- id: opensource-license
@@ -16,3 +16,5 @@ repos:
hooks:
- id: check-xml
- id: mixed-line-ending
+ - id: trailing-whitespace
+ files: \.(cpp|c|h|inl|py|glsl|cmake|yaml|sh)$
diff --git a/autobuild.xml b/autobuild.xml
index d239f66a4d..38ab65386a 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1720,6 +1720,14 @@
llphysicsextensions_source
name
linux64
@@ -1761,26 +1769,18 @@
creds
github
hash
- f652ce0d6aef864689f0ed44255da4d9cd65a43f
+ 67f647538b1b49d0152fd9d03cfb9bdf978e33d1
hash_algorithm
sha1
url
- https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851463
+ https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966328
name
windows64
- license
- internal
- license_file
- LICENSES/llphysicsextensions.txt
- copyright
- Copyright (c) 2010, Linden Research, Inc.
version
- 1.0.479d20a
- name
- llphysicsextensions_source
+ 1.0.b8b1f73
llphysicsextensions_stub
diff --git a/build.sh b/build.sh
index b40a86e9e5..f5cf448948 100755
--- a/build.sh
+++ b/build.sh
@@ -199,14 +199,14 @@ package_llphysicsextensions_tpv()
tpv_status=0
# nat 2016-12-21: without HAVOK, can't build PhysicsExtensions_TPV.
if [ "$variant" = "Release" -a "${HAVOK:-}" != "OFF" ]
- then
+ then
tpvconfig="$build_dir/packages/llphysicsextensions/autobuild-tpv.xml"
test -r "$tpvconfig" || fatal "No llphysicsextensions_tpv autobuild configuration found"
# SL-19942: autobuild ignores -c switch if AUTOBUILD_CONFIGURATION set
unset AUTOBUILD_CONFIGURATION
"$autobuild" build --quiet --config-file "$(native_path "$tpvconfig")" -c Tpv \
|| fatal "failed to build llphysicsextensions_tpv"
-
+
# capture the package file name for use in upload later...
PKGTMP=`mktemp -t pgktpv.XXXXXX`
cleanup="$cleanup ; rm $PKGTMP* 2>/dev/null"
@@ -239,7 +239,7 @@ build()
|| fatal "failed building $variant"
echo true >"$build_dir"/build_ok
end_section "autobuild $variant"
-
+
begin_section "extensions $variant"
# Run build extensions
if [ -d ${build_dir}/packages/build-extensions ]
@@ -312,7 +312,7 @@ begin_section "select viewer channel"
# Look for a branch-specific viewer_channel setting
# changeset_branch is set in the sling-buildscripts
viewer_build_branch=$(echo -n "${changeset_branch:-$(repo_branch ${BUILDSCRIPTS_SRC:-$(pwd)})}" | tr -Cs 'A-Za-z0-9_' '_' | sed -E 's/^_+//; s/_+$//')
-if [ -n "$viewer_build_branch" ]
+if [ -n "$viewer_build_branch" ]
then
branch_viewer_channel_var="${viewer_build_branch}_viewer_channel"
if [ -n "${!branch_viewer_channel_var}" ]
@@ -434,7 +434,7 @@ do
record_event "configure for $variant failed: build skipped"
fi
- if ! $succeeded
+ if ! $succeeded
then
record_event "remaining variants skipped due to $variant failure"
break
@@ -496,7 +496,7 @@ then
fi
done
end_section "Upload Debian Repository"
-
+
else
record_event "debian build not enabled"
fi
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index f209220f71..52465312eb 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -129,6 +129,11 @@ if (WINDOWS)
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
endif()
+
+ # workaround for github runner image breakage:
+ # https://github.com/actions/runner-images/issues/10004#issuecomment-2153445161
+ # can be removed after the above issue is resolved and deployed across GHA
+ add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
endif (WINDOWS)
diff --git a/indra/cmake/TinyEXR.cmake b/indra/cmake/TinyEXR.cmake
index e6d142d19d..e741c07f6e 100644
--- a/indra/cmake/TinyEXR.cmake
+++ b/indra/cmake/TinyEXR.cmake
@@ -3,5 +3,5 @@ include(Prebuilt)
use_prebuilt_binary(tinyexr)
-set(TINYEXR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinyexr)
+set(TINYEXR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinyexr)
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 65d3d51e12..5a5fcffe9b 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -117,7 +117,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(FIND_LIBRARY_USE_LIB64_PATHS ON)
endif (ADDRESS_SIZE EQUAL 32)
- execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
+ execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
RESULT_VARIABLE DPKG_RESULT
OUTPUT_VARIABLE DPKG_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py
index de6f2d187e..90bae43db9 100755
--- a/indra/lib/python/indra/util/llmanifest.py
+++ b/indra/lib/python/indra/util/llmanifest.py
@@ -537,8 +537,8 @@ class LLManifest(object, metaclass=LLManifestRegistry):
return path
def run_command(self, command, **kwds):
- """
- Runs an external command.
+ """
+ Runs an external command.
Raises ManifestError exception if the command returns a nonzero status.
"""
print("Running command:", shlex.join(command))
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 30ac98eeac..1987749826 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -164,19 +164,7 @@ LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAv
LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
LLCharacter(),
- mIsDummy(false),
- mTexSkinColor( NULL ),
- mTexHairColor( NULL ),
- mTexEyeColor( NULL ),
- mPelvisToFoot(0.f),
- mHeadOffset(),
- mRoot(NULL),
- mWearableData(wearable_data),
- mNumBones(0),
- mNumCollisionVolumes(0),
- mCollisionVolumes(NULL),
- mIsBuilt(false),
- mInitFlags(0)
+ mWearableData(wearable_data)
{
llassert_always(mWearableData);
mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
@@ -542,11 +530,11 @@ void LLAvatarAppearance::computeBodySize()
new_body_size.mV[VZ] = mPelvisToFoot +
// the sqrt(2) correction below is an approximate
// correction to get to the top of the head
- F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) +
- head.mV[VZ] * neck_scale.mV[VZ] +
- neck.mV[VZ] * chest_scale.mV[VZ] +
- chest.mV[VZ] * torso_scale.mV[VZ] +
- torso.mV[VZ] * pelvis_scale.mV[VZ];
+ F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) +
+ head.mV[VZ] * neck_scale.mV[VZ] +
+ neck.mV[VZ] * chest_scale.mV[VZ] +
+ chest.mV[VZ] * torso_scale.mV[VZ] +
+ torso.mV[VZ] * pelvis_scale.mV[VZ];
// TODO -- measure the real depth and width
new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH;
@@ -1479,12 +1467,12 @@ void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_
if( teToColorParams( te, param_name ) )
{
// [Legacy Bake]
- //setVisualParamWeight( param_name[0], new_color.mV[VX]);
- //setVisualParamWeight( param_name[1], new_color.mV[VY]);
- //setVisualParamWeight( param_name[2], new_color.mV[VZ]);
- setVisualParamWeight( param_name[0], new_color.mV[VX], upload_bake);
- setVisualParamWeight( param_name[1], new_color.mV[VY], upload_bake);
- setVisualParamWeight( param_name[2], new_color.mV[VZ], upload_bake);
+ //setVisualParamWeight( param_name[0], new_color.mV[VRED]);
+ //setVisualParamWeight( param_name[1], new_color.mV[VGREEN]);
+ //setVisualParamWeight( param_name[2], new_color.mV[VBLUE]);
+ setVisualParamWeight( param_name[0], new_color.mV[VRED], upload_bake);
+ setVisualParamWeight( param_name[1], new_color.mV[VGREEN], upload_bake);
+ setVisualParamWeight( param_name[2], new_color.mV[VBLUE], upload_bake);
// [Legacy Bake]
}
}
@@ -1495,9 +1483,9 @@ LLColor4 LLAvatarAppearance::getClothesColor( ETextureIndex te )
U32 param_name[3];
if( teToColorParams( te, param_name ) )
{
- color.mV[VX] = getVisualParamWeight( param_name[0] );
- color.mV[VY] = getVisualParamWeight( param_name[1] );
- color.mV[VZ] = getVisualParamWeight( param_name[2] );
+ color.mV[VRED] = getVisualParamWeight( param_name[0] );
+ color.mV[VGREEN] = getVisualParamWeight( param_name[1] );
+ color.mV[VBLUE] = getVisualParamWeight( param_name[2] );
}
return color;
}
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index f0bf080427..3617ce2bb6 100644
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -70,7 +70,7 @@ public:
static void initClass();
static void cleanupClass(); // Cleanup data that's only init'd once per class.
virtual void initInstance(); // Called after construction to initialize the instance.
- S32 mInitFlags;
+ S32 mInitFlags{ 0 };
virtual bool loadSkeletonNode();
bool loadMeshNodes();
bool loadLayersets();
@@ -137,8 +137,8 @@ public:
F32 getPelvisToFoot() const { return mPelvisToFoot; }
/*virtual*/ LLJoint* getRootJoint() { return mRoot; }
- LLVector3 mHeadOffset; // current head position
- LLAvatarJoint *mRoot;
+ LLVector3 mHeadOffset{}; // current head position
+ LLAvatarJoint* mRoot{ nullptr };
// This map gets queried a huge amount of time.
// typedef std::map joint_map_t;
@@ -176,7 +176,7 @@ protected:
bool buildSkeleton(const LLAvatarSkeletonInfo *info);
void clearSkeleton();
- bool mIsBuilt; // state of deferred character building
+ bool mIsBuilt{ false }; // state of deferred character building
avatar_joint_list_t mSkeleton;
LLVector3OverrideMap mPelvisFixups;
joint_alias_map_t mJointAliasMap;
@@ -193,30 +193,30 @@ public:
LLVector3 mBodySize;
LLVector3 mAvatarOffset;
protected:
- F32 mPelvisToFoot;
+ F32 mPelvisToFoot{ 0.f };
//--------------------------------------------------------------------
// Cached pointers to well known joints
//--------------------------------------------------------------------
public:
- LLJoint* mPelvisp;
- LLJoint* mTorsop;
- LLJoint* mChestp;
- LLJoint* mNeckp;
- LLJoint* mHeadp;
- LLJoint* mSkullp;
- LLJoint* mEyeLeftp;
- LLJoint* mEyeRightp;
- LLJoint* mHipLeftp;
- LLJoint* mHipRightp;
- LLJoint* mKneeLeftp;
- LLJoint* mKneeRightp;
- LLJoint* mAnkleLeftp;
- LLJoint* mAnkleRightp;
- LLJoint* mFootLeftp;
- LLJoint* mFootRightp;
- LLJoint* mWristLeftp;
- LLJoint* mWristRightp;
+ LLJoint* mPelvisp{nullptr};
+ LLJoint* mTorsop{ nullptr };
+ LLJoint* mChestp{ nullptr };
+ LLJoint* mNeckp{ nullptr };
+ LLJoint* mHeadp{ nullptr };
+ LLJoint* mSkullp{ nullptr };
+ LLJoint* mEyeLeftp{ nullptr };
+ LLJoint* mEyeRightp{ nullptr };
+ LLJoint* mHipLeftp{ nullptr };
+ LLJoint* mHipRightp{ nullptr };
+ LLJoint* mKneeLeftp{ nullptr };
+ LLJoint* mKneeRightp{ nullptr };
+ LLJoint* mAnkleLeftp{ nullptr };
+ LLJoint* mAnkleRightp{ nullptr };
+ LLJoint* mFootLeftp{ nullptr };
+ LLJoint* mFootRightp{ nullptr };
+ LLJoint* mWristLeftp{ nullptr };
+ LLJoint* mWristRightp{ nullptr };
//--------------------------------------------------------------------
// XML parse tree
@@ -240,7 +240,7 @@ public:
** RENDERING
**/
public:
- bool mIsDummy; // for special views and animated object controllers; local to viewer
+ bool mIsDummy{ false }; // for special views and animated object controllers; local to viewer
//--------------------------------------------------------------------
// Morph masks
@@ -311,9 +311,9 @@ public:
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake) = 0;
// [Legacy Bake]
protected:
- LLTexGlobalColor* mTexSkinColor;
- LLTexGlobalColor* mTexHairColor;
- LLTexGlobalColor* mTexEyeColor;
+ LLTexGlobalColor* mTexSkinColor{ nullptr };
+ LLTexGlobalColor* mTexHairColor{ nullptr };
+ LLTexGlobalColor* mTexEyeColor{ nullptr };
//--------------------------------------------------------------------
// Visibility
@@ -336,7 +336,7 @@ public:
virtual bool isWearingWearableType(LLWearableType::EType type ) const;
private:
- LLWearableData* mWearableData;
+ LLWearableData* mWearableData{ nullptr };
/********************************************************************************
** **
@@ -354,11 +354,11 @@ protected:
struct BakedTextureData
{
LLUUID mLastTextureID;
- LLTexLayerSet* mTexLayerSet; // Only exists for self
- bool mIsLoaded;
- bool mIsUsed;
- LLAvatarAppearanceDefines::ETextureIndex mTextureIndex;
- U32 mMaskTexName;
+ LLTexLayerSet* mTexLayerSet{ nullptr }; // Only exists for self
+ bool mIsLoaded{ false };
+ bool mIsUsed{ false };
+ LLAvatarAppearanceDefines::ETextureIndex mTextureIndex{ LLAvatarAppearanceDefines::ETextureIndex::TEX_INVALID };
+ U32 mMaskTexName{ 0 };
// Stores pointers to the joint meshes that this baked texture deals with
avatar_joint_mesh_list_t mJointMeshes;
morph_list_t mMaskedMorphs;
@@ -375,9 +375,9 @@ protected:
// Collision volumes
//--------------------------------------------------------------------
public:
- S32 mNumBones;
- S32 mNumCollisionVolumes;
- LLAvatarJointCollisionVolume* mCollisionVolumes;
+ S32 mNumBones{ 0 };
+ S32 mNumCollisionVolumes{ 0 };
+ LLAvatarJointCollisionVolume* mCollisionVolumes{ nullptr };
protected:
bool allocateCollisionVolumes(U32 num);
diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp
index 01e0dbbdd0..2c21b9ee4b 100644
--- a/indra/llappearance/lldriverparam.cpp
+++ b/indra/llappearance/lldriverparam.cpp
@@ -435,7 +435,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po
S32 LLDriverParam::getDrivenParamsCount() const
{
- return mDriven.size();
+ return static_cast(mDriven.size());
}
const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h
index af3169ae3d..7b0061cb0d 100644
--- a/indra/llappearance/lldriverparam.h
+++ b/indra/llappearance/lldriverparam.h
@@ -138,10 +138,10 @@ protected:
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder
entry_list_t mDriven;
- LLViewerVisualParam* mCurrentDistortionParam;
+ LLViewerVisualParam* mCurrentDistortionParam{ nullptr };
// Backlink only; don't make this an LLPointer.
- LLAvatarAppearance* mAvatarAppearance;
- LLWearable* mWearablep;
+ LLAvatarAppearance* mAvatarAppearance{ nullptr };
+ LLWearable* mWearablep{ nullptr };
};
#endif // LL_LLDRIVERPARAM_H
diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp
index 9707f002ee..f743f7b517 100644
--- a/indra/llappearance/lllocaltextureobject.cpp
+++ b/indra/llappearance/lllocaltextureobject.cpp
@@ -109,7 +109,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name)
U32 LLLocalTextureObject::getNumTexLayers() const
{
- return mTexLayers.size();
+ return static_cast(mTexLayers.size());
}
LLUUID LLLocalTextureObject::getID() const
diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp
index ffcd63d6df..7aa6c10803 100644
--- a/indra/llappearance/llpolymesh.cpp
+++ b/indra/llappearance/llpolymesh.cpp
@@ -983,7 +983,7 @@ void LLPolyMesh::initializeForMorph()
LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2));
- for (U32 i = 0; i < mSharedData->mNumVertices; ++i)
+ for (S32 i = 0; i < mSharedData->mNumVertices; ++i)
{
mClothingWeights[i].clear();
}
diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index 77d3575f55..305ad61a5f 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -107,7 +107,7 @@ LLPolyMorphData::~LLPolyMorphData()
bool LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
{
S32 numVertices;
- S32 numRead;
+ size_t numRead;
numRead = fread(&numVertices, sizeof(S32), 1, fp);
llendianswizzle(&numVertices, sizeof(S32), 1);
@@ -386,8 +386,8 @@ bool LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
if (!mMorphData)
{
const std::string driven_tag = "_Driven";
- U32 pos = morph_param_name.find(driven_tag);
- if (pos > 0)
+ auto pos = morph_param_name.find(driven_tag);
+ if (pos != std::string::npos && pos > 0)
{
morph_param_name = morph_param_name.substr(0,pos);
mMorphData = mMesh->getMorphData(morph_param_name);
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index 0896540266..b1344e508f 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -1045,7 +1045,7 @@ bool LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
bool success = true;
// If you can't see the layer, don't render it.
- if( is_approx_zero( net_color.mV[VW] ) )
+ if( is_approx_zero( net_color.mV[VALPHA] ) )
{
return success;
}
@@ -1220,7 +1220,7 @@ bool LLTexLayer::findNetColor(LLColor4* net_color) const
{
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getInfo()->mGlobalColor ) );
}
- else if (getInfo()->mFixedColor.mV[VW])
+ else if (getInfo()->mFixedColor.mV[VALPHA])
{
net_color->setVec( getInfo()->mFixedColor );
}
@@ -1239,7 +1239,7 @@ bool LLTexLayer::findNetColor(LLColor4* net_color) const
return true;
}
- if( getInfo()->mFixedColor.mV[VW] )
+ if( getInfo()->mFixedColor.mV[VALPHA] )
{
net_color->setVec( getInfo()->mFixedColor );
return true;
@@ -1380,7 +1380,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
// Draw a rectangle with the layer color to multiply the alpha by that color's alpha.
// Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO );
- if ( !is_approx_equal(layer_color.mV[VW], 1.f) )
+ if ( !is_approx_equal(layer_color.mV[VALPHA], 1.f) )
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4fv(layer_color.mV);
@@ -1486,8 +1486,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
// Check invariants and allocate memory
llassert_always(textureH > 0);
llassert_always(textureW > 0);
- llassert_always(textureH >= height);
- llassert_always(textureW >= width);
+ llassert_always(textureH >= (U32)height);
+ llassert_always(textureW >= (U32)width);
llassert_always(x == 0);
llassert_always(y == 0);
diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp
index 55bc73b9b0..5d614d5d8f 100644
--- a/indra/llappearance/lltexlayerparams.cpp
+++ b/indra/llappearance/lltexlayerparams.cpp
@@ -482,10 +482,10 @@ LLColor4 LLTexLayerParamColor::getNetColor() const
F32 weight = scaled_weight - index_start;
const LLColor4 *start = &info->mColors[ index_start ];
const LLColor4 *end = &info->mColors[ index_end ];
- return LLColor4((1.f - weight) * start->mV[VX] + weight * end->mV[VX],
- (1.f - weight) * start->mV[VY] + weight * end->mV[VY],
- (1.f - weight) * start->mV[VZ] + weight * end->mV[VZ],
- (1.f - weight) * start->mV[VW] + weight * end->mV[VW]);
+ return LLColor4((1.f - weight) * start->mV[VRED] + weight * end->mV[VRED],
+ (1.f - weight) * start->mV[VGREEN] + weight * end->mV[VGREEN],
+ (1.f - weight) * start->mV[VBLUE] + weight * end->mV[VBLUE],
+ (1.f - weight) * start->mV[VALPHA] + weight * end->mV[VALPHA]);
}
}
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index 472e14133f..13bfee31c2 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -763,7 +763,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
std::string terse_F32_to_string(F32 f)
{
std::string r = llformat("%.2f", f);
- S32 len = r.length();
+ auto len = r.length();
// "1.20" -> "1.2"
// "24.00" -> "24."
diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp
index 2ac5c87c0e..1aca01ae3c 100644
--- a/indra/llappearance/llwearabledata.cpp
+++ b/indra/llappearance/llwearabledata.cpp
@@ -346,7 +346,7 @@ U32 LLWearableData::getWearableCount(const LLWearableType::EType type) const
return 0;
}
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
- return wearable_vec.size();
+ return static_cast(wearable_vec.size());
}
U32 LLWearableData::getWearableCount(const U32 tex_index) const
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp
index fc1ae2a7f0..2b003b6aa8 100644
--- a/indra/llaudio/llaudiodecodemgr.cpp
+++ b/indra/llaudio/llaudiodecodemgr.cpp
@@ -422,7 +422,7 @@ bool LLVorbisDecodeState::finishDecode()
ov_clear(&mVF);
// write "data" chunk length, in little-endian format
- S32 data_length = mWAVBuffer.size() - WAV_HEADER_SIZE;
+ S32 data_length = static_cast(mWAVBuffer.size()) - WAV_HEADER_SIZE;
mWAVBuffer[40] = (data_length) & 0x000000FF;
mWAVBuffer[41] = (data_length >> 8) & 0x000000FF;
mWAVBuffer[42] = (data_length >> 16) & 0x000000FF;
@@ -463,7 +463,7 @@ bool LLVorbisDecodeState::finishDecode()
{
memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/
}
- S32 near_end = mWAVBuffer.size() - (2 * fade_length);
+ S32 near_end = static_cast(mWAVBuffer.size()) - (2 * fade_length);
if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length))
{
memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/
@@ -491,7 +491,7 @@ bool LLVorbisDecodeState::finishDecode()
return true; // we've finished
}
mBytesRead = -1;
- mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, mWAVBuffer.size(),
+ mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, static_cast(mWAVBuffer.size()),
new WriteResponder(this));
}
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp
index 350d74dc6a..bc27a1e5f1 100644
--- a/indra/llcharacter/llcharacter.cpp
+++ b/indra/llcharacter/llcharacter.cpp
@@ -73,8 +73,8 @@ LLCharacter::~LLCharacter()
delete param;
}
- U32 i ;
- U32 size = sInstances.size() ;
+ size_t i ;
+ size_t size = sInstances.size() ;
for(i = 0 ; i < size ; i++)
{
if(sInstances[i] == this)
diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp
index 151bac7920..b69462ce28 100644
--- a/indra/llcharacter/llgesture.cpp
+++ b/indra/llcharacter/llgesture.cpp
@@ -282,7 +282,7 @@ bool LLGestureList::trigger(KEY key, MASK mask)
U8 *LLGestureList::serialize(U8 *buffer) const
{
// a single S32 serves as the header that tells us how many to read
- U32 count = mList.size();
+ auto count = mList.size();
htolememcpy(buffer, &count, MVT_S32, 4);
buffer += sizeof(count);
diff --git a/indra/llcharacter/llgesture.h b/indra/llcharacter/llgesture.h
index f1b83a4b50..f8504d06d2 100644
--- a/indra/llcharacter/llgesture.h
+++ b/indra/llcharacter/llgesture.h
@@ -90,7 +90,7 @@ public:
bool triggerAndReviseString(const std::string &string, std::string* revised_string);
// Used for construction from UI
- S32 count() const { return mList.size(); }
+ S32 count() const { return static_cast(mList.size()); }
virtual LLGesture* get(S32 i) const { return mList.at(i); }
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
void deleteAll();
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index a94406696a..b63101aa07 100644
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -47,7 +47,7 @@ JointKey JointKey::construct(const std::string& aName)
return { aName, itr->second };
}
- U32 size = mpStringToKeys.size() + 1;
+ U32 size = static_cast(mpStringToKeys.size()) + 1;
mpStringToKeys.try_emplace(aName, size);
return { aName, size };
}
@@ -94,7 +94,7 @@ void LLVector3OverrideMap::showJointVector3Overrides( std::ostringstream& os ) c
U32 LLVector3OverrideMap::count() const
{
- return m_map.size();
+ return static_cast(m_map.size());
}
void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
@@ -104,7 +104,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 53ab3968ee..e0f436a6cd 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -432,9 +432,9 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
//-----------------------------------------------------------------------------
LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
: LLMotion(id),
- mJointMotionList(NULL),
- mPelvisp(NULL),
- mCharacter(NULL), // Uninitialized pointer fix by Drake Arconis
+ mJointMotionList(nullptr),
+ mPelvisp(nullptr),
+ mCharacter(nullptr),
mLastSkeletonSerialNum(0),
mLastUpdateTime(0.f),
mLastLoopedTime(0.f),
@@ -2082,7 +2082,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
JointMotion* joint_motionp = mJointMotionList->getJointMotion(i);
success &= dp.packString(joint_motionp->mJointName, "joint_name");
success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
- success &= dp.packS32(joint_motionp->mRotationCurve.mKeys.size(), "num_rot_keys");
+ success &= dp.packS32(static_cast(joint_motionp->mRotationCurve.mKeys.size()), "num_rot_keys");
LL_DEBUGS("BVH") << "Joint " << i
<< " name: " << joint_motionp->mJointName
@@ -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;
}
- success &= dp.packS32(joint_motionp->mPositionCurve.mKeys.size(), "num_pos_keys");
+ success &= dp.packS32(static_cast(joint_motionp->mPositionCurve.mKeys.size()), "num_pos_keys");
for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys)
{
PositionKey& pos_key = pos_pair.second;
@@ -2128,7 +2128,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
}
}
- success &= dp.packS32(mJointMotionList->mConstraints.size(), "num_constraints");
+ success &= dp.packS32(static_cast(mJointMotionList->mConstraints.size()), "num_constraints");
LL_DEBUGS("BVH") << "num_constraints " << mJointMotionList->mConstraints.size() << LL_ENDL;
for (JointConstraintSharedData* shared_constraintp : mJointMotionList->mConstraints)
{
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index edf2308050..d5b27c8102 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -420,7 +420,7 @@ public:
~JointMotionList();
U32 dumpDiagInfo();
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
- U32 getNumJointMotions() const { return mJointMotionArray.size(); }
+ U32 getNumJointMotions() const { return static_cast(mJointMotionArray.size()); }
};
protected:
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 98e0f70fb2..7b1e8384ce 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -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)
{
- num_motions += mAllMotions.size();
- num_loading_motions += mLoadingMotions.size();
- num_loaded_motions += mLoadedMotions.size();
- num_active_motions += mActiveMotions.size();
- num_deprecated_motions += mDeprecatedMotions.size();
+ num_motions += static_cast(mAllMotions.size());
+ num_loading_motions += static_cast(mLoadingMotions.size());
+ num_loaded_motions += static_cast(mLoadedMotions.size());
+ num_active_motions += static_cast(mActiveMotions.size());
+ num_deprecated_motions += static_cast(mDeprecatedMotions.size());
}
//-----------------------------------------------------------------------------
@@ -223,7 +223,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
@@ -234,7 +234,7 @@ void LLMotionController::purgeExcessMotions()
}
}
- U32 loaded_count = mLoadedMotions.size();
+ U32 loaded_count = static_cast(mLoadedMotions.size());
// Can't do anything about it anyway - stop spamming the log
//if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge)
//{
diff --git a/indra/llcommon/StackWalker.cpp b/indra/llcommon/StackWalker.cpp
index 2c1bc47d0e..e9ae1723fb 100644
--- a/indra/llcommon/StackWalker.cpp
+++ b/indra/llcommon/StackWalker.cpp
@@ -1,5 +1,5 @@
/**********************************************************************
- *
+ *
* StackWalker.cpp
* http://stackwalker.codeplex.com/
*
@@ -13,14 +13,14 @@
* http://www.codeproject.com/threads/StackWalker.asp
* 2005-07-28 v2 - Changed the params of the constructor and ShowCallstack
* (to simplify the usage)
- * 2005-08-01 v3 - Changed to use 'CONTEXT_FULL' instead of CONTEXT_ALL
+ * 2005-08-01 v3 - Changed to use 'CONTEXT_FULL' instead of CONTEXT_ALL
* (should also be enough)
* - Changed to compile correctly with the PSDK of VC7.0
* (GetFileVersionInfoSizeA and GetFileVersionInfoA is wrongly defined:
* it uses LPSTR instead of LPCSTR as first paremeter)
* - Added declarations to support VC5/6 without using 'dbghelp.h'
- * - Added a 'pUserData' member to the ShowCallstack function and the
- * PReadProcessMemoryRoutine declaration (to pass some user-defined data,
+ * - Added a 'pUserData' member to the ShowCallstack function and the
+ * PReadProcessMemoryRoutine declaration (to pass some user-defined data,
* which can be used in the readMemoryFunction-callback)
* 2005-08-02 v4 - OnSymInit now also outputs the OS-Version by default
* - Added example for doing an exception-callstack-walking in main.cpp
@@ -60,26 +60,26 @@
* Copyright (c) 2005-2013, Jochen Kalmbach
* All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without modification,
+ * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of Jochen Kalmbach nor the names of its contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * Neither the name of Jochen Kalmbach nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
**********************************************************************/
@@ -234,7 +234,7 @@ DWORD64
// Some missing defines (for VC5/6):
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
-#endif
+#endif
// secure-CRT_functions are only available starting with VC8
@@ -396,7 +396,7 @@ public:
m_szSymPath = _strdup(szSymPath);
if (this->pSI(m_hProcess, m_szSymPath, FALSE) == FALSE)
this->m_parent->OnDbgHelpErr("SymInitialize", GetLastError(), 0);
-
+
DWORD symOptions = this->pSGO(); // SymGetOptions
symOptions |= SYMOPT_LOAD_LINES;
symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS;
@@ -512,11 +512,11 @@ struct IMAGEHLP_MODULE64_V2 {
tSSO pSSO;
// StackWalk64()
- typedef BOOL (__stdcall *tSW)(
- DWORD MachineType,
+ typedef BOOL (__stdcall *tSW)(
+ DWORD MachineType,
HANDLE hProcess,
- HANDLE hThread,
- LPSTACKFRAME64 StackFrame,
+ HANDLE hThread,
+ LPSTACKFRAME64 StackFrame,
PVOID ContextRecord,
PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine,
PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine,
@@ -1012,7 +1012,7 @@ bool StackWalker::LoadModules()
// The following is used to pass the "userData"-Pointer to the user-provided readMemoryFunction
// This has to be done due to a problem with the "hProcess"-parameter in x64...
-// Because this class is in no case multi-threading-enabled (because of the limitations
+// Because this class is in no case multi-threading-enabled (because of the limitations
// of dbghelp.dll) it is "safe" to use a static-variable
static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = NULL;
static LPVOID s_readMemoryFunction_UserData = NULL;
@@ -1222,7 +1222,7 @@ bool StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con
csEntry.symTypeString = NULL;
break;
}
-
+
MyStrCpy(csEntry.moduleName, STACKWALK_MAX_NAMELEN, Module.ModuleName);
csEntry.baseOfImage = Module.BaseOfImage;
MyStrCpy(csEntry.loadedImageName, STACKWALK_MAX_NAMELEN, Module.LoadedImageName);
@@ -1243,7 +1243,7 @@ bool StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con
et = firstEntry;
bLastEntryCalled = false;
this->OnCallstackEntry(et, csEntry);
-
+
if (s.AddrReturn.Offset == 0)
{
bLastEntryCalled = true;
@@ -1358,7 +1358,7 @@ void StackWalker::OnSymInit(LPCSTR szSearchPath, DWORD symOptions, LPCSTR szUser
ver.dwOSVersionInfoSize = sizeof(ver);
if (GetVersionExA(&ver) != FALSE)
{
- _snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "OS-Version: %d.%d.%d (%s)\n",
+ _snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "OS-Version: %d.%d.%d (%s)\n",
ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber,
ver.szCSDVersion);
if (m_verbose)
@@ -1372,7 +1372,7 @@ void StackWalker::OnSymInit(LPCSTR szSearchPath, DWORD symOptions, LPCSTR szUser
ver.dwOSVersionInfoSize = sizeof(ver);
if (GetVersionExA( (OSVERSIONINFOA*) &ver) != FALSE)
{
- _snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "OS-Version: %d.%d.%d (%s) 0x%x-0x%x\n",
+ _snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "OS-Version: %d.%d.%d (%s) 0x%x-0x%x\n",
ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber,
ver.szCSDVersion, ver.wSuiteMask, ver.wProductType);
if (m_verbose)
diff --git a/indra/llcommon/is_approx_equal_fraction.h b/indra/llcommon/is_approx_equal_fraction.h
index 732d168986..371a1307c1 100644
--- a/indra/llcommon/is_approx_equal_fraction.h
+++ b/indra/llcommon/is_approx_equal_fraction.h
@@ -5,25 +5,25 @@
* @brief lltut.h uses is_approx_equal_fraction(). Moved to this header
* file in llcommon so we can use lltut.h for llcommon tests without
* making llcommon depend on llmath.
- *
+ *
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h
index 0ba8b34cb6..8248f82186 100644
--- a/indra/llcommon/llalignedarray.h
+++ b/indra/llcommon/llalignedarray.h
@@ -116,7 +116,7 @@ void LLAlignedArray::resize(U32 size)
template
T& LLAlignedArray::operator[](int idx)
{
- if(idx >= mElementCount || idx < 0)
+ if (idx < 0 || unsigned(idx) >= mElementCount)
{
LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL;
}
@@ -126,7 +126,7 @@ T& LLAlignedArray::operator[](int idx)
template
const T& LLAlignedArray::operator[](int idx) const
{
- if (idx >= mElementCount || idx < 0)
+ if (idx < 0 || unsigned(idx) >= mElementCount)
{
LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL;
}
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 17555e7da7..2ab4dd3fda 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -199,9 +199,9 @@ bool LLApp::parseCommandOptions(int argc, char** argv)
#if LL_WINDOWS
//Windows changed command line parsing. Deal with it.
- S32 slen = value.length() - 1;
- S32 start = 0;
- S32 end = slen;
+ size_t slen = value.length() - 1;
+ size_t start = 0;
+ size_t end = slen;
if (argv[ii][start]=='"')start++;
if (argv[ii][end]=='"')end--;
if (start!=0 || end!=slen)
@@ -264,9 +264,9 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv)
#if LL_WINDOWS
//Windows changed command line parsing. Deal with it.
- S32 slen = value.length() - 1;
- S32 start = 0;
- S32 end = slen;
+ size_t slen = value.length() - 1;
+ size_t start = 0;
+ size_t end = slen;
if (wargv[ii][start]=='"')start++;
if (wargv[ii][end]=='"')end--;
if (start!=0 || end!=slen)
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp
index 23b30bcc57..a6a5fae5c4 100644
--- a/indra/llcommon/llcoros.cpp
+++ b/indra/llcommon/llcoros.cpp
@@ -3,25 +3,25 @@
* @author Nat Goodspeed
* @date 2009-06-03
* @brief Implementation for llcoros.
- *
+ *
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
diff --git a/indra/llcommon/lldefs.h b/indra/llcommon/lldefs.h
index 0ba756d472..2fbb26dc1a 100644
--- a/indra/llcommon/lldefs.h
+++ b/indra/llcommon/lldefs.h
@@ -31,64 +31,64 @@
#include
// Often used array indices
-const U32 VX = 0;
-const U32 VY = 1;
-const U32 VZ = 2;
-const U32 VW = 3;
-const U32 VS = 3;
+constexpr U32 VX = 0;
+constexpr U32 VY = 1;
+constexpr U32 VZ = 2;
+constexpr U32 VW = 3;
+constexpr U32 VS = 3;
-const U32 VRED = 0;
-const U32 VGREEN = 1;
-const U32 VBLUE = 2;
-const U32 VALPHA = 3;
+constexpr U32 VRED = 0;
+constexpr U32 VGREEN = 1;
+constexpr U32 VBLUE = 2;
+constexpr U32 VALPHA = 3;
-const U32 INVALID_DIRECTION = 0xFFFFFFFF;
-const U32 EAST = 0;
-const U32 NORTH = 1;
-const U32 WEST = 2;
-const U32 SOUTH = 3;
+constexpr U32 INVALID_DIRECTION = 0xFFFFFFFF;
+constexpr U32 EAST = 0;
+constexpr U32 NORTH = 1;
+constexpr U32 WEST = 2;
+constexpr U32 SOUTH = 3;
-const U32 NORTHEAST = 4;
-const U32 NORTHWEST = 5;
-const U32 SOUTHWEST = 6;
-const U32 SOUTHEAST = 7;
-const U32 MIDDLE = 8;
+constexpr U32 NORTHEAST = 4;
+constexpr U32 NORTHWEST = 5;
+constexpr U32 SOUTHWEST = 6;
+constexpr U32 SOUTHEAST = 7;
+constexpr U32 MIDDLE = 8;
-const U8 EAST_MASK = 0x1< // Windows errno
@@ -35,12 +41,6 @@
#include
#endif
-#include "linden_common.h"
-#include "llfile.h"
-#include "llstring.h"
-#include "llerror.h"
-#include "stringize.h"
-
using namespace std;
static std::string empty;
@@ -389,7 +389,7 @@ const char *LLFile::tmpdir()
sep = '\\';
std::vector utf16path(MAX_PATH + 1);
- GetTempPathW(utf16path.size(), &utf16path[0]);
+ GetTempPathW(static_cast(utf16path.size()), &utf16path[0]);
utf8path = ll_convert_wide_to_string(&utf16path[0]);
#else
sep = '/';
diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h
index 08a008c19a..2564671b13 100644
--- a/indra/llcommon/llfile.h
+++ b/indra/llcommon/llfile.h
@@ -97,7 +97,7 @@ public:
// no copy
LLUniqueFile(const LLUniqueFile&) = delete;
// move construction
- LLUniqueFile(LLUniqueFile&& other)
+ LLUniqueFile(LLUniqueFile&& other) noexcept
{
mFileHandle = other.mFileHandle;
other.mFileHandle = nullptr;
@@ -118,7 +118,7 @@ public:
// copy assignment deleted
LLUniqueFile& operator=(const LLUniqueFile&) = delete;
// move assignment
- LLUniqueFile& operator=(LLUniqueFile&& other)
+ LLUniqueFile& operator=(LLUniqueFile&& other) noexcept
{
close();
std::swap(mFileHandle, other.mFileHandle);
diff --git a/indra/llcommon/llfindlocale.cpp b/indra/llcommon/llfindlocale.cpp
index e39812bfc4..ac52f90c9f 100644
--- a/indra/llcommon/llfindlocale.cpp
+++ b/indra/llcommon/llfindlocale.cpp
@@ -157,14 +157,22 @@ canonise_fl(FL_Locale *l) {
if (l->lang && 0 == strcmp(l->lang, "en")) {
if (l->country && 0 == strcmp(l->country, "UK")) {
free((void*)l->country);
+#ifdef LL_WINDOWS
+ l->country = _strdup("GB");
+#else
l->country = strdup("GB");
+#endif
}
}
/* ja_JA -> ja_JP */
if (l->lang && 0 == strcmp(l->lang, "ja")) {
if (l->country && 0 == strcmp(l->country, "JA")) {
free((void*)l->country);
+#ifdef LL_WINDOWS
+ l->country = _strdup("JP");
+#else
l->country = strdup("JP");
+#endif
}
}
}
diff --git a/indra/llcommon/llindexedvector.h b/indra/llcommon/llindexedvector.h
index de3ae0dcc4..0b2e9c76ca 100644
--- a/indra/llcommon/llindexedvector.h
+++ b/indra/llcommon/llindexedvector.h
@@ -47,7 +47,7 @@ public:
typedef typename std::vector::size_type size_type;
protected:
std::vector mVector;
- std::map mIndexMap;
+ std::map mIndexMap;
public:
LLIndexedVector() { mVector.reserve(BlockSize); }
@@ -68,10 +68,10 @@ public:
Type& operator[](const Key& k)
{
- typename std::map::const_iterator iter = mIndexMap.find(k);
+ typename std::map::const_iterator iter = mIndexMap.find(k);
if (iter == mIndexMap.end())
{
- U32 n = mVector.size();
+ auto n = mVector.size();
mIndexMap[k] = n;
mVector.push_back(Type());
llassert(mVector.size() == mIndexMap.size());
@@ -85,7 +85,7 @@ public:
const_iterator find(const Key& k) const
{
- typename std::map::const_iterator iter = mIndexMap.find(k);
+ typename std::map::const_iterator iter = mIndexMap.find(k);
if(iter == mIndexMap.end())
{
return mVector.end();
diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp
index e93ba83434..662a2511cd 100644
--- a/indra/llcommon/llleap.cpp
+++ b/indra/llcommon/llleap.cpp
@@ -233,7 +233,7 @@ public:
LL_DEBUGS("EventHost") << "Sending: "
<< static_cast(buffer.tellp()) << ':';
- std::string::size_type truncate(80);
+ llssize truncate(80);
if (buffer.tellp() <= truncate)
{
LL_CONT << buffer.str();
diff --git a/indra/llcommon/llmainthreadtask.h b/indra/llcommon/llmainthreadtask.h
index 5fae0212c4..cec95b2356 100644
--- a/indra/llcommon/llmainthreadtask.h
+++ b/indra/llcommon/llmainthreadtask.h
@@ -4,7 +4,7 @@
* @date 2019-12-04
* @brief LLMainThreadTask dispatches work to the main thread. When invoked on
* the main thread, it performs the work inline.
- *
+ *
* $LicenseInfo:firstyear=2019&license=viewerlgpl$
* Copyright (c) 2019, Linden Research, Inc.
* $/LicenseInfo$
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index d71a5cac14..c1acd88f2b 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -136,44 +136,20 @@
#endif // LL_WINDOWS
-// Deal with VC6 problems
+// Deal with VC++ problems
#if LL_MSVC
-#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4.
-//#pragma warning( 3 : 4018 ) // "signed/unsigned mismatch" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4263 ) // 'function' : member function does not override any base class virtual member function
-#pragma warning( 3 : 4264 ) // "'virtual_function' : no override available for virtual member function from base 'class'; function is hidden"
-#pragma warning( 3 : 4265 ) // "class has virtual functions, but destructor is not virtual"
-#pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden
-#pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored
-//#pragma warning( disable : 4284 ) // silly MS warning deep inside their include file
-
-#if ADDRESS_SIZE == 64
-// That one is all over the place for x64 builds.
-#pragma warning( disable : 4267 ) // 'var' : conversion from 'size_t' to 'type', possible loss of data)
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS // disable warnings for methods considered unsafe
+#endif
+#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS
+#define _WINSOCK_DEPRECATED_NO_WARNINGS // disable deprecated WinSock API warnings
#endif
-#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
-#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
-#pragma warning( disable : 4996 ) // warning: deprecated
-
-// Linker optimization with "extern template" generates these warnings
-#pragma warning( disable : 4231 ) // nonstandard extension used : 'extern' before template explicit instantiation
-#pragma warning( disable : 4506 ) // no definition for inline function
-
// level 4 warnings that we need to disable:
-#pragma warning (disable : 4100) // unreferenced formal parameter
-#pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) )
#pragma warning (disable : 4244) // possible loss of data on conversions
#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
-#pragma warning (disable : 4512) // assignment operator could not be generated
-#pragma warning (disable : 4706) // assignment within conditional (even if((x = y)) )
-
#pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
#pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
-#pragma warning (disable : 4018) // '<' : signed/unsigned mismatch
-
#endif // LL_MSVC
#if LL_WINDOWS
diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp
index 39e8113587..7d77f6f6a9 100644
--- a/indra/llcommon/llqueuedthread.cpp
+++ b/indra/llcommon/llqueuedthread.cpp
@@ -210,7 +210,7 @@ void LLQueuedThread::waitOnPending()
// MAIN thread
void LLQueuedThread::printQueueStats()
{
- U32 size = mRequestQueue.size();
+ auto size = mRequestQueue.size();
if (size > 0)
{
LL_INFOS() << llformat("Pending Requests:%d ", mRequestQueue.size()) << LL_ENDL;
diff --git a/indra/llcommon/llsdjson.cpp b/indra/llcommon/llsdjson.cpp
index 2fe24693dd..e95d2e6c1c 100644
--- a/indra/llcommon/llsdjson.cpp
+++ b/indra/llcommon/llsdjson.cpp
@@ -1,25 +1,25 @@
-/**
+/**
* @file llsdjson.cpp
* @brief LLSD flexible data system
*
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2015, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
diff --git a/indra/llcommon/llsdjson.h b/indra/llcommon/llsdjson.h
index 7173e26046..415bbf4821 100644
--- a/indra/llcommon/llsdjson.h
+++ b/indra/llcommon/llsdjson.h
@@ -1,25 +1,25 @@
-/**
+/**
* @file llsdjson.cpp
* @brief LLSD flexible data system
*
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2015, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -36,10 +36,10 @@
#include "llsd.h"
#include
-/// Convert a parsed JSON structure into LLSD maintaining member names and
+/// Convert a parsed JSON structure into LLSD maintaining member names and
/// array indexes.
/// JSON/JavaScript types are converted as follows:
-///
+///
/// JSON Type | LLSD Type
/// --------------+--------------
/// null | undefined
@@ -50,14 +50,14 @@
/// boolean | LLSD::Boolean
/// array | LLSD::Array
/// object | LLSD::Map
-///
+///
/// For maps and arrays child entries will be converted and added to the structure.
/// Order is preserved for an array but not for objects.
LLSD LlsdFromJson(const boost::json::value &val);
-/// Convert an LLSD object into Parsed JSON object maintaining member names and
+/// Convert an LLSD object into Parsed JSON object maintaining member names and
/// array indexs.
-///
+///
/// Types are converted as follows:
/// LLSD Type | JSON Type
/// --------------+----------------
@@ -71,7 +71,7 @@ LLSD LlsdFromJson(const boost::json::value &val);
/// TypeUUID | string
/// TypeMap | object
/// TypeArray | array
-/// TypeBinary | unsupported
+/// TypeBinary | unsupported
boost::json::value LlsdToJson(const LLSD &val);
#endif // LL_LLSDJSON_H
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index 64a0c76bf9..af688c26fa 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -1547,7 +1547,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
case LLSD::TypeMap:
{
ostr.put('{');
- U32 size_nbo = htonl(data.size());
+ U32 size_nbo = htonl(static_cast(data.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32));
LLSD::map_const_iterator iter = data.beginMap();
LLSD::map_const_iterator end = data.endMap();
@@ -1564,7 +1564,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
case LLSD::TypeArray:
{
ostr.put('[');
- U32 size_nbo = htonl(data.size());
+ U32 size_nbo = htonl(static_cast(data.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32));
LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray();
@@ -1631,7 +1631,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
{
ostr.put('b');
const std::vector& buffer = data.asBinary();
- U32 size_nbo = htonl(buffer.size());
+ U32 size_nbo = htonl(static_cast(buffer.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32));
if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size());
break;
@@ -1649,7 +1649,7 @@ void LLSDBinaryFormatter::formatString(
const std::string& string,
std::ostream& ostr) const
{
- U32 size_nbo = htonl(string.size());
+ U32 size_nbo = htonl(static_cast(string.size()));
ostr.write((const char*)(&size_nbo), sizeof(U32));
ostr.write(string.c_str(), string.size());
}
diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h
index 22fa2a6f4b..741d9385e9 100644
--- a/indra/llcommon/llsingleton.h
+++ b/indra/llcommon/llsingleton.h
@@ -1,24 +1,24 @@
-/**
+/**
* @file llsingleton.h
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -36,6 +36,10 @@
#include "llthread.h" // on_main_thread()
#include "llmainthreadtask.h"
+#ifdef LL_WINDOWS
+#pragma warning( disable : 4506 ) // no definition for inline function
+#endif
+
class LLSingletonBase: private boost::noncopyable
{
public:
@@ -569,6 +573,7 @@ public:
classname(),
" -- creating new instance"});
// fall through
+ [[fallthrough]];
case UNINITIALIZED:
case QUEUED:
// QUEUED means some secondary thread has already requested an
@@ -867,7 +872,7 @@ private: \
// Relatively unsafe singleton implementation that is much faster
// and simpler than LLSingleton, but has no dependency tracking
-// or inherent thread safety and requires manual invocation of
+// or inherent thread safety and requires manual invocation of
// createInstance before first use.
template
class LLSimpleton
diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h
index 52bebf82e3..5730ce6ff2 100644
--- a/indra/llcommon/llstl.h
+++ b/indra/llcommon/llstl.h
@@ -301,7 +301,7 @@ inline bool vector_replace_with_last(std::vector& invec, const T& val)
template
inline T* vector_append(std::vector& invec, S32 N)
{
- U32 sz = invec.size();
+ auto sz = invec.size();
invec.resize(sz+N);
return &(invec[sz]);
}
diff --git a/indra/llcommon/llstreamqueue.h b/indra/llcommon/llstreamqueue.h
index a09bf4cb4b..01689457dd 100644
--- a/indra/llcommon/llstreamqueue.h
+++ b/indra/llcommon/llstreamqueue.h
@@ -216,7 +216,7 @@ std::streamsize LLGenericStreamQueue::skip(std::streamsize n)
{
typename BufferList::iterator bli(mBuffer.begin()), blend(mBuffer.end());
std::streamsize toskip(n), skipped(0);
- while (bli != blend && toskip >= bli->length())
+ while (bli != blend && (size_t)toskip >= bli->length())
{
std::streamsize chunk(bli->length());
typename BufferList::iterator zap(bli++);
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 4841174b10..1200da23e5 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -565,7 +565,7 @@ std::string utf8str_truncate(const std::string& utf8str, const S32 max_len)
}
// [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)
{
@@ -577,7 +577,7 @@ std::string utf8str_substr(const std::string& utf8str, const S32 index, const S3
}
else
{
- S32 cur_char = max_len;
+ size_t cur_char = max_len;
// If we're ASCII, we don't need to do anything
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,
0,
in,
- len_in,
+ static_cast(len_in),
NULL,
0,
0,
@@ -896,7 +896,7 @@ std::string ll_convert_wide_to_string(const wchar_t* in, size_t len_in, unsigned
code_page,
0,
in,
- len_in,
+ static_cast(len_in),
pout,
len_out,
0,
@@ -923,8 +923,8 @@ std::wstring ll_convert_string_to_wide(const char* in, size_t len, unsigned int
std::vector w_out(len + 1);
memset(&w_out[0], 0, w_out.size());
- int real_output_str_len = MultiByteToWideChar(code_page, 0, in, len,
- &w_out[0], w_out.size() - 1);
+ int real_output_str_len = MultiByteToWideChar(code_page, 0, in, static_cast(len),
+ &w_out[0], static_cast(w_out.size() - 1));
//looks like MultiByteToWideChar didn't add null terminator to converted string, see EXT-4858.
w_out[real_output_str_len] = 0;
@@ -1015,7 +1015,7 @@ std::optional llstring_getoptenv(const std::string& key)
auto wkey = ll_convert_string_to_wide(key);
// Take a wild guess as to how big the buffer should be.
std::vector buffer(1024);
- auto n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], buffer.size());
+ auto n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], static_cast(buffer.size()));
// If our initial guess was too short, n will indicate the size (in
// wchar_t's) that buffer should have been, including the terminating nul.
if (n > (buffer.size() - 1))
@@ -1023,7 +1023,7 @@ std::optional llstring_getoptenv(const std::string& key)
// make it big enough
buffer.resize(n);
// and try again
- n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], buffer.size());
+ n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], static_cast(buffer.size()));
}
// did that (ultimately) succeed?
if (n)
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 0e70bf94d5..42bbb565a1 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -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);
// [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& split_list, const std::string& utf8str, size_t maxlen, char split_token);
// [/RLVa:KB]
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index e408c1d009..67f0b83c7a 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -1,25 +1,25 @@
-/**
+/**
* @file llthread.h
* @brief Base classes for thread, mutex and condition handling.
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010-2013, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -55,10 +55,10 @@ public:
LLThread(const std::string& name, apr_pool_t *poolp = NULL);
virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state.
virtual void shutdown(); // stops the thread
-
+
bool isQuitting() const { return (QUITTING == mStatus); }
bool isStopped() const { return (STOPPED == mStatus) || (CRASHED == mStatus); }
- bool isCrashed() const { return (CRASHED == mStatus); }
+ bool isCrashed() const { return (CRASHED == mStatus); }
// Try to encourage the inlining
static LL_FORCE_INLINE id_t currentID(){return std::this_thread::get_id();}; // Return ID of current thread
@@ -91,11 +91,11 @@ public:
// internal state used by LLMutex. You must call this once early
// in the running thread to prevent collisions with the main thread.
static void registerThreadID();
-
+
private:
bool mPaused;
std::thread::native_handle_type mNativeHandle; // for termination in case of issues
-
+
// static function passed to APR thread creation routine
void threadRun();
@@ -112,21 +112,21 @@ protected:
//a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used.
//Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes.
// otherwise it will cause severe memory leaking!!! --bao
- LLVolatileAPRPool *mLocalAPRFilePoolp ;
+ LLVolatileAPRPool *mLocalAPRFilePoolp ;
void setQuitting();
-
+
// virtual function overridden by subclass -- this will be called when the thread runs
- virtual void run(void) = 0;
-
+ virtual void run(void) = 0;
+
// virtual predicate function -- returns true if the thread should wake up, false if it should sleep.
virtual bool runCondition(void);
// Lock/Unlock Run Condition -- use around modification of any variable used in runCondition()
void lockData();
void unlockData();
-
- // This is the predicate that decides whether the thread should sleep.
+
+ // This is the predicate that decides whether the thread should sleep.
// It should only be called with mDataLock locked, since the virtual runCondition() function may need to access
// data structures that are thread-unsafe.
bool shouldSleep(void) { return (mStatus == RUNNING) && (isPaused() || (!runCondition())); }
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
index 692bbe5acf..ba7acf9547 100644
--- a/indra/llcommon/lltraceaccumulators.h
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -522,9 +522,9 @@ namespace LLTrace
struct BlockTimerStackRecord
{
- class BlockTimer* mActiveTimer;
- class BlockTimerStatHandle* mTimeBlock;
- U64 mChildTime;
+ class BlockTimer* mActiveTimer{ nullptr };
+ class BlockTimerStatHandle* mTimeBlock{ nullptr };
+ U64 mChildTime{ 0 };
};
struct AccumulatorBufferGroup : public LLRefCount
diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h
index 9b1dfa8ac9..3690376e9f 100644
--- a/indra/llcommon/lluuid.h
+++ b/indra/llcommon/lluuid.h
@@ -82,8 +82,6 @@ public:
// to integers, among other things. Use isNull() or notNull().
// operator bool() const;
- // JC: These must return real bool's (not BOOLs) or else use of the STL
- // will generate bool-to-int performance warnings.
bool operator==(const LLUUID &rhs) const;
bool operator!=(const LLUUID &rhs) const;
bool operator<(const LLUUID &rhs) const;
diff --git a/indra/llcommon/tests/commonmisc_test.cpp b/indra/llcommon/tests/commonmisc_test.cpp
index 3deb864c0c..0057a1f639 100644
--- a/indra/llcommon/tests/commonmisc_test.cpp
+++ b/indra/llcommon/tests/commonmisc_test.cpp
@@ -67,7 +67,7 @@ namespace tut
std::ostringstream resp;
resp << "{'connect':true, 'position':[r128,r128,r128], 'look_at':[r0,r1,r0], 'agent_access':'M', 'region_x':i8192, 'region_y':i8192}";
std::string str = resp.str();
- LLMemoryStream mstr((U8*)str.c_str(), str.size());
+ LLMemoryStream mstr((U8*)str.c_str(), static_cast(str.size()));
LLSD response;
S32 count = LLSDSerialize::fromNotation(response, mstr, str.size());
ensure("stream parsed", response.isDefined());
@@ -252,7 +252,7 @@ namespace tut
resp << "{'label':'short binary test', 'singlebinary':b(1)\"A\", 'singlerawstring':s(1)\"A\", 'endoftest':'end' }";
std::string str = resp.str();
LLSD sd;
- LLMemoryStream mstr((U8*)str.c_str(), str.size());
+ LLMemoryStream mstr((U8*)str.c_str(), static_cast(str.size()));
S32 count = LLSDSerialize::fromNotation(sd, mstr, str.size());
ensure_equals("parse count", count, 5);
ensure("sd created", sd.isDefined());
@@ -456,7 +456,7 @@ namespace tut
void mem_object::test<1>()
{
const char HELLO_WORLD[] = "hello world";
- LLMemoryStream mem((U8*)&HELLO_WORLD[0], strlen(HELLO_WORLD)); /* Flawfinder: ignore */
+ LLMemoryStream mem((U8*)&HELLO_WORLD[0], static_cast(strlen(HELLO_WORLD))); /* Flawfinder: ignore */
std::string hello;
std::string world;
mem >> hello >> world;
diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp
index a99acba848..44f772e322 100644
--- a/indra/llcommon/tests/lleventdispatcher_test.cpp
+++ b/indra/llcommon/tests/lleventdispatcher_test.cpp
@@ -491,7 +491,7 @@ namespace tut
// Partial defaults arrays.
for (LLSD::String a: ab)
{
- LLSD::Integer partition(std::min(partial_offset, dft_array_full[a].size()));
+ LLSD::Integer partition(static_cast(std::min(partial_offset, dft_array_full[a].size())));
dft_array_partial[a] =
llsd_copy_array(dft_array_full[a].beginArray() + partition,
dft_array_full[a].endArray());
@@ -508,7 +508,7 @@ namespace tut
// (params, dft_array_full). Part of the point of using map-style
// defaults is to allow any subset of the target function's
// parameters to be optional, not just the rightmost.
- for (LLSD::Integer ix = 0, ixend = params[a].size(); ix < ixend; ix += 2)
+ for (LLSD::Integer ix = 0, ixend = static_cast(params[a].size()); ix < ixend; ix += 2)
{
dft_map_partial[a][params[a][ix].asString()] = dft_array_full[a][ix];
}
@@ -696,7 +696,7 @@ namespace tut
LLSD zipmap(const LLSD& keys, const LLSD& values)
{
LLSD map;
- for (LLSD::Integer i = 0, iend = keys.size(); i < iend; ++i)
+ for (LLSD::Integer i = 0, iend = static_cast(keys.size()); i < iend; ++i)
{
// Have to select asString() since you can index an LLSD
// object with either String or Integer.
@@ -955,7 +955,7 @@ namespace tut
allreq[a] = zipmap(params[a], LLSD::emptyArray());
// Same for leftreq, save that we use the subset of the params not
// supplied by dft_array_partial[a].
- LLSD::Integer partition(params[a].size() - dft_array_partial[a].size());
+ LLSD::Integer partition(static_cast(params[a].size() - dft_array_partial[a].size()));
leftreq[a] = zipmap(llsd_copy_array(params[a].beginArray(),
params[a].beginArray() + partition),
LLSD::emptyArray());
diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp
index 56fdc51e82..fb2af1d2db 100644
--- a/indra/llcommon/tests/llsdserialize_test.cpp
+++ b/indra/llcommon/tests/llsdserialize_test.cpp
@@ -701,7 +701,7 @@ namespace tut
"cam1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
}
template<> template<>
@@ -721,7 +721,7 @@ namespace tut
"cam1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
v.clear();
v["amy"] = 23;
@@ -734,7 +734,7 @@ namespace tut
"cam1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
v.clear();
v["amy"] = 23;
@@ -751,7 +751,7 @@ namespace tut
"cam1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
v.clear();
v[0] = 23;
@@ -766,7 +766,7 @@ namespace tut
"1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
v.clear();
v[0] = 23;
@@ -782,7 +782,7 @@ namespace tut
"1.23"
"",
v,
- v.size() + 1);
+ static_cast(v.size()) + 1);
}
template<> template<>
@@ -1405,13 +1405,13 @@ namespace tut
uint32_t size = htonl(1);
memcpy(&vec[1], &size, sizeof(uint32_t));
vec.push_back('k');
- int key_size_loc = vec.size();
+ auto key_size_loc = vec.size();
size = htonl(1); // 1 too short
vec.resize(vec.size() + 4);
memcpy(&vec[key_size_loc], &size, sizeof(uint32_t));
vec.push_back('a'); vec.push_back('m'); vec.push_back('y');
vec.push_back('i');
- int integer_loc = vec.size();
+ auto integer_loc = vec.size();
vec.resize(vec.size() + 4);
uint32_t val_int = htonl(23);
memcpy(&vec[integer_loc], &val_int, sizeof(uint32_t));
@@ -1473,7 +1473,7 @@ namespace tut
memcpy(&vec[1], &size, sizeof(uint32_t));
vec.push_back('"'); vec.push_back('a'); vec.push_back('m');
vec.push_back('y'); vec.push_back('"'); vec.push_back('i');
- int integer_loc = vec.size();
+ auto integer_loc = vec.size();
vec.resize(vec.size() + 4);
uint32_t val_int = htonl(23);
memcpy(&vec[integer_loc], &val_int, sizeof(uint32_t));
diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp
index ee4af3e3a0..10370bc437 100644
--- a/indra/llcommon/threadpool.cpp
+++ b/indra/llcommon/threadpool.cpp
@@ -3,7 +3,7 @@
* @author Nat Goodspeed
* @date 2021-10-21
* @brief Implementation for threadpool.
- *
+ *
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
* Copyright (c) 2021, Linden Research, Inc.
* $/LicenseInfo$
diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp
index a8e750e391..4988e1e4c0 100644
--- a/indra/llcorehttp/_httplibcurl.cpp
+++ b/indra/llcorehttp/_httplibcurl.cpp
@@ -88,7 +88,7 @@ void HttpLibcurl::shutdown()
if (mMultiHandles)
{
- for (int policy_class(0); policy_class < mPolicyCount; ++policy_class)
+ for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class)
{
if (mMultiHandles[policy_class])
{
@@ -122,7 +122,7 @@ void HttpLibcurl::start(int policy_count)
mActiveHandles = new int [mPolicyCount];
mDirtyPolicy = new bool [mPolicyCount];
- for (int policy_class(0); policy_class < mPolicyCount; ++policy_class)
+ for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class)
{
if (NULL == (mMultiHandles[policy_class] = curl_multi_init()))
{
@@ -148,7 +148,7 @@ HttpService::ELoopSpeed HttpLibcurl::processTransport()
HttpService::ELoopSpeed ret(HttpService::REQUEST_SLEEP);
// Give libcurl some cycles to do I/O & callbacks
- for (int policy_class(0); policy_class < mPolicyCount; ++policy_class)
+ for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class)
{
if (! mMultiHandles[policy_class])
{
@@ -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
// pipelining off.
bool bFailed = false;
- if( op->mXLLURL.size() )
+ if (op->mXLLURL.size())
{
std::string strURI = op->mReqURL;
- int i = strURI.find( "://" );
- if( i > 0 )
- i = strURI.find( "/", i+3 );
+ size_t i = strURI.find("://");
+ if (i != std::string::npos)
+ i = strURI.find("/", i + 3);
- if( i > 0 )
- strURI = strURI.substr( i );
+ if (i != std::string::npos)
+ 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;
op->mStatus = HttpStatus(HTTP_SERVICE_UNAVAILABLE);
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;
strm << "HTTP pipelining possibly out of sync, request wanted: " << op->mReqOffset << "-";
- if( op->mReqLength )
+ if (op->mReqLength)
strm << op->mReqLength + op->mReqLength -1;
strm << " got: " << op->mReplyOffset << "-" << op->mReplyOffset+op->mReplyLength-1;
strm << " url: " << op->mReqURL;
@@ -445,19 +445,19 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode
bFailed = true;
}
}
- if( bFailed )
+ if (bFailed)
{
HttpPolicy & policy(mService->getPolicy());
- for( int i = 0; i < mPolicyCount; ++ i )
+ for (unsigned int i = 0; i < mPolicyCount; ++ i)
{
HttpPolicyClass & options(policy.getClassOptions(i));
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 );
- mDirtyPolicy[ i ] = true;
- policyUpdated( i );
+ options.set(LLCore::HttpRequest::PO_PIPELINING_DEPTH, 0);
+ mDirtyPolicy[i] = true;
+ policyUpdated(i);
}
}
}
@@ -496,18 +496,18 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode
int HttpLibcurl::getActiveCount() const
{
- return mActiveOps.size();
+ return static_cast(mActiveOps.size());
}
-int HttpLibcurl::getActiveCountInClass(int policy_class) const
+int HttpLibcurl::getActiveCountInClass(unsigned int policy_class) const
{
llassert_always(policy_class < mPolicyCount);
return mActiveHandles ? mActiveHandles[policy_class] : 0;
}
-void HttpLibcurl::policyUpdated(int policy_class)
+void HttpLibcurl::policyUpdated(unsigned int policy_class)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
if (policy_class < 0 || policy_class >= mPolicyCount || ! mMultiHandles)
diff --git a/indra/llcorehttp/_httplibcurl.h b/indra/llcorehttp/_httplibcurl.h
index a1b537d354..3631965837 100644
--- a/indra/llcorehttp/_httplibcurl.h
+++ b/indra/llcorehttp/_httplibcurl.h
@@ -107,7 +107,7 @@ public:
///
/// Threading: called by worker thread.
int getActiveCount() const;
- int getActiveCountInClass(int policy_class) const;
+ int getActiveCountInClass(unsigned int policy_class) const;
/// Attempt to cancel a request identified by handle.
///
@@ -124,7 +124,7 @@ public:
/// initialization and dynamic option setting.
///
/// Threading: called by worker thread.
- void policyUpdated(int policy_class);
+ void policyUpdated(unsigned int policy_class);
/// Allocate a curl handle for caller. May be freed using
/// either the freeHandle() method or calling curl_easy_cleanup()
@@ -211,7 +211,7 @@ protected:
HttpService * mService; // Simple reference, not owner
HandleCache mHandleCache; // Handle allocator, owner
active_set_t mActiveOps;
- int mPolicyCount;
+ unsigned int mPolicyCount;
CURLM ** mMultiHandles; // One handle per policy class
int * mActiveHandles; // Active count per policy class
bool * mDirtyPolicy; // Dirty policy update waiting for stall (per pc)
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index 69bdfa5b11..d7205db8ec 100644
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -269,7 +269,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request)
if (mReplyOffset || mReplyLength)
{
// Got an explicit offset/length in response
- response->setRange(mReplyOffset, mReplyLength, mReplyFullLength);
+ response->setRange(mReplyOffset, static_cast(mReplyLength), static_cast(mReplyFullLength));
}
response->setContentType(mReplyConType);
response->setRetries(mPolicyRetries, mPolicy503Retries);
@@ -330,7 +330,7 @@ HttpStatus HttpOpRequest::setupGetByteRange(HttpRequest::policy_t policy_id,
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
setupCommon(policy_id, url, NULL, options, headers);
mReqMethod = HOR_GET;
- mReqOffset = offset;
+ mReqOffset = static_cast(offset);
mReqLength = len;
if (offset || len)
{
@@ -625,7 +625,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
long data_size(0);
if (mReqBody)
{
- data_size = mReqBody->size();
+ data_size = static_cast(mReqBody->size());
}
check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast(NULL));
check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size);
@@ -636,13 +636,14 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
case HOR_PATCH:
check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "PATCH");
// fall through. The rest is the same as PUT
+ [[fallthrough]];
case HOR_PUT:
{
check_curl_easy_setopt(mCurlHandle, CURLOPT_UPLOAD, 1);
long data_size(0);
if (mReqBody)
{
- data_size = mReqBody->size();
+ data_size = static_cast(mReqBody->size());
}
check_curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size);
mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:");
diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp
index 03ac521b87..58d0e64e2f 100644
--- a/indra/llcorehttp/_httppolicy.cpp
+++ b/indra/llcorehttp/_httppolicy.cpp
@@ -98,7 +98,7 @@ HttpPolicy::~HttpPolicy()
HttpRequest::policy_t HttpPolicy::createPolicyClass()
{
- const HttpRequest::policy_t policy_class(mClasses.size());
+ const HttpRequest::policy_t policy_class(static_cast(mClasses.size()));
if (policy_class >= HTTP_POLICY_CLASS_LIMIT)
{
return HttpRequest::INVALID_POLICY_ID;
@@ -433,8 +433,8 @@ int HttpPolicy::getReadyCount(HttpRequest::policy_t policy_class) const
{
if (policy_class < mClasses.size())
{
- return (mClasses[policy_class]->mReadyQueue.size()
- + mClasses[policy_class]->mRetryQueue.size());
+ return static_cast((mClasses[policy_class]->mReadyQueue.size()
+ + mClasses[policy_class]->mRetryQueue.size()));
}
return 0;
}
diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp
index 4d1e52b766..72e0c29a24 100644
--- a/indra/llcorehttp/examples/http_texture_load.cpp
+++ b/indra/llcorehttp/examples/http_texture_load.cpp
@@ -24,6 +24,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include
#include
#include
@@ -33,8 +35,6 @@
#include
#endif
-#include "linden_common.h"
-
#include "httpcommon.h"
#include "httprequest.h"
#include "httphandler.h"
@@ -519,7 +519,7 @@ void WorkingSet::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * r
{
// More success
LLCore::BufferArray * data(response->getBody());
- mByteCount += data ? data->size() : 0;
+ mByteCount += data ? static_cast(data->size()) : 0L;
++mSuccesses;
}
else
@@ -602,7 +602,7 @@ void WorkingSet::loadAssetUuids(FILE * in)
mAssets.push_back(asset);
}
}
- mRemaining = mLimit = mAssets.size();
+ mRemaining = mLimit = static_cast(mAssets.size());
}
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index e70d7d632c..3921f44f0f 100644
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -146,7 +146,7 @@ std::string getStartupStateFromLog(std::string& sllog)
std::string startup_state = "STATE_FIRST";
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()) {
return startup_state;
}
diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp
index c0c9e94876..ca69088095 100644
--- a/indra/llfilesystem/lldir.cpp
+++ b/indra/llfilesystem/lldir.cpp
@@ -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::size_t offset = filepath.find_last_of(getDirDelimiter());
- S32 len = (offset == std::string::npos) ? 0 : offset;
+ auto len = (offset == std::string::npos) ? 0 : offset;
std::string dirname = filepath.substr(0, len);
return dirname;
}
@@ -948,8 +948,8 @@ std::string LLDir::getScrubbedFileName(const std::string uncleanFileName)
// replace any illegal file chars with and underscore '_'
for( unsigned int i = 0; i < illegalChars.length(); i++ )
{
- int j = -1;
- while((j = name.find(illegalChars[i])) > -1)
+ std::string::size_type j = -1;
+ while((j = name.find(illegalChars[i])) > std::string::npos)
{
name[j] = '_';
}
diff --git a/indra/llfilesystem/lldir_utils_objc.h b/indra/llfilesystem/lldir_utils_objc.h
index 48148aad95..1d9cb34e19 100644
--- a/indra/llfilesystem/lldir_utils_objc.h
+++ b/indra/llfilesystem/lldir_utils_objc.h
@@ -1,28 +1,28 @@
-/**
+/**
* @file lldir_utils_objc.h
* @brief Definition of directory utilities class for macOS
*
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2020, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
- */
+ */
#if !LL_DARWIN
#error This header must not be included when compiling for any target other than Mac OS. Consider including lldir.h instead.
diff --git a/indra/llfilesystem/lldir_win32.cpp b/indra/llfilesystem/lldir_win32.cpp
index 8606a97582..cc7c50a0f2 100644
--- a/indra/llfilesystem/lldir_win32.cpp
+++ b/indra/llfilesystem/lldir_win32.cpp
@@ -232,7 +232,7 @@ LLDir_Win32::LLDir_Win32()
{
w_str[size] = '\0';
mExecutablePathAndName = utf16str_to_utf8str(llutf16string(w_str));
- S32 path_end = mExecutablePathAndName.find_last_of('\\');
+ auto path_end = mExecutablePathAndName.find_last_of('\\');
if (path_end != std::string::npos)
{
mExecutableDir = mExecutablePathAndName.substr(0, path_end);
diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp
index e76f48b0dc..910b92bb8f 100644
--- a/indra/llfilesystem/llfilesystem.cpp
+++ b/indra/llfilesystem/llfilesystem.cpp
@@ -212,7 +212,7 @@ bool LLFileSystem::read(U8* buffer, S32 bytes)
{
if (fseek(file, mPosition, SEEK_SET) == 0)
{
- mBytesRead = fread(buffer, 1, bytes, file);
+ mBytesRead = static_cast(fread(buffer, 1, bytes, file));
fclose(file);
mPosition += mBytesRead;
@@ -306,7 +306,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
LLFILE* ofs = LLFile::fopen(filename, "a+b");
if (ofs)
{
- S32 bytes_written = fwrite(buffer, 1, bytes, ofs);
+ S32 bytes_written = static_cast(fwrite(buffer, 1, bytes, ofs));
mPosition = ftell(ofs);
fclose(ofs);
success = (bytes_written == bytes);
@@ -319,7 +319,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
{
if (fseek(ofs, mPosition, SEEK_SET) == 0)
{
- S32 bytes_written = fwrite(buffer, 1, bytes, ofs);
+ S32 bytes_written = static_cast(fwrite(buffer, 1, bytes, ofs));
mPosition = ftell(ofs);
fclose(ofs);
success = (bytes_written == bytes);
@@ -330,7 +330,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
ofs = LLFile::fopen(filename, "wb");
if (ofs)
{
- S32 bytes_written = fwrite(buffer, 1, bytes, ofs);
+ S32 bytes_written = static_cast(fwrite(buffer, 1, bytes, ofs));
mPosition = ftell(ofs);
fclose(ofs);
success = (bytes_written == bytes);
@@ -342,7 +342,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
LLFILE* ofs = LLFile::fopen(filename, "wb");
if (ofs)
{
- S32 bytes_written = fwrite(buffer, 1, bytes, ofs);
+ S32 bytes_written = static_cast(fwrite(buffer, 1, bytes, ofs));
mPosition = ftell(ofs);
fclose(ofs);
success = (bytes_written == bytes);
diff --git a/indra/llfilesystem/lllfsthread.cpp b/indra/llfilesystem/lllfsthread.cpp
index 7d135b4472..6a882f64a8 100644
--- a/indra/llfilesystem/lllfsthread.cpp
+++ b/indra/llfilesystem/lllfsthread.cpp
@@ -45,7 +45,7 @@ void LLLFSThread::initClass(bool local_is_threaded)
//static
S32 LLLFSThread::updateClass(U32 ms_elapsed)
{
- return sLocal->update((F32)ms_elapsed);
+ return static_cast(sLocal->update((F32)ms_elapsed));
}
//static
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index c2eb8d96c4..60df7a3d32 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1970,7 +1970,6 @@ void LLImageRaw::compositeRowScaled4onto3( const U8* in, U8* out, S32 in_pixel_l
}
}
-
void LLImageRaw::addEmissive(LLImageRaw* src)
{
LLImageRaw* dst = this; // Just for clarity.
@@ -2036,7 +2035,6 @@ void LLImageRaw::addEmissiveScaled(LLImageRaw* src)
dst->addEmissiveUnscaled(&temp);
}
-// static
bool LLImageRaw::validateSrcAndDst(std::string func, const LLImageRaw* src, const LLImageRaw* dst)
{
LLImageDataSharedLock lockIn(src);
diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp
index e59224e55b..1e60713b6d 100644
--- a/indra/llimage/llimagedxt.cpp
+++ b/indra/llimage/llimagedxt.cpp
@@ -476,7 +476,7 @@ bool LLImageDXT::convertToDXR()
// virtual
S32 LLImageDXT::calcHeaderSize()
{
- return llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t));
+ return static_cast(llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t)));
}
// virtual
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index 5b09e0b580..57a7ee13d2 100644
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
@@ -781,9 +781,9 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
// Compute min and max counts minus tail
tail = llclampf(tail);
- S32 total = cumulated_histo[255];
- S32 min_c = (S32)((F32)(total) * tail);
- S32 max_c = (S32)((F32)(total) * (1.0 - tail));
+ U32 total = cumulated_histo[255];
+ U32 min_c = (U32)((F32)(total) * tail);
+ U32 max_c = (U32)((F32)(total) * (1.0 - tail));
// Find min and max values
S32 min_v = 0;
@@ -798,9 +798,9 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
}
// Compute linear lookup table
- U8 linear_red_lut[256];
- U8 linear_green_lut[256];
- U8 linear_blue_lut[256];
+ U8 linear_red_lut[256]{};
+ U8 linear_green_lut[256]{};
+ U8 linear_blue_lut[256]{};
if (max_v == min_v)
{
// Degenerated binary split case
@@ -850,16 +850,16 @@ void LLImageFilter::filterEqualize(S32 nb_classes, const LLColor3& alpha)
}
// Compute deltas
- S32 total = cumulated_histo[255];
- S32 delta_count = total / nb_classes;
- S32 current_count = delta_count;
- S32 delta_value = 256 / (nb_classes - 1);
- S32 current_value = 0;
+ U32 total = cumulated_histo[255];
+ U32 delta_count = total / nb_classes;
+ U32 current_count = delta_count;
+ U32 delta_value = 256 / (nb_classes - 1);
+ U32 current_value = 0;
// Compute equalized lookup table
- U8 equalize_red_lut[256];
- U8 equalize_green_lut[256];
- U8 equalize_blue_lut[256];
+ U8 equalize_red_lut[256]{};
+ U8 equalize_green_lut[256]{};
+ U8 equalize_blue_lut[256]{};
for (S32 i = 0; i < 256; i++)
{
// Blend in current_value with alpha values
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index bbf1ea579d..4e8d4d9e84 100644
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -477,7 +477,7 @@ bool LLImageTGA::decodeTruecolorNonRle( LLImageRaw* raw_image, bool &alpha_opaqu
S32 pixels = getWidth() * getHeight();
- if (pixels * (mIs15Bit ? 2 : getComponents()) > getDataSize() - mDataOffset)
+ if (pixels * (mIs15Bit ? 2 : getComponents()) > getDataSize() - (S32)mDataOffset)
{ //here we have situation when data size in src less than actually needed
return false;
}
@@ -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.
bool LLImageTGA::loadFile( const std::string& path )
{
- S32 len = path.size();
+ auto len = path.size();
if( len < 5 )
{
return false;
@@ -1238,7 +1238,7 @@ bool LLImageTGA::loadFile( const std::string& path )
return false;
}
- S32 bytes_read = fread(buffer, 1, file_size, file);
+ S32 bytes_read = static_cast(fread(buffer, 1, file_size, file));
if( bytes_read != file_size )
{
deleteData();
diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp
index a5fb7a3167..79c201b1f4 100644
--- a/indra/llimage/llpngwrapper.cpp
+++ b/indra/llimage/llpngwrapper.cpp
@@ -328,10 +328,10 @@ bool LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSiz
mWriteInfoPtr = png_create_info_struct(mWritePngPtr);
// Setup write function
- PngDataInfo dataPtr;
+ PngDataInfo dataPtr{};
dataPtr.mData = dest;
dataPtr.mOffset = 0;
- dataPtr.mDataSize = destSize;
+ dataPtr.mDataSize = static_cast(destSize);
png_set_write_fn(mWritePngPtr, &dataPtr, &writeDataCallback, &writeFlush);
// Setup image params
diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp
index dd31534f4f..71dc5fa42e 100644
--- a/indra/llimagej2coj/llimagej2coj.cpp
+++ b/indra/llimagej2coj/llimagej2coj.cpp
@@ -175,7 +175,7 @@ static OPJ_OFF_T opj_skip(OPJ_OFF_T bytes, void* user_data)
JPEG2KBase* jpeg_codec = static_cast(user_data);
jpeg_codec->offset += bytes;
- if (jpeg_codec->offset > jpeg_codec->size)
+ if (jpeg_codec->offset > (OPJ_OFF_T)jpeg_codec->size)
{
jpeg_codec->offset = jpeg_codec->size;
// Indicate end of stream
@@ -848,7 +848,7 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
S32 offset = dest;
for (S32 y = (height - 1); y >= 0; y--)
{
- for (S32 x = 0; x < width; x++)
+ for (U32 x = 0; x < width; x++)
{
rawp[offset] = image->comps[comp].data[y*comp_width + x];
offset += channels;
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index 101509122e..f98caf4f88 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -112,10 +112,10 @@ const LLSettingsDay::Seconds LLSettingsDay::DEFAULT_DAYOFFSET(57600); // +16 ho
const LLSettingsDay::Seconds LLSettingsDay::MAXIMUM_DAYOFFSET(86400); // 24 hours
const LLSettingsDay::Seconds LLSettingsDay::INVALID_DAYOFFSET(-1); // KC
-const S32 LLSettingsDay::TRACK_WATER(0); // water track is 0
-const S32 LLSettingsDay::TRACK_GROUND_LEVEL(1);
-const S32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water
-const S32 LLSettingsDay::FRAME_MAX(56);
+const U32 LLSettingsDay::TRACK_WATER(0); // water track is 0
+const U32 LLSettingsDay::TRACK_GROUND_LEVEL(1);
+const U32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water
+const U32 LLSettingsDay::FRAME_MAX(56);
const F32 LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR(0.02501f);
@@ -463,7 +463,7 @@ namespace
// Trim extra tracks.
while (value.size() > LLSettingsDay::TRACK_MAX)
{
- value.erase(value.size() - 1);
+ value.erase(static_cast(value.size()) - 1);
}
S32 framecount(0);
@@ -512,7 +512,7 @@ namespace
}
- int waterTracks = value[0].size();
+ int waterTracks = static_cast(value[0].size());
int skyTracks = framecount - waterTracks;
if (waterTracks < 1)
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index a253676c63..216f2763fd 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -60,10 +60,10 @@ public:
static const Seconds MAXIMUM_DAYOFFSET;
static const Seconds INVALID_DAYOFFSET; // KC
- static const S32 TRACK_WATER;
- static const S32 TRACK_GROUND_LEVEL;
- static const S32 TRACK_MAX;
- static const S32 FRAME_MAX;
+ static const U32 TRACK_WATER;
+ static const U32 TRACK_GROUND_LEVEL;
+ static const U32 TRACK_MAX;
+ static const U32 FRAME_MAX;
static const F32 DEFAULT_FRAME_SLOP_FACTOR;
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index 222ab040cb..40bb337a48 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -62,7 +62,7 @@ public:
static const std::string SETTING_DOME_OFFSET;
static const std::string SETTING_DOME_RADIUS;
static const std::string SETTING_GAMMA;
- static const std::string SETTING_GLOW;
+ static const std::string SETTING_GLOW;
static const std::string SETTING_LIGHT_NORMAL;
static const std::string SETTING_MAX_Y;
static const std::string SETTING_MOON_ROTATION;
@@ -92,7 +92,7 @@ public:
static const std::string SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR;
static const std::string SETTING_DENSITY_PROFILE_LINEAR_TERM;
static const std::string SETTING_DENSITY_PROFILE_CONSTANT_TERM;
-
+
static const std::string SETTING_SKY_MOISTURE_LEVEL;
static const std::string SETTING_SKY_DROPLET_RADIUS;
static const std::string SETTING_SKY_ICE_LEVEL;
@@ -117,7 +117,7 @@ public:
virtual std::string getSettingsType() const SETTINGS_OVERRIDE { return std::string("sky"); }
virtual LLSettingsType::type_e getSettingsTypeValue() const SETTINGS_OVERRIDE { return LLSettingsType::ST_SKY; }
- // Settings status
+ // Settings status
virtual void blend(const LLSettingsBase::ptr_t &end, F64 blendf) SETTINGS_OVERRIDE;
virtual void replaceSettings(LLSD settings) SETTINGS_OVERRIDE;
@@ -129,7 +129,7 @@ public:
F32 getSkyBottomRadius() const;
F32 getSkyTopRadius() const;
F32 getSunArcRadians() const;
- F32 getMieAnisotropy() const;
+ F32 getMieAnisotropy() const;
F32 getSkyMoistureLevel() const;
F32 getSkyDropletRadius() const;
@@ -196,7 +196,7 @@ public:
F32 getCloudShadow() const;
void setCloudShadow(F32 val);
-
+
F32 getCloudVariance() const;
void setCloudVariance(F32 val);
@@ -295,7 +295,7 @@ public:
// color based on brightness
LLColor3 getMoonlightColor() const;
-
+
LLColor4 getMoonAmbient() const;
LLColor3 getMoonDiffuse() const;
LLColor4 getSunAmbient() const;
diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index 91bea67bf1..18ca1f69ae 100644
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -484,7 +484,7 @@ public:
S32 i = data->getBinIndex();
- if (i >= 0 && i < getElementCount())
+ if (i >= 0 && i < (S32)getElementCount())
{
if (mData[i] == data)
{ //found it
diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h
index 9db152adf8..11462170fb 100644
--- a/indra/llmath/llsimdtypes.h
+++ b/indra/llmath/llsimdtypes.h
@@ -60,7 +60,7 @@ public:
inline operator bool() const { return static_cast(m_bool); }
private:
- int m_bool;
+ int m_bool{ 0 };
};
#if LL_WINDOWS
@@ -118,7 +118,7 @@ public:
}
private:
- LLQuad mQ;
+ LLQuad mQ{};
};
#endif //LL_SIMD_TYPES_H
diff --git a/indra/llmath/llsphere.cpp b/indra/llmath/llsphere.cpp
index 89349af6c8..5f48764455 100644
--- a/indra/llmath/llsphere.cpp
+++ b/indra/llmath/llsphere.cpp
@@ -185,7 +185,7 @@ LLSphere LLSphere::getBoundingSphere(const std::vector& sphere_list)
// TODO -- improve the accuracy for small collections of spheres
LLSphere bounding_sphere( LLVector3(0.f, 0.f, 0.f), 0.f );
- S32 sphere_count = sphere_list.size();
+ auto sphere_count = sphere_list.size();
if (1 == sphere_count)
{
// trivial case -- single sphere
diff --git a/indra/llmath/lltreenode.h b/indra/llmath/lltreenode.h
index f648a114ca..e3d30206b7 100644
--- a/indra/llmath/lltreenode.h
+++ b/indra/llmath/lltreenode.h
@@ -57,7 +57,7 @@ public:
virtual bool remove(T* data);
virtual void notifyRemoval(T* data);
virtual U32 hasListeners() const { return !mListeners.empty(); }
- virtual U32 getListenerCount() const { return mListeners.size(); }
+ virtual U32 getListenerCount() const { return static_cast(mListeners.size()); }
virtual LLTreeListener* getListener(U32 index) const
{
if (index < mListeners.size())
diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h
index 1c3bc74f15..8ef560dadf 100644
--- a/indra/llmath/llvector4a.h
+++ b/indra/llmath/llvector4a.h
@@ -365,7 +365,7 @@ public:
inline operator LLQuad() const;
private:
- LLQuad mQ;
+ LLQuad mQ{};
};
inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p)
diff --git a/indra/llmath/llvector4logical.h b/indra/llmath/llvector4logical.h
index d08b5513d9..70759eef5c 100644
--- a/indra/llmath/llvector4logical.h
+++ b/indra/llmath/llvector4logical.h
@@ -120,7 +120,7 @@ public:
private:
- LLQuad mQ;
+ LLQuad mQ{};
};
#endif //LL_VECTOR4ALOGICAL_H
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index f9b9937fbe..d7ed30ad60 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2340,7 +2340,7 @@ bool LLVolume::unpackVolumeFaces(U8* in_data, S32 size)
bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
{
{
- U32 face_count = mdl.size();
+ auto face_count = mdl.size();
if (face_count == 0)
{ //no faces unpacked, treat as failed decode
@@ -2372,7 +2372,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
LLSD::Binary idx = mdl[i]["TriangleList"];
//copy out indices
- S32 num_indices = idx.size() / 2;
+ auto num_indices = idx.size() / 2;
const S32 indices_to_discard = num_indices % 3;
if (indices_to_discard > 0)
{
@@ -2380,7 +2380,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
LL_WARNS() << "Incomplete triangle discarded from face! Indices count " << num_indices << " was not divisible by 3. face index: " << i << " Total: " << face_count << LL_ENDL;
num_indices -= indices_to_discard;
}
- face.resizeIndices(num_indices);
+ face.resizeIndices(static_cast(num_indices));
if (num_indices > 2 && !face.mIndices)
{
@@ -2401,7 +2401,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
}
//copy out vertices
- U32 num_verts = pos.size()/(3*2);
+ U32 num_verts = static_cast(pos.size())/(3*2);
face.resizeVertices(num_verts);
if (num_verts > 0 && !face.mPositions)
@@ -2665,7 +2665,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
if (do_reverse_triangles)
{
- for (U32 j = 0; j < face.mNumIndices; j += 3)
+ for (S32 j = 0; j < face.mNumIndices; j += 3)
{
// swap the 2nd and 3rd index
S32 swap = face.mIndices[j+1];
@@ -2702,7 +2702,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
min_tc = face.mTexCoords[0];
max_tc = face.mTexCoords[0];
- for (U32 j = 1; j < face.mNumVertices; ++j)
+ for (S32 j = 1; j < face.mNumVertices; ++j)
{
update_min_max(min_tc, max_tc, face.mTexCoords[j]);
}
@@ -3827,7 +3827,7 @@ void LLVolume::generateSilhouetteVertices(std::vector &vertices,
LLVector4a* v = (LLVector4a*)face.mPositions;
LLVector4a* n = (LLVector4a*)face.mNormals;
- for (U32 j = 0; j < face.mNumIndices / 3; j++)
+ for (S32 j = 0; j < face.mNumIndices / 3; j++)
{
for (S32 k = 0; k < 3; k++)
{
@@ -3953,7 +3953,7 @@ void LLVolume::generateSilhouetteVertices(std::vector &vertices,
LLVector4a* v = (LLVector4a*) face.mPositions;
LLVector4a* n = (LLVector4a*) face.mNormals;
- for (U32 j = 0; j < face.mNumIndices/3; j++)
+ for (S32 j = 0; j < face.mNumIndices/3; j++)
{
//approximate normal
S32 v1 = face.mIndices[j*3+0];
@@ -3990,7 +3990,7 @@ void LLVolume::generateSilhouetteVertices(std::vector &vertices,
}
//for each triangle
- for (U32 j = 0; j < face.mNumIndices/3; j++)
+ for (S32 j = 0; j < face.mNumIndices/3; j++)
{
if (fFacing[j] == (AWAY | TOWARDS))
{ //this is a degenerate triangle
@@ -4992,13 +4992,13 @@ void LLVolumeFace::remap()
{
// Generate a remap buffer
std::vector remap(mNumVertices);
- S32 remap_vertices_count = LLMeshOptimizer::generateRemapMultiU16(&remap[0],
+ S32 remap_vertices_count = static_cast(LLMeshOptimizer::generateRemapMultiU16(&remap[0],
mIndices,
mNumIndices,
mPositions,
mNormals,
mTexCoords,
- mNumVertices);
+ mNumVertices));
// Allocate new buffers
S32 size = ((mNumIndices * sizeof(U16)) + 0xF) & ~0xF;
@@ -5043,7 +5043,7 @@ void LLVolumeFace::optimize(F32 angle_cutoff)
range.setSub(mExtents[1],mExtents[0]);
//remove redundant vertices
- for (U32 i = 0; i < mNumIndices; ++i)
+ for (S32 i = 0; i < mNumIndices; ++i)
{
U16 index = mIndices[i];
@@ -5429,7 +5429,7 @@ struct MikktData
LLVector3 inv_scale(1.f / face->mNormalizedScale.mV[0], 1.f / face->mNormalizedScale.mV[1], 1.f / face->mNormalizedScale.mV[2]);
- for (int i = 0; i < face->mNumIndices; ++i)
+ for (S32 i = 0; i < face->mNumIndices; ++i)
{
U32 idx = face->mIndices[i];
@@ -5440,17 +5440,6 @@ struct MikktData
n[i].normalize();
tc[i].set(face->mTexCoords[idx]);
- if (idx >= face->mNumVertices)
- {
- // invalid index
- // replace with a valid index to avoid crashes
- idx = face->mNumVertices - 1;
- face->mIndices[i] = idx;
-
- // Needs better logging
- LL_DEBUGS_ONCE("LLVOLUME") << "Invalid index, substituting" << LL_ENDL;
- }
-
if (face->mWeights)
{
w[i].set(face->mWeights[idx].getF32ptr());
@@ -5522,7 +5511,7 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
U32 stream_count = data.w.empty() ? 4 : 5;
- size_t vert_count = meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count);
+ S32 vert_count = static_cast(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count));
if (vert_count < 65535 && vert_count != 0)
{
@@ -5536,11 +5525,11 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
allocateTangents(mNumVertices);
- for (int i = 0; i < mNumIndices; ++i)
+ for (S32 i = 0; i < mNumIndices; ++i)
{
U32 src_idx = i;
U32 dst_idx = remap[i];
- if (dst_idx >= mNumVertices)
+ if (dst_idx >= (U32)mNumVertices)
{
dst_idx = mNumVertices - 1;
// Shouldn't happen, figure out what gets returned in remap and why.
@@ -5567,7 +5556,7 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
scale.load3(mNormalizedScale.mV);
scale.getF32ptr()[3] = 1.f;
- for (int i = 0; i < mNumVertices; ++i)
+ for (S32 i = 0; i < mNumVertices; ++i)
{
mPositions[i].mul(inv_scale);
mNormals[i].mul(scale);
@@ -6431,7 +6420,7 @@ void LLVolumeFace::createTangents()
LLCalculateTangentArray(mNumVertices, mPositions, mNormals, mTexCoords, mNumIndices / 3, mIndices, mTangents);
//normalize normals
- for (U32 i = 0; i < mNumVertices; i++)
+ for (S32 i = 0; i < mNumVertices; i++)
{
//bump map/planar projection code requires normals to be normalized
mNormals[i].normalize3fast();
@@ -6607,8 +6596,8 @@ void LLVolumeFace::pushIndex(const U16& idx)
void LLVolumeFace::fillFromLegacyData(std::vector& v, std::vector& idx)
{
- resizeVertices(v.size());
- resizeIndices(idx.size());
+ resizeVertices(static_cast(v.size()));
+ resizeIndices(static_cast(idx.size()));
for (U32 i = 0; i < v.size(); ++i)
{
@@ -6703,7 +6692,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build)
{
// Get s value for tex-coord.
S32 index = mBeginS + s;
- if (index >= profile.size())
+ if (index >= (S32)profile.size())
{
// edge?
ss = flat ? 1.f - begin_stex : 1.f;
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 53c8f531cc..69d601a7e6 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -1025,7 +1025,7 @@ public:
U8 getProfileType() const { return mParams.getProfileParams().getCurveType(); }
U8 getPathType() const { return mParams.getPathParams().getCurveType(); }
S32 getNumFaces() const;
- S32 getNumVolumeFaces() const { return mVolumeFaces.size(); }
+ S32 getNumVolumeFaces() const { return static_cast(mVolumeFaces.size()); }
F32 getDetail() const { return mDetail; }
F32 getSurfaceArea() const { return mSurfaceArea; }
const LLVolumeParams& getParams() const { return mParams; }
diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp
index faa169e295..71288daa89 100644
--- a/indra/llmath/llvolumeoctree.cpp
+++ b/indra/llmath/llvolumeoctree.cpp
@@ -113,7 +113,7 @@ void LLOctreeTriangleRayIntersect::traverse(const LLOctreeNodemBounds[0], vl->mBounds[1]))
{
node->accept(this);
- for (S32 i = 0; i < node->getChildCount(); ++i)
+ for (U32 i = 0; i < node->getChildCount(); ++i)
{
traverse(node->getChild(i));
}
diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h
index 838e1d3db0..05d45f7b5f 100644
--- a/indra/llmath/llvolumeoctree.h
+++ b/indra/llmath/llvolumeoctree.h
@@ -186,7 +186,7 @@ public:
llassert(!branch->isLeaf()); // Empty leaf
}
- for (S32 i = 0; i < branch->getChildCount(); ++i)
+ for (U32 i = 0; i < branch->getChildCount(); ++i)
{ //stretch by child extents
LLVolumeOctreeListener* child = (LLVolumeOctreeListener*)branch->getChild(i)->getListener(0);
min.setMin(min, child->mExtents[0]);
diff --git a/indra/llmath/nd/ndoctreelog.cpp b/indra/llmath/nd/ndoctreelog.cpp
index 48716c3d58..a7636c107c 100644
--- a/indra/llmath/nd/ndoctreelog.cpp
+++ b/indra/llmath/nd/ndoctreelog.cpp
@@ -22,8 +22,9 @@
* $/LicenseInfo$
*/
-#include "../llmath.h"
-#include "ndoctreelog.h"
+#include "llpreprocessor.h"
+#include "llmath.h"
+#include "nd/ndoctreelog.h"
#include "llfile.h"
namespace nd
diff --git a/indra/llmath/tests/v4color_test.cpp b/indra/llmath/tests/v4color_test.cpp
index 3b3adbda0d..e5d914a065 100644
--- a/indra/llmath/tests/v4color_test.cpp
+++ b/indra/llmath/tests/v4color_test.cpp
@@ -49,23 +49,23 @@ namespace tut
void v4color_object::test<1>()
{
LLColor4 llcolor4;
- ensure("1:LLColor4:Fail to initialize ", ((0 == llcolor4.mV[VX]) && (0 == llcolor4.mV[VY]) && (0 == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
+ ensure("1:LLColor4:Fail to initialize ", ((0 == llcolor4.mV[VRED]) && (0 == llcolor4.mV[VGREEN]) && (0 == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
F32 r = 0x20, g = 0xFFFF, b = 0xFF, a = 0xAF;
LLColor4 llcolor4a(r,g,b);
- ensure("2:LLColor4:Fail to initialize ", ((r == llcolor4a.mV[VX]) && (g == llcolor4a.mV[VY]) && (b == llcolor4a.mV[VZ])&& (1.0f == llcolor4a.mV[VW])));
+ ensure("2:LLColor4:Fail to initialize ", ((r == llcolor4a.mV[VRED]) && (g == llcolor4a.mV[VGREEN]) && (b == llcolor4a.mV[VBLUE])&& (1.0f == llcolor4a.mV[VALPHA])));
LLColor4 llcolor4b(r,g,b,a);
- ensure("3:LLColor4:Fail to initialize ", ((r == llcolor4b.mV[VX]) && (g == llcolor4b.mV[VY]) && (b == llcolor4b.mV[VZ])&& (a == llcolor4b.mV[VW])));
+ ensure("3:LLColor4:Fail to initialize ", ((r == llcolor4b.mV[VRED]) && (g == llcolor4b.mV[VGREEN]) && (b == llcolor4b.mV[VBLUE])&& (a == llcolor4b.mV[VALPHA])));
const F32 vec[4] = {.112f ,23.2f, -4.2f, -.0001f};
LLColor4 llcolor4c(vec);
- ensure("4:LLColor4:Fail to initialize ", ((vec[0] == llcolor4c.mV[VX]) && (vec[1] == llcolor4c.mV[VY]) && (vec[2] == llcolor4c.mV[VZ])&& (vec[3] == llcolor4c.mV[VW])));
+ ensure("4:LLColor4:Fail to initialize ", ((vec[0] == llcolor4c.mV[VRED]) && (vec[1] == llcolor4c.mV[VGREEN]) && (vec[2] == llcolor4c.mV[VBLUE])&& (vec[3] == llcolor4c.mV[VALPHA])));
LLColor3 llcolor3(-2.23f,1.01f,42.3f);
F32 val = -.1f;
LLColor4 llcolor4d(llcolor3,val);
- ensure("5:LLColor4:Fail to initialize ", ((llcolor3.mV[VX] == llcolor4d.mV[VX]) && (llcolor3.mV[VY] == llcolor4d.mV[VY]) && (llcolor3.mV[VZ] == llcolor4d.mV[VZ])&& (val == llcolor4d.mV[VW])));
+ ensure("5:LLColor4:Fail to initialize ", ((llcolor3.mV[VRED] == llcolor4d.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4d.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4d.mV[VBLUE])&& (val == llcolor4d.mV[VALPHA])));
LLSD sd = llcolor4d.getValue();
LLColor4 llcolor4e(sd);
@@ -76,7 +76,7 @@ namespace tut
LLColor4 llcolor4g(color4u);
const F32 SCALE = 1.f/255.f;
F32 r2 = r1*SCALE, g2 = g1* SCALE, b2 = b1* SCALE;
- ensure("7:LLColor4:Fail to initialize ", ((r2 == llcolor4g.mV[VX]) && (g2 == llcolor4g.mV[VY]) && (b2 == llcolor4g.mV[VZ])));
+ ensure("7:LLColor4:Fail to initialize ", ((r2 == llcolor4g.mV[VRED]) && (g2 == llcolor4g.mV[VGREEN]) && (b2 == llcolor4g.mV[VBLUE])));
}
template<> template<>
@@ -98,10 +98,10 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF,a = 0xAF;
LLColor4 llcolor4(r,g,b,a);
llcolor4.setToBlack();
- ensure("setToBlack:Fail to set the black ", ((0 == llcolor4.mV[VX]) && (0 == llcolor4.mV[VY]) && (0 == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
+ ensure("setToBlack:Fail to set the black ", ((0 == llcolor4.mV[VRED]) && (0 == llcolor4.mV[VGREEN]) && (0 == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
llcolor4.setToWhite();
- ensure("setToWhite:Fail to set the white ", ((1.f == llcolor4.mV[VX]) && (1.f == llcolor4.mV[VY]) && (1.f == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
+ ensure("setToWhite:Fail to set the white ", ((1.f == llcolor4.mV[VRED]) && (1.f == llcolor4.mV[VGREEN]) && (1.f == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
}
template<> template<>
@@ -110,10 +110,10 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF, a = 0xAF;
LLColor4 llcolor4;
llcolor4.setVec(r,g,b);
- ensure("1:setVec:Fail to set the values ", ((r == llcolor4.mV[VX]) && (g == llcolor4.mV[VY]) && (b == llcolor4.mV[VZ])&& (1.f == llcolor4.mV[VW])));
+ ensure("1:setVec:Fail to set the values ", ((r == llcolor4.mV[VRED]) && (g == llcolor4.mV[VGREEN]) && (b == llcolor4.mV[VBLUE])&& (1.f == llcolor4.mV[VALPHA])));
llcolor4.setVec(r,g,b,a);
- ensure("2:setVec:Fail to set the values ", ((r == llcolor4.mV[VX]) && (g == llcolor4.mV[VY]) && (b == llcolor4.mV[VZ])&& (a == llcolor4.mV[VW])));
+ ensure("2:setVec:Fail to set the values ", ((r == llcolor4.mV[VRED]) && (g == llcolor4.mV[VGREEN]) && (b == llcolor4.mV[VBLUE])&& (a == llcolor4.mV[VALPHA])));
LLColor4 llcolor4a;
llcolor4a.setVec(llcolor4);
@@ -121,23 +121,23 @@ namespace tut
LLColor3 llcolor3(-2.23f,1.01f,42.3f);
llcolor4a.setVec(llcolor3);
- ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VX] == llcolor4a.mV[VX]) && (llcolor3.mV[VY] == llcolor4a.mV[VY]) && (llcolor3.mV[VZ] == llcolor4a.mV[VZ])));
+ ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VRED] == llcolor4a.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4a.mV[VBLUE])));
F32 val = -.33f;
llcolor4a.setVec(llcolor3,val);
- ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VX] == llcolor4a.mV[VX]) && (llcolor3.mV[VY] == llcolor4a.mV[VY]) && (llcolor3.mV[VZ] == llcolor4a.mV[VZ]) && (val == llcolor4a.mV[VW])));
+ ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VRED] == llcolor4a.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4a.mV[VBLUE]) && (val == llcolor4a.mV[VALPHA])));
const F32 vec[4] = {.112f ,23.2f, -4.2f, -.0001f};
LLColor4 llcolor4c;
llcolor4c.setVec(vec);
- ensure("5:setVec:Fail to initialize ", ((vec[0] == llcolor4c.mV[VX]) && (vec[1] == llcolor4c.mV[VY]) && (vec[2] == llcolor4c.mV[VZ])&& (vec[3] == llcolor4c.mV[VW])));
+ ensure("5:setVec:Fail to initialize ", ((vec[0] == llcolor4c.mV[VRED]) && (vec[1] == llcolor4c.mV[VGREEN]) && (vec[2] == llcolor4c.mV[VBLUE])&& (vec[3] == llcolor4c.mV[VALPHA])));
U8 r1 = 0xF2, g1 = 0xFA, b1= 0xBF;
LLColor4U color4u(r1,g1,b1);
llcolor4.setVec(color4u);
const F32 SCALE = 1.f/255.f;
F32 r2 = r1*SCALE, g2 = g1* SCALE, b2 = b1* SCALE;
- ensure("6:setVec:Fail to initialize ", ((r2 == llcolor4.mV[VX]) && (g2 == llcolor4.mV[VY]) && (b2 == llcolor4.mV[VZ])));
+ ensure("6:setVec:Fail to initialize ", ((r2 == llcolor4.mV[VRED]) && (g2 == llcolor4.mV[VGREEN]) && (b2 == llcolor4.mV[VBLUE])));
}
template<> template<>
@@ -146,7 +146,7 @@ namespace tut
F32 alpha = 0xAF;
LLColor4 llcolor4;
llcolor4.setAlpha(alpha);
- ensure("setAlpha:Fail to initialize ", (alpha == llcolor4.mV[VW]));
+ ensure("setAlpha:Fail to initialize ", (alpha == llcolor4.mV[VALPHA]));
}
template<> template<>
@@ -209,7 +209,7 @@ namespace tut
LLColor3 llcolor3(r,g,b);
LLColor4 llcolor4a,llcolor4b;
llcolor4a = llcolor3;
- ensure("Operator=:Fail to initialize ", ((llcolor3.mV[0] == llcolor4a.mV[VX]) && (llcolor3.mV[1] == llcolor4a.mV[VY]) && (llcolor3.mV[2] == llcolor4a.mV[VZ])));
+ ensure("Operator=:Fail to initialize ", ((llcolor3.mV[0] == llcolor4a.mV[VRED]) && (llcolor3.mV[1] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[2] == llcolor4a.mV[VBLUE])));
LLSD sd = llcolor4a.getValue();
llcolor4b = LLColor4(sd);
ensure_equals("Operator= LLSD:Fail ", llcolor4a, llcolor4b);
@@ -234,10 +234,10 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4b + llcolor4a;
- ensure("operator+:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4c.mV[VX]) && is_approx_equal(g1+g2,llcolor4c.mV[VY]) && is_approx_equal(b1+b2,llcolor4c.mV[VZ])));
+ ensure("operator+:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4c.mV[VRED]) && is_approx_equal(g1+g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1+b2,llcolor4c.mV[VBLUE])));
llcolor4b += llcolor4a;
- ensure("operator+=:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4b.mV[VX]) && is_approx_equal(g1+g2,llcolor4b.mV[VY]) && is_approx_equal(b1+b2,llcolor4b.mV[VZ])));
+ ensure("operator+=:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4b.mV[VRED]) && is_approx_equal(g1+g2,llcolor4b.mV[VGREEN]) && is_approx_equal(b1+b2,llcolor4b.mV[VBLUE])));
}
template<> template<>
@@ -247,10 +247,10 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4a - llcolor4b;
- ensure("operator-:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4c.mV[VX]) && is_approx_equal(g1-g2,llcolor4c.mV[VY]) && is_approx_equal(b1-b2,llcolor4c.mV[VZ])));
+ ensure("operator-:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4c.mV[VRED]) && is_approx_equal(g1-g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1-b2,llcolor4c.mV[VBLUE])));
llcolor4a -= llcolor4b;
- ensure("operator-=:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4a.mV[VX]) && is_approx_equal(g1-g2,llcolor4a.mV[VY]) && is_approx_equal(b1-b2,llcolor4a.mV[VZ])));
+ ensure("operator-=:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4a.mV[VRED]) && is_approx_equal(g1-g2,llcolor4a.mV[VGREEN]) && is_approx_equal(b1-b2,llcolor4a.mV[VBLUE])));
}
template<> template<>
@@ -260,20 +260,20 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4a * llcolor4b;
- ensure("1:operator*:Fail to multiply the values", (is_approx_equal(r1*r2,llcolor4c.mV[VX]) && is_approx_equal(g1*g2,llcolor4c.mV[VY]) && is_approx_equal(b1*b2,llcolor4c.mV[VZ])));
+ ensure("1:operator*:Fail to multiply the values", (is_approx_equal(r1*r2,llcolor4c.mV[VRED]) && is_approx_equal(g1*g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*b2,llcolor4c.mV[VBLUE])));
F32 mulVal = 3.33f;
llcolor4c = llcolor4a * mulVal;
- ensure("2:operator*:Fail ", (is_approx_equal(r1*mulVal,llcolor4c.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VZ])));
+ ensure("2:operator*:Fail ", (is_approx_equal(r1*mulVal,llcolor4c.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VBLUE])));
llcolor4c = mulVal * llcolor4a;
- ensure("3:operator*:Fail to multiply the values", (is_approx_equal(r1*mulVal,llcolor4c.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VZ])));
+ ensure("3:operator*:Fail to multiply the values", (is_approx_equal(r1*mulVal,llcolor4c.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VBLUE])));
llcolor4a *= mulVal;
- ensure("4:operator*=:Fail to multiply the values ", (is_approx_equal(r1*mulVal,llcolor4a.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4a.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4a.mV[VZ])));
+ ensure("4:operator*=:Fail to multiply the values ", (is_approx_equal(r1*mulVal,llcolor4a.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4a.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4a.mV[VBLUE])));
LLColor4 llcolor4d(r1,g1,b1),llcolor4e(r2,g2,b2);
llcolor4e *= llcolor4d;
- ensure("5:operator*=:Fail to multiply the values ", (is_approx_equal(r1*r2,llcolor4e.mV[VX]) && is_approx_equal(g1*g2,llcolor4e.mV[VY]) && is_approx_equal(b1*b2,llcolor4e.mV[VZ])));
+ ensure("5:operator*=:Fail to multiply the values ", (is_approx_equal(r1*r2,llcolor4e.mV[VRED]) && is_approx_equal(g1*g2,llcolor4e.mV[VGREEN]) && is_approx_equal(b1*b2,llcolor4e.mV[VBLUE])));
}
template<> template<>
@@ -283,13 +283,13 @@ namespace tut
F32 div = 12.345f;
LLColor4 llcolor4a(r,g,b,a),llcolor4b;
llcolor4b = llcolor4a % div;//chnage only alpha value nor r,g,b;
- ensure("1operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VX]) && is_approx_equal(g,llcolor4b.mV[VY]) && is_approx_equal(b,llcolor4b.mV[VZ])&& is_approx_equal(div*a,llcolor4b.mV[VW])));
+ ensure("1operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VRED]) && is_approx_equal(g,llcolor4b.mV[VGREEN]) && is_approx_equal(b,llcolor4b.mV[VBLUE])&& is_approx_equal(div*a,llcolor4b.mV[VALPHA])));
llcolor4b = div % llcolor4a;
- ensure("2operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VX]) && is_approx_equal(g,llcolor4b.mV[VY]) && is_approx_equal(b,llcolor4b.mV[VZ])&& is_approx_equal(div*a,llcolor4b.mV[VW])));
+ ensure("2operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VRED]) && is_approx_equal(g,llcolor4b.mV[VGREEN]) && is_approx_equal(b,llcolor4b.mV[VBLUE])&& is_approx_equal(div*a,llcolor4b.mV[VALPHA])));
llcolor4a %= div;
- ensure("operator%=:Fail ", (is_approx_equal(a*div,llcolor4a.mV[VW])));
+ ensure("operator%=:Fail ", (is_approx_equal(a*div,llcolor4a.mV[VALPHA])));
}
template<> template<>
@@ -312,7 +312,7 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF;
LLColor4 llcolor4a(r,g,b),llcolor4b;
LLColor3 llcolor3 = vec4to3(llcolor4a);
- ensure("vec4to3:Fail to convert vec4 to vec3 ", (is_approx_equal(llcolor3.mV[VX],llcolor4a.mV[VX]) && is_approx_equal(llcolor3.mV[VY],llcolor4a.mV[VY]) && is_approx_equal(llcolor3.mV[VZ],llcolor4a.mV[VZ])));
+ ensure("vec4to3:Fail to convert vec4 to vec3 ", (is_approx_equal(llcolor3.mV[VRED],llcolor4a.mV[VRED]) && is_approx_equal(llcolor3.mV[VGREEN],llcolor4a.mV[VGREEN]) && is_approx_equal(llcolor3.mV[VBLUE],llcolor4a.mV[VBLUE])));
llcolor4b = vec3to4(llcolor3);
ensure_equals("vec3to4:Fail to convert vec3 to vec4 ", llcolor4b, llcolor4a);
}
@@ -324,7 +324,7 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = lerp(llcolor4a,llcolor4b,val);
- ensure("lerp:Fail ", (is_approx_equal(r1 + (r2 - r1)* val,llcolor4c.mV[VX]) && is_approx_equal(g1 + (g2 - g1)* val,llcolor4c.mV[VY]) && is_approx_equal(b1 + (b2 - b1)* val,llcolor4c.mV[VZ])));
+ ensure("lerp:Fail ", (is_approx_equal(r1 + (r2 - r1)* val,llcolor4c.mV[VRED]) && is_approx_equal(g1 + (g2 - g1)* val,llcolor4c.mV[VGREEN]) && is_approx_equal(b1 + (b2 - b1)* val,llcolor4c.mV[VBLUE])));
}
template<> template<>
diff --git a/indra/llmath/tests/v4coloru_test.cpp b/indra/llmath/tests/v4coloru_test.cpp
index 55cef0fea1..9d707d18c5 100644
--- a/indra/llmath/tests/v4coloru_test.cpp
+++ b/indra/llmath/tests/v4coloru_test.cpp
@@ -48,18 +48,18 @@ namespace tut
void v4coloru_object::test<1>()
{
LLColor4U llcolor4u;
- ensure("1:LLColor4u:Fail to initialize ", ((0 == llcolor4u.mV[VX]) && (0 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("1:LLColor4u:Fail to initialize ", ((0 == llcolor4u.mV[VRED]) && (0 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u1(r,g,b);
- ensure("2:LLColor4u:Fail to initialize ", ((r == llcolor4u1.mV[VX]) && (g == llcolor4u1.mV[VY]) && (b == llcolor4u1.mV[VZ])&& (255 == llcolor4u1.mV[VW])));
+ ensure("2:LLColor4u:Fail to initialize ", ((r == llcolor4u1.mV[VRED]) && (g == llcolor4u1.mV[VGREEN]) && (b == llcolor4u1.mV[VBLUE])&& (255 == llcolor4u1.mV[VALPHA])));
LLColor4U llcolor4u2(r,g,b,a);
- ensure("3:LLColor4u:Fail to initialize ", ((r == llcolor4u2.mV[VX]) && (g == llcolor4u2.mV[VY]) && (b == llcolor4u2.mV[VZ])&& (a == llcolor4u2.mV[VW])));
+ ensure("3:LLColor4u:Fail to initialize ", ((r == llcolor4u2.mV[VRED]) && (g == llcolor4u2.mV[VGREEN]) && (b == llcolor4u2.mV[VBLUE])&& (a == llcolor4u2.mV[VALPHA])));
const U8 vec[4] = {0x12,0xFF,0xAF,0x23};
LLColor4U llcolor4u3(vec);
- ensure("4:LLColor4u:Fail to initialize ", ((vec[0] == llcolor4u3.mV[VX]) && (vec[1] == llcolor4u3.mV[VY]) && (vec[2] == llcolor4u3.mV[VZ])&& (vec[3] == llcolor4u3.mV[VW])));
+ ensure("4:LLColor4u:Fail to initialize ", ((vec[0] == llcolor4u3.mV[VRED]) && (vec[1] == llcolor4u3.mV[VGREEN]) && (vec[2] == llcolor4u3.mV[VBLUE])&& (vec[3] == llcolor4u3.mV[VALPHA])));
LLSD sd = llcolor4u3.getValue();
LLColor4U llcolor4u4(sd);
@@ -82,10 +82,10 @@ namespace tut
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u(r,g,b,a);
llcolor4u.setToBlack();
- ensure("setToBlack:Fail to set black ", ((0 == llcolor4u.mV[VX]) && (0 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("setToBlack:Fail to set black ", ((0 == llcolor4u.mV[VRED]) && (0 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
llcolor4u.setToWhite();
- ensure("setToWhite:Fail to white ", ((255 == llcolor4u.mV[VX]) && (255 == llcolor4u.mV[VY]) && (255 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("setToWhite:Fail to white ", ((255 == llcolor4u.mV[VRED]) && (255 == llcolor4u.mV[VGREEN]) && (255 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
}
template<> template<>
@@ -104,11 +104,11 @@ namespace tut
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u;
llcolor4u.setVec(r,g,b,a);
- ensure("1:setVec:Fail to set the values ", ((r == llcolor4u.mV[VX]) && (g == llcolor4u.mV[VY]) && (b == llcolor4u.mV[VZ])&& (a == llcolor4u.mV[VW])));
+ ensure("1:setVec:Fail to set the values ", ((r == llcolor4u.mV[VRED]) && (g == llcolor4u.mV[VGREEN]) && (b == llcolor4u.mV[VBLUE])&& (a == llcolor4u.mV[VALPHA])));
llcolor4u.setToBlack();
llcolor4u.setVec(r,g,b);
- ensure("2:setVec:Fail to set the values ", ((r == llcolor4u.mV[VX]) && (g == llcolor4u.mV[VY]) && (b == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("2:setVec:Fail to set the values ", ((r == llcolor4u.mV[VRED]) && (g == llcolor4u.mV[VGREEN]) && (b == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
LLColor4U llcolor4u1;
llcolor4u1.setVec(llcolor4u);
@@ -117,7 +117,7 @@ namespace tut
const U8 vec[4] = {0x12,0xFF,0xAF,0x23};
LLColor4U llcolor4u2;
llcolor4u2.setVec(vec);
- ensure("4:setVec:Fail to set the values ", ((vec[0] == llcolor4u2.mV[VX]) && (vec[1] == llcolor4u2.mV[VY]) && (vec[2] == llcolor4u2.mV[VZ])&& (vec[3] == llcolor4u2.mV[VW])));
+ ensure("4:setVec:Fail to set the values ", ((vec[0] == llcolor4u2.mV[VRED]) && (vec[1] == llcolor4u2.mV[VGREEN]) && (vec[2] == llcolor4u2.mV[VBLUE])&& (vec[3] == llcolor4u2.mV[VALPHA])));
}
template<> template<>
@@ -126,7 +126,7 @@ namespace tut
U8 alpha = 0x12;
LLColor4U llcolor4u;
llcolor4u.setAlpha(alpha);
- ensure("setAlpha:Fail to set alpha value ", (alpha == llcolor4u.mV[VW]));
+ ensure("setAlpha:Fail to set alpha value ", (alpha == llcolor4u.mV[VALPHA]));
}
template<> template<>
@@ -159,29 +159,29 @@ namespace tut
llcolor4u3 = llcolor4u1 + llcolor4u2;
ensure_equals(
"1a.operator+:Fail to Add the values ",
- llcolor4u3.mV[VX],
+ llcolor4u3.mV[VRED],
(U8)(r1+r2));
ensure_equals(
"1b.operator+:Fail to Add the values ",
- llcolor4u3.mV[VY],
+ llcolor4u3.mV[VGREEN],
(U8)(g1+g2));
ensure_equals(
"1c.operator+:Fail to Add the values ",
- llcolor4u3.mV[VZ],
+ llcolor4u3.mV[VBLUE],
(U8)(b1+b2));
llcolor4u2 += llcolor4u1;
ensure_equals(
"2a.operator+=:Fail to Add the values ",
- llcolor4u2.mV[VX],
+ llcolor4u2.mV[VRED],
(U8)(r1+r2));
ensure_equals(
"2b.operator+=:Fail to Add the values ",
- llcolor4u2.mV[VY],
+ llcolor4u2.mV[VGREEN],
(U8)(g1+g2));
ensure_equals(
"2c.operator+=:Fail to Add the values ",
- llcolor4u2.mV[VZ],
+ llcolor4u2.mV[VBLUE],
(U8)(b1+b2));
}
@@ -194,29 +194,29 @@ namespace tut
llcolor4u3 = llcolor4u1 - llcolor4u2;
ensure_equals(
"1a. operator-:Fail to Add the values ",
- llcolor4u3.mV[VX],
+ llcolor4u3.mV[VRED],
(U8)(r1-r2));
ensure_equals(
"1b. operator-:Fail to Add the values ",
- llcolor4u3.mV[VY],
+ llcolor4u3.mV[VGREEN],
(U8)(g1-g2));
ensure_equals(
"1c. operator-:Fail to Add the values ",
- llcolor4u3.mV[VZ],
+ llcolor4u3.mV[VBLUE],
(U8)(b1-b2));
llcolor4u1 -= llcolor4u2;
ensure_equals(
"2a. operator-=:Fail to Add the values ",
- llcolor4u1.mV[VX],
+ llcolor4u1.mV[VRED],
(U8)(r1-r2));
ensure_equals(
"2b. operator-=:Fail to Add the values ",
- llcolor4u1.mV[VY],
+ llcolor4u1.mV[VGREEN],
(U8)(g1-g2));
ensure_equals(
"2c. operator-=:Fail to Add the values ",
- llcolor4u1.mV[VZ],
+ llcolor4u1.mV[VBLUE],
(U8)(b1-b2));
}
@@ -229,30 +229,30 @@ namespace tut
llcolor4u3 = llcolor4u1 * llcolor4u2;
ensure_equals(
"1a. operator*:Fail to multiply the values",
- llcolor4u3.mV[VX],
+ llcolor4u3.mV[VRED],
(U8)(r1*r2));
ensure_equals(
"1b. operator*:Fail to multiply the values",
- llcolor4u3.mV[VY],
+ llcolor4u3.mV[VGREEN],
(U8)(g1*g2));
ensure_equals(
"1c. operator*:Fail to multiply the values",
- llcolor4u3.mV[VZ],
+ llcolor4u3.mV[VBLUE],
(U8)(b1*b2));
U8 mulVal = 123;
llcolor4u1 *= mulVal;
ensure_equals(
"2a. operator*=:Fail to multiply the values",
- llcolor4u1.mV[VX],
+ llcolor4u1.mV[VRED],
(U8)(r1*mulVal));
ensure_equals(
"2b. operator*=:Fail to multiply the values",
- llcolor4u1.mV[VY],
+ llcolor4u1.mV[VGREEN],
(U8)(g1*mulVal));
ensure_equals(
"2c. operator*=:Fail to multiply the values",
- llcolor4u1.mV[VZ],
+ llcolor4u1.mV[VBLUE],
(U8)(b1*mulVal));
}
@@ -274,7 +274,7 @@ namespace tut
LLColor4U llcolor4u(r,g,b,a);
U8 modVal = 45;
llcolor4u %= modVal;
- ensure_equals("operator%=:Fail ", llcolor4u.mV[VW], (U8)(a * modVal));
+ ensure_equals("operator%=:Fail ", llcolor4u.mV[VALPHA], (U8)(a * modVal));
}
template<> template<>
@@ -284,7 +284,7 @@ namespace tut
LLColor4U llcolor4u1(r,g,b,a);
std::string color("12, 23, 132, 50");
LLColor4U::parseColor4U(color, &llcolor4u1);
- ensure("parseColor4U() failed to parse the color value ", ((12 == llcolor4u1.mV[VX]) && (23 == llcolor4u1.mV[VY]) && (132 == llcolor4u1.mV[VZ])&& (50 == llcolor4u1.mV[VW])));
+ ensure("parseColor4U() failed to parse the color value ", ((12 == llcolor4u1.mV[VRED]) && (23 == llcolor4u1.mV[VGREEN]) && (132 == llcolor4u1.mV[VBLUE])&& (50 == llcolor4u1.mV[VALPHA])));
color = "12, 23, 132";
ensure("2:parseColor4U() failed to parse the color value ", (false == LLColor4U::parseColor4U(color, &llcolor4u1)));
@@ -300,8 +300,8 @@ namespace tut
LLColor4U llcolor4u(r,g,b,a),llcolor4u1;
const F32 fVal = 3.f;
llcolor4u1 = llcolor4u.multAll(fVal);
- ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VX]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VY]
- && ((U8)ll_round(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VW])));
+ ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VRED]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VGREEN]
+ && ((U8)ll_round(b * fVal) == llcolor4u1.mV[VBLUE])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VALPHA])));
}
template<> template<>
@@ -311,13 +311,13 @@ namespace tut
U8 r2 = 23, g2 = 230, b2 = 124, a2 = 255;
LLColor4U llcolor4u(r1,g1,b1,a1),llcolor4u1(r2,g2,b2,a2);
llcolor4u1 = llcolor4u1.addClampMax(llcolor4u);
- ensure("1:addClampMax():Fail to add the value ", ((r1+r2 == llcolor4u1.mV[VX]) && (255 == llcolor4u1.mV[VY]) && (b1+b2 == llcolor4u1.mV[VZ])&& (255 == llcolor4u1.mV[VW])));
+ ensure("1:addClampMax():Fail to add the value ", ((r1+r2 == llcolor4u1.mV[VRED]) && (255 == llcolor4u1.mV[VGREEN]) && (b1+b2 == llcolor4u1.mV[VBLUE])&& (255 == llcolor4u1.mV[VALPHA])));
r1 = 132, g1 = 3, b1 = 3, a1 = 2;
r2 = 123, g2 = 230, b2 = 154, a2 = 25;
LLColor4U llcolor4u2(r1,g1,b1,a1),llcolor4u3(r2,g2,b2,a2);
llcolor4u3 = llcolor4u3.addClampMax(llcolor4u2);
- ensure("2:addClampMax():Fail to add the value ", ((255 == llcolor4u3.mV[VX]) && (g1+g2 == llcolor4u3.mV[VY]) && (b1+b2 == llcolor4u3.mV[VZ])&& (a1+a2 == llcolor4u3.mV[VW])));
+ ensure("2:addClampMax():Fail to add the value ", ((255 == llcolor4u3.mV[VRED]) && (g1+g2 == llcolor4u3.mV[VGREEN]) && (b1+b2 == llcolor4u3.mV[VBLUE])&& (a1+a2 == llcolor4u3.mV[VALPHA])));
}
template<> template<>
@@ -331,6 +331,6 @@ namespace tut
F32 color_scale_factor = MAX_COLOR/r;
S32 r2 = ll_round(r * color_scale_factor);
S32 g2 = ll_round(g * color_scale_factor);
- ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VX]) && (g2 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VRED]) && (g2 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
}
}
diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp
index 9fe9c8d5e5..4367b993f8 100644
--- a/indra/llmath/v3color.cpp
+++ b/indra/llmath/v3color.cpp
@@ -63,7 +63,7 @@ const LLColor3& LLColor3::operator=(const LLColor4 &a)
std::ostream& operator<<(std::ostream& s, const LLColor3 &a)
{
- s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << " }";
+ s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << " }";
return s;
}
diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h
index 69cbdeb1a3..b305c98727 100644
--- a/indra/llmath/v3color.h
+++ b/indra/llmath/v3color.h
@@ -198,17 +198,17 @@ inline LLColor3::LLColor3(void)
inline LLColor3::LLColor3(F32 r, F32 g, F32 b)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
}
inline LLColor3::LLColor3(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
}
#if LL_WINDOWS
@@ -228,11 +228,11 @@ inline LLColor3::LLColor3(const char* color_string) // takes a string of format
char tempstr[7];
strncpy(tempstr,color_string,6); /* Flawfinder: ignore */
tempstr[6] = '\0';
- mV[VZ] = (F32)strtol(&tempstr[4],NULL,16)/255.f;
+ mV[VBLUE] = (F32)strtol(&tempstr[4],NULL,16)/255.f;
tempstr[4] = '\0';
- mV[VY] = (F32)strtol(&tempstr[2],NULL,16)/255.f;
+ mV[VGREEN] = (F32)strtol(&tempstr[2],NULL,16)/255.f;
tempstr[2] = '\0';
- mV[VX] = (F32)strtol(&tempstr[0],NULL,16)/255.f;
+ mV[VRED] = (F32)strtol(&tempstr[0],NULL,16)/255.f;
}
inline const LLColor3& LLColor3::setToBlack(void)
diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp
index 9caac46464..a941bcf337 100644
--- a/indra/llmath/v4color.cpp
+++ b/indra/llmath/v4color.cpp
@@ -136,57 +136,57 @@ LLColor4::operator LLColor4U() const
LLColor4::LLColor4(const LLColor3 &vec, F32 a)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = a;
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = a;
}
LLColor4::LLColor4(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
- mV[VX] = color4u.mV[VX] * SCALE;
- mV[VY] = color4u.mV[VY] * SCALE;
- mV[VZ] = color4u.mV[VZ] * SCALE;
- mV[VW] = color4u.mV[VW] * SCALE;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
}
LLColor4::LLColor4(const LLVector4& vector4)
{
- mV[VX] = vector4.mV[VX];
- mV[VY] = vector4.mV[VY];
- mV[VZ] = vector4.mV[VZ];
- mV[VW] = vector4.mV[VW];
+ mV[VRED] = vector4.mV[VRED];
+ mV[VGREEN] = vector4.mV[VGREEN];
+ mV[VBLUE] = vector4.mV[VBLUE];
+ mV[VALPHA] = vector4.mV[VALPHA];
}
const LLColor4& LLColor4::set(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
- mV[VX] = color4u.mV[VX] * SCALE;
- mV[VY] = color4u.mV[VY] * SCALE;
- mV[VZ] = color4u.mV[VZ] * SCALE;
- mV[VW] = color4u.mV[VW] * SCALE;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
return (*this);
}
const LLColor4& LLColor4::set(const LLColor3 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
// no change to alpha!
-// mV[VW] = 1.f;
+// mV[VALPHA] = 1.f;
return (*this);
}
const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = a;
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = a;
return (*this);
}
@@ -194,22 +194,22 @@ const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a)
const LLColor4& LLColor4::setVec(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
- mV[VX] = color4u.mV[VX] * SCALE;
- mV[VY] = color4u.mV[VY] * SCALE;
- mV[VZ] = color4u.mV[VZ] * SCALE;
- mV[VW] = color4u.mV[VW] * SCALE;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
return (*this);
}
// deprecated -- use set()
const LLColor4& LLColor4::setVec(const LLColor3 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
// no change to alpha!
-// mV[VW] = 1.f;
+// mV[VALPHA] = 1.f;
return (*this);
}
@@ -217,10 +217,10 @@ const LLColor4& LLColor4::setVec(const LLColor3 &vec)
// deprecated -- use set()
const LLColor4& LLColor4::setVec(const LLColor3 &vec, F32 a)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = a;
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = a;
return (*this);
}
@@ -260,45 +260,45 @@ void LLColor4::setValue(const LLSD& sd)
const LLColor4& LLColor4::operator=(const LLColor3 &a)
{
- mV[VX] = a.mV[VX];
- mV[VY] = a.mV[VY];
- mV[VZ] = a.mV[VZ];
+ mV[VRED] = a.mV[VRED];
+ mV[VGREEN] = a.mV[VGREEN];
+ mV[VBLUE] = a.mV[VBLUE];
// converting from an rgb sets a=1 (opaque)
- mV[VW] = 1.f;
+ mV[VALPHA] = 1.f;
return (*this);
}
std::ostream& operator<<(std::ostream& s, const LLColor4 &a)
{
- s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << ", " << a.mV[VW] << " }";
+ s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << ", " << a.mV[VALPHA] << " }";
return s;
}
bool operator==(const LLColor4 &a, const LLColor3 &b)
{
- return ( (a.mV[VX] == b.mV[VX])
- &&(a.mV[VY] == b.mV[VY])
- &&(a.mV[VZ] == b.mV[VZ]));
+ return ( (a.mV[VRED] == b.mV[VRED])
+ &&(a.mV[VGREEN] == b.mV[VGREEN])
+ &&(a.mV[VBLUE] == b.mV[VBLUE]));
}
bool operator!=(const LLColor4 &a, const LLColor3 &b)
{
- return ( (a.mV[VX] != b.mV[VX])
- ||(a.mV[VY] != b.mV[VY])
- ||(a.mV[VZ] != b.mV[VZ]));
+ return ( (a.mV[VRED] != b.mV[VRED])
+ ||(a.mV[VGREEN] != b.mV[VGREEN])
+ ||(a.mV[VBLUE] != b.mV[VBLUE]));
}
LLColor3 vec4to3(const LLColor4 &vec)
{
- LLColor3 temp(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
+ LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
return temp;
}
LLColor4 vec3to4(const LLColor3 &vec)
{
- LLColor3 temp(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
+ LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
return temp;
}
@@ -411,10 +411,10 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
{
// There are more tokens to read. This must be a vector.
LLColor4 v;
- LLStringUtil::convertToF32( color_name, v.mV[VX] );
- LLStringUtil::convertToF32( *token_iter, v.mV[VY] );
- v.mV[VZ] = 0.0f;
- v.mV[VW] = 1.0f;
+ LLStringUtil::convertToF32( color_name, v.mV[VRED] );
+ LLStringUtil::convertToF32( *token_iter, v.mV[VGREEN] );
+ v.mV[VBLUE] = 0.0f;
+ v.mV[VALPHA] = 1.0f;
++token_iter;
if (token_iter == tokens.end())
@@ -425,18 +425,18 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
else
{
// There is a z-component.
- LLStringUtil::convertToF32( *token_iter, v.mV[VZ] );
+ LLStringUtil::convertToF32( *token_iter, v.mV[VBLUE] );
++token_iter;
if (token_iter != tokens.end())
{
// There is an alpha component.
- LLStringUtil::convertToF32( *token_iter, v.mV[VW] );
+ LLStringUtil::convertToF32( *token_iter, v.mV[VALPHA] );
}
}
// Make sure all values are between 0 and 1.
- if (v.mV[VX] > 1.f || v.mV[VY] > 1.f || v.mV[VZ] > 1.f || v.mV[VW] > 1.f)
+ if (v.mV[VRED] > 1.f || v.mV[VGREEN] > 1.f || v.mV[VBLUE] > 1.f || v.mV[VALPHA] > 1.f)
{
v = v * (1.f / 255.f);
}
diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h
index 7e2ca42af2..46b52186f2 100644
--- a/indra/llmath/v4color.h
+++ b/indra/llmath/v4color.h
@@ -245,10 +245,10 @@ LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u);
inline LLColor4::LLColor4(void)
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
- mV[VZ] = 0.f;
- mV[VW] = 1.f;
+ mV[VRED] = 0.f;
+ mV[VGREEN] = 0.f;
+ mV[VBLUE] = 0.f;
+ mV[VALPHA] = 1.f;
}
inline LLColor4::LLColor4(const LLSD& sd)
@@ -258,113 +258,113 @@ inline LLColor4::LLColor4(const LLSD& sd)
inline LLColor4::LLColor4(F32 r, F32 g, F32 b)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
- mV[VW] = 1.f;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = 1.f;
}
inline LLColor4::LLColor4(F32 r, F32 g, F32 b, F32 a)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
- mV[VW] = a;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = a;
}
inline LLColor4::LLColor4(U32 clr)
{
- mV[VX] = (clr&0xff) * (1.0f/255.0f);
- mV[VY] = ((clr>>8)&0xff) * (1.0f/255.0f);
- mV[VZ] = ((clr>>16)&0xff) * (1.0f/255.0f);
- mV[VW] = (clr>>24) * (1.0f/255.0f);
+ mV[VRED] = (clr&0xff) * (1.0f/255.0f);
+ mV[VGREEN] = ((clr>>8)&0xff) * (1.0f/255.0f);
+ mV[VBLUE] = ((clr>>16)&0xff) * (1.0f/255.0f);
+ mV[VALPHA] = (clr>>24) * (1.0f/255.0f);
}
inline LLColor4::LLColor4(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
}
inline const LLColor4& LLColor4::setToBlack(void)
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
- mV[VZ] = 0.f;
- mV[VW] = 1.f;
+ mV[VRED] = 0.f;
+ mV[VGREEN] = 0.f;
+ mV[VBLUE] = 0.f;
+ mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::setToWhite(void)
{
- mV[VX] = 1.f;
- mV[VY] = 1.f;
- mV[VZ] = 1.f;
- mV[VW] = 1.f;
+ mV[VRED] = 1.f;
+ mV[VGREEN] = 1.f;
+ mV[VBLUE] = 1.f;
+ mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
// no change to alpha!
-// mV[VW] = 1.f;
+// mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z, F32 a)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = a;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
+ mV[VALPHA] = a;
return (*this);
}
inline const LLColor4& LLColor4::set(const LLColor4 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::set(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::set(const F64 *vec)
{
- mV[VX] = static_cast(vec[VX]);
- mV[VY] = static_cast(vec[VY]);
- mV[VZ] = static_cast(vec[VZ]);
- mV[VW] = static_cast(vec[VW]);
+ mV[VRED] = static_cast(vec[VRED]);
+ mV[VGREEN] = static_cast(vec[VGREEN]);
+ mV[VBLUE] = static_cast(vec[VBLUE]);
+ mV[VALPHA] = static_cast(vec[VALPHA]);
return (*this);
}
// deprecated
inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
// no change to alpha!
-// mV[VW] = 1.f;
+// mV[VALPHA] = 1.f;
return (*this);
}
@@ -372,20 +372,20 @@ inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z)
// deprecated
inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = a;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
+ mV[VALPHA] = a;
return (*this);
}
// deprecated
inline const LLColor4& LLColor4::setVec(const LLColor4 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
@@ -393,16 +393,16 @@ inline const LLColor4& LLColor4::setVec(const LLColor4 &vec)
// deprecated
inline const LLColor4& LLColor4::setVec(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::setAlpha(F32 a)
{
- mV[VW] = a;
+ mV[VALPHA] = a;
return (*this);
}
@@ -410,25 +410,25 @@ inline const LLColor4& LLColor4::setAlpha(F32 a)
inline F32 LLColor4::length(void) const
{
- return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
}
inline F32 LLColor4::lengthSquared(void) const
{
- return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
+ return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE];
}
inline F32 LLColor4::normalize(void)
{
- F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
F32 oomag;
if (mag)
{
oomag = 1.f/mag;
- mV[VX] *= oomag;
- mV[VY] *= oomag;
- mV[VZ] *= oomag;
+ mV[VRED] *= oomag;
+ mV[VGREEN] *= oomag;
+ mV[VBLUE] *= oomag;
}
return (mag);
}
@@ -436,27 +436,27 @@ inline F32 LLColor4::normalize(void)
// deprecated
inline F32 LLColor4::magVec(void) const
{
- return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
}
// deprecated
inline F32 LLColor4::magVecSquared(void) const
{
- return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
+ return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE];
}
// deprecated
inline F32 LLColor4::normVec(void)
{
- F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
F32 oomag;
if (mag)
{
oomag = 1.f/mag;
- mV[VX] *= oomag;
- mV[VY] *= oomag;
- mV[VZ] *= oomag;
+ mV[VRED] *= oomag;
+ mV[VGREEN] *= oomag;
+ mV[VBLUE] *= oomag;
}
return (mag);
}
@@ -467,135 +467,135 @@ inline F32 LLColor4::normVec(void)
inline LLColor4 operator+(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
- a.mV[VX] + b.mV[VX],
- a.mV[VY] + b.mV[VY],
- a.mV[VZ] + b.mV[VZ],
- a.mV[VW] + b.mV[VW]);
+ a.mV[VRED] + b.mV[VRED],
+ a.mV[VGREEN] + b.mV[VGREEN],
+ a.mV[VBLUE] + b.mV[VBLUE],
+ a.mV[VALPHA] + b.mV[VALPHA]);
}
inline LLColor4 operator-(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
- a.mV[VX] - b.mV[VX],
- a.mV[VY] - b.mV[VY],
- a.mV[VZ] - b.mV[VZ],
- a.mV[VW] - b.mV[VW]);
+ a.mV[VRED] - b.mV[VRED],
+ a.mV[VGREEN] - b.mV[VGREEN],
+ a.mV[VBLUE] - b.mV[VBLUE],
+ a.mV[VALPHA] - b.mV[VALPHA]);
}
inline LLColor4 operator*(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
- a.mV[VX] * b.mV[VX],
- a.mV[VY] * b.mV[VY],
- a.mV[VZ] * b.mV[VZ],
- a.mV[VW] * b.mV[VW]);
+ a.mV[VRED] * b.mV[VRED],
+ a.mV[VGREEN] * b.mV[VGREEN],
+ a.mV[VBLUE] * b.mV[VBLUE],
+ a.mV[VALPHA] * b.mV[VALPHA]);
}
inline LLColor4 operator*(const LLColor4 &a, F32 k)
{
// only affects rgb (not a!)
return LLColor4(
- a.mV[VX] * k,
- a.mV[VY] * k,
- a.mV[VZ] * k,
- a.mV[VW]);
+ a.mV[VRED] * k,
+ a.mV[VGREEN] * k,
+ a.mV[VBLUE] * k,
+ a.mV[VALPHA]);
}
inline LLColor4 operator/(const LLColor4 &a, F32 k)
{
return LLColor4(
- a.mV[VX] / k,
- a.mV[VY] / k,
- a.mV[VZ] / k,
- a.mV[VW]);
+ a.mV[VRED] / k,
+ a.mV[VGREEN] / k,
+ a.mV[VBLUE] / k,
+ a.mV[VALPHA]);
}
inline LLColor4 operator*(F32 k, const LLColor4 &a)
{
// only affects rgb (not a!)
return LLColor4(
- a.mV[VX] * k,
- a.mV[VY] * k,
- a.mV[VZ] * k,
- a.mV[VW]);
+ a.mV[VRED] * k,
+ a.mV[VGREEN] * k,
+ a.mV[VBLUE] * k,
+ a.mV[VALPHA]);
}
inline LLColor4 operator%(F32 k, const LLColor4 &a)
{
// only affects alpha (not rgb!)
return LLColor4(
- a.mV[VX],
- a.mV[VY],
- a.mV[VZ],
- a.mV[VW] * k);
+ a.mV[VRED],
+ a.mV[VGREEN],
+ a.mV[VBLUE],
+ a.mV[VALPHA] * k);
}
inline LLColor4 operator%(const LLColor4 &a, F32 k)
{
// only affects alpha (not rgb!)
return LLColor4(
- a.mV[VX],
- a.mV[VY],
- a.mV[VZ],
- a.mV[VW] * k);
+ a.mV[VRED],
+ a.mV[VGREEN],
+ a.mV[VBLUE],
+ a.mV[VALPHA] * k);
}
inline bool operator==(const LLColor4 &a, const LLColor4 &b)
{
- return ( (a.mV[VX] == b.mV[VX])
- &&(a.mV[VY] == b.mV[VY])
- &&(a.mV[VZ] == b.mV[VZ])
- &&(a.mV[VW] == b.mV[VW]));
+ return ( (a.mV[VRED] == b.mV[VRED])
+ &&(a.mV[VGREEN] == b.mV[VGREEN])
+ &&(a.mV[VBLUE] == b.mV[VBLUE])
+ &&(a.mV[VALPHA] == b.mV[VALPHA]));
}
inline bool operator!=(const LLColor4 &a, const LLColor4 &b)
{
- return ( (a.mV[VX] != b.mV[VX])
- ||(a.mV[VY] != b.mV[VY])
- ||(a.mV[VZ] != b.mV[VZ])
- ||(a.mV[VW] != b.mV[VW]));
+ return ( (a.mV[VRED] != b.mV[VRED])
+ ||(a.mV[VGREEN] != b.mV[VGREEN])
+ ||(a.mV[VBLUE] != b.mV[VBLUE])
+ ||(a.mV[VALPHA] != b.mV[VALPHA]));
}
inline const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b)
{
- a.mV[VX] += b.mV[VX];
- a.mV[VY] += b.mV[VY];
- a.mV[VZ] += b.mV[VZ];
- a.mV[VW] += b.mV[VW];
+ a.mV[VRED] += b.mV[VRED];
+ a.mV[VGREEN] += b.mV[VGREEN];
+ a.mV[VBLUE] += b.mV[VBLUE];
+ a.mV[VALPHA] += b.mV[VALPHA];
return a;
}
inline const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b)
{
- a.mV[VX] -= b.mV[VX];
- a.mV[VY] -= b.mV[VY];
- a.mV[VZ] -= b.mV[VZ];
- a.mV[VW] -= b.mV[VW];
+ a.mV[VRED] -= b.mV[VRED];
+ a.mV[VGREEN] -= b.mV[VGREEN];
+ a.mV[VBLUE] -= b.mV[VBLUE];
+ a.mV[VALPHA] -= b.mV[VALPHA];
return a;
}
inline const LLColor4& operator*=(LLColor4 &a, F32 k)
{
// only affects rgb (not a!)
- a.mV[VX] *= k;
- a.mV[VY] *= k;
- a.mV[VZ] *= k;
+ a.mV[VRED] *= k;
+ a.mV[VGREEN] *= k;
+ a.mV[VBLUE] *= k;
return a;
}
inline const LLColor4& operator *=(LLColor4 &a, const LLColor4 &b)
{
- a.mV[VX] *= b.mV[VX];
- a.mV[VY] *= b.mV[VY];
- a.mV[VZ] *= b.mV[VZ];
-// a.mV[VW] *= b.mV[VW];
+ a.mV[VRED] *= b.mV[VRED];
+ a.mV[VGREEN] *= b.mV[VGREEN];
+ a.mV[VBLUE] *= b.mV[VBLUE];
+// a.mV[VALPHA] *= b.mV[VALPHA];
return a;
}
inline const LLColor4& operator%=(LLColor4 &a, F32 k)
{
// only affects alpha (not rgb!)
- a.mV[VW] *= k;
+ a.mV[VALPHA] *= k;
return a;
}
@@ -617,10 +617,10 @@ inline F32 distVec_squared(const LLColor4 &a, const LLColor4 &b)
inline LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u)
{
return LLColor4(
- a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u,
- a.mV[VY] + (b.mV[VY] - a.mV[VY]) * u,
- a.mV[VZ] + (b.mV[VZ] - a.mV[VZ]) * u,
- a.mV[VW] + (b.mV[VW] - a.mV[VW]) * u);
+ a.mV[VRED] + (b.mV[VRED] - a.mV[VRED]) * u,
+ a.mV[VGREEN] + (b.mV[VGREEN] - a.mV[VGREEN]) * u,
+ a.mV[VBLUE] + (b.mV[VBLUE] - a.mV[VBLUE]) * u,
+ a.mV[VALPHA] + (b.mV[VALPHA] - a.mV[VALPHA]) * u);
}
inline bool LLColor4::operator<(const LLColor4& rhs) const
diff --git a/indra/llmath/v4coloru.cpp b/indra/llmath/v4coloru.cpp
index 45d310856a..acf349245a 100644
--- a/indra/llmath/v4coloru.cpp
+++ b/indra/llmath/v4coloru.cpp
@@ -53,10 +53,10 @@ LLColor4U::operator LLColor4()
/*
LLColor4U::LLColor4U(const LLColor3 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = 255;
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = 255;
}
*/
@@ -70,12 +70,12 @@ LLColor4U::LLColor4U(const LLColor3 &vec)
/*
LLColor4U LLColor4U::operator=(const LLColor3 &a)
{
- mV[VX] = a.mV[VX];
- mV[VY] = a.mV[VY];
- mV[VZ] = a.mV[VZ];
+ mV[VRED] = a.mV[VRED];
+ mV[VGREEN] = a.mV[VGREEN];
+ mV[VBLUE] = a.mV[VBLUE];
// converting from an rgb sets a=1 (opaque)
- mV[VW] = 255;
+ mV[VALPHA] = 255;
return (*this);
}
*/
@@ -83,7 +83,7 @@ LLColor4U LLColor4U::operator=(const LLColor3 &a)
std::ostream& operator<<(std::ostream& s, const LLColor4U &a)
{
- s << "{ " << (S32)a.mV[VX] << ", " << (S32)a.mV[VY] << ", " << (S32)a.mV[VZ] << ", " << (S32)a.mV[VW] << " }";
+ s << "{ " << (S32)a.mV[VRED] << ", " << (S32)a.mV[VGREEN] << ", " << (S32)a.mV[VBLUE] << ", " << (S32)a.mV[VALPHA] << " }";
return s;
}
diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h
index 6d921d12fa..29128a08a7 100644
--- a/indra/llmath/v4coloru.h
+++ b/indra/llmath/v4coloru.h
@@ -142,34 +142,34 @@ F32 distVec_squared(const LLColor4U &a, const LLColor4U &b); // Returns d
inline LLColor4U::LLColor4U()
{
- mV[VX] = 0;
- mV[VY] = 0;
- mV[VZ] = 0;
- mV[VW] = 255;
+ mV[VRED] = 0;
+ mV[VGREEN] = 0;
+ mV[VBLUE] = 0;
+ mV[VALPHA] = 255;
}
inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
- mV[VW] = 255;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = 255;
}
inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b, U8 a)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
- mV[VW] = a;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = a;
}
inline LLColor4U::LLColor4U(const U8 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
}
/*
@@ -181,30 +181,30 @@ inline LLColor4U::operator LLColor4()
inline const LLColor4U& LLColor4U::setToBlack(void)
{
- mV[VX] = 0;
- mV[VY] = 0;
- mV[VZ] = 0;
- mV[VW] = 255;
+ mV[VRED] = 0;
+ mV[VGREEN] = 0;
+ mV[VBLUE] = 0;
+ mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::setToWhite(void)
{
- mV[VX] = 255;
- mV[VY] = 255;
- mV[VZ] = 255;
- mV[VW] = 255;
+ mV[VRED] = 255;
+ mV[VGREEN] = 255;
+ mV[VBLUE] = 255;
+ mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::set(const U8 x, const U8 y, const U8 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
// no change to alpha!
-// mV[VW] = 255;
+// mV[VALPHA] = 255;
return (*this);
}
@@ -220,31 +220,31 @@ inline const LLColor4U& LLColor4U::set(const U8 r, const U8 g, const U8 b, U8 a)
inline const LLColor4U& LLColor4U::set(const LLColor4U &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
inline const LLColor4U& LLColor4U::set(const U8 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
return (*this);
}
// deprecated
inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
// no change to alpha!
-// mV[VW] = 255;
+// mV[VALPHA] = 255;
return (*this);
}
@@ -262,26 +262,26 @@ inline const LLColor4U& LLColor4U::setVec(const U8 r, const U8 g, const U8 b, U8
// deprecated
inline const LLColor4U& LLColor4U::setVec(const LLColor4U &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
// deprecated
inline const LLColor4U& LLColor4U::setVec(const U8 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4U& LLColor4U::setAlpha(U8 a)
{
- mV[VW] = a;
+ mV[VALPHA] = a;
return (*this);
}
@@ -289,159 +289,159 @@ inline const LLColor4U& LLColor4U::setAlpha(U8 a)
inline F32 LLColor4U::length(void) const
{
- return (F32) sqrt( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] );
+ return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] );
}
inline F32 LLColor4U::lengthSquared(void) const
{
- return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ];
+ return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE];
}
// deprecated
inline F32 LLColor4U::magVec(void) const
{
- return (F32) sqrt( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] );
+ return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] );
}
// deprecated
inline F32 LLColor4U::magVecSquared(void) const
{
- return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ];
+ return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE];
}
inline LLColor4U operator+(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
- a.mV[VX] + b.mV[VX],
- a.mV[VY] + b.mV[VY],
- a.mV[VZ] + b.mV[VZ],
- a.mV[VW] + b.mV[VW]);
+ a.mV[VRED] + b.mV[VRED],
+ a.mV[VGREEN] + b.mV[VGREEN],
+ a.mV[VBLUE] + b.mV[VBLUE],
+ a.mV[VALPHA] + b.mV[VALPHA]);
}
inline LLColor4U operator-(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
- a.mV[VX] - b.mV[VX],
- a.mV[VY] - b.mV[VY],
- a.mV[VZ] - b.mV[VZ],
- a.mV[VW] - b.mV[VW]);
+ a.mV[VRED] - b.mV[VRED],
+ a.mV[VGREEN] - b.mV[VGREEN],
+ a.mV[VBLUE] - b.mV[VBLUE],
+ a.mV[VALPHA] - b.mV[VALPHA]);
}
inline LLColor4U operator*(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
- a.mV[VX] * b.mV[VX],
- a.mV[VY] * b.mV[VY],
- a.mV[VZ] * b.mV[VZ],
- a.mV[VW] * b.mV[VW]);
+ a.mV[VRED] * b.mV[VRED],
+ a.mV[VGREEN] * b.mV[VGREEN],
+ a.mV[VBLUE] * b.mV[VBLUE],
+ a.mV[VALPHA] * b.mV[VALPHA]);
}
inline LLColor4U LLColor4U::addClampMax(const LLColor4U &color)
{
- return LLColor4U(llmin((S32)mV[VX] + color.mV[VX], 255),
- llmin((S32)mV[VY] + color.mV[VY], 255),
- llmin((S32)mV[VZ] + color.mV[VZ], 255),
- llmin((S32)mV[VW] + color.mV[VW], 255));
+ return LLColor4U(llmin((S32)mV[VRED] + color.mV[VRED], 255),
+ llmin((S32)mV[VGREEN] + color.mV[VGREEN], 255),
+ llmin((S32)mV[VBLUE] + color.mV[VBLUE], 255),
+ llmin((S32)mV[VALPHA] + color.mV[VALPHA], 255));
}
inline LLColor4U LLColor4U::multAll(const F32 k)
{
// Round to nearest
return LLColor4U(
- (U8)ll_round(mV[VX] * k),
- (U8)ll_round(mV[VY] * k),
- (U8)ll_round(mV[VZ] * k),
- (U8)ll_round(mV[VW] * k));
+ (U8)ll_round(mV[VRED] * k),
+ (U8)ll_round(mV[VGREEN] * k),
+ (U8)ll_round(mV[VBLUE] * k),
+ (U8)ll_round(mV[VALPHA] * k));
}
/*
inline LLColor4U operator*(const LLColor4U &a, U8 k)
{
// only affects rgb (not a!)
return LLColor4U(
- a.mV[VX] * k,
- a.mV[VY] * k,
- a.mV[VZ] * k,
- a.mV[VW]);
+ a.mV[VRED] * k,
+ a.mV[VGREEN] * k,
+ a.mV[VBLUE] * k,
+ a.mV[VALPHA]);
}
inline LLColor4U operator*(U8 k, const LLColor4U &a)
{
// only affects rgb (not a!)
return LLColor4U(
- a.mV[VX] * k,
- a.mV[VY] * k,
- a.mV[VZ] * k,
- a.mV[VW]);
+ a.mV[VRED] * k,
+ a.mV[VGREEN] * k,
+ a.mV[VBLUE] * k,
+ a.mV[VALPHA]);
}
inline LLColor4U operator%(U8 k, const LLColor4U &a)
{
// only affects alpha (not rgb!)
return LLColor4U(
- a.mV[VX],
- a.mV[VY],
- a.mV[VZ],
- a.mV[VW] * k );
+ a.mV[VRED],
+ a.mV[VGREEN],
+ a.mV[VBLUE],
+ a.mV[VALPHA] * k );
}
inline LLColor4U operator%(const LLColor4U &a, U8 k)
{
// only affects alpha (not rgb!)
return LLColor4U(
- a.mV[VX],
- a.mV[VY],
- a.mV[VZ],
- a.mV[VW] * k );
+ a.mV[VRED],
+ a.mV[VGREEN],
+ a.mV[VBLUE],
+ a.mV[VALPHA] * k );
}
*/
inline bool operator==(const LLColor4U &a, const LLColor4U &b)
{
- return ( (a.mV[VX] == b.mV[VX])
- &&(a.mV[VY] == b.mV[VY])
- &&(a.mV[VZ] == b.mV[VZ])
- &&(a.mV[VW] == b.mV[VW]));
+ return ( (a.mV[VRED] == b.mV[VRED])
+ &&(a.mV[VGREEN] == b.mV[VGREEN])
+ &&(a.mV[VBLUE] == b.mV[VBLUE])
+ &&(a.mV[VALPHA] == b.mV[VALPHA]));
}
inline bool operator!=(const LLColor4U &a, const LLColor4U &b)
{
- return ( (a.mV[VX] != b.mV[VX])
- ||(a.mV[VY] != b.mV[VY])
- ||(a.mV[VZ] != b.mV[VZ])
- ||(a.mV[VW] != b.mV[VW]));
+ return ( (a.mV[VRED] != b.mV[VRED])
+ ||(a.mV[VGREEN] != b.mV[VGREEN])
+ ||(a.mV[VBLUE] != b.mV[VBLUE])
+ ||(a.mV[VALPHA] != b.mV[VALPHA]));
}
inline const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b)
{
- a.mV[VX] += b.mV[VX];
- a.mV[VY] += b.mV[VY];
- a.mV[VZ] += b.mV[VZ];
- a.mV[VW] += b.mV[VW];
+ a.mV[VRED] += b.mV[VRED];
+ a.mV[VGREEN] += b.mV[VGREEN];
+ a.mV[VBLUE] += b.mV[VBLUE];
+ a.mV[VALPHA] += b.mV[VALPHA];
return a;
}
inline const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b)
{
- a.mV[VX] -= b.mV[VX];
- a.mV[VY] -= b.mV[VY];
- a.mV[VZ] -= b.mV[VZ];
- a.mV[VW] -= b.mV[VW];
+ a.mV[VRED] -= b.mV[VRED];
+ a.mV[VGREEN] -= b.mV[VGREEN];
+ a.mV[VBLUE] -= b.mV[VBLUE];
+ a.mV[VALPHA] -= b.mV[VALPHA];
return a;
}
inline const LLColor4U& operator*=(LLColor4U &a, U8 k)
{
// only affects rgb (not a!)
- a.mV[VX] *= k;
- a.mV[VY] *= k;
- a.mV[VZ] *= k;
+ a.mV[VRED] *= k;
+ a.mV[VGREEN] *= k;
+ a.mV[VBLUE] *= k;
return a;
}
inline const LLColor4U& operator%=(LLColor4U &a, U8 k)
{
// only affects alpha (not rgb!)
- a.mV[VW] *= k;
+ a.mV[VALPHA] *= k;
return a;
}
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 13fda24e62..70a7a34a70 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -1,25 +1,25 @@
-/**
+/**
* @file llassetstorage.cpp
* @brief Implementation of the base asset storage system.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -74,18 +74,18 @@ namespace
return false;
}
-// Rider: This is the general case of the operator declared above. The code compares the callback
-// passed into the LLAssetStorage functions to determine if there are duplicated requests for an
-// asset. Unfortunately std::function does not provide a direct way to compare two variables so
-// we define the operator here.
-// XCode is not very happy with the variadic temples in use below so we will just define the specific
+// Rider: This is the general case of the operator declared above. The code compares the callback
+// passed into the LLAssetStorage functions to determine if there are duplicated requests for an
+// asset. Unfortunately std::function does not provide a direct way to compare two variables so
+// we define the operator here.
+// XCode is not very happy with the variadic temples in use below so we will just define the specific
// case of comparing two LLGetAssetCallback objects since that is all we really use.
-//
+//
// template
// bool operator == (const std::function &a, const std::function &b)
// {
// typedef T(fnType)(U...);
-//
+//
// auto fnPtrA = a.target();
// auto fnPtrB = b.target();
// if (fnPtrA && fnPtrB)
@@ -112,8 +112,8 @@ LLAssetInfo::LLAssetInfo( void )
LLAssetInfo::LLAssetInfo( const LLUUID& object_id, const LLUUID& creator_id,
LLAssetType::EType type, const char* name,
const char* desc )
- : mUuid( object_id ),
- mCreatorID( creator_id ),
+ : mUuid( object_id ),
+ mCreatorID( creator_id ),
mType( type )
{
setName( name );
@@ -355,7 +355,7 @@ void LLAssetStorage::_init(LLMessageSystem *msg,
LLAssetStorage::~LLAssetStorage()
{
mShutDown = true;
-
+
_cleanupRequests(true, LL_ERR_CIRCUIT_GONE);
if (gMessageSystem)
@@ -372,7 +372,7 @@ LLAssetStorage::~LLAssetStorage()
void LLAssetStorage::setUpstream(const LLHost &upstream_host)
{
LL_DEBUGS("AppInit") << "AssetStorage: Setting upstream provider to " << upstream_host << LL_ENDL;
-
+
mUpstreamHost = upstream_host;
}
@@ -398,7 +398,7 @@ void LLAssetStorage::_cleanupRequests(bool all, S32 error)
// if all is true, we want to clean up everything
// otherwise just check for timed out requests
// EXCEPT for upload timeouts
- if (all
+ if (all
|| ((RT_DOWNLOAD == rt)
&& LL_ASSET_STORAGE_TIMEOUT < (mt_secs - tmp->mTime)))
{
@@ -406,7 +406,7 @@ void LLAssetStorage::_cleanupRequests(bool all, S32 error)
<< (all ? "aborted" : "timed out") << " for "
<< tmp->getUUID() << "."
<< LLAssetType::lookup(tmp->getType()) << LL_ENDL;
-
+
timed_out.push_front(tmp);
iter = requests->erase(curiter);
}
@@ -477,11 +477,11 @@ bool LLAssetStorage::findInCacheAndInvokeCallback(const LLUUID& uuid, LLAssetTyp
// GET routines
///////////////////////////////////////////////////////////////////////////
-// IW - uuid is passed by value to avoid side effects, please don't re-add &
+// IW - uuid is passed by value to avoid side effects, please don't re-add &
void LLAssetStorage::getAssetData(const LLUUID uuid,
- LLAssetType::EType type,
+ LLAssetType::EType type,
LLAssetStorage::LLGetAssetCallback callback,
- void *user_data,
+ void *user_data,
bool is_priority)
{
LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << LL_ENDL;
@@ -546,9 +546,9 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
LL_WARNS("AssetStorage") << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << LL_ENDL;
file.remove();
}
-
+
bool duplicate = false;
-
+
// check to see if there's a pending download of this uuid already
for (request_list_t::iterator iter = mPendingDownloads.begin();
iter != mPendingDownloads.end(); ++iter )
@@ -563,7 +563,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
<< "." << LLAssetType::lookup(type) << LL_ENDL;
return;
}
-
+
// this is a duplicate request
// queue the request, but don't actually ask for it again
duplicate = true;
@@ -571,11 +571,11 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
}
if (duplicate)
{
- LL_DEBUGS("AssetStorage") << "Adding additional non-duplicate request for asset " << uuid
+ LL_DEBUGS("AssetStorage") << "Adding additional non-duplicate request for asset " << uuid
<< "." << LLAssetType::lookup(type) << LL_ENDL;
}
-
- _queueDataRequest(uuid, type, callback, user_data, duplicate, is_priority);
+
+ _queueDataRequest(uuid, type, callback, user_data, duplicate, is_priority);
}
}
@@ -645,7 +645,7 @@ void LLAssetStorage::downloadCompleteCallback(
// Inefficient since we're doing a find through a list that may have thousands of elements.
// This is due for refactoring; we will probably change mPendingDownloads into a set.
- request_list_t::iterator download_iter = std::find(gAssetStorage->mPendingDownloads.begin(),
+ request_list_t::iterator download_iter = std::find(gAssetStorage->mPendingDownloads.begin(),
gAssetStorage->mPendingDownloads.end(),
req);
@@ -668,7 +668,7 @@ void LLAssetStorage::downloadCompleteCallback(
if (vfile.getSize() <= 0)
{
LL_WARNS("AssetStorage") << "downloadCompleteCallback has non-existent or zero-size asset " << callback_id << LL_ENDL;
-
+
result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
vfile.remove();
}
@@ -693,13 +693,13 @@ void LLAssetStorage::downloadCompleteCallback(
void LLAssetStorage::getEstateAsset(
const LLHost &object_sim,
- const LLUUID &agent_id,
+ const LLUUID &agent_id,
const LLUUID &session_id,
- const LLUUID &asset_id,
- LLAssetType::EType atype,
+ const LLUUID &asset_id,
+ LLAssetType::EType atype,
EstateAssetType etype,
- LLGetAssetCallback callback,
- void *user_data,
+ LLGetAssetCallback callback,
+ void *user_data,
bool is_priority)
{
LL_DEBUGS() << "LLAssetStorage::getEstateAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << ", estatetype " << etype << LL_ENDL;
@@ -723,7 +723,7 @@ void LLAssetStorage::getEstateAsset(
{
return;
}
-
+
bool exists = LLFileSystem::getExists(asset_id, atype);
LLFileSystem file(asset_id, atype);
U32 size = exists ? file.getSize() : 0;
@@ -836,21 +836,21 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback(
}
void LLAssetStorage::getInvItemAsset(
- const LLHost &object_sim,
- const LLUUID &agent_id,
+ const LLHost &object_sim,
+ const LLUUID &agent_id,
const LLUUID &session_id,
const LLUUID &owner_id,
- const LLUUID &task_id,
+ const LLUUID &task_id,
const LLUUID &item_id,
- const LLUUID &asset_id,
+ const LLUUID &asset_id,
LLAssetType::EType atype,
- LLGetAssetCallback callback,
- void *user_data,
+ LLGetAssetCallback callback,
+ void *user_data,
bool is_priority)
{
LL_DEBUGS() << "LLAssetStorage::getInvItemAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << LL_ENDL;
- bool exists = false;
+ bool exists = false;
U32 size = 0;
if(asset_id.notNull())
@@ -910,7 +910,7 @@ void LLAssetStorage::getInvItemAsset(
spi.setAsset(asset_id, atype);
LL_DEBUGS("ViewerAsset") << "requesting inv item id " << item_id << " asset_id " << asset_id << " type " << LLAssetType::lookup(atype) << LL_ENDL;
-
+
// Set our destination file, and the completion callback.
LLTransferTargetParamsVFile tpvf;
tpvf.setAsset(asset_id, atype);
@@ -984,9 +984,9 @@ void LLAssetStorage::downloadInvItemCompleteCallback(
// static
void LLAssetStorage::uploadCompleteCallback(
- const LLUUID& uuid,
- void *user_data,
- S32 result,
+ const LLUUID& uuid,
+ void *user_data,
+ S32 result,
LLExtStat ext_status) // StoreAssetData callback (fixed)
{
if (!gAssetStorage)
@@ -1125,7 +1125,7 @@ S32 LLAssetStorage::getNumPending(LLAssetStorage::ERequestType rt) const
S32 num_pending = -1;
if (requests)
{
- num_pending = requests->size();
+ num_pending = static_cast(requests->size());
}
return num_pending;
}
@@ -1190,7 +1190,7 @@ const LLAssetRequest* LLAssetStorage::findRequest(const LLAssetStorage::request_
LLAssetType::EType asset_type,
const LLUUID& asset_id)
{
- if (requests)
+ if (requests)
{
// Search the requests list for the asset.
request_list_t::const_iterator iter = requests->begin();
@@ -1213,7 +1213,7 @@ LLAssetRequest* LLAssetStorage::findRequest(LLAssetStorage::request_list_t* requ
LLAssetType::EType asset_type,
const LLUUID& asset_id)
{
- if (requests)
+ if (requests)
{
// Search the requests list for the asset.
request_list_t::iterator iter = requests->begin();
@@ -1296,7 +1296,7 @@ bool LLAssetStorage::deletePendingRequestImpl(LLAssetStorage::request_list_t* re
delete req;
return true;
}
-
+
return false;
}
@@ -1340,14 +1340,14 @@ const char* LLAssetStorage::getErrorString(S32 status)
}
}
-void LLAssetStorage::getAssetData(const LLUUID uuid,
- LLAssetType::EType type,
- void (*callback)(const char*,
- const LLUUID&,
- void *,
- S32,
- LLExtStat),
- void *user_data,
+void LLAssetStorage::getAssetData(const LLUUID uuid,
+ LLAssetType::EType type,
+ void (*callback)(const char*,
+ const LLUUID&,
+ void *,
+ S32,
+ LLExtStat),
+ void *user_data,
bool is_priority)
{
// check for duplicates here, since we're about to fool the normal duplicate checker
@@ -1358,7 +1358,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
auto cbptr = tmp->mDownCallback.target();
- if (type == tmp->getType() &&
+ if (type == tmp->getType() &&
uuid == tmp->getUUID() &&
(cbptr && (*cbptr == legacyGetDataCallback)) &&
callback == ((LLLegacyAssetRequest *)tmp->mUserData)->mDownCallback &&
@@ -1369,8 +1369,8 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
return;
}
}
-
-
+
+
LLLegacyAssetRequest *legacy = new LLLegacyAssetRequest;
legacy->mDownCallback = callback;
@@ -1381,10 +1381,10 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
}
// static
-void LLAssetStorage::legacyGetDataCallback(const LLUUID &uuid,
+void LLAssetStorage::legacyGetDataCallback(const LLUUID &uuid,
LLAssetType::EType type,
- void *user_data,
- S32 status,
+ void *user_data,
+ S32 status,
LLExtStat ext_status)
{
LLLegacyAssetRequest *legacy = (LLLegacyAssetRequest *)user_data;
@@ -1403,7 +1403,7 @@ void LLAssetStorage::legacyGetDataCallback(const LLUUID &uuid,
uuid.toString(uuid_str);
filename = llformat("%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type));
- LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
+ LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
if (fp)
{
const S32 buf_size = 65536;
@@ -1458,7 +1458,7 @@ void LLAssetStorage::reportMetric( const LLUUID& asset_id, const LLAssetType::ET
std::string filename(in_filename);
if (filename.empty())
filename = ll_safe_string(file);
-
+
// Create revised message - new_message = "in_message :: file:line"
std::stringstream new_message;
new_message << in_message << " :: " << filename << ":" << line;
@@ -1531,7 +1531,7 @@ void LLAssetStorage::flushOldToxicAssets( bool force_it )
// Add an item to the toxic asset map
void LLAssetStorage::markAssetToxic( const LLUUID& uuid )
-{
+{
if ( !uuid.isNull() )
{
// Set the value to the current time. Creates a new entry if needed
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 992929eee0..5ddd888de2 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -263,7 +263,7 @@ void LLAvatarNameCache::handleAvNameCacheSuccess(const LLSD &data, const LLSD &h
// Same logic as error response case
const LLSD& unresolved_agents = data["bad_ids"];
- S32 num_unresolved = unresolved_agents.size();
+ auto num_unresolved = unresolved_agents.size();
if (num_unresolved > 0)
{
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result " << num_unresolved << " unresolved ids; "
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 2c720f595c..8eb2ad458e 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -616,13 +616,13 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
{
//boost::regexp was showing up in the crashreporter, so doing
//painfully manual parsing using substr. LF
- S32 open_paren = complete_name.rfind(" (");
- S32 close_paren = complete_name.rfind(')');
+ auto open_paren = complete_name.rfind(" (");
+ auto close_paren = complete_name.rfind(')');
if (open_paren != std::string::npos &&
close_paren == complete_name.length()-1)
{
- S32 length = close_paren - open_paren - 2;
+ auto length = close_paren - open_paren - 2;
std::string legacy_name = complete_name.substr(open_paren+2, length);
if (legacy_name.length() > 0)
@@ -631,7 +631,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
LLStringUtil::toUpper(cap_letter);
legacy_name = cap_letter + legacy_name.substr(1);
- S32 separator = legacy_name.find('.');
+ auto separator = legacy_name.find('.');
if (separator != std::string::npos)
{
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index 68af5503db..5ffe7bbf32 100644
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -801,8 +801,8 @@ void LLCircuitData::checkPacketInID(TPACKETID id, bool receive_resent)
void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
{
F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds();
- S32 count = mPingSet.size();
- S32 cur = 0;
+ size_t count = mPingSet.size();
+ size_t cur = 0;
// Only process each circuit once at most, stop processing if no circuits
while((cur < count) && !mPingSet.empty())
diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp
index eb2fe1d93b..6d7dabc7e0 100644
--- a/indra/llmessage/llcoproceduremanager.cpp
+++ b/indra/llmessage/llcoproceduremanager.cpp
@@ -87,7 +87,7 @@ public:
///
inline S32 count() const
{
- return countPending() + countActive();
+ return static_cast(countPending() + countActive());
}
void close();
diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp
index bd9c2ab319..3ce9a07b75 100644
--- a/indra/llmessage/llcorehttputil.cpp
+++ b/indra/llmessage/llcorehttputil.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file llcorehttputil.cpp
* @date 2014-08-25
* @brief Implementation of adapter and utility classes expanding the llcorehttp interfaces.
@@ -6,21 +6,21 @@
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2014, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -48,7 +48,7 @@ namespace LLCoreHttpUtil
const F32 HTTP_REQUEST_EXPIRY_SECS = 60.0f;
-namespace
+namespace
{
const std::string HTTP_LOGBODY_KEY("HTTPLogBodyOnError");
@@ -87,9 +87,9 @@ void logMessageFail(std::string logAuth, std::string url, std::string message)
}
//=========================================================================
-/// The HttpRequestPumper is a utility class. When constructed it will poll the
+/// The HttpRequestPumper is a utility class. When constructed it will poll the
/// supplied HttpRequest once per frame until it is destroyed.
-///
+///
class HttpRequestPumper
{
public:
@@ -261,7 +261,7 @@ void HttpCoroHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespons
LLCore::HttpStatus status = response->getStatus();
if (status == LLCore::HttpStatus(LLCore::HttpStatus::LLCORE, LLCore::HE_HANDLE_NOT_FOUND))
- { // A response came in for a canceled request and we have not processed the
+ { // A response came in for a canceled request and we have not processed the
// cancel yet. Patience!
return;
}
@@ -273,9 +273,9 @@ void HttpCoroHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespons
LLCore::HttpStatus::type_enum_t errType = status.getType();
LL_WARNS("CoreHTTP")
- << "Possible failure [" << status.toTerseString() << "] cannot "<< response->getRequestMethod()
+ << "Possible failure [" << status.toTerseString() << "] cannot "<< response->getRequestMethod()
<< " url '" << response->getRequestURL()
- << "' because " << status.toString()
+ << "' because " << status.toString()
<< LL_ENDL;
if ((errType >= 400) && (errType < 500))
{
@@ -360,13 +360,13 @@ void HttpCoroHandler::writeStatusCodes(LLCore::HttpStatus status, const std::str
}
//=========================================================================
-/// The HttpCoroLLSDHandler is a specialization of the LLCore::HttpHandler for
-/// interacting with coroutines. When the request is completed the response
+/// The HttpCoroLLSDHandler is a specialization of the LLCore::HttpHandler for
+/// interacting with coroutines. When the request is completed the response
/// will be posted onto the supplied Event Pump.
-///
+///
/// If the LLSD retrieved from through the HTTP connection is not in the form
/// of a LLSD::map it will be returned as in an llsd["content"] element.
-///
+///
/// The LLSD posted back to the coroutine will have the following additions:
/// llsd["http_result"] -+- ["message"] - An error message returned from the HTTP status
/// +- ["status"] - The status code associated with the HTTP call
@@ -374,7 +374,7 @@ void HttpCoroHandler::writeStatusCodes(LLCore::HttpStatus status, const std::str
/// +- ["type"] - The LLCore::HttpStatus type associted with the HTTP call
/// +- ["url"] - The URL used to make the call.
/// +- ["headers"] - A map of name name value pairs with the HTTP headers.
-///
+///
class HttpCoroLLSDHandler : public HttpCoroHandler
{
public:
@@ -390,7 +390,7 @@ HttpCoroLLSDHandler::HttpCoroLLSDHandler(LLEventStream &reply):
HttpCoroHandler(reply)
{
}
-
+
LLSD HttpCoroLLSDHandler::handleSuccess(LLCore::HttpResponse * response, LLCore::HttpStatus &status)
{
@@ -424,7 +424,7 @@ LLSD HttpCoroLLSDHandler::handleSuccess(LLCore::HttpResponse * response, LLCore:
#endif
if (!success)
- {
+ {
#if 1
// Only emit a warning if we failed to parse when 'content-type' == 'application/llsd+xml'
LLCore::HttpHeaders::ptr_t headers(response->getHeaders());
@@ -440,13 +440,13 @@ LLSD HttpCoroLLSDHandler::handleSuccess(LLCore::HttpResponse * response, LLCore:
status = LLCore::HttpStatus(499, "Failed to deserialize LLSD.");
}
#endif
- // If we've gotten to this point and the result LLSD is still undefined
+ // If we've gotten to this point and the result LLSD is still undefined
// either there was an issue deserializing the body or the response was
// blank. Create an empty map to hold the result either way.
result = LLSD::emptyMap();
}
else if (!result.isMap())
- { // The results are not themselves a map. Move them down so that
+ { // The results are not themselves a map. Move them down so that
// this method can return a map to the caller.
// *TODO: Should it always do this?
LLSD newResult = LLSD::emptyMap();
@@ -476,13 +476,13 @@ LLSD HttpCoroLLSDHandler::parseBody(LLCore::HttpResponse *response, bool &succes
//========================================================================
-/// The HttpCoroRawHandler is a specialization of the LLCore::HttpHandler for
-/// interacting with coroutines.
-///
-/// In addition to the normal "http_results" the returned LLSD will contain
+/// The HttpCoroRawHandler is a specialization of the LLCore::HttpHandler for
+/// interacting with coroutines.
+///
+/// In addition to the normal "http_results" the returned LLSD will contain
/// an entry keyed with "raw" containing the unprocessed results of the HTTP
/// call.
-///
+///
class HttpCoroRawHandler : public HttpCoroHandler
{
public:
@@ -515,9 +515,9 @@ LLSD HttpCoroRawHandler::handleSuccess(LLCore::HttpResponse * response, LLCore::
#if 1
// This is the slower implementation. It is safe vis-a-vi the const_cast<> and modification
// of a LLSD managed array but contains an extra (potentially large) copy.
- //
+ //
// *TODO: https://jira.secondlife.com/browse/MAINT-5221
-
+
LLSD::Binary data;
data.reserve(size);
bas >> std::noskipws;
@@ -526,12 +526,12 @@ LLSD HttpCoroRawHandler::handleSuccess(LLCore::HttpResponse * response, LLCore::
result[HttpCoroutineAdapter::HTTP_RESULTS_RAW] = data;
#else
- // This is disabled because it's dangerous. See the other case for an
+ // This is disabled because it's dangerous. See the other case for an
// alternate implementation.
// We create a new LLSD::Binary object and assign it to the result map.
- // The LLSD has created it's own copy so we retrieve it asBinary and const cast
+ // The LLSD has created it's own copy so we retrieve it asBinary and const cast
// the reference so that we can modify it.
- // *TODO: This is potentially dangerous... but I am trying to avoid a potentially
+ // *TODO: This is potentially dangerous... but I am trying to avoid a potentially
// large copy.
result[HttpCoroutineAdapter::HTTP_RESULTS_RAW] = LLSD::Binary();
LLSD::Binary &data = const_cast( result[HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary() );
@@ -551,13 +551,13 @@ LLSD HttpCoroRawHandler::parseBody(LLCore::HttpResponse *response, bool &success
}
//========================================================================
-/// The HttpCoroJSONHandler is a specialization of the LLCore::HttpHandler for
-/// interacting with coroutines.
-///
-/// In addition to the normal "http_results" the returned LLSD will contain
-/// JSON entries will be converted into an LLSD map. All results are considered
+/// The HttpCoroJSONHandler is a specialization of the LLCore::HttpHandler for
+/// interacting with coroutines.
+///
+/// In addition to the normal "http_results" the returned LLSD will contain
+/// JSON entries will be converted into an LLSD map. All results are considered
/// strings
-///
+///
class HttpCoroJSONHandler : public HttpCoroHandler
{
public:
@@ -692,7 +692,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPostWithLLSD(request,
mPolicyId, url, body, options, headers,
@@ -730,7 +730,7 @@ LLSD HttpCoroutineAdapter::postRawAndSuspend(LLCore::HttpRequest::ptr_t request,
return postAndSuspend_(request, url, rawbody, options, headers, httpHandler);
}
-// *TODO: This functionality could be moved into the LLCore::Http library itself
+// *TODO: This functionality could be moved into the LLCore::Http library itself
// by having the CURL layer read the file directly.
LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, std::string fileName,
@@ -759,7 +759,7 @@ LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request
return postAndSuspend(request, url, fileData, options, headers);
}
-// *TODO: This functionality could be moved into the LLCore::Http library itself
+// *TODO: This functionality could be moved into the LLCore::Http library itself
// by having the CURL layer read the file directly.
LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLUUID assetId, LLAssetType::EType assetType,
@@ -776,7 +776,7 @@ LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request
U8* fileBuffer;
fileBuffer = new U8[fileSize];
vfile.read(fileBuffer, fileSize);
-
+
outs.write((char*)fileBuffer, fileSize);
delete[] fileBuffer;
}
@@ -816,7 +816,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestPost(mPolicyId, url, rawbody.get(),
options, headers, handler);
@@ -873,7 +873,7 @@ LLSD HttpCoroutineAdapter::putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPutWithLLSD(request,
mPolicyId, url, body, options, headers,
@@ -900,7 +900,7 @@ LLSD HttpCoroutineAdapter::putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestPut(mPolicyId,
url, rawbody.get(), options, headers, handler);
@@ -950,13 +950,13 @@ LLSD HttpCoroutineAdapter::getJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
LLSD HttpCoroutineAdapter::getAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url,
- LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
+ LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
{
HttpRequestPumper pumper(request);
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestGet(mPolicyId,
url, options, headers, handler);
@@ -985,7 +985,7 @@ LLSD HttpCoroutineAdapter::deleteAndSuspend(LLCore::HttpRequest::ptr_t request,
}
LLSD HttpCoroutineAdapter::deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
- const std::string & url,
+ const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
@@ -996,13 +996,13 @@ LLSD HttpCoroutineAdapter::deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t reque
LLSD HttpCoroutineAdapter::deleteAndSuspend_(LLCore::HttpRequest::ptr_t &request,
- const std::string & url, LLCore::HttpOptions::ptr_t &options,
+ const std::string & url, LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers, HttpCoroHandler::ptr_t &handler)
{
HttpRequestPumper pumper(request);
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestDelete(mPolicyId,
url, options, headers, handler);
@@ -1039,7 +1039,7 @@ LLSD HttpCoroutineAdapter::patchAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPatchWithLLSD(request,
mPolicyId, url, body, options, headers,
@@ -1073,7 +1073,7 @@ LLSD HttpCoroutineAdapter::copyAndSuspend(LLCore::HttpRequest::ptr_t request,
LLSD HttpCoroutineAdapter::copyAndSuspend_(LLCore::HttpRequest::ptr_t &request,
- const std::string & url,
+ const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
{
@@ -1081,9 +1081,9 @@ LLSD HttpCoroutineAdapter::copyAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
- //
+ //
LLCore::HttpHandle hhandle = request->requestCopy(mPolicyId, url,
options, headers, handler);
@@ -1123,9 +1123,9 @@ LLSD HttpCoroutineAdapter::moveAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
- // The HTTPCoroHandler does not self delete, so retrieval of a the contained
+ // The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
- //
+ //
LLCore::HttpHandle hhandle = request->requestMove(mPolicyId, url,
options, headers, handler);
@@ -1174,7 +1174,7 @@ void HttpCoroutineAdapter::cancelSuspendedOperation()
}
}
-void HttpCoroutineAdapter::saveState(LLCore::HttpHandle yieldingHandle,
+void HttpCoroutineAdapter::saveState(LLCore::HttpHandle yieldingHandle,
LLCore::HttpRequest::ptr_t &request, HttpCoroHandler::ptr_t &handler)
{
mWeakRequest = request;
@@ -1190,15 +1190,15 @@ void HttpCoroutineAdapter::cleanState()
}
/*static*/
-LLSD HttpCoroutineAdapter::buildImmediateErrorResult(const LLCore::HttpRequest::ptr_t &request,
- const std::string &url)
+LLSD HttpCoroutineAdapter::buildImmediateErrorResult(const LLCore::HttpRequest::ptr_t &request,
+ const std::string &url)
{
LLCore::HttpStatus status = request->getStatus();
LL_WARNS("CoreHTTP") << "Error posting to " << url << " Status=" << status.getStatus() <<
" message = " << status.getMessage() << LL_ENDL;
- // Mimic the status results returned from an http error that we had
- // to wait on
+ // Mimic the status results returned from an http error that we had
+ // to wait on
LLSD httpresults = LLSD::emptyMap();
HttpCoroHandler::writeStatusCodes(status, url, httpresults);
@@ -1228,7 +1228,7 @@ void HttpCoroutineAdapter::callbackHttpGet(const std::string &url, LLCore::HttpR
/*static*/
void HttpCoroutineAdapter::messageHttpGet(const std::string &url, const std::string &success, const std::string &failure)
{
- completionCallback_t cbSuccess = (success.empty()) ? NULL :
+ completionCallback_t cbSuccess = (success.empty()) ? NULL :
static_cast(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success));
completionCallback_t cbFailure = (failure.empty()) ? NULL :
static_cast(boost::bind(&logMessageFail, "HttpCoroutineAdapter", url, failure));
@@ -1253,7 +1253,7 @@ void HttpCoroutineAdapter::trivialGetCoro(std::string url, LLCore::HttpRequest::
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
if (!status)
- {
+ {
if (failure)
{
failure(httpResults);
diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp
index 134f34aafa..e911150787 100644
--- a/indra/llmessage/lldatapacker.cpp
+++ b/indra/llmessage/lldatapacker.cpp
@@ -237,7 +237,7 @@ bool LLDataPacker::unpackUUIDs(LLUUID *values, S32 count, const char *name)
bool LLDataPackerBinaryBuffer::packString(const std::string& value, const char *name)
{
- S32 length = value.length()+1;
+ S32 length = static_cast(value.length()) + 1;
if (!verifyLength(length, name))
{
@@ -740,7 +740,7 @@ bool LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n
}
else
{
- numCopied = value.length() + 1; /*Flawfinder: ignore*/
+ numCopied = static_cast(value.length()) + 1; /*Flawfinder: ignore*/
}
// snprintf returns number of bytes that would have been written
diff --git a/indra/llmessage/llfiltersd2xmlrpc.cpp b/indra/llmessage/llfiltersd2xmlrpc.cpp
index 44dbe1e71d..b31c3e7c57 100644
--- a/indra/llmessage/llfiltersd2xmlrpc.cpp
+++ b/indra/llmessage/llfiltersd2xmlrpc.cpp
@@ -283,12 +283,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
if(!buffer.empty())
{
// *TODO: convert to LLBase64
- int b64_buffer_length = apr_base64_encode_len(buffer.size());
+ int b64_buffer_length = apr_base64_encode_len(static_cast(buffer.size()));
char* b64_buffer = new char[b64_buffer_length];
b64_buffer_length = apr_base64_encode_binary(
b64_buffer,
&buffer[0],
- buffer.size());
+ static_cast(buffer.size()));
ostr.write(b64_buffer, b64_buffer_length - 1);
delete[] b64_buffer;
}
diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp
index 9791a20743..e562f09844 100644
--- a/indra/llmessage/lliohttpserver.cpp
+++ b/indra/llmessage/lliohttpserver.cpp
@@ -494,7 +494,7 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
LLChangeChannel change(channels.in(), channels.out());
std::for_each(buffer->beginSegment(), buffer->endSegment(), change);
std::string header = ostr.str();
- buffer->prepend(channels.out(), (U8*)header.c_str(), header.size());
+ buffer->prepend(channels.out(), (U8*)header.c_str(), static_cast(header.size()));
PUMP_DEBUG;
return STATUS_DONE;
}
diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp
index b7b747a28c..a4a85c59b4 100644
--- a/indra/llmessage/lliosocket.cpp
+++ b/indra/llmessage/lliosocket.cpp
@@ -352,7 +352,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl(
PUMP_DEBUG;
len = READ_BUFFER_SIZE;
status = apr_socket_recv(mSource->getSocket(), read_buf, &len);
- buffer->append(channels.out(), (U8*)read_buf, len);
+ buffer->append(channels.out(), (U8*)read_buf, static_cast(len));
} while((APR_SUCCESS == status) && (READ_BUFFER_SIZE == len));
LL_DEBUGS() << "socket read status: " << status << LL_ENDL;
LLIOPipe::EStatus rv = STATUS_OK;
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index ca027d7675..9e10a356db 100644
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -273,7 +273,7 @@ bool LLMail::send(
std::string good_string = "\n..\n";
while (1)
{
- int index = message.find(bad_string);
+ auto index = message.find(bad_string);
if (index == std::string::npos) break;
message.replace(index, bad_string.size(), good_string);
}
diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp
index b693b054a0..b74ab8034d 100644
--- a/indra/llmessage/llpartdata.cpp
+++ b/indra/llmessage/llpartdata.cpp
@@ -289,14 +289,14 @@ bool LLPartSysData::unpack(LLDataPacker &dp)
//skip to LLPartData block
U8 feh = 0;
- for (U32 i = 0; i < size; ++i)
+ for (S32 i = 0; i < size; ++i)
{
dp.unpackU8(feh, "whippang");
}
dp.unpackS32(size, "partsize");
//skip LLPartData block
- for (U32 i = 0; i < size; ++i)
+ for (S32 i = 0; i < size; ++i)
{
dp.unpackU8(feh, "whippang");
}
diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp
index 3599cb7776..c4370303ac 100644
--- a/indra/llmessage/llproxy.cpp
+++ b/indra/llmessage/llproxy.cpp
@@ -123,7 +123,7 @@ S32 LLProxy::proxyHandshake(LLHost proxy)
// The server has requested a username/password combination
std::string socks_username(getSocksUser());
std::string socks_password(getSocksPwd());
- U32 request_size = socks_username.size() + socks_password.size() + 3;
+ U32 request_size = static_cast(socks_username.size() + socks_password.size() + 3);
char * password_auth = new char[request_size];
password_auth[0] = 0x01;
password_auth[1] = (char)(socks_username.size());
diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp
index d3b75cf86b..e1cd70b216 100644
--- a/indra/llmessage/llpumpio.cpp
+++ b/indra/llmessage/llpumpio.cpp
@@ -818,7 +818,7 @@ void LLPumpIO::rebuildPollset()
running_chains_t::iterator run_end = mRunningChains.end();
for(; run_it != run_end; ++run_it)
{
- size += (*run_it).mDescriptors.size();
+ size += static_cast((*run_it).mDescriptors.size());
}
//LL_DEBUGS() << "found " << size << " descriptors." << LL_ENDL;
if(size)
diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h
index b8a0e91ae3..106b433839 100644
--- a/indra/llmessage/llregionflags.h
+++ b/indra/llmessage/llregionflags.h
@@ -28,83 +28,83 @@
#define LL_LLREGIONFLAGS_H
// Can you be hurt here? Should health be on?
-const U64 REGION_FLAGS_ALLOW_DAMAGE = (1 << 0);
+constexpr U64 REGION_FLAGS_ALLOW_DAMAGE = (1ULL << 0);
// Can you make landmarks here?
-const U64 REGION_FLAGS_ALLOW_LANDMARK = (1 << 1);
+constexpr U64 REGION_FLAGS_ALLOW_LANDMARK = (1ULL << 1);
// Do we reset the home position when someone teleports away from here?
-const U64 REGION_FLAGS_ALLOW_SET_HOME = (1 << 2);
+constexpr U64 REGION_FLAGS_ALLOW_SET_HOME = (1ULL << 2);
// Do we reset the home position when someone teleports away from here?
-const U64 REGION_FLAGS_RESET_HOME_ON_TELEPORT = (1 << 3);
+constexpr U64 REGION_FLAGS_RESET_HOME_ON_TELEPORT = (1ULL << 3);
// Does the sun move?
-const U64 REGION_FLAGS_SUN_FIXED = (1 << 4);
+constexpr U64 REGION_FLAGS_SUN_FIXED = (1ULL << 4);
// Does the estate owner allow private parcels?
-const U64 REGION_FLAGS_ALLOW_ACCESS_OVERRIDE = (1 << 5);
+constexpr U64 REGION_FLAGS_ALLOW_ACCESS_OVERRIDE = (1ULL << 5);
// Can't change the terrain heightfield, even on owned parcels,
// but can plant trees and grass.
-const U64 REGION_FLAGS_BLOCK_TERRAFORM = (1 << 6);
+constexpr U64 REGION_FLAGS_BLOCK_TERRAFORM = (1ULL << 6);
// Can't release, sell, or buy land.
-const U64 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7);
+constexpr U64 REGION_FLAGS_BLOCK_LAND_RESELL = (1ULL << 7);
// All content wiped once per night
-const U64 REGION_FLAGS_SANDBOX = (1 << 8);
+constexpr U64 REGION_FLAGS_SANDBOX = (1ULL << 8);
-const U64 REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE = (1 << 9);
+constexpr U64 REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE = (1ULL << 9);
-const U64 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies
-const U64 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13);
-const U64 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics
-const U64 REGION_FLAGS_EXTERNALLY_VISIBLE = (1 << 15);
-const U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1 << 16);
-const U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1 << 17);
-const U64 REGION_FLAGS_BLOCK_DWELL = (1 << 18);
+constexpr U64 REGION_FLAGS_SKIP_COLLISIONS = (1ULL << 12); // Pin all non agent rigid bodies
+constexpr U64 REGION_FLAGS_SKIP_SCRIPTS = (1ULL << 13);
+constexpr U64 REGION_FLAGS_SKIP_PHYSICS = (1ULL << 14); // Skip all physics
+constexpr U64 REGION_FLAGS_EXTERNALLY_VISIBLE = (1ULL << 15);
+constexpr U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1ULL << 16);
+constexpr U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1ULL << 17);
+constexpr U64 REGION_FLAGS_BLOCK_DWELL = (1ULL << 18);
// Is flight allowed?
-const U64 REGION_FLAGS_BLOCK_FLY = (1 << 19);
+constexpr U64 REGION_FLAGS_BLOCK_FLY = (1ULL << 19);
// Is direct teleport (p2p) allowed?
-const U64 REGION_FLAGS_ALLOW_DIRECT_TELEPORT = (1 << 20);
+constexpr U64 REGION_FLAGS_ALLOW_DIRECT_TELEPORT = (1ULL << 20);
// Is there an administrative override on scripts in the region at the
// moment. This is the similar skip scripts, except this flag is
// presisted in the database on an estate level.
-const U64 REGION_FLAGS_ESTATE_SKIP_SCRIPTS = (1 << 21);
+constexpr U64 REGION_FLAGS_ESTATE_SKIP_SCRIPTS = (1ULL << 21);
-const U64 REGION_FLAGS_RESTRICT_PUSHOBJECT = (1 << 22);
+constexpr U64 REGION_FLAGS_RESTRICT_PUSHOBJECT = (1ULL << 22);
-const U64 REGION_FLAGS_DENY_ANONYMOUS = (1 << 23);
+constexpr U64 REGION_FLAGS_DENY_ANONYMOUS = (1ULL << 23);
-const U64 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26);
+constexpr U64 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1ULL << 26);
-const U64 REGION_FLAGS_BLOCK_FLYOVER = (1 << 27);
+constexpr U64 REGION_FLAGS_BLOCK_FLYOVER = (1ULL << 27);
-const U64 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
+constexpr U64 REGION_FLAGS_ALLOW_VOICE = (1ULL << 28);
-const U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29);
-const U64 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30);
+constexpr U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1ULL << 29);
+constexpr U64 REGION_FLAGS_DENY_AGEUNVERIFIED = (1ULL << 30);
-const U64 REGION_FLAGS_DENY_BOTS = (1 << 31);
+constexpr U64 REGION_FLAGS_DENY_BOTS = (1ULL << 31);
-const U64 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
- REGION_FLAGS_ALLOW_SET_HOME |
- REGION_FLAGS_ALLOW_PARCEL_CHANGES |
- REGION_FLAGS_ALLOW_VOICE;
+constexpr U64 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
+ REGION_FLAGS_ALLOW_SET_HOME |
+ REGION_FLAGS_ALLOW_PARCEL_CHANGES |
+ REGION_FLAGS_ALLOW_VOICE;
-const U64 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT;
-const U64 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK
- | REGION_FLAGS_ALLOW_SET_HOME;
+constexpr U64 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT;
+constexpr U64 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK |
+ REGION_FLAGS_ALLOW_SET_HOME;
-const U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE
- | REGION_FLAGS_SUN_FIXED
- | REGION_FLAGS_DENY_ANONYMOUS
- | REGION_FLAGS_DENY_AGEUNVERIFIED;
+constexpr U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE |
+ REGION_FLAGS_SUN_FIXED |
+ REGION_FLAGS_DENY_ANONYMOUS |
+ REGION_FLAGS_DENY_AGEUNVERIFIED;
inline bool is_flag_set(U64 flags, U64 flag)
{
@@ -133,81 +133,77 @@ inline U64 unset_prelude_flags(U64 flags)
}
// Region protocols
-const U64 REGION_PROTOCOLS_AGENT_APPEARANCE_SERVICE = (1 << 0);
+constexpr U64 REGION_PROTOCOLS_AGENT_APPEARANCE_SERVICE = (1ULL << 0);
// estate constants. Need to match first few etries in indra.estate table.
-const U32 ESTATE_ALL = 0; // will not match in db, reserved key for logic
-const U32 ESTATE_MAINLAND = 1;
-const U32 ESTATE_ORIENTATION = 2;
-const U32 ESTATE_INTERNAL = 3;
-const U32 ESTATE_SHOWCASE = 4;
-const U32 ESTATE_TEEN = 5;
-const U32 ESTATE_LAST_LINDEN = 5; // last linden owned/managed estate
+constexpr U32 ESTATE_ALL = 0; // will not match in db, reserved key for logic
+constexpr U32 ESTATE_MAINLAND = 1;
+constexpr U32 ESTATE_ORIENTATION = 2;
+constexpr U32 ESTATE_INTERNAL = 3;
+constexpr U32 ESTATE_SHOWCASE = 4;
+constexpr U32 ESTATE_TEEN = 5;
+constexpr U32 ESTATE_LAST_LINDEN = 5; // last linden owned/managed estate
// for EstateOwnerRequest, setaccess message
-const U32 ESTATE_ACCESS_ALLOWED_AGENTS = 1 << 0;
-const U32 ESTATE_ACCESS_ALLOWED_GROUPS = 1 << 1;
-const U32 ESTATE_ACCESS_BANNED_AGENTS = 1 << 2;
-const U32 ESTATE_ACCESS_MANAGERS = 1 << 3;
+constexpr U32 ESTATE_ACCESS_ALLOWED_AGENTS = 1 << 0;
+constexpr U32 ESTATE_ACCESS_ALLOWED_GROUPS = 1 << 1;
+constexpr U32 ESTATE_ACCESS_BANNED_AGENTS = 1 << 2;
+constexpr U32 ESTATE_ACCESS_MANAGERS = 1 << 3;
//maximum number of access list entries we can fit in one packet
-const S32 ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET = 63;
+constexpr S32 ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET = 63;
// for reply to "getinfo", don't need to forward to all sims in estate
-const U32 ESTATE_ACCESS_SEND_TO_AGENT_ONLY = 1 << 4;
+constexpr U32 ESTATE_ACCESS_SEND_TO_AGENT_ONLY = 1 << 4;
-const U32 ESTATE_ACCESS_ALL = ESTATE_ACCESS_ALLOWED_AGENTS
- | ESTATE_ACCESS_ALLOWED_GROUPS
- | ESTATE_ACCESS_BANNED_AGENTS
- | ESTATE_ACCESS_MANAGERS;
+constexpr U32 ESTATE_ACCESS_ALL = ESTATE_ACCESS_ALLOWED_AGENTS
+ | ESTATE_ACCESS_ALLOWED_GROUPS
+ | ESTATE_ACCESS_BANNED_AGENTS
+ | ESTATE_ACCESS_MANAGERS;
// for EstateOwnerRequest, estateaccessdelta, estateexperiencedelta messages
-const U32 ESTATE_ACCESS_APPLY_TO_ALL_ESTATES = 1U << 0;
-const U32 ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES = 1U << 1;
+constexpr U32 ESTATE_ACCESS_APPLY_TO_ALL_ESTATES = 1U << 0;
+constexpr U32 ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES = 1U << 1;
-const U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1U << 2;
-const U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1U << 3;
-const U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1U << 4;
-const U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1U << 5;
-const U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1U << 6;
-const U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1U << 7;
-const U32 ESTATE_ACCESS_MANAGER_ADD = 1U << 8;
-const U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9;
-const U32 ESTATE_ACCESS_NO_REPLY = 1U << 10;
-const U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11;
+constexpr U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1U << 2;
+constexpr U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1U << 3;
+constexpr U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1U << 4;
+constexpr U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1U << 5;
+constexpr U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1U << 6;
+constexpr U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1U << 7;
+constexpr U32 ESTATE_ACCESS_MANAGER_ADD = 1U << 8;
+constexpr U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9;
+constexpr U32 ESTATE_ACCESS_NO_REPLY = 1U << 10;
+constexpr U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11;
-const S32 ESTATE_MAX_MANAGERS = 20;
-const S32 ESTATE_MAX_MANAGERS_OS = 15; // OpenSim
-const S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access
-const S32 ESTATE_MAX_BANNED_IDS = 750; // max for banned
-const S32 ESTATE_MAX_BANNED_IDS_OS = 500; // max for banned // OpenSim
-const S32 ESTATE_MAX_GROUP_IDS = (S32) ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET;
+constexpr S32 ESTATE_MAX_MANAGERS = 20;
+constexpr S32 ESTATE_MAX_MANAGERS_OS = 15; // OpenSim
+constexpr S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access
+constexpr S32 ESTATE_MAX_BANNED_IDS = 750; // max for banned
+constexpr S32 ESTATE_MAX_BANNED_IDS_OS = 500; // max for banned // OpenSim
+constexpr S32 ESTATE_MAX_GROUP_IDS = (S32) ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET;
// 'Sim Wide Delete' flags
-const U32 SWD_OTHERS_LAND_ONLY = (1 << 0);
-const U32 SWD_ALWAYS_RETURN_OBJECTS = (1 << 1);
-const U32 SWD_SCRIPTED_ONLY = (1 << 2);
+constexpr U32 SWD_OTHERS_LAND_ONLY = (1 << 0);
+constexpr U32 SWD_ALWAYS_RETURN_OBJECTS = (1 << 1);
+constexpr U32 SWD_SCRIPTED_ONLY = (1 << 2);
// Controls experience key validity in the estate
-const U32 EXPERIENCE_KEY_TYPE_NONE = 0;
-const U32 EXPERIENCE_KEY_TYPE_BLOCKED = 1;
-const U32 EXPERIENCE_KEY_TYPE_ALLOWED = 2;
-const U32 EXPERIENCE_KEY_TYPE_TRUSTED = 3;
+constexpr U32 EXPERIENCE_KEY_TYPE_NONE = 0;
+constexpr U32 EXPERIENCE_KEY_TYPE_BLOCKED = 1;
+constexpr U32 EXPERIENCE_KEY_TYPE_ALLOWED = 2;
+constexpr U32 EXPERIENCE_KEY_TYPE_TRUSTED = 3;
-const U32 EXPERIENCE_KEY_TYPE_FIRST = EXPERIENCE_KEY_TYPE_BLOCKED;
-const U32 EXPERIENCE_KEY_TYPE_LAST = EXPERIENCE_KEY_TYPE_TRUSTED;
+constexpr U32 EXPERIENCE_KEY_TYPE_FIRST = EXPERIENCE_KEY_TYPE_BLOCKED;
+constexpr U32 EXPERIENCE_KEY_TYPE_LAST = EXPERIENCE_KEY_TYPE_TRUSTED;
//
-const U32 ESTATE_EXPERIENCE_TRUSTED_ADD = 1U << 2;
-const U32 ESTATE_EXPERIENCE_TRUSTED_REMOVE = 1U << 3;
-const U32 ESTATE_EXPERIENCE_ALLOWED_ADD = 1U << 4;
-const U32 ESTATE_EXPERIENCE_ALLOWED_REMOVE = 1U << 5;
-const U32 ESTATE_EXPERIENCE_BLOCKED_ADD = 1U << 6;
-const U32 ESTATE_EXPERIENCE_BLOCKED_REMOVE = 1U << 7;
-
-const S32 ESTATE_MAX_EXPERIENCE_IDS = 8;
-
+constexpr U32 ESTATE_EXPERIENCE_TRUSTED_ADD = 1U << 2;
+constexpr U32 ESTATE_EXPERIENCE_TRUSTED_REMOVE = 1U << 3;
+constexpr U32 ESTATE_EXPERIENCE_ALLOWED_ADD = 1U << 4;
+constexpr U32 ESTATE_EXPERIENCE_ALLOWED_REMOVE = 1U << 5;
+constexpr U32 ESTATE_EXPERIENCE_BLOCKED_ADD = 1U << 6;
+constexpr U32 ESTATE_EXPERIENCE_BLOCKED_REMOVE = 1U << 7;
+constexpr S32 ESTATE_MAX_EXPERIENCE_IDS = 8;
#endif
-
-
diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp
index 8be6158d82..6ade7c0dad 100644
--- a/indra/llmessage/llsdmessagereader.cpp
+++ b/indra/llmessage/llsdmessagereader.cpp
@@ -242,7 +242,7 @@ void LLSDMessageReader::getString(const char *block, const char *var,
return;
}
std::string data = getLLSD(mMessage, block, var, blocknum);
- S32 data_size = data.size();
+ auto data_size = data.size();
if (data_size >= buffer_size)
{
data_size = buffer_size - 1;
@@ -261,7 +261,7 @@ void LLSDMessageReader::getString(const char *block, const char *var,
//virtual
S32 LLSDMessageReader::getNumberOfBlocks(const char *blockname)
{
- return mMessage[blockname].size();
+ return static_cast(mMessage[blockname].size());
}
S32 getElementSize(const LLSD& llsd)
@@ -276,7 +276,7 @@ S32 getElementSize(const LLSD& llsd)
case LLSD::TypeReal:
return sizeof(F64);
case LLSD::TypeString:
- return llsd.size();
+ return static_cast(llsd.size());
case LLSD::TypeUUID:
return sizeof(LLUUID);
case LLSD::TypeDate:
@@ -286,7 +286,7 @@ S32 getElementSize(const LLSD& llsd)
case LLSD::TypeBinary:
{
std::vector data = llsd;
- return data.size() * sizeof(U8);
+ return static_cast(data.size() * sizeof(U8));
}
case LLSD::TypeMap:
case LLSD::TypeArray:
diff --git a/indra/llmessage/lltemplatemessagedispatcher.cpp b/indra/llmessage/lltemplatemessagedispatcher.cpp
index 93db7eba98..ef2034927a 100644
--- a/indra/llmessage/lltemplatemessagedispatcher.cpp
+++ b/indra/llmessage/lltemplatemessagedispatcher.cpp
@@ -45,7 +45,7 @@ void LLTemplateMessageDispatcher::dispatch(const std::string& msg_name,
LLHTTPNode::ResponsePtr responsep)
{
std::vector data = message["body"]["binary-template-data"].asBinary();
- U32 size = data.size();
+ auto size = data.size();
if(size == 0)
{
return;
@@ -54,7 +54,7 @@ void LLTemplateMessageDispatcher::dispatch(const std::string& msg_name,
LLHost host;
host = gMessageSystem->getSender();
- bool validate_message = mTemplateMessageReader.validateMessage(&(data[0]), data.size(), host, true);
+ bool validate_message = mTemplateMessageReader.validateMessage(&(data[0]), static_cast(size), host, true);
if (validate_message)
{
diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp
index 337926f2dc..efac9adc2e 100644
--- a/indra/llmessage/llxfer_file.cpp
+++ b/indra/llmessage/llxfer_file.cpp
@@ -317,7 +317,7 @@ S32 LLXfer_File::flush()
if (mFp)
{
- S32 write_size = fwrite(mBuffer,1,mBufferLength,mFp);
+ S32 write_size = static_cast(fwrite(mBuffer,1,mBufferLength,mFp));
if (write_size != mBufferLength)
{
LL_WARNS("Xfer") << "Non-matching write size, requested " << mBufferLength
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index dc9fa0b0d6..64dba0cc43 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -2183,7 +2183,7 @@ S32 LLMessageSystem::sendError(
if (LLMessageConfig::getMessageFlavor(ERROR_MESSAGE_NAME) ==
LLMessageConfig::TEMPLATE_FLAVOR)
{
- S32 msg_size = temp.size() + mMessageBuilder->getMessageSize();
+ S32 msg_size = static_cast(temp.size()) + mMessageBuilder->getMessageSize();
if(msg_size >= ETHERNET_MTU_BYTES)
{
pack_data = false;
@@ -2191,7 +2191,7 @@ S32 LLMessageSystem::sendError(
}
if(pack_data)
{
- addBinaryData("Data", (void*)temp.c_str(), temp.size());
+ addBinaryData("Data", (void*)temp.c_str(), static_cast(temp.size()));
}
else
{
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index ad8affe34b..d23992cd2a 100644
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -262,10 +262,10 @@ void LLPluginClassMedia::idle(void)
message.setValueS32("height", mRequestedMediaHeight);
message.setValueS32("texture_width", mRequestedTextureWidth);
message.setValueS32("texture_height", mRequestedTextureHeight);
- message.setValueReal("background_r", mBackgroundColor.mV[VX]);
- message.setValueReal("background_g", mBackgroundColor.mV[VY]);
- message.setValueReal("background_b", mBackgroundColor.mV[VZ]);
- message.setValueReal("background_a", mBackgroundColor.mV[VW]);
+ message.setValueReal("background_r", mBackgroundColor.mV[VRED]);
+ message.setValueReal("background_g", mBackgroundColor.mV[VGREEN]);
+ message.setValueReal("background_b", mBackgroundColor.mV[VBLUE]);
+ message.setValueReal("background_a", mBackgroundColor.mV[VALPHA]);
mPlugin->sendMessage(message); // DO NOT just use sendMessage() here -- we want this to jump ahead of the queue.
LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL;
diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp
index 2cbc16ceec..085afc0944 100644
--- a/indra/llplugin/llpluginmessagepipe.cpp
+++ b/indra/llplugin/llpluginmessagepipe.cpp
@@ -371,7 +371,7 @@ bool LLPluginMessagePipe::pumpInput(F64 timeout)
void LLPluginMessagePipe::processInput(void)
{
// Look for input delimiter(s) in the input buffer.
- int delim;
+ size_t delim;
mInputMutex.lock();
while((delim = mInput.find(MESSAGE_DELIMITER)) != std::string::npos)
{
diff --git a/indra/llplugin/llpluginsharedmemory.cpp b/indra/llplugin/llpluginsharedmemory.cpp
index a10d251069..28a0f0bf4e 100644
--- a/indra/llplugin/llpluginsharedmemory.cpp
+++ b/indra/llplugin/llpluginsharedmemory.cpp
@@ -450,7 +450,7 @@ bool LLPluginSharedMemory::create(size_t size)
NULL, // default security
PAGE_READWRITE, // read/write access
0, // max. object size
- mSize, // buffer size
+ static_cast(mSize), // buffer size
mName.c_str()); // name of mapping object
if(mImpl->mMapFile == NULL)
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index c5918967e1..778648a5bb 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -306,7 +306,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(
// Don't share verts within the same tri, degenerate
//
- U32 indx_size = indices.size();
+ U32 indx_size = static_cast(indices.size());
U32 verts_new_tri = indx_size % 3;
if ((verts_new_tri < 1 || indices[indx_size - 1] != shared_index)
&& (verts_new_tri < 2 || indices[indx_size - 2] != shared_index))
@@ -780,7 +780,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac
{ //for each vertex
if (j > 2)
{
- U32 size = verts.size();
+ auto size = verts.size();
LLVolumeFace::VertexData v0 = verts[size-3];
LLVolumeFace::VertexData v1 = verts[size-1];
@@ -1064,9 +1064,9 @@ bool LLDAELoader::OpenFile(const std::string& filename)
//Verify some basic properties of the dae
//1. Basic validity check on controller
- U32 controllerCount = (int) db->getElementCount( NULL, "controller" );
+ U32 controllerCount = db->getElementCount(NULL, "controller");
bool result = false;
- for ( int i=0; igetElement( (daeElement**) &pController, i , NULL, "controller" );
@@ -1162,7 +1162,7 @@ bool LLDAELoader::OpenFile(const std::string& filename)
while (model_iter != mModelList.end())
{
LLModel* mdl = *model_iter;
- U32 material_count = mdl->mMaterialList.size();
+ U32 material_count = static_cast(mdl->mMaterialList.size());
LL_INFOS() << "Importing " << mdl->mLabel << " model with " << material_count << " material references" << LL_ENDL;
std::vector::iterator mat_iter = mdl->mMaterialList.begin();
std::vector::iterator end_iter = material_count > LIMIT_MATERIALS_OUTPUT
@@ -1319,7 +1319,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
//Some collada setup for accessing the skeleton
U32 skeleton_count = dae->getDatabase()->getElementCount( NULL, "skeleton" );
std::vector skeletons;
- for (S32 i=0; igetDatabase()->getElement( &pElement, i, 0, "skeleton" );
@@ -1351,11 +1351,11 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
{
//Get the children at this level
daeTArray< daeSmartRef > children = pScene->getChildren();
- S32 childCount = children.getCount();
+ auto childCount = children.getCount();
//Process any children that are joints
//Not all children are joints, some could be ambient lights, cameras, geometry etc..
- for (S32 i = 0; i < childCount; ++i)
+ for (size_t i = 0; i < childCount; ++i)
{
domNode* pNode = daeSafeCast(children[i]);
if (pNode)
@@ -1376,7 +1376,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
if ( pSkeletonRootNode )
{
//Once we have the root node - start acccessing it's joint components
- const int jointCnt = mJointMap.size();
+ const int jointCnt = static_cast(mJointMap.size());
JointMap :: const_iterator jointIt = mJointMap.begin();
//Loop over all the possible joints within the .dae - using the allowed joint list in the ctor.
@@ -1523,9 +1523,9 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
if (t)
{
domListOfFloats& transform = t->getValue();
- S32 count = transform.getCount()/16;
+ auto count = transform.getCount()/16;
- for (S32 k = 0; k < count; ++k)
+ for (size_t k = 0; k < count; ++k)
{
LLMatrix4 mat;
@@ -1611,7 +1611,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
std::vector ::const_iterator jointIt = jointNames.begin();
//
- const int jointCnt = model->mSkinInfo.mJointNames.size();
+ const int jointCnt = static_cast(model->mSkinInfo.mJointNames.size());
for ( int i=0; imSkinInfo.mAlternateBindMatrix.size();
+ auto bind_count = model->mSkinInfo.mAlternateBindMatrix.size();
if (bind_count > 0 && bind_count != jointCnt)
{
LL_WARNS("Mesh") << "Model " << model->mLabel << " has invalid joint bind matrix list." << LL_ENDL;
@@ -1779,8 +1779,8 @@ void LLDAELoader::buildJointToNodeMappingFromScene( daeElement* pRoot )
if ( pScene )
{
daeTArray< daeSmartRef > children = pScene->getChildren();
- S32 childCount = children.getCount();
- for (S32 i = 0; i < childCount; ++i)
+ auto childCount = children.getCount();
+ for (size_t i = 0; i < childCount; ++i)
{
domNode* pNode = daeSafeCast(children[i]);
processJointToNodeMapping( pNode );
@@ -1825,8 +1825,8 @@ void LLDAELoader::processJointToNodeMapping( domNode* pNode )
void LLDAELoader::processChildJoints( domNode* pParentNode )
{
daeTArray< daeSmartRef > childOfChild = pParentNode->getChildren();
- S32 childOfChildCount = childOfChild.getCount();
- for (S32 i = 0; i < childOfChildCount; ++i)
+ auto childOfChildCount = childOfChild.getCount();
+ for (size_t i = 0; i < childOfChildCount; ++i)
{
domNode* pChildNode = daeSafeCast( childOfChild[i] );
if ( pChildNode )
@@ -1927,7 +1927,7 @@ bool LLDAELoader::verifyController( domController* pController )
{
sum += pVertexWeights->getVcount()->getValue()[i];
}
- result = verifyCount( sum * inputs.getCount(), (domInt) pVertexWeights->getV()->getValue().getCount() );
+ result = verifyCount( sum * static_cast(inputs.getCount()), (domInt) static_cast(pVertexWeights->getV()->getValue().getCount()) );
}
}
@@ -2060,9 +2060,9 @@ void LLDAELoader::processJointNode( domNode* pNode, JointTransformMap& jointTran
//Gather and handle the incoming nodes children
daeTArray< daeSmartRef > childOfChild = pNode->getChildren();
- S32 childOfChildCount = childOfChild.getCount();
+ auto childOfChildCount = childOfChild.getCount();
- for (S32 i = 0; i < childOfChildCount; ++i)
+ for (size_t i = 0; i < childOfChildCount; ++i)
{
domNode* pChildNode = daeSafeCast( childOfChild[i] );
if ( pChildNode )
@@ -2281,8 +2281,8 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
//process children
daeTArray< daeSmartRef > children = element->getChildren();
- int childCount = children.getCount();
- for (S32 i = 0; i < childCount; i++)
+ auto childCount = children.getCount();
+ for (size_t i = 0; i < childCount; i++)
{
processElement(children[i],badElement, dae);
}
@@ -2713,7 +2713,7 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector& mo
ret->remapVolumeFaces();
}
- volume_faces = remainder.size();
+ volume_faces = static_cast(remainder.size());
models_out.push_back(ret);
diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp
index 810b648f17..776f81cc01 100644
--- a/indra/llprimitive/llgltfloader.cpp
+++ b/indra/llprimitive/llgltfloader.cpp
@@ -231,7 +231,7 @@ bool LLGLTFLoader::parseMaterials()
image.numChannels = in_image.component;
image.bytesPerChannel = in_image.bits >> 3; // Convert bits to bytes
image.pixelType = in_image.pixel_type; // Maps exactly, i.e. TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE == GL_UNSIGNED_BYTE, etc
- image.size = in_image.image.size();
+ image.size = static_cast(in_image.image.size());
image.height = in_image.height;
image.width = in_image.width;
image.data = in_image.image.data();
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index 008c72462c..e8c9af5ea3 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -5,21 +5,21 @@
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2022, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -72,7 +72,7 @@ LLGLTFMaterial::LLGLTFMaterial()
#if 0
mTextureTransform[i].mOffset.clear();
mTextureTransform[i].mRotation = 0.f;
-#endif
+#endif
}
#if 0
mLocalTexDataDigest = 0;
@@ -189,7 +189,7 @@ bool LLGLTFMaterial::fromJSON(const std::string& json, std::string& warn_msg, st
tinygltf::Model model_in;
- if (gltf.LoadASCIIFromString(&model_in, &error_msg, &warn_msg, json.c_str(), json.length(), ""))
+ if (gltf.LoadASCIIFromString(&model_in, &error_msg, &warn_msg, json.c_str(), static_cast(json.length()), ""))
{
setFromModel(model_in, 0);
@@ -792,7 +792,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
{
mMetallicFactor = mf.asReal();
if (mMetallicFactor == getDefaultMetallicFactor())
- {
+ {
// HACK -- nudge by epsilon if we receive a default value (indicates override to default)
mMetallicFactor -= FLT_EPSILON;
}
@@ -803,7 +803,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
{
mRoughnessFactor = rf.asReal();
if (mRoughnessFactor == getDefaultRoughnessFactor())
- {
+ {
// HACK -- nudge by epsilon if we receive a default value (indicates override to default)
mRoughnessFactor -= FLT_EPSILON;
}
diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h
index e04b6d5eee..febeec350c 100644
--- a/indra/llprimitive/llgltfmaterial.h
+++ b/indra/llprimitive/llgltfmaterial.h
@@ -5,21 +5,21 @@
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2022, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -115,18 +115,6 @@ public:
static const char* const GLTF_FILE_EXTENSION_TRANSFORM_ROTATION;
static const LLUUID GLTF_OVERRIDE_NULL_UUID;
- // *TODO: If/when we implement additional GLTF extensions, they may not be
- // compatible with our GLTF terrain implementation. We may want to disallow
- // materials with some features from being set on terrain, if their
- // implementation on terrain is not compliant with the spec:
- // - KHR_materials_transmission: Probably OK?
- // - KHR_materials_ior: Probably OK?
- // - KHR_materials_volume: Likely incompatible, as our terrain
- // heightmaps cannot currently be described as finite enclosed
- // volumes.
- // See also LLPanelRegionTerrainInfo::validateMaterials
-public:
-
// get a UUID based on a hash of this LLGLTFMaterial
LLUUID getHash() const;
@@ -195,7 +183,7 @@ public:
void writeToModel(tinygltf::Model& model, S32 mat_index) const;
virtual void applyOverride(const LLGLTFMaterial& override_mat);
-
+
// apply the given LLSD override data
void applyOverrideLLSD(const LLSD& data);
@@ -249,10 +237,17 @@ protected:
void updateLocalTexDataDigest();
public:
+ // *TODO: If/when we implement additional GLTF extensions, they may not be
+ // compatible with our GLTF terrain implementation. We may want to disallow
+ // materials with some features from being set on terrain, if their
+ // implementation on terrain is not compliant with the spec:
+ // - KHR_materials_transmission: Probably OK?
+ // - KHR_materials_ior: Probably OK?
+ // - KHR_materials_volume: Likely incompatible, as our terrain
+ // heightmaps cannot currently be described as finite enclosed
+ // volumes.
+ // See also LLPanelRegionTerrainInfo::validateMaterials
// These fields are local to viewer and are a part of local bitmap support
- // IMPORTANT: do not move this member down (and do not move
- // mLocalTexDataDigest either): the getHash() method does rely on the
- // current ordering. HB
typedef std::map local_tex_map_t;
local_tex_map_t mTrackingIdToLocalTexture;
diff --git a/indra/llprimitive/llgltfmaterial_templates.h b/indra/llprimitive/llgltfmaterial_templates.h
index 276cc71b19..4ec7f312af 100644
--- a/indra/llprimitive/llgltfmaterial_templates.h
+++ b/indra/llprimitive/llgltfmaterial_templates.h
@@ -87,12 +87,12 @@ void LLGLTFMaterial::setFromTexture(const tinygltf::Model& model, const T& textu
template
void LLGLTFMaterial::allocateTextureImage(tinygltf::Model& model, T& texture_info, const std::string& uri)
{
- const S32 image_idx = model.images.size();
+ const S32 image_idx = static_cast(model.images.size());
model.images.emplace_back();
model.images[image_idx].uri = uri;
// The texture, not to be confused with the texture info
- const S32 texture_idx = model.textures.size();
+ const S32 texture_idx = static_cast(model.textures.size());
model.textures.emplace_back();
tinygltf::Texture& texture = model.textures[texture_idx];
texture.source = image_idx;
diff --git a/indra/llprimitive/llmediaentry.cpp b/indra/llprimitive/llmediaentry.cpp
index e626a989f6..b5b17c53aa 100644
--- a/indra/llprimitive/llmediaentry.cpp
+++ b/indra/llprimitive/llmediaentry.cpp
@@ -353,7 +353,7 @@ U32 LLMediaEntry::setWhiteList( const std::vector &whitelist )
{
// *NOTE: This code is VERY similar to the setWhitelist below.
// IF YOU CHANGE THIS IMPLEMENTATION, BE SURE TO CHANGE THE OTHER!
- U32 size = 0;
+ size_t size = 0;
U32 count = 0;
// First count to make sure the size constraint is not violated
std::vector::const_iterator iter = whitelist.begin();
@@ -394,7 +394,7 @@ U32 LLMediaEntry::setWhiteList( const LLSD &whitelist )
{
// *NOTE: This code is VERY similar to the setWhitelist above.
// IF YOU CHANGE THIS IMPLEMENTATION, BE SURE TO CHANGE THE OTHER!
- U32 size = 0;
+ size_t size = 0;
U32 count = 0;
// First check to make sure the size and count constraints are not violated
LLSD::array_const_iterator iter = whitelist.beginArray();
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index d721aa63c8..a02d00f128 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -104,7 +104,7 @@ void LLModel::offsetMesh( const LLVector3& pivotPoint )
LLVolumeFace& face = *currentFaceIt;
LLVector4a *pos = (LLVector4a*) face.mPositions;
- for (U32 i=0; i new_count))
+ if (new_count > 0 && ((U32)getNumVolumeFaces() > new_count))
{
// Copy out remaining volume faces for alternative handling, if provided
//
@@ -227,7 +227,7 @@ void LLModel::normalizeVolumeFaces()
min_tc = face.mTexCoords[0];
max_tc = face.mTexCoords[0];
- for (U32 j = 1; j < face.mNumVertices; ++j)
+ for (S32 j = 1; j < face.mNumVertices; ++j)
{
update_min_max(min_tc, max_tc, face.mTexCoords[j]);
}
@@ -301,7 +301,7 @@ void LLModel::normalizeVolumeFaces()
LLVector4a* norm = (LLVector4a*) face.mNormals;
LLVector4a* t = (LLVector4a*)face.mTangents;
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
pos[j].add(trans);
pos[j].mul(scale);
@@ -375,7 +375,7 @@ LLVector3 LLModel::getTransformedCenter(const LLMatrix4& mat)
{
LLVolumeFace& face = mVolumeFaces[i];
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
m.affineTransform(face.mPositions[j],t);
update_min_max(minv, maxv, t);
@@ -487,7 +487,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
faceted.resizeVertices(vol_face.mNumIndices);
faceted.resizeIndices(vol_face.mNumIndices);
//bake out triangles into temporary face, clearing texture coordinates
- for (U32 i = 0; i < vol_face.mNumIndices; ++i)
+ for (S32 i = 0; i < vol_face.mNumIndices; ++i)
{
U32 idx = vol_face.mIndices[i];
@@ -497,7 +497,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//generate normals for temporary face
- for (U32 i = 0; i < faceted.mNumIndices; i += 3)
+ for (S32 i = 0; i < faceted.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = faceted.mIndices[i+0];
U16 i1 = faceted.mIndices[i+1];
@@ -526,12 +526,12 @@ void LLModel::generateNormals(F32 angle_cutoff)
//generate normals for welded face based on new topology (step 3)
- for (U32 i = 0; i < faceted.mNumVertices; i++)
+ for (S32 i = 0; i < faceted.mNumVertices; i++)
{
faceted.mNormals[i].clear();
}
- for (U32 i = 0; i < faceted.mNumIndices; i += 3)
+ for (S32 i = 0; i < faceted.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = faceted.mIndices[i+0];
U16 i1 = faceted.mIndices[i+1];
@@ -560,7 +560,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
//normalize normals and build point map
LLVolumeFace::VertexMapData::PointMap point_map;
- for (U32 i = 0; i < faceted.mNumVertices; ++i)
+ for (S32 i = 0; i < faceted.mNumVertices; ++i)
{
faceted.mNormals[i].normalize3();
@@ -578,7 +578,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
new_face.resizeIndices(vol_face.mNumIndices);
new_face.resizeVertices(vol_face.mNumIndices);
- for (U32 i = 0; i < vol_face.mNumIndices; ++i)
+ for (S32 i = 0; i < vol_face.mNumIndices; ++i)
{
U32 idx = vol_face.mIndices[i];
LLVolumeFace::VertexData v;
@@ -589,7 +589,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
if (vol_face.mTexCoords)
{
- for (U32 i = 0; i < vol_face.mNumIndices; i++)
+ for (S32 i = 0; i < vol_face.mNumIndices; i++)
{
U32 idx = vol_face.mIndices[i];
new_face.mTexCoords[i] = vol_face.mTexCoords[idx];
@@ -602,7 +602,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//generate normals for new face
- for (U32 i = 0; i < new_face.mNumIndices; i += 3)
+ for (S32 i = 0; i < new_face.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = new_face.mIndices[i+0];
U16 i1 = new_face.mIndices[i+1];
@@ -627,7 +627,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//swap out normals in new_face with best match from point map (step 5)
- for (U32 i = 0; i < new_face.mNumVertices; ++i)
+ for (S32 i = 0; i < new_face.mNumVertices; ++i)
{
//LLVolumeFace::VertexData v = new_face.mVertices[i];
@@ -740,7 +740,7 @@ LLSD LLModel::writeModel(
for (S32 i = 0; i < model[idx]->getNumVolumeFaces(); ++i)
{ //for each face
const LLVolumeFace& face = model[idx]->getVolumeFace(i);
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
update_min_max(min_pos, max_pos, face.mPositions[j].getF32ptr());
}
@@ -777,7 +777,7 @@ LLSD LLModel::writeModel(
max_tc = min_tc;
//get texture coordinate domain
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
update_min_max(min_tc, max_tc, ftc[j]);
}
@@ -785,7 +785,7 @@ LLSD LLModel::writeModel(
LLVector2 tc_range = max_tc - min_tc;
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{ //for each vert
F32* pos = face.mPositions[j].getF32ptr();
@@ -855,7 +855,7 @@ LLSD LLModel::writeModel(
}
U32 idx_idx = 0;
- for (U32 j = 0; j < face.mNumIndices; ++j)
+ for (S32 j = 0; j < face.mNumIndices; ++j)
{
U8* buff = (U8*) &(face.mIndices[j]);
indices[idx_idx++] = buff[0];
@@ -902,7 +902,7 @@ LLSD LLModel::writeModel(
// a bone index of 0xFF signifies no more influences for this vertex
std::stringstream ostr;
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
LLVector3 pos(face.mPositions[j].getF32ptr());
@@ -933,7 +933,7 @@ LLSD LLModel::writeModel(
//copy ostr to binary buffer
std::string data = ostr.str();
const U8* buff = (U8*)data.data();
- U32 bytes = data.size();
+ U32 bytes = static_cast(data.size());
LLSD::Binary w(bytes);
for (U32 j = 0; j < bytes; ++j)
@@ -980,7 +980,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{ //write out skin block
skin = zip_llsd(mdl["skin"]);
- U32 size = skin.size();
+ U32 size = static_cast(skin.size());
if (size > 0)
{
header["skin"]["offset"] = (LLSD::Integer) cur_offset;
@@ -995,7 +995,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{ //write out convex decomposition
decomposition = zip_llsd(mdl["physics_convex"]);
- U32 size = decomposition.size();
+ U32 size = static_cast(decomposition.size());
if (size > 0)
{
header["physics_convex"]["offset"] = (LLSD::Integer) cur_offset;
@@ -1017,7 +1017,7 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bo
{
out[i] = zip_llsd(mdl[model_names[i]]);
- U32 size = out[i].size();
+ U32 size = static_cast(out[i].size());
header[model_names[i]]["offset"] = (LLSD::Integer) cur_offset;
header[model_names[i]]["size"] = (LLSD::Integer) size;
@@ -1177,7 +1177,7 @@ void LLModel::updateHullCenters()
mCenterOfHullCenters += cur_center;
cur_center *= 1.f/mPhysics.mHull[i].size();
mHullCenter[i] = cur_center;
- mHullPoints += mPhysics.mHull[i].size();
+ mHullPoints += static_cast(mPhysics.mHull[i].size());
}
if (mHullPoints > 0)
@@ -1298,8 +1298,8 @@ bool LLModel::loadModel(std::istream& is)
bool LLModel::isMaterialListSubset( LLModel* ref )
{
- int refCnt = ref->mMaterialList.size();
- int modelCnt = mMaterialList.size();
+ auto refCnt = ref->mMaterialList.size();
+ auto modelCnt = mMaterialList.size();
// FIRE-30965 Cleanup braindead mesh parsing error handlers
if(modelCnt > refCnt)
{
@@ -1307,11 +1307,11 @@ bool LLModel::isMaterialListSubset( LLModel* ref )
return false;
}
//
- for (U32 src = 0; src < modelCnt; ++src)
+ for (size_t src = 0; src < modelCnt; ++src)
{
bool foundRef = false;
- for (U32 dst = 0; dst < refCnt; ++dst)
+ for (size_t dst = 0; dst < refCnt; ++dst)
{
//LL_INFOS()<mMaterialList[dst]<mMaterialList[dst];
@@ -1665,18 +1665,18 @@ U32 LLMeshSkinInfo::sizeBytes() const
{
U32 res = sizeof(LLUUID); // mMeshID
- res += sizeof(std::vector) + sizeof(std::string) * mJointNames.size();
+ res += sizeof(std::vector) + sizeof(std::string) * static_cast(mJointNames.size());
for (U32 i = 0; i < mJointNames.size(); ++i)
{
// 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 += mJointNames[i].mName.size(); // actual size, not capacity
+ //res += static_cast(mJointNames[i].size()); // actual size, not capacity
+ res += static_cast(mJointNames[i].mName.size()); // actual size, not capacity
//
}
- res += sizeof(std::vector) + sizeof(S32) * mJointNums.size();
- res += sizeof(std::vector) + 16 * sizeof(float) * mInvBindMatrix.size();
- res += sizeof(std::vector) + 16 * sizeof(float) * mAlternateBindMatrix.size();
+ res += sizeof(std::vector) + sizeof(S32) * static_cast(mJointNums.size());
+ res += sizeof(std::vector) + 16 * sizeof(float) * static_cast(mInvBindMatrix.size());
+ res += sizeof(std::vector) + 16 * sizeof(float) * static_cast(mAlternateBindMatrix.size());
res += 16 * sizeof(float); //mBindShapeMatrix
res += sizeof(float) + 3 * sizeof(bool);
@@ -1793,15 +1793,15 @@ U32 LLModel::Decomposition::sizeBytes() const
{
U32 res = sizeof(LLUUID); // mMeshID
- res += sizeof(LLModel::convex_hull_decomposition) + sizeof(std::vector) * mHull.size();
+ res += sizeof(LLModel::convex_hull_decomposition) + sizeof(std::vector) * static_cast(mHull.size());
for (U32 i = 0; i < mHull.size(); ++i)
{
- res += mHull[i].size() * sizeof(LLVector3);
+ res += static_cast(mHull[i].size()) * sizeof(LLVector3);
}
- res += sizeof(LLModel::hull) + sizeof(LLVector3) * mBaseHull.size();
+ res += sizeof(LLModel::hull) + sizeof(LLVector3) * static_cast(mBaseHull.size());
- res += sizeof(std::vector) + sizeof(std::vector) * mMesh.size();
+ res += sizeof(std::vector) + sizeof(std::vector) * static_cast(mMesh.size());
for (U32 i = 0; i < mMesh.size(); ++i)
{
res += mMesh[i].sizeBytes();
@@ -1852,7 +1852,7 @@ LLSD LLModel::Decomposition::asLLSD() const
for (U32 i = 0; i < mHull.size(); ++i)
{
- U32 size = mHull[i].size();
+ U32 size = static_cast(mHull[i].size());
total += size;
hulls[i] = (U8) (size);
@@ -2053,7 +2053,7 @@ bool ll_is_degenerate(const LLVector4a& a, const LLVector4a& b, const LLVector4a
bool validate_face(const LLVolumeFace& face)
{
- for (U32 i = 0; i < face.mNumIndices; ++i)
+ for (S32 i = 0; i < face.mNumIndices; ++i)
{
if (face.mIndices[i] >= face.mNumVertices)
{
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index 02c10b7e77..9a0f72454f 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -127,8 +127,8 @@ public:
U32 sizeBytes() const
{
U32 res = sizeof(std::vector) * 2;
- res += sizeof(LLVector3) * mPositions.size();
- res += sizeof(LLVector3) * mNormals.size();
+ res += sizeof(LLVector3) * static_cast(mPositions.size());
+ res += sizeof(LLVector3) * static_cast(mNormals.size());
return res;
}
};
@@ -362,7 +362,7 @@ public:
protected:
LLUUID mDiffuseMapID;
- void* mOpaqueData; // allow refs to viewer/platform-specific structs for each material
+ void* mOpaqueData{ nullptr }; // allow refs to viewer/platform-specific structs for each material
// currently only stores an LLPointer< LLViewerFetchedTexture > > to
// maintain refs to textures associated with each material for free
// ref counting.
diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp
index 44d99a95a9..2584466a43 100644
--- a/indra/llprimitive/llprimtexturelist.cpp
+++ b/indra/llprimitive/llprimtexturelist.cpp
@@ -83,13 +83,13 @@ void LLPrimTextureList::clear()
void LLPrimTextureList::copy(const LLPrimTextureList& other_list)
{
// compare the sizes
- S32 this_size = mEntryList.size();
- S32 other_size = other_list.mEntryList.size();
+ auto this_size = mEntryList.size();
+ auto other_size = other_list.mEntryList.size();
if (this_size > other_size)
{
// remove the extra entries
- for (S32 index = this_size; index > other_size; --index)
+ for (size_t index = this_size; index > other_size; --index)
{
delete mEntryList[index-1];
}
@@ -97,18 +97,18 @@ void LLPrimTextureList::copy(const LLPrimTextureList& other_list)
this_size = other_size;
}
- S32 index = 0;
+ size_t index = 0;
// copy for the entries that already exist
for ( ; index < this_size; ++index)
{
delete mEntryList[index];
- mEntryList[index] = other_list.getTexture(index)->newCopy();
+ mEntryList[index] = other_list.getTexture(static_cast(index))->newCopy();
}
// add new entires if needed
for ( ; index < other_size; ++index)
{
- mEntryList.push_back( other_list.getTexture(index)->newCopy() );
+ mEntryList.push_back( other_list.getTexture(static_cast(index))->newCopy());
}
}
@@ -127,9 +127,9 @@ void LLPrimTextureList::take(LLPrimTextureList& other_list)
// returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE
S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te)
{
- if (S32(index) >= mEntryList.size())
+ if (size_t(index) >= mEntryList.size())
{
- S32 current_size = mEntryList.size();
+ auto current_size = mEntryList.size();
LL_WARNS() << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << LL_ENDL;
return TEM_CHANGE_NONE;
}
@@ -394,7 +394,7 @@ LLMaterialPtr LLPrimTextureList::getMaterialParams(const U8 index)
S32 LLPrimTextureList::size() const
{
- return mEntryList.size();
+ return static_cast(mEntryList.size());
}
// sets the size of the mEntryList container
@@ -405,12 +405,12 @@ void LLPrimTextureList::setSize(S32 new_size)
new_size = 0;
}
- S32 current_size = mEntryList.size();
+ auto current_size = mEntryList.size();
if (new_size > current_size)
{
mEntryList.resize(new_size);
- for (S32 index = current_size; index < new_size; ++index)
+ for (size_t index = current_size; index < new_size; ++index)
{
if (current_size > 0
&& mEntryList[current_size - 1])
@@ -428,7 +428,7 @@ void LLPrimTextureList::setSize(S32 new_size)
}
else if (new_size < current_size)
{
- for (S32 index = current_size-1; index >= new_size; --index)
+ for (size_t index = current_size-1; index >= new_size; --index)
{
delete mEntryList[index];
}
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index 2ed8f8c044..ac482ffbf9 100644
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -407,9 +407,9 @@ S32 LLTextureEntry::setColor(const LLColor3 &color)
S32 LLTextureEntry::setAlpha(const F32 alpha)
{
- if (mColor.mV[VW] != alpha)
+ if (mColor.mV[VALPHA] != alpha)
{
- mColor.mV[VW] = alpha;
+ mColor.mV[VALPHA] = alpha;
return TEM_CHANGE_COLOR;
}
return TEM_CHANGE_NONE;
diff --git a/indra/llprimitive/tests/llgltfmaterial_test.cpp b/indra/llprimitive/tests/llgltfmaterial_test.cpp
index 585b9da3ad..4f2de82386 100644
--- a/indra/llprimitive/tests/llgltfmaterial_test.cpp
+++ b/indra/llprimitive/tests/llgltfmaterial_test.cpp
@@ -1,26 +1,26 @@
-/**
+/**
* @file llgltfmaterial_test.cpp
*
- * $LicenseInfo:firstyear=2023&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
+ * $/LicenseInfo$
*/
#include "linden_common.h"
diff --git a/indra/llprimitive/tests/llprimitive_test.cpp b/indra/llprimitive/tests/llprimitive_test.cpp
index 60960067d0..0213a3e8b6 100644
--- a/indra/llprimitive/tests/llprimitive_test.cpp
+++ b/indra/llprimitive/tests/llprimitive_test.cpp
@@ -109,7 +109,7 @@ void LLPrimTextureList::take(LLPrimTextureList &other_list) { }
void LLPrimTextureList::setSize(S32 new_size) { mEntryList.resize(new_size); }
void LLPrimTextureList::setAllIDs(const LLUUID &id) { }
LLTextureEntry * LLPrimTextureList::getTexture(const U8 index) const { return nullptr; }
-S32 LLPrimTextureList::size() const { return mEntryList.size(); }
+S32 LLPrimTextureList::size() const { return static_cast(mEntryList.size()); }
class PRIMITIVE_TEST_SETUP
{
diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp
index d2c40ad590..46c2e89797 100644
--- a/indra/llrender/llfontbitmapcache.cpp
+++ b/indra/llrender/llfontbitmapcache.cpp
@@ -108,7 +108,7 @@ bool LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp
S32 num_components = getNumComponents(bitmap_type);
mImageRawVec[bitmap_idx].push_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components));
- bitmap_num = mImageRawVec[bitmap_idx].size() - 1;
+ bitmap_num = static_cast(mImageRawVec[bitmap_idx].size()) - 1;
LLImageRaw* image_raw = getImageRaw(bitmap_type, bitmap_num);
if (EFontGlyphType::Grayscale == bitmap_type)
diff --git a/indra/llrender/llfontbitmapcache.h b/indra/llrender/llfontbitmapcache.h
index 6b19ba2154..f2dfd87877 100644
--- a/indra/llrender/llfontbitmapcache.h
+++ b/indra/llrender/llfontbitmapcache.h
@@ -60,7 +60,7 @@ public:
LLImageGL* getImageGL(EFontGlyphType bitmapType, U32 bitmapNum) const;
S32 getMaxCharWidth() const { return mMaxCharWidth; }
- U32 getNumBitmaps(EFontGlyphType bitmapType) const { return (bitmapType < EFontGlyphType::Count) ? mImageRawVec[static_cast(bitmapType)].size() : 0; }
+ U32 getNumBitmaps(EFontGlyphType bitmapType) const { return (bitmapType < EFontGlyphType::Count) ? static_cast(mImageRawVec[static_cast(bitmapType)].size()) : 0U; }
S32 getBitmapWidth() const { return mBitmapWidth; }
S32 getBitmapHeight() const { return mBitmapHeight; }
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 0039d38b10..0b46dc8632 100644
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -382,7 +382,7 @@ S32 LLFontFreetype::ftOpenFace(const std::string& filename, S32 face_n)
pFtStream = new LLFT_Stream();
pFtStream->base = 0;
pFtStream->pos = 0;
- pFtStream->size = file_size;
+ pFtStream->size = static_cast(file_size);
pFtStream->descriptor.pointer = pFileStream;
pFtStream->read = ft_read_cb;
pFtStream->close = ft_close_cb;
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 729fb00aad..f2c3823a11 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -149,7 +149,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
if(!sDisplayFont) //do not display texts
{
- return wstr.length() ;
+ return static_cast(wstr.length());
}
if (wstr.empty())
@@ -283,7 +283,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
LLColor4U text_color(color);
// Preserve the transparency to render fading emojis in fading text (e.g.
// for the chat console)... HB
- LLColor4U emoji_color(255, 255, 255, text_color.mV[VW]);
+ LLColor4U emoji_color(255, 255, 255, text_color.mV[VALPHA]);
std::pair bitmap_entry = std::make_pair(EFontGlyphType::Grayscale, -1);
S32 glyph_count = 0;
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 97066bfba9..fa669f1ae5 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1184,7 +1184,7 @@ bool LLGLManager::initGL()
// stop doing this and trust the hardware detection
// if hardware detection has all failed the this will correct for that
- // S32 old_vram = mVRAM;
+ // U32 old_vram = mVRAM;
// mVRAM = 0;
#if LL_WINDOWS
@@ -1229,7 +1229,7 @@ bool LLGLManager::initGL()
// // Function will check all GPUs WMI knows of and will pick up the one with most
// // memory. We need to check all GPUs because system can switch active GPU to
// // weaker one, to preserve power when not under load.
-// S32 mem = LLDXHardware::getMBVideoMemoryViaWMI();
+// U32 mem = LLDXHardware::getMBVideoMemoryViaWMI();
// if (mem != 0)
// {
// mVRAM = mem;
@@ -1386,7 +1386,7 @@ void LLGLManager::asLLSD(LLSD& info)
info["gpu_version"] = mDriverVersionVendorString;
info["opengl_version"] = mGLVersionString;
- info["vram"] = mVRAM;
+ info["vram"] = LLSD::Integer(mVRAM);
// OpenGL limits
info["max_samples"] = mMaxSamples;
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index 22862f7f7c..32fa0c3cf7 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -133,9 +133,7 @@ public:
std::string mDriverVersionVendorString;
std::string mGLVersionString;
- S32 mVRAM; // VRAM in MB
-
- void getPixelFormat(); // Get the best pixel format
+ U32 mVRAM; // VRAM in MB
std::string getGLInfoString();
void printGLInfoString();
@@ -153,7 +151,6 @@ public:
private:
void initExtensions();
void initGLStates();
- void initGLImages();
};
extern LLGLManager gGLManager;
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index f2b5c4881c..3b4224cbfd 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -70,8 +70,8 @@ public:
template
struct UniformSetting
{
- S32 mUniform;
- T mValue;
+ S32 mUniform{ 0 };
+ T mValue{};
};
typedef UniformSetting IntSetting;
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index acbfdfa826..afe9c90aaf 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -100,7 +100,7 @@ void LLImageGLMemory::free_tex_image(U32 texName)
// track texture free on given texNames
void LLImageGLMemory::free_tex_images(U32 count, const U32* texNames)
{
- for (int i = 0; i < count; ++i)
+ for (U32 i = 0; i < count; ++i)
{
free_tex_image(texNames[i]);
}
@@ -1318,7 +1318,7 @@ void LLImageGL::generateTextures(S32 numTextures, U32 *textures)
name_count = pool_size;
}
- if (numTextures <= name_count)
+ if ((U32)numTextures <= name_count)
{
//copy teture names off the end of the pool
memcpy(textures, name_pool + name_count - numTextures, sizeof(U32) * numTextures);
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 60a11e7ba8..b573618ee6 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -208,7 +208,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
return true;
}
- U32 offset = mTex.size();
+ U32 offset = static_cast(mTex.size());
if( offset >= 4 )
{
@@ -378,11 +378,11 @@ void LLRenderTarget::release()
if (mFBO && (mTex.size() > 1))
{
glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
- S32 z;
+ size_t z;
for (z = mTex.size() - 1; z >= 1; z--)
{
sBytesAllocated -= mResX*mResY*4;
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+z, LLTexUnit::getInternalType(mUsage), 0, 0);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, static_cast(GL_COLOR_ATTACHMENT0+z), LLTexUnit::getInternalType(mUsage), 0, 0);
LLImageGL::deleteTextures(1, &mTex[z]);
}
glBindFramebuffer(GL_FRAMEBUFFER, sCurFBO);
@@ -426,7 +426,7 @@ void LLRenderTarget::bindTarget()
GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2,
GL_COLOR_ATTACHMENT3};
- glDrawBuffers(mTex.size(), drawbuffers);
+ glDrawBuffers(static_cast(mTex.size()), drawbuffers);
if (mTex.empty())
{ //no color buffer to draw to
@@ -485,7 +485,7 @@ U32 LLRenderTarget::getTexture(U32 attachment) const
U32 LLRenderTarget::getNumTextures() const
{
- return mTex.size();
+ return static_cast(mTex.size());
}
void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options)
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index cb04f8cd89..f50213f5ab 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -695,7 +695,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
{ //switches are supported in GLSL 1.30 and later
if (gGLManager.mIsNVIDIA)
{ //switches are unreliable on some NVIDIA drivers
- for (U32 i = 0; i < texture_index_channels; ++i)
+ for (S32 i = 0; i < texture_index_channels; ++i)
{
std::string if_string = llformat("\t%sif (vary_texture_index == %d) { return texture(tex%d, texcoord); }\n", i > 0 ? "else " : "", i, i);
extra_code_text[extra_code_count++] = strdup(if_string.c_str());
@@ -1126,7 +1126,7 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader)
program_binary.resize(binary_info.mBinaryLength);
GLenum error = glGetError(); // Clear current error
- glGetProgramBinary(shader->mProgramObject, program_binary.size() * sizeof(U8), nullptr, &binary_info.mBinaryFormat, program_binary.data());
+ glGetProgramBinary(shader->mProgramObject, static_cast(program_binary.size() * sizeof(U8)), nullptr, &binary_info.mBinaryFormat, program_binary.data());
error = glGetError();
if (error == GL_NO_ERROR)
{
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 77d36fee34..913dc32574 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -719,7 +719,7 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
if (tc != nullptr)
{
- for (int i = 0; i < num_indices; ++i)
+ for (U32 i = 0; i < num_indices; ++i)
{
U16 idx = indicesp[i];
gGL.texCoord2fv(tc[idx].mV);
@@ -728,7 +728,7 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
}
else
{
- for (int i = 0; i < num_indices; ++i)
+ for (U32 i = 0; i < num_indices; ++i)
{
U16 idx = indicesp[i];
gGL.vertex3fv(pos[idx].getF32ptr());
@@ -745,19 +745,17 @@ bool LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
return true;
}
- llassert(start < (U32)mNumVerts);
- llassert(end < (U32)mNumVerts);
+ llassert(start < mNumVerts);
+ llassert(end < mNumVerts);
- if (start >= (U32) mNumVerts ||
- end >= (U32) mNumVerts)
+ if (start >= mNumVerts ||
+ end >= mNumVerts)
{
LL_ERRS() << "Bad vertex buffer draw range: [" << start << ", " << end << "] vs " << mNumVerts << LL_ENDL;
}
- llassert(mNumIndices >= 0);
-
- if (indices_offset >= (U32) mNumIndices ||
- indices_offset + count > (U32) mNumIndices)
+ if (indices_offset >= mNumIndices ||
+ indices_offset + count > mNumIndices)
{
LL_ERRS() << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << LL_ENDL;
}
@@ -795,7 +793,7 @@ bool LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
for (U32 i = start; i < end; i++)
{
U32 idx = (U32) (v[i][3]+0.25f);
- if (idx >= shader->mFeatures.mIndexedTextureChannels)
+ if (idx >= (U32)shader->mFeatures.mIndexedTextureChannels)
{
LL_ERRS() << "Bad texture index found in vertex data stream." << LL_ENDL;
}
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index f0eab7bbd3..9076f54795 100644
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -495,7 +495,7 @@ void LLAccordionCtrl::arrangeMultiple()
if (mFitParent)
{
// All expanded tabs will have equal height
- panel_height = calcExpandedTabHeight(i, panel_top);
+ panel_height = calcExpandedTabHeight(static_cast(i), panel_top);
ctrlSetLeftTopAndSize(accordion_tab, panel_left, panel_top, panel_width, panel_height);
// Try to make accordion tab fit accordion view height.
diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 5132d33bbf..64896ccfcb 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -73,7 +73,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
if (LLAssetType::lookupIsAssetIDKnowable(type))
{
LLWString source = utf8str_to_wstring(src.asString());
- res = addToClipboard(source, 0, source.size());
+ res = addToClipboard(source, 0, static_cast(source.size()));
}
if (res)
{
@@ -87,13 +87,13 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
bool LLClipboard::pasteFromClipboard(std::vector& inv_objects) const
{
bool res = false;
- S32 count = mObjects.size();
+ auto count = mObjects.size();
inv_objects.reserve(inv_objects.size() + count);
if (count > 0)
{
res = true;
inv_objects.clear();
- for (S32 i = 0; i < count; i++)
+ for (size_t i = 0; i < count; i++)
{
inv_objects.push_back(mObjects[i]);
}
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 301572e273..36c17b566a 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -1023,7 +1023,7 @@ void LLComboBox::updateSelection()
LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());
LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size());
mTextEntry->setText(wstring_to_utf8str(wtext));
- mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size());
+ mTextEntry->setSelection(static_cast(left_wstring.size()), static_cast(mTextEntry->getWText().size()));
mTextEntry->endSelection();
mTextEntry->setTentative(false);
mHasAutocompletedText = true;
@@ -1034,7 +1034,7 @@ void LLComboBox::updateSelection()
{
LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());
mTextEntry->setText(wstring_to_utf8str(left_wstring) + " (" + getSelectedItemLabel() + ")");
- mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size());
+ mTextEntry->setSelection(static_cast(left_wstring.size()), static_cast(mTextEntry->getWText().size()));
mTextEntry->endSelection();
mTextEntry->setTentative(false);
mHasAutocompletedText = true;
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 7b6859c785..3ef52eb26d 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -111,7 +111,7 @@ LLCommandManager::~LLCommandManager()
U32 LLCommandManager::commandCount() const
{
- return mCommands.size();
+ return static_cast(mCommands.size());
}
LLCommand * LLCommandManager::getCommand(U32 commandIndex)
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index 46359a02a3..59e6adf73a 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -214,7 +214,7 @@ protected:
void addCommand(LLCommand * command);
private:
- typedef std::map CommandIndexMap;
+ typedef std::map CommandIndexMap;
typedef std::vector CommandVector;
CommandVector mCommands;
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index 3298320e99..efca628075 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -180,11 +180,11 @@ void LLConsole::draw()
{
// This is done in update() if session support is enabled
//
- U32 num_lines=0;
+ size_t num_lines{ 0 };
paragraph_t::reverse_iterator paragraph_it;
paragraph_it = mParagraphs.rbegin();
- U32 paragraph_num=mParagraphs.size();
+ auto paragraph_num=mParagraphs.size();
while (!mParagraphs.empty() && paragraph_it != mParagraphs.rend())
{
@@ -192,7 +192,7 @@ void LLConsole::draw()
if(num_lines > mMaxLines
|| ( (mLinePersistTime > (F32)0.f) && ((*paragraph_it).mAddTime - skip_time)/(mLinePersistTime - mFadeTime) <= (F32)0.f))
{ //All lines above here are done. Lose them.
- for (U32 i=0;i(color_str.length());
mParagraphColorSegments.push_back(color_segment);
}
@@ -597,14 +597,14 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, L
// skip_chars = 0;
//}
- //U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
+ //U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, static_cast(line_end) - paragraph_offset, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
if (line_end == LLWString::npos)
{
line_end = mParagraphText.size();
}
S32 skip_chars = 0; // skip '\n'
- U32 line_length = line_end - paragraph_offset;
+ U32 line_length = static_cast(line_end) - paragraph_offset;
U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_length, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
//
@@ -812,11 +812,11 @@ void LLConsole::update()
F32 skip_time = mTimer.getElapsedTimeF32() - mLinePersistTime;
paragraph_t temp_para;
- std::map session_map;
+ std::map session_map;
for (paragraph_t::reverse_iterator it = mParagraphs.rbegin(); it != mParagraphs.rend(); ++it)
{
Paragraph& para = *it;
- session_map[para.mSessionID] += (S32)para.mLines.size();
+ session_map[para.mSessionID] += (U32)para.mLines.size();
if (session_map[para.mSessionID] <= mMaxLines && // max lines on a per session basis
!((mLinePersistTime > 0.f) && (para.mAddTime - skip_time) / (mLinePersistTime - mFadeTime) <= 0.f)) // not expired yet
{
diff --git a/indra/llui/llemojidictionary.cpp b/indra/llui/llemojidictionary.cpp
index f16c38a11a..925608e47e 100644
--- a/indra/llui/llemojidictionary.cpp
+++ b/indra/llui/llemojidictionary.cpp
@@ -210,7 +210,7 @@ void LLEmojiDictionary::findByShortCode(
std::size_t begin, end;
if (searchInShortCode(begin, end, shortCode, needle))
{
- results[begin].emplace_back(d.Character, shortCode, begin, end);
+ results[static_cast(begin)].emplace_back(d.Character, shortCode, begin, end);
}
}
}
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index f3f132bb74..64cc55823d 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -399,7 +399,7 @@ U32 LLFlatListView::size(const bool only_visible_items) const
}
else
{
- return mItemPairs.size();
+ return static_cast(mItemPairs.size());
}
}
@@ -573,7 +573,7 @@ void LLFlatListView::rearrangeItems()
}
// add paddings between items, excluding invisible ones
- height += mItemPad * (mItemPairs.size() - invisible_children_count - 1);
+ height += mItemPad * (static_cast(mItemPairs.size()) - invisible_children_count - 1);
LLRect rc = mItemsPanel->getRect();
S32 width = mItemsNoScrollWidth;
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index 0e1d00681e..7010c6a6ad 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -272,7 +272,7 @@ public:
void setCommitOnSelectionChange(bool b) { mCommitOnSelectionChange = b; }
/** Get number of selected items in the list */
- U32 numSelected() const {return mSelectedItemPairs.size(); }
+ U32 numSelected() const {return static_cast(mSelectedItemPairs.size()); }
/** Get number of (visible) items in the list */
U32 size(const bool only_visible_items = true) const;
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index e00a9295ea..cd43dd032f 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -778,7 +778,7 @@ void LLFolderView::removeSelectedItems()
// items, since the removal will futz with internal data
// structures.
std::vector items;
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
if(count <= 0) return;
LLFolderViewItem* item = NULL;
selected_items_t::iterator item_it;
@@ -823,7 +823,7 @@ void LLFolderView::removeSelectedItems()
setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus());
listeners.reserve(count);
- for(S32 i = 0; i < count; ++i)
+ for(size_t i = 0; i < count; ++i)
{
listener = items[i]->getViewModelItem();
if(listener && (std::find(listeners.begin(), listeners.end(), listener) == listeners.end()))
@@ -942,7 +942,7 @@ void LLFolderView::copy()
{
// *NOTE: total hack to clear the inventory clipboard
LLClipboard::instance().reset();
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
if(getVisible() && getEnabled() && (count > 0))
{
LLFolderViewModelItem* listener = NULL;
@@ -1096,7 +1096,7 @@ void LLFolderView::startRenamingSelectedItem( void )
// make sure selection is visible
scrollToShowSelection();
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
LLFolderViewItem* item = NULL;
if(count > 0)
{
@@ -1353,7 +1353,7 @@ bool LLFolderView::handleKeyHere( KEY key, MASK mask )
// FIRE-19933: Open context menu on context menu key press
case KEY_CONTEXT_MENU:
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
if (( count > 0 && (hasVisibleChildren()) ) // show menu only if selected items are visible
&& menu )
@@ -1508,7 +1508,7 @@ bool LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
std::string current_item_label(search_item->getViewModelItem()->getSearchableName());
LLStringUtil::toUpper(current_item_label);
- S32 search_string_length = llmin(upper_case_string.size(), current_item_label.size());
+ auto search_string_length = llmin(upper_case_string.size(), current_item_label.size());
if (!current_item_label.compare(0, search_string_length, upper_case_string))
{
found = true;
@@ -1548,7 +1548,7 @@ bool LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
mParentPanel.get()->setFocus(true);
bool handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
- S32 count = mSelectedItems.size();
+ auto count = mSelectedItems.size();
LLMenuGL* menu = static_cast(mPopupMenuHandle.get());
if (!menu)
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index e1413dc73d..828e8b8350 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -1011,22 +1011,22 @@ void LLFolderViewItem::draw()
return;
}
- std::string::size_type filter_string_length = mViewModelItem->hasFilterStringMatch() ? mViewModelItem->getFilterStringSize() : 0;
+ auto filter_string_length = mViewModelItem->hasFilterStringMatch() ? static_cast(mViewModelItem->getFilterStringSize()) : 0;
F32 right_x = 0;
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD;
F32 text_left = (F32)getLabelXPos();
std::string combined_string = mLabel + mLabelSuffix;
const LLFontGL* suffix_font = getLabelFontForStyle(LLFontGL::NORMAL);
- S32 filter_offset = mViewModelItem->getFilterStringOffset();
+ S32 filter_offset = static_cast(mViewModelItem->getFilterStringOffset());
if (filter_string_length > 0)
{
S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD);
S32 top = getRect().getHeight() - TOP_PAD;
if(mLabelSuffix.empty() || (font == suffix_font))
{
- S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2;
- S32 right = left + font->getWidth(combined_string, mViewModelItem->getFilterStringOffset(), filter_string_length) + 2;
+ S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, static_cast(mViewModelItem->getFilterStringOffset())) - 2;
+ S32 right = left + font->getWidth(combined_string, static_cast(mViewModelItem->getFilterStringOffset()), filter_string_length) + 2;
LLUIImage* box_image = default_params.selection_image;
LLRect box_rect(left, top, right, bottom);
@@ -1047,7 +1047,7 @@ void LLFolderViewItem::draw()
if(suffix_filter_length > 0)
{
S32 suffix_offset = llmax(0, filter_offset - (S32)mLabel.size());
- S32 left = ll_round(text_left) + font->getWidthF32(mLabel, 0, mLabel.size()) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset) - 2;
+ S32 left = ll_round(text_left) + font->getWidthF32(mLabel, 0, static_cast(mLabel.size())) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset) - 2;
S32 right = left + suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length) + 2;
LLUIImage* box_image = default_params.selection_image;
LLRect box_rect(left, top, right, bottom);
@@ -1124,7 +1124,7 @@ void LLFolderViewItem::draw()
if(suffix_filter_length > 0)
{
S32 suffix_offset = llmax(0, filter_offset - (S32)mLabel.size());
- F32 match_string_left = text_left + font->getWidthF32(mLabel, 0, mLabel.size()) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset + suffix_filter_length) - suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length);
+ F32 match_string_left = text_left + font->getWidthF32(mLabel, 0, static_cast(mLabel.size())) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset + suffix_filter_length) - suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length);
F32 yy = (F32)getRect().getHeight() - suffix_font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD;
suffix_font->renderUTF8(mLabelSuffix, suffix_offset, match_string_left, yy, sFilterTextColor,
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index feddcc93cc..bd08f54f3a 100644
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -39,7 +39,7 @@ inline bool LLKeywordToken::isHead(const llwchar* s) const
// strncmp is much faster than string compare
bool res = true;
const llwchar* t = mToken.c_str();
- S32 len = mToken.size();
+ auto len = mToken.size();
for (S32 i=0; i* seg_list, const LLW
return;
}
- S32 text_len = wtext.size() + 1;
+ S32 text_len = static_cast(wtext.size()) + 1;
// Script editor ignoring font selection
//seg_list->push_back( new LLNormalTextSegment( style, 0, text_len, editor ) );
@@ -750,23 +750,23 @@ void LLKeywords::insertSegments(const LLWString& wtext, std::vector Script editor ignoring font selection
- //LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, pos, editor );
+ //LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, static_cast(pos), editor );
LLStyleSP style = getDefaultStyle(editor);
style->setColor(cur_token->getColor());
- LLTextSegmentPtr text_segment = new LLNormalTextSegment( style, seg_start, pos, editor );
+ LLTextSegmentPtr text_segment = new LLNormalTextSegment( style, seg_start, static_cast(pos), editor );
//
text_segment->setToken( cur_token );
insertSegment( seg_list, text_segment, text_len, style, editor);
}
// Script editor ignoring font selection
- //LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(style, pos);
- LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(getDefaultStyle(editor), pos);
+ //LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(style, static_cast(pos));
+ LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(getDefaultStyle(editor), static_cast(pos));
//
text_segment->setToken( cur_token );
insertSegment( seg_list, text_segment, text_len, style, editor);
- seg_start = pos+1;
+ seg_start = static_cast(pos) + 1;
pos = wtext.find('\n',seg_start);
}
@@ -1026,9 +1026,9 @@ void LLKeywords::dump()
void LLKeywordToken::dump()
{
LL_INFOS() << "[" <<
- mColor.mV[VX] << ", " <<
- mColor.mV[VY] << ", " <<
- mColor.mV[VZ] << "] [" <<
+ mColor.mV[VRED] << ", " <<
+ mColor.mV[VGREEN] << ", " <<
+ mColor.mV[VBLUE] << "] [" <<
wstring_to_utf8str(mToken) << "]" <<
LL_ENDL;
}
diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h
index 488381cbda..36620425b5 100644
--- a/indra/llui/llkeywords.h
+++ b/indra/llui/llkeywords.h
@@ -86,8 +86,8 @@ public:
{
}
- S32 getLengthHead() const { return mToken.size(); }
- S32 getLengthTail() const { return mDelimiter.size(); }
+ S32 getLengthHead() const { return static_cast(mToken.size()); }
+ S32 getLengthTail() const { return static_cast(mDelimiter.size()); }
bool isHead(const llwchar* s) const;
bool isTail(const llwchar* s) const;
const LLWString& getToken() const { return mToken; }
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 1885212d75..754ac6d9c6 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -91,7 +91,7 @@ public:
void addPanel(LLLayoutPanel* panel, EAnimate animate = NO_ANIMATE);
void collapsePanel(LLPanel* panel, bool collapsed = true);
- S32 getNumPanels() { return mPanels.size(); }
+ S32 getNumPanels() { return static_cast(mPanels.size()); }
void updateLayout();
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 4dc54b62a8..d23644fa6e 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -592,7 +592,7 @@ const std::string& LLLineEditor::getSuggestion(U32 index) const
U32 LLLineEditor::getSuggestionCount() const
{
- return mSuggestionList.size();
+ return static_cast(mSuggestionList.size());
}
void LLLineEditor::replaceWithSuggestion(U32 index)
@@ -1026,7 +1026,7 @@ void LLLineEditor::addChar(const llwchar uni_char)
mText.erase(getCursor(), 1);
}
- S32 cur_bytes = mText.getString().size();
+ S32 cur_bytes = static_cast(mText.getString().size());
S32 new_bytes = wchar_utf8_length(new_c);
@@ -1039,7 +1039,7 @@ void LLLineEditor::addChar(const llwchar uni_char)
}
else if (mMaxLengthChars)
{
- S32 wide_chars = mText.getWString().size();
+ auto wide_chars = mText.getWString().size();
if ((wide_chars + 1) > mMaxLengthChars)
{
allow_char = false;
@@ -1385,7 +1385,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
if (mMaxLengthChars)
{
- U32 available_chars = mMaxLengthChars - mText.getWString().size();
+ auto available_chars = mMaxLengthChars - mText.getWString().size();
if (available_chars < clean_string.size())
{
@@ -2393,10 +2393,10 @@ bool LLLineEditor::postvalidateFloat(const std::string &str)
LLWString trimmed = utf8str_to_wstring(str);
LLWStringUtil::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if( 0 < len )
{
- S32 i = 0;
+ size_t i = 0;
// First character can be a negative sign
if( '-' == trimmed[0] )
@@ -2453,7 +2453,7 @@ bool LLLineEditor::evaluateFloat()
if (!success)
{
// Move the cursor to near the error on failure
- setCursor(LLCalc::getInstance()->getLastErrorPos());
+ setCursor(static_cast(LLCalc::getInstance()->getLastErrorPos()));
// *TODO: Translated error message indicating the type of error? Select error text?
}
else
@@ -2603,7 +2603,7 @@ void LLLineEditor::updatePreedit(const LLWString &preedit_string,
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode())
{
mPreeditOverwrittenWString.assign( LLWString( mText, insert_preedit_at, mPreeditWString.length() ) );
- mText.erase(insert_preedit_at, mPreeditWString.length());
+ mText.erase(insert_preedit_at, static_cast(mPreeditWString.length()));
}
else
{
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index a3b8cc59df..d21c7127cc 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -198,7 +198,7 @@ LLMenuItemGL::LLMenuItemGL(const LLMenuItemGL::Params& p)
{
mAcceleratorMask |= MASK_SHIFT;
}
- S32 pipe_pos = shortcut.rfind("|");
+ auto pipe_pos = shortcut.rfind("|");
std::string key_str = shortcut.substr(pipe_pos+1);
LLKeyboard::keyFromString(key_str, &mAcceleratorKey);
@@ -250,10 +250,10 @@ bool LLMenuItemGL::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
// Holding CTRL & ALT while right clicking a menu entry will copy the menu
// text and shortcut (accelerator) to the clipboard. The menu items action will not be called.
- if( (MASK_CONTROL|MASK_ALT) == ((MASK_CONTROL|MASK_ALT) & mask) )
+ if ((MASK_CONTROL|MASK_ALT) == ((MASK_CONTROL|MASK_ALT) & mask))
{
- LLWString label = utf8string_to_wstring( getLabel() + ": " + mDrawAccelLabel.getString() );
- LLClipboard::instance().copyToClipboard( label, 0, label.size() );
+ LLWString label = utf8string_to_wstring(getLabel() + ": " + mDrawAccelLabel.getString());
+ LLClipboard::instance().copyToClipboard(label, 0, static_cast(label.size()));
return false;
}
//
@@ -566,8 +566,8 @@ void LLMenuItemGL::draw( void )
std::string::size_type offset = upper_case_label.find(mJumpKey);
if (offset != std::string::npos)
{
- S32 x_begin = LEFT_PLAIN_PIXELS + mFont->getWidth(mLabel, 0, offset);
- S32 x_end = LEFT_PLAIN_PIXELS + mFont->getWidth(mLabel, 0, offset + 1);
+ S32 x_begin = LEFT_PLAIN_PIXELS + mFont->getWidth(mLabel, 0, static_cast(offset));
+ S32 x_end = LEFT_PLAIN_PIXELS + mFont->getWidth(mLabel, 0, static_cast(offset) + 1);
gl_line_2d(x_begin, (MENU_ITEM_PADDING / 2) + 1, x_end, (MENU_ITEM_PADDING / 2) + 1);
}
}
@@ -1672,8 +1672,8 @@ void LLMenuItemBranchDownGL::draw( void )
if (offset != std::string::npos)
{
S32 x_offset = ll_round((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f);
- S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, offset);
- S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, offset + 1);
+ S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, static_cast(offset));
+ S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, static_cast(offset) + 1);
gl_line_2d(x_begin, LABEL_BOTTOM_PAD_PIXELS, x_end, LABEL_BOTTOM_PAD_PIXELS);
}
}
@@ -2091,7 +2091,7 @@ bool LLMenuGL::scrollItems(EScrollingDirection direction)
// Otherwise viewer will hang for a time needed to scroll U32_MAX
// times in std::advance(). STORM-659.
size_t nitems = mItems.size();
- U32 scrollable_items = nitems < mMaxScrollableItems ? nitems : mMaxScrollableItems;
+ U32 scrollable_items = nitems < mMaxScrollableItems ? static_cast(nitems) : mMaxScrollableItems;
// Advance by mMaxScrollableItems back from the end of the list
// to make the last item visible.
@@ -2623,7 +2623,7 @@ void LLMenuGL::empty( void )
// erase group of items from menu
void LLMenuGL::erase( S32 begin, S32 end, bool arrange/* = true*/)
{
- S32 items = mItems.size();
+ auto items = mItems.size();
if ( items == 0 || begin >= end || begin < 0 || end > items )
{
@@ -2842,7 +2842,7 @@ void LLMenuGL::setTornOff(bool torn_off)
U32 LLMenuGL::getItemCount()
{
- return mItems.size();
+ return static_cast(mItems.size());
}
LLMenuItemGL* LLMenuGL::getItem(S32 number)
diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h
index 58c253c3f4..177664dde4 100644
--- a/indra/llui/llmodaldialog.h
+++ b/indra/llui/llmodaldialog.h
@@ -66,7 +66,7 @@ public:
static void onAppFocusLost();
static void onAppFocusGained();
- static S32 activeCount() { return sModalStack.size(); }
+ static S32 activeCount() { return static_cast(sModalStack.size()); }
static void shutdownModals();
protected:
diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h
index 630e45dddb..b2bfc8bc84 100644
--- a/indra/llui/llmultislider.h
+++ b/indra/llui/llmultislider.h
@@ -118,7 +118,7 @@ public:
/*virtual*/ void draw() override;
S32 getMaxNumSliders() { return mMaxNumSliders; }
- S32 getCurNumSliders() { return mValue.size(); }
+ S32 getCurNumSliders() { return static_cast(mValue.size()); }
F32 getOverlapThreshold() { return mOverlapThreshold; }
bool canAddSliders() { return mValue.size() < mMaxNumSliders; }
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 7f36b92e1e..7963977d29 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1208,7 +1208,7 @@ bool LLNotificationChannel::isEmpty() const
S32 LLNotificationChannel::size() const
{
- return mItems.size();
+ return static_cast(mItems.size());
}
size_t LLNotificationChannel::size()
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index eb7bba9b33..4e2bd85e29 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -251,7 +251,7 @@ public:
void fromLLSD(const LLSD& sd);
LLSD asLLSD() const;
- S32 getNumElements() { return mFormData.size(); }
+ S32 getNumElements() { return static_cast(mFormData.size()); }
LLSD getElement(S32 index) { return mFormData.get(index); }
LLSD getElement(const std::string& element_name);
void getElements(LLSD& elements, S32 offset = 0);
diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h
index 810830ffa4..a24a7c86b2 100644
--- a/indra/llui/llradiogroup.h
+++ b/indra/llui/llradiogroup.h
@@ -87,7 +87,7 @@ public:
LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; };
// LLCtrlSelectionInterface functions
- /*virtual*/ S32 getItemCount() const { return mRadioButtons.size(); }
+ /*virtual*/ S32 getItemCount() const { return static_cast(mRadioButtons.size()); }
/*virtual*/ bool getCanSelect() const { return true; }
/*virtual*/ bool selectFirstItem() { return setSelectedIndex(0); }
/*virtual*/ bool selectNthItem( S32 index ) { return setSelectedIndex(index); }
diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp
index 540e3abca8..5d4423543e 100644
--- a/indra/llui/llresmgr.cpp
+++ b/indra/llui/llresmgr.cpp
@@ -140,7 +140,7 @@ std::string LLResMgr::getMonetaryString( S32 input ) const
S32 output_pos = 0;
cur_group = 0;
- S32 pos = digits.size()-1;
+ S32 pos = static_cast(digits.size()) - 1;
S32 count_within_group = 0;
while( (pos >= 0) && (groupings[cur_group] >= 0) )
{
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 2ddc40e01b..b71e5aa897 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -457,7 +457,7 @@ S32 LLScrollListCtrl::getItemCount() const
}
// Fix for FS-specific people list (radar)
- return mItemList.size();
+ return static_cast(mItemList.size());
}
bool LLScrollListCtrl::hasSelectedItem() const
@@ -1448,7 +1448,7 @@ bool LLScrollListCtrl::selectItemByStringMatch(const LLWString& target, bool pre
bool found = false;
LLWString target_trimmed( target );
- S32 target_len = target_trimmed.size();
+ auto target_len = target_trimmed.size();
if( 0 == target_len )
{
@@ -1511,8 +1511,8 @@ bool LLScrollListCtrl::selectItemByStringMatch(const LLWString& target, bool pre
if (select)
{
// find offset of matching text (might have leading whitespace)
- S32 offset = item_label.find(target_trimmed);
- cellp->highlightText(offset, target_trimmed.size());
+ auto offset = item_label.find(target_trimmed);
+ cellp->highlightText(static_cast(offset), static_cast(target_trimmed.size()));
selectItem(item, -1);
found = true;
break;
@@ -1538,7 +1538,7 @@ U32 LLScrollListCtrl::searchItems(const LLWString& substring, bool case_sensitiv
U32 found = 0;
LLWString substring_trimmed(substring);
- S32 len = substring_trimmed.size();
+ auto len = substring_trimmed.size();
if (0 == len)
{
@@ -1586,7 +1586,7 @@ U32 LLScrollListCtrl::searchItems(const LLWString& substring, bool case_sensitiv
if (found_iter != std::string::npos)
{
// find offset of matching text
- cellp->highlightText(found_iter, substring_trimmed.size());
+ cellp->highlightText(static_cast(found_iter), static_cast(substring_trimmed.size()));
selectItem(item, -1, false);
found++;
@@ -3315,7 +3315,7 @@ void LLScrollListCtrl::copy()
{
buffer += (*itor)->getContentsCSV() + "\n";
}
- LLClipboard::instance().copyToClipboard(utf8str_to_wstring(buffer), 0, buffer.length());
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(buffer), 0, static_cast(buffer.length()));
}
// virtual
@@ -3399,7 +3399,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params
// Add column
mColumns[name] = new LLScrollListColumn(column_params, this);
LLScrollListColumn* new_column = mColumns[name];
- new_column->mIndex = mColumns.size()-1;
+ new_column->mIndex = static_cast(mColumns.size()) - 1;
// Add button
if (new_column->getWidth() > 0 || new_column->mRelWidth > 0 || new_column->mDynamicWidth)
@@ -3646,7 +3646,7 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
if (!item_p.validateBlock() || !new_item) return NULL;
- new_item->setNumColumns(mColumns.size());
+ new_item->setNumColumns(static_cast(mColumns.size()));
// Add any columns we don't already have
S32 col_index = 0;
@@ -3681,7 +3681,7 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS
}
addColumn(new_column);
columnp = mColumns[column];
- new_item->setNumColumns(mColumns.size());
+ new_item->setNumColumns(static_cast(mColumns.size()));
}
S32 index = columnp->mIndex;
@@ -3714,7 +3714,7 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS
new_column.name = "0";
addColumn(new_column);
- new_item->setNumColumns(mColumns.size());
+ new_item->setNumColumns(static_cast(mColumns.size()));
}
LLScrollListCell* cell = LLScrollListCell::create(LLScrollListCell::Params().value(item_p.value));
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index 256efcfbc1..9e799f35e2 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -184,7 +184,7 @@ public:
virtual bool preProcessChildNode(LLXMLNodePtr child);
virtual LLScrollListColumn* getColumn(S32 index);
virtual LLScrollListColumn* getColumn(const std::string& name);
- virtual S32 getNumColumns() const { return mColumnsIndexed.size(); }
+ virtual S32 getNumColumns() const { return static_cast(mColumnsIndexed.size()); }
// Adds a single element, from an array of:
// "columns" => [ "column" => column name, "value" => value, "type" => type, "font" => font, "font-style" => style ], "id" => uuid
diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp
index 85da55e3e6..0d79d19a37 100644
--- a/indra/llui/llscrolllistitem.cpp
+++ b/indra/llui/llscrolllistitem.cpp
@@ -85,7 +85,7 @@ void LLScrollListItem::addColumn(const LLScrollListCell::Params& p)
void LLScrollListItem::setNumColumns(S32 columns)
{
- S32 prev_columns = mColumns.size();
+ auto prev_columns = mColumns.size();
if (columns < prev_columns)
{
std::for_each(mColumns.begin()+columns, mColumns.end(), DeletePointer());
@@ -93,7 +93,7 @@ void LLScrollListItem::setNumColumns(S32 columns)
mColumns.resize(columns);
- for (S32 col = prev_columns; col < columns; ++col)
+ for (auto col = prev_columns; col < columns; ++col)
{
mColumns[col] = NULL;
}
@@ -115,7 +115,7 @@ void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell )
S32 LLScrollListItem::getNumColumns() const
{
- return mColumns.size();
+ return static_cast(mColumns.size());
}
LLScrollListCell* LLScrollListItem::getColumn(const S32 i) const
diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp
index cfe96cc85a..afa965e30f 100644
--- a/indra/llui/llspellcheck.cpp
+++ b/indra/llui/llspellcheck.cpp
@@ -94,7 +94,7 @@ S32 LLSpellChecker::getSuggestions(const std::string& word, std::vectorfree_list(&suggestion_list, suggestion_cnt);
}
- return suggestions.size();
+ return static_cast(suggestions.size());
}
const LLSD LLSpellChecker::getDictionaryData(const std::string& dict_language)
diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index 2afff0e06f..f69c1e7d11 100644
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -512,7 +512,7 @@ void LLStatBar::draw()
if (mDisplayHistory && mStat.valid)
{
- const S32 num_values = frame_recording.getNumRecordedPeriods() - 1;
+ const S32 num_values = static_cast(frame_recording.getNumRecordedPeriods()) - 1;
F32 min_value = 0.f,
max_value = 0.f;
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index de1fda15c6..4dcb0456e3 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1439,7 +1439,7 @@ void LLTabContainer::removeTabPanel(LLPanel* child)
if (mCurrentTabIdx >= (S32)mTabList.size())
{
- mCurrentTabIdx = mTabList.size()-1;
+ mCurrentTabIdx = static_cast(mTabList.size()) - 1;
}
selectTab(mCurrentTabIdx);
if (has_focus)
@@ -1518,7 +1518,7 @@ S32 LLTabContainer::getCurrentPanelIndex()
S32 LLTabContainer::getTabCount()
{
- return mTabList.size();
+ return static_cast(mTabList.size());
}
LLPanel* LLTabContainer::getPanelByIndex(S32 index)
@@ -1585,7 +1585,7 @@ void LLTabContainer::selectFirstTab()
void LLTabContainer::selectLastTab()
{
- selectTab( mTabList.size()-1 );
+ selectTab(static_cast(mTabList.size()) - 1);
}
void LLTabContainer::selectNextTab()
@@ -1623,12 +1623,12 @@ void LLTabContainer::selectPrevTab()
}
S32 idx = mCurrentTabIdx-1;
if (idx < 0)
- idx = mTabList.size()-1;
+ idx = static_cast(mTabList.size()) - 1;
while (!selectTab(idx) && idx != mCurrentTabIdx)
{
idx = idx - 1;
if (idx < 0)
- idx = mTabList.size()-1;
+ idx = static_cast(mTabList.size()) - 1;
}
if (tab_has_focus)
{
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 8c2927cecf..32f4d1f3f4 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -350,12 +350,12 @@ bool LLTextBase::truncate()
if (value.type() == LLSD::TypeString)
{
// save a copy for strings.
- utf8_byte_size = value.size();
+ utf8_byte_size = static_cast(value.size());
}
else
{
// non string LLSDs need explicit conversion to string
- utf8_byte_size = value.asString().size();
+ utf8_byte_size = static_cast(value.asString().size());
}
if ( utf8_byte_size > mMaxTextByteLength )
@@ -365,7 +365,7 @@ bool LLTextBase::truncate()
temp_utf8_text = utf8str_truncate( temp_utf8_text, mMaxTextByteLength );
LLWString text = utf8str_to_wstring( temp_utf8_text );
// remove extra bit of current string, to preserve formatting, etc.
- removeStringNoUndo(text.size(), getWText().size() - text.size());
+ removeStringNoUndo(static_cast(text.size()), static_cast(getWText().size() - text.size()));
did_truncate = true;
}
}
@@ -483,7 +483,7 @@ void LLTextBase::drawHighlightsBackground(const highlight_list_t& highlights, co
continue;
}
}
- selection_rects.push_back(selection_rect);
+ selection_rects.emplace_back(selection_rect);
}
// Only advance if the highlight ends on the current line
@@ -499,12 +499,8 @@ void LLTextBase::drawHighlightsBackground(const highlight_list_t& highlights, co
alpha *= getDrawContext().mAlpha;
LLColor4 selection_color(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], alpha);
- for (std::vector::iterator rect_it = selection_rects.begin();
- rect_it != selection_rects.end();
- ++rect_it)
+ for (auto& selection_rect : selection_rects)
{
- LLRect selection_rect = *rect_it;
- selection_rect = *rect_it;
selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom);
gl_rect_2d(selection_rect, selection_color);
}
@@ -766,7 +762,7 @@ void LLTextBase::drawText()
}
else if (useLabel())
{
- text_len = mLabel.getWString().length();
+ text_len = static_cast(mLabel.getWString().length());
}
S32 selection_left = -1;
@@ -835,7 +831,7 @@ void LLTextBase::drawText()
// Find the start of the first word
U32 word_start = seg_start, word_end = -1;
- U32 text_length = wstrText.length();
+ U32 text_length = static_cast(wstrText.length());
while ( (word_start < text_length) && (!LLStringOps::isAlpha(wstrText[word_start])) )
{
word_start++;
@@ -938,7 +934,7 @@ void LLTextBase::drawText()
}
// Draw squiggly lines under any visible misspelled words
- while ( (mMisspellRanges.end() != misspell_it) && (misspell_it->first < seg_end) && (misspell_it->second > seg_start) )
+ while ( (mMisspellRanges.end() != misspell_it) && (misspell_it->first < (U32)seg_end) && (misspell_it->second > (U32)seg_start) )
{
// Skip the current word if the user is still busy editing it
if ( (!mSpellCheckTimer.hasExpired()) && (misspell_it->first <= (U32)mCursorPos) && (misspell_it->second >= (U32)mCursorPos) )
@@ -947,7 +943,7 @@ void LLTextBase::drawText()
continue;
}
- U32 misspell_start = llmax(misspell_it->first, seg_start), misspell_end = llmin(misspell_it->second, seg_end);
+ U32 misspell_start = llmax(misspell_it->first, (U32)seg_start), misspell_end = llmin(misspell_it->second, (U32)seg_end);
S32 squiggle_start = 0, squiggle_end = 0, pony = 0;
cur_segment->getDimensions(seg_start - cur_segment->getStart(), misspell_start - seg_start, squiggle_start, pony);
cur_segment->getDimensions(misspell_start - cur_segment->getStart(), misspell_end - misspell_start, squiggle_end, pony);
@@ -970,7 +966,7 @@ void LLTextBase::drawText()
squiggle_start += 4;
}
- if (misspell_it->second > seg_end)
+ if (misspell_it->second > (U32)seg_end)
{
break;
}
@@ -994,7 +990,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s
beforeValueChange();
S32 old_len = getLength(); // length() returns character length
- S32 insert_len = wstr.length();
+ S32 insert_len = static_cast(wstr.length());
pos = getEditableIndex(pos, true);
if (pos > old_len)
@@ -1066,7 +1062,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s
static LLUICachedControl useBWEmojis("FSUseBWEmojis", false); // Add B&W emoji font support
LLStyleSP emoji_style;
LLEmojiDictionary* ed = LLEmojiDictionary::instanceExists() ? LLEmojiDictionary::getInstance() : NULL;
- for (S32 text_kitty = 0, text_len = wstr.size(); text_kitty < text_len; text_kitty++)
+ for (S32 text_kitty = 0, text_len = static_cast(wstr.size()); text_kitty < text_len; text_kitty++)
{
llwchar code = wstr[text_kitty];
bool isEmoji = ed ? ed->isEmoji(code) : LLStringOps::isEmoji(code);
@@ -1523,7 +1519,6 @@ void LLTextBase::draw()
: hasFocus()
? mFocusBgColor.get()
: mWriteableBgColor.get();
-
gl_rect_2d(text_rect, bg_color % alpha, true);
}
@@ -1640,7 +1635,7 @@ const std::string& LLTextBase::getSuggestion(U32 index) const
U32 LLTextBase::getSuggestionCount() const
{
- return mSuggestionList.size();
+ return static_cast(mSuggestionList.size());
}
void LLTextBase::replaceWithSuggestion(U32 index)
@@ -1653,7 +1648,7 @@ void LLTextBase::replaceWithSuggestion(U32 index)
// Insert the suggestion in its place
LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]);
LLStyleConstSP sp(new LLStyle(getStyleParams()));
- LLTextSegmentPtr segmentp = new LLNormalTextSegment(sp, it->first, it->first + suggestion.size(), *this);
+ LLTextSegmentPtr segmentp = new LLNormalTextSegment(sp, it->first, it->first + static_cast(suggestion.size()), *this);
segment_vec_t segments(1, segmentp);
insertStringNoUndo(it->first, suggestion, &segments);
@@ -2216,7 +2211,6 @@ LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index)
index_segment->setStart(index);
index_segment->setEnd(index);
segment_set_t::iterator it = mSegments.upper_bound(index_segment);
-
return it;
}
@@ -2612,7 +2606,7 @@ void LLTextBase::resetLabel()
style->setColor(mTentativeFgColor);
LLStyleConstSP sp(style);
- LLTextSegmentPtr label = new LLLabelTextSegment(sp, 0, mLabel.getWString().length() + 1, *this);
+ LLTextSegmentPtr label = new LLLabelTextSegment(sp, 0, static_cast(mLabel.getWString().length()) + 1, *this);
insertSegment(label);
}
}
@@ -2688,7 +2682,7 @@ void LLTextBase::appendWidget(const LLInlineViewSegment::Params& params, const s
{
segment_vec_t segments;
LLWString widget_wide_text = utf8str_to_wstring(text);
- segments.push_back(new LLInlineViewSegment(params, getLength(), getLength() + widget_wide_text.size()));
+ segments.push_back(new LLInlineViewSegment(params, getLength(), getLength() + static_cast(widget_wide_text.size())));
insertStringNoUndo(getLength(), widget_wide_text, &segments);
}
@@ -2738,11 +2732,11 @@ void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 hig
highlight_params.font.style(normal_font_style);
//
LLStyleConstSP normal_sp(new LLStyle(highlight_params));
- segmentp = new LLOnHoverChangeableTextSegment(sp, normal_sp, cur_length, cur_length + wide_text.size(), *this);
+ segmentp = new LLOnHoverChangeableTextSegment(sp, normal_sp, cur_length, cur_length + static_cast(wide_text.size()), *this);
}
else
{
- segmentp = new LLNormalTextSegment(sp, cur_length, cur_length + wide_text.size(), *this);
+ segmentp = new LLNormalTextSegment(sp, cur_length, cur_length + static_cast(wide_text.size()), *this);
}
segment_vec_t segments;
segments.push_back(segmentp);
@@ -2756,7 +2750,7 @@ void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 hig
segment_vec_t segments;
S32 segment_start = old_length;
- S32 segment_end = old_length + wide_text.size();
+ S32 segment_end = old_length + static_cast(wide_text.size());
LLStyleConstSP sp(new LLStyle(style_params));
if (underline_on_hover_only || mSkipLinkUnderline)
{
@@ -2847,7 +2841,7 @@ void LLTextBase::replaceUrl(const std::string &url,
S32 start = seg->getStart();
S32 end = seg->getEnd();
text = text.substr(0, start) + wlabel + text.substr(end, text.size() - end + 1);
- seg->setEnd(start + wlabel.size());
+ seg->setEnd(start + static_cast(wlabel.size()));
modified = true;
}
@@ -2878,8 +2872,8 @@ void LLTextBase::replaceUrl(const std::string &url,
//deselect();
// Make sure we're still within limits
S32 text_length = getLength();
- mSelectionStart = llmin(mSelectionStart, text_length);
- mSelectionEnd = llmin(mSelectionEnd, text_length);
+ mSelectionStart = llmin(mSelectionStart, static_cast(text_length));
+ mSelectionEnd = llmin(mSelectionEnd, static_cast(text_length));
//
setCursorPos(mCursorPos);
needsReflow();
@@ -3230,7 +3224,7 @@ void LLTextBase::refreshHighlights()
for (std::list >::const_iterator itRange = highlightRanges.begin(); itRange != highlightRanges.end(); ++itRange)
{
S32 idxStart = itRange->begin() - wstrText.begin();
- mHighlights.push_back(range_pair_t(idxStart, idxStart + itRange->size()));
+ mHighlights.emplace_back(range_pair_t(idxStart, idxStart + static_cast(itRange->size())));
}
}
mHighlightsDirty = false;
@@ -3255,7 +3249,7 @@ bool LLTextBase::setCursor(S32 row, S32 column)
{
if (row < 0 || column < 0) return false;
- S32 n_lines = mLineInfoList.size();
+ S32 n_lines = static_cast(mLineInfoList.size());
for (S32 line = row; line < n_lines; ++line)
{
const line_info& li = mLineInfoList[line];
@@ -3903,8 +3897,8 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
// Prevent unnecessary calculations
- //S32 offsetLength = text.length() - (segment_offset + mStart);
- S32 offsetLength = text.length() - start_offset;
+ //S32 offsetLength = static_cast(text.length()) - (segment_offset + mStart);
+ S32 offsetLength = static_cast(text.length()) - start_offset;
//if(getLength() < segment_offset + mStart)
if(getLength() < start_offset)
@@ -3951,9 +3945,9 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
void LLNormalTextSegment::dump() const
{
LL_INFOS() << "Segment [" <<
-// mColor.mV[VX] << ", " <<
-// mColor.mV[VY] << ", " <<
-// mColor.mV[VZ] << "]\t[" <<
+// mColor.mV[VRED] << ", " <<
+// mColor.mV[VGREEN] << ", " <<
+// mColor.mV[VBLUE] << "]\t[" <<
mStart << ", " <<
getEnd() << "]" <<
LL_ENDL;
@@ -3989,7 +3983,7 @@ const LLWString& LLLabelTextSegment::getWText() const
/*virtual*/
const S32 LLLabelTextSegment::getLength() const
{
- return mEditor.getWlabel().length();
+ return static_cast(mEditor.getWlabel().length());
}
//
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 292f8f19fb..a195e27852 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -481,8 +481,8 @@ public:
// force reflow of text
void needsReflow(S32 index = 0);
- S32 getLength() const { return getWText().length(); }
- S32 getLineCount() const { return mLineInfoList.size(); }
+ S32 getLength() const { return static_cast(getWText().length()); }
+ S32 getLineCount() const { return static_cast(mLineInfoList.size()); }
S32 removeFirstLine(); // returns removed length
void addDocumentChild(LLView* view);
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 997a721937..2dcc57c0ed 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -98,13 +98,13 @@ public:
}
virtual S32 undo( LLTextBase* editor )
{
- remove(editor, getPosition(), mWString.length() );
+ remove(editor, getPosition(), static_cast(mWString.length()));
return getPosition();
}
virtual S32 redo( LLTextBase* editor )
{
- insert(editor, getPosition(), mWString );
- return getPosition() + mWString.length();
+ insert(editor, getPosition(), mWString);
+ return getPosition() + static_cast(mWString.length());
}
private:
@@ -151,13 +151,13 @@ public:
}
virtual S32 undo( LLTextBase* editor )
{
- remove(editor, getPosition(), mWString.length() );
+ remove(editor, getPosition(), static_cast(mWString.length()));
return getPosition();
}
virtual S32 redo( LLTextBase* editor )
{
- insert(editor, getPosition(), mWString );
- return getPosition() + mWString.length();
+ insert(editor, getPosition(), mWString);
+ return getPosition() + static_cast(mWString.length());
}
private:
@@ -216,7 +216,7 @@ public:
virtual S32 undo( LLTextBase* editor )
{
insert(editor, getPosition(), mWString);
- return getPosition() + mWString.length();
+ return getPosition() + static_cast(mWString.length());
}
virtual S32 redo( LLTextBase* editor )
{
@@ -379,7 +379,7 @@ void LLTextEditor::selectNext(const std::string& search_text_in, bool case_insen
if (selected_text == search_text)
{
// // We already have this word selected, we are searching for the next.
-// setCursorPos(mCursorPos + search_text.size());
+// setCursorPos(mCursorPos + static_cast(search_text.size()));
// [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-10-29 (Catznip-2.3.0a) | Added: Catznip-2.3.0a
if (search_up)
{
@@ -389,23 +389,23 @@ void LLTextEditor::selectNext(const std::string& search_text_in, bool case_insen
else
{
// We already have this word selected, we are searching for the next.
- setCursorPos(mCursorPos + search_text.size());
+ setCursorPos(mCursorPos + static_cast(search_text.size()));
}
// [/SL:KB]
}
}
-// S32 loc = text.find(search_text,mCursorPos);
+// S32 loc = static_cast(text.find(search_text,mCursorPos));
// [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-10-29 (Catznip-2.3.0a) | Added: Catznip-2.3.0a
- S32 loc = (search_up) ? text.rfind(search_text, llmax(0, mCursorPos - (S32)search_text.size())) : text.find(search_text,mCursorPos);
+ S32 loc = (search_up) ? static_cast(text.rfind(search_text, llmax(0, mCursorPos - (S32)search_text.size()))) : static_cast(text.find(search_text,mCursorPos));
// [/SL:KB]
// If Maybe we wrapped, search again
if (wrap && (-1 == loc))
{
-// loc = text.find(search_text);
+// loc = static_cast(text.find(search_text));
// [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-10-29 (Catznip-2.3.0a) | Added: Catznip-2.3.0a
- loc = (search_up) ? text.rfind(search_text) : text.find(search_text);
+ loc = (search_up) ? static_cast(text.rfind(search_text)) : static_cast(text.find(search_text));
// [/SL:KB]
}
@@ -1678,8 +1678,8 @@ void LLTextEditor::cleanStringForPaste(LLWString & clean_string)
if( mAllowEmbeddedItems )
{
const llwchar LF = 10;
- S32 len = clean_string.length();
- for( S32 i = 0; i < len; i++ )
+ auto len = clean_string.length();
+ for( size_t i = 0; i < len; i++ )
{
llwchar wc = clean_string[i];
if( (wc < LLFontFreetype::FIRST_CHAR) && (wc != LF) )
@@ -2692,7 +2692,7 @@ void LLTextEditor::appendWidget(const LLInlineViewSegment::Params& params, const
LLWString widget_wide_text = utf8str_to_wstring(text);
- LLTextSegmentPtr segment = new LLInlineViewSegment(params, old_length, old_length + widget_wide_text.size());
+ LLTextSegmentPtr segment = new LLInlineViewSegment(params, old_length, old_length + static_cast(widget_wide_text.size()));
insert(getLength(), widget_wide_text, false, segment);
// Set the cursor and scroll position
@@ -3048,7 +3048,7 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string,
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode())
{
mPreeditOverwrittenWString = getWText().substr(insert_preedit_at, mPreeditWString.length());
- removeStringNoUndo(insert_preedit_at, mPreeditWString.length());
+ removeStringNoUndo(insert_preedit_at, static_cast(mPreeditWString.length()));
}
else
{
diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp
index 8e2bfe6ac2..097b168106 100644
--- a/indra/llui/lltextparser.cpp
+++ b/indra/llui/lltextparser.cpp
@@ -73,11 +73,11 @@ S32 LLTextParser::findPattern(const std::string &text, LLSD highlight)
found = (! ltext.find(pattern) ? 0 : std::string::npos);
break;
case ENDS_WITH:
- S32 pos = ltext.rfind(pattern);
- if (pos >= 0 && (ltext.length()-pattern.length()==pos)) found = pos;
+ auto pos = ltext.rfind(pattern);
+ if (pos != std::string::npos && pos >= 0 && (ltext.length() - pattern.length() == pos)) found = pos;
break;
}
- return found;
+ return static_cast(found);
}
LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLColor4 &color, EHighlightPosition part, S32 index)
@@ -99,8 +99,8 @@ LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLC
S32 start = findPattern(text,mHighlights[i]);
if (start >= 0 )
{
- S32 end = std::string(mHighlights[i]["pattern"]).length();
- S32 len = text.length();
+ auto end = std::string(mHighlights[i]["pattern"]).length();
+ auto len = text.length();
EHighlightPosition newpart;
if (start==0)
{
diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp
index 9e27ed6232..9a087d8230 100644
--- a/indra/llui/lltextvalidate.cpp
+++ b/indra/llui/lltextvalidate.cpp
@@ -1,25 +1,25 @@
-/**
+/**
* @file lltextvalidate.cpp
* @brief Text validation helper functions
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -73,7 +73,7 @@ class ValidatorFloat : public ValidatorImpl
std::basic_string trimmed = str;
LLStringUtilBase::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
// May be a comma or period, depending on the locale
@@ -118,7 +118,7 @@ class ValidatorInt : public ValidatorImpl
std::basic_string trimmed = str;
LLStringUtilBase::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
S32 i = 0;
@@ -157,7 +157,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
std::basic_string trimmed = str;
LLStringUtilBase::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
CHAR ch = trimmed.front();
@@ -167,7 +167,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
return setError("Validator_ShouldNotBeMinusOrZero", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = trimmed[i];
if (!LLStringOps::isDigit(ch))
@@ -177,7 +177,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
}
}
- S32 val = strtol(trimmed);
+ auto val = strtol(trimmed);
if (val <= 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(trimmed)));
@@ -201,7 +201,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
std::basic_string trimmed = str;
LLStringUtilBase::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
CHAR ch = trimmed.front();
@@ -211,7 +211,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
return setError("Validator_ShouldNotBeMinus", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = trimmed[i];
if (!LLStringOps::isDigit(ch))
@@ -221,7 +221,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
}
}
- S32 val = strtol(trimmed);
+ auto val = strtol(trimmed);
if (val < 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(trimmed)));
@@ -244,7 +244,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
LLLocale locale(LLLocale::USER_LOCALE);
std::basic_string test_str = str;
- S32 len = test_str.length();
+ auto len = test_str.length();
if (0 < len)
{
CHAR ch = test_str.front();
@@ -254,7 +254,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
return setError("Validator_ShouldNotBeMinus", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = test_str[i];
if (!LLStringOps::isDigit(ch) || LLStringOps::isSpace(ch))
@@ -264,7 +264,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
}
}
- S32 val = strtol(test_str);
+ auto val = strtol(test_str);
if (val < 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(test_str)));
@@ -286,7 +286,7 @@ class ValidatorAlphaNum : public ValidatorImpl
{
LLLocale locale(LLLocale::USER_LOCALE);
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -313,7 +313,7 @@ class ValidatorAlphaNumSpace : public ValidatorImpl
{
LLLocale locale(LLLocale::USER_LOCALE);
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -341,7 +341,7 @@ class ValidatorASCIIPrintableNoPipe : public ValidatorImpl
template
bool validate(const std::basic_string& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -368,7 +368,7 @@ class ValidatorASCIIPrintableNoSpace : public ValidatorImpl
template
bool validate(const std::basic_string& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -395,7 +395,7 @@ protected:
template
bool validate(const std::basic_string& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -441,7 +441,7 @@ class ValidatorASCIIWithNewLine : public ValidatorImpl
template
bool validate(const std::basic_string& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
diff --git a/indra/llui/lltextvalidate.h b/indra/llui/lltextvalidate.h
index 2c2941de7f..a4ff144d82 100644
--- a/indra/llui/lltextvalidate.h
+++ b/indra/llui/lltextvalidate.h
@@ -1,4 +1,4 @@
-/**
+/**
* @file lltextbase.h
* @author Martin Reddy
* @brief The base class of text box/editor, providing Url handling support
@@ -6,21 +6,21 @@
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp
index f1bf60d262..e2e735b131 100644
--- a/indra/llui/lltimectrl.cpp
+++ b/indra/llui/lltimectrl.cpp
@@ -343,7 +343,7 @@ LLTimeCtrl::EEditingPart LLTimeCtrl::getEditingPart()
S32 cur_pos = mEditor->getCursor();
std::string time_str = mEditor->getText();
- S32 colon_index = time_str.find_first_of(':');
+ auto colon_index = time_str.find_first_of(':');
if (cur_pos <= colon_index)
{
@@ -376,7 +376,7 @@ std::string LLTimeCtrl::getMinutesString(const std::string& str)
size_t colon_index = str.find_first_of(':');
++colon_index;
- int minutes_len = str.length() - colon_index - AMPM_LEN;
+ auto minutes_len = str.length() - colon_index - AMPM_LEN;
std::string minutes_str = str.substr(colon_index, minutes_len);
return minutes_str;
@@ -411,7 +411,7 @@ bool LLTimeCtrl::isMinutesStringValid(const std::string& str)
// static
bool LLTimeCtrl::isPMAMStringValid(const std::string& str)
{
- S32 len = str.length();
+ auto len = str.length();
bool valid = (str[--len] == 'M') && (str[--len] == 'P' || str[len] == 'A');
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 69d135953f..c1e14c9d15 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -775,7 +775,7 @@ void LLToolBar::updateLayoutAsNeeded()
{
if (mButtons.size())
{
- equalized_width = (full_screen_width - mPadBetween * (mButtons.size() + 1)) / mButtons.size();
+ equalized_width = (full_screen_width - mPadBetween * (static_cast(mButtons.size()) + 1)) / static_cast(mButtons.size());
}
}
else if (mLayoutStyle == LAYOUT_STYLE_EQUALIZE)
@@ -789,7 +789,7 @@ void LLToolBar::updateLayoutAsNeeded()
}
}
- S32 total_button_width = mButtons.size() * equalized_width + (mButtons.size() + 1) * mPadBetween;
+ S32 total_button_width = static_cast(mButtons.size()) * equalized_width + (static_cast(mButtons.size()) + 1) * mPadBetween;
if (mMaxRows > 0 && orientation == LLLayoutStack::HORIZONTAL && total_button_width > full_screen_width)
{
S32 buttons_per_row = llceil((F32)mButtons.size() / (F32)mMaxRows);
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 8c277047e0..bee15cb1db 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -222,12 +222,12 @@ public:
protected:
friend class LLUICtrlFactory;
- LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params), mButtonPanel(NULL) {}
+ LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params) {};
private:
reshape_callback_t mReshapeCallback;
- LLToolBarEnums::EToolBarLocation mLocationId;
- LLPanel * mButtonPanel;
+ LLToolBarEnums::EToolBarLocation mLocationId{ LLToolBarEnums::EToolBarLocation::TOOLBAR_NONE };
+ LLPanel * mButtonPanel{ nullptr };
};
struct Params : public LLInitParam::Block
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index fa508091dd..e13800d658 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -243,7 +243,7 @@ public:
private:
- S32 mValue;
+ S32 mValue{ 0 };
};
//
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 2e1dddf409..f7cdd4a251 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -134,7 +134,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
// string_color_map_t::iterator color_value = mLoadedColors.find(previous->second);
- ColorName oName;
+ ColorName oName{};
oName.nLen = previous->second.size();
oName.pName = const_cast(previous->second.c_str()); // That's ok, I won't hurt you.
@@ -191,14 +191,12 @@ LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& defa
LLUIColor LLUIColorTable::getColor( char const *name, const LLColor4& default_color) const // Change from std::string to char*, avoind lots of unecessary string constructions
{
// Change from std::string to char*, avoind lots of unecessary string constructions
-
// string_color_map_t::const_iterator iter = mUserSetColors.find(name);
- ColorName oName;
- oName.nLen = strlen( name );
+ ColorName oName{};
+ oName.nLen = strlen(name);
oName.pName = const_cast(name);
string_color_map_t::const_iterator iter = mUserSetColors.find(oName);
-
//
if(iter != mUserSetColors.end())
@@ -207,10 +205,8 @@ LLUIColor LLUIColorTable::getColor( char const *name, const LLColor4& default_co
}
// Change from std::string to char*, avoind lots of unecessary string constructions
-
// iter = mLoadedColors.find(name);
iter = mLoadedColors.find(oName);
-
//
if(iter != mLoadedColors.end())
@@ -331,16 +327,14 @@ void LLUIColorTable::saveUserSettingsPaletteOnly() const
bool LLUIColorTable::colorExists( char const *name ) const
{
// Change from std::string to char*, avoind lots of unecessary string constructions
-
// return ((mLoadedColors.find(color_name) != mLoadedColors.end())
// || (mUserSetColors.find(color_name) != mUserSetColors.end()));
- ColorName oName;
- oName.nLen = strlen( name );
+ ColorName oName{};
+ oName.nLen = strlen(name);
oName.pName = const_cast(name);
return ((mLoadedColors.find(oName) != mLoadedColors.end())
|| (mUserSetColors.find(oName) != mUserSetColors.end()));
-
//
}
@@ -360,24 +354,22 @@ void LLUIColorTable::setColor(const std::string& name, const LLColor4& color, st
{
// Change from std::string to char*, avoind lots of unecessary string constructions
-
// string_color_map_t::iterator it = table.lower_bound(name);
- ColorName oName;
+ ColorName oName{};
oName.nLen = name.size();
- oName.pName = const_cast( name.c_str() );
+ oName.pName = const_cast(name.c_str());
string_color_map_t::iterator it = table.find(oName);
// if(it != table.end() && !(table.key_comp()(name, it->first)))
- if(it != table.end() )
-
+ if (it != table.end())
//
{
it->second = color;
}
else
{
- oName.pName = strdup( oName.pName );
+ oName.pName = strdup(oName.pName);
table.insert(string_color_map_t::value_type(oName, color));
}
}
diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h
index 4c6f25e044..459f2fb034 100644
--- a/indra/llui/lluicolortable.h
+++ b/indra/llui/lluicolortable.h
@@ -49,21 +49,19 @@ class LLUIColorTable : public LLSingleton
struct ColorName
{
- char *pName;
- int nLen;
+ char* pName;
+ size_t nLen;
- bool operator<( ColorName const &aRHS ) const
+ bool operator<(ColorName const &aRHS) const
{
- if( nLen == aRHS.nLen )
- return strcmp( pName, aRHS.pName ) < 0;
+ if (nLen == aRHS.nLen)
+ return strcmp(pName, aRHS.pName) < 0;
return nLen < aRHS.nLen;
}
};
typedef std::map string_color_map_t;
-
-
//
public:
diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h
index 42bf19da64..9f95f7e16e 100644
--- a/indra/llui/lluistring.h
+++ b/indra/llui/lluistring.h
@@ -79,7 +79,7 @@ public:
operator LLWString() const { return getUpdatedWResult(); }
bool empty() const { return getUpdatedResult().empty(); }
- S32 length() const { return getUpdatedWResult().size(); }
+ S32 length() const { return static_cast(getUpdatedWResult().size()); }
void clear();
void clearArgs() { if (mArgs) mArgs->clear(); }
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 575516debe..6e25446dd8 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -446,7 +446,7 @@ bool LLUrlEntryInvalidSLURL::isSLURLvalid(const std::string &url) const
LLURI uri(url);
LLSD path_array = uri.pathArray();
- S32 path_parts = path_array.size();
+ auto path_parts = path_array.size();
S32 x,y,z;
if (path_parts == actual_parts)
@@ -511,7 +511,7 @@ std::string LLUrlEntrySLURL::getLabel(const std::string &url, const LLUrlLabelCa
LLURI uri(url);
LLSD path_array = uri.pathArray();
- S32 path_parts = path_array.size();
+ auto path_parts = path_array.size();
if (path_parts == 5)
{
// handle slurl with (X,Y,Z) coordinates
@@ -1222,7 +1222,7 @@ LLUrlEntryParcel::~LLUrlEntryParcel()
std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
LLSD path_array = LLURI(url).pathArray();
- S32 path_parts = path_array.size();
+ auto path_parts = path_array.size();
if (path_parts < 3) // no parcel id
{
@@ -1313,7 +1313,7 @@ std::string LLUrlEntryPlace::getLabel(const std::string &url, const LLUrlLabelCa
LLURI uri(url);
std::string location = unescapeUrl(uri.hostName());
LLSD path_array = uri.pathArray();
- S32 path_parts = path_array.size();
+ auto path_parts = path_array.size();
if (path_parts == 3)
{
// handle slurl with (X,Y,Z) coordinates
@@ -1362,7 +1362,7 @@ std::string LLUrlEntryRegion::getLabel(const std::string &url, const LLUrlLabelC
//
LLSD path_array = LLURI(url).pathArray();
- S32 path_parts = path_array.size();
+ auto path_parts = path_array.size();
if (path_parts < 3) // no region name
{
@@ -1426,7 +1426,7 @@ std::string LLUrlEntryTeleport::getLabel(const std::string &url, const LLUrlLabe
//
LLURI uri(url);
LLSD path_array = uri.pathArray();
- S32 path_parts = path_array.size();
+ auto path_parts = path_array.size();
std::string host = uri.hostName();
std::string label = LLTrans::getString("SLurlLabelTeleport");
if (!host.empty())
@@ -1600,7 +1600,7 @@ std::string LLUrlEntryWorldMap::getLabel(const std::string &url, const LLUrlLabe
//
LLURI uri(url);
LLSD path_array = uri.pathArray();
- S32 path_parts = path_array.size();
+ auto path_parts = path_array.size();
if (path_parts < 3)
{
return url;
@@ -1730,10 +1730,7 @@ LLUrlEntryEmail::LLUrlEntryEmail()
std::string LLUrlEntryEmail::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
- // Fix type
- //int pos = url.find("mailto:");
- size_t pos = url.find("mailto:");
- //
+ auto pos = url.find("mailto:");
if (pos == std::string::npos)
{
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index b1ed4782b0..a3247b5e6d 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -351,9 +351,9 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
{
return false;
}
- S32 end = start + wurl.size() - 1;
+ auto end = start + wurl.size() - 1;
- match.setValues(start, end, match.getUrl(),
+ match.setValues(static_cast(start), static_cast(end), match.getUrl(),
match.getLabel(),
match.getQuery(),
match.getTooltip(),
diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h
index e749e1ab57..9e752e8090 100644
--- a/indra/llui/llviewereventrecorder.h
+++ b/indra/llui/llviewereventrecorder.h
@@ -3,22 +3,22 @@
* @brief Viewer event recording and playback support for mouse and keyboard events
*
* $LicenseInfo:firstyear=2013&license=viewerlgpl$
- *
+ *
* Copyright (c) 2013, Linden Research, Inc.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -27,10 +27,10 @@
#define LL_VIEWER_EVENT_RECORDER
-#include "linden_common.h"
+#include "linden_common.h"
-#include "lldir.h"
-#include "llsd.h"
+#include "lldir.h"
+#include "llsd.h"
#include "llfile.h"
#include "lldate.h"
#include "llsdserialize.h"
@@ -46,7 +46,7 @@ class LLViewerEventRecorder : public LLSimpleton
public:
LLViewerEventRecorder();
~LLViewerEventRecorder();
-
+
void updateMouseEventInfo(S32 local_x,S32 local_y, S32 global_x, S32 global_y, std::string mName);
void setMouseLocalCoords(S32 x,S32 y);
void setMouseGlobalCoords(S32 x,S32 y);
@@ -75,12 +75,12 @@ public:
bool logEvents;
std::string mLogFilename;
- llofstream mLog;
+ llofstream mLog;
private:
- // Mouse event info
+ // Mouse event info
S32 global_x;
S32 global_y;
S32 local_x;
@@ -92,7 +92,7 @@ public:
// Actually write the event out to llsd log file
void recordEvent(LLSD event);
- void clear(S32 r);
+ void clear(S32 r);
static const S32 UNDEFINED=-1;
};
diff --git a/indra/llui/llxyvector.cpp b/indra/llui/llxyvector.cpp
index 40f3fe83d9..82f51c1f9e 100644
--- a/indra/llui/llxyvector.cpp
+++ b/indra/llui/llxyvector.cpp
@@ -25,7 +25,7 @@
* $/LicenseInfo$
*/
-// A control that allows to set two related vector magnitudes by manipulating a single vector on a plane.
+// A control that allows to set two related vector magnitudes by manipulating a single vector on a plane.
#include "linden_common.h"
@@ -158,7 +158,7 @@ void drawArrow(S32 tailX, S32 tailY, S32 tipX, S32 tipY, LLColor4 color)
S32 dy = tipY - tailY;
S32 arrowLength = (abs(dx) < ARROW_LENGTH_LONG && abs(dy) < ARROW_LENGTH_LONG) ? ARROW_LENGTH_SHORT : ARROW_LENGTH_LONG;
-
+
F32 theta = std::atan2(dy, dx);
F32 rad = ARROW_ANGLE * std::atan(1) * 4 / 180;
diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp
index 2e40d6c380..d63894c30c 100644
--- a/indra/llwindow/lldxhardware.cpp
+++ b/indra/llwindow/lldxhardware.cpp
@@ -253,7 +253,7 @@ HRESULT GetVideoMemoryViaWMI(WCHAR* strInputDeviceID, DWORD* pdwAdapterRam)
}
//static
-S32 LLDXHardware::getMBVideoMemoryViaWMI()
+U32 LLDXHardware::getMBVideoMemoryViaWMI()
{
DWORD vram = 0;
if (SUCCEEDED(GetVideoMemoryViaWMI(NULL, &vram)))
@@ -491,10 +491,10 @@ void get_wstring(IDxDiagContainer* containerp, WCHAR* wszPropName, WCHAR* wszPro
switch( var.vt )
{
case VT_UI4:
- swprintf( wszPropValue, L"%d", var.ulVal ); /* Flawfinder: ignore */
+ swprintf( wszPropValue, outputSize, L"%d", var.ulVal ); /* Flawfinder: ignore */
break;
case VT_I4:
- swprintf( wszPropValue, L"%d", var.lVal ); /* Flawfinder: ignore */
+ swprintf( wszPropValue, outputSize, L"%d", var.lVal ); /* Flawfinder: ignore */
break;
case VT_BOOL:
wcscpy( wszPropValue, (var.boolVal) ? L"true" : L"false" ); /* Flawfinder: ignore */
diff --git a/indra/llwindow/lldxhardware.h b/indra/llwindow/lldxhardware.h
index e3c1726663..0baf4e83d2 100644
--- a/indra/llwindow/lldxhardware.h
+++ b/indra/llwindow/lldxhardware.h
@@ -107,7 +107,7 @@ public:
// Will get memory of best GPU in MB, return memory on sucsess, 0 on failure
// Note: WMI is not accurate in some cases
- static S32 getMBVideoMemoryViaWMI();
+ static U32 getMBVideoMemoryViaWMI();
// Find a particular device that matches the following specs.
// Empty strings indicate that you don't care.
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 73f09bca25..776feae5a9 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -447,7 +447,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
mMaxCores = llmin(mMaxCores, (U32) 64);
DWORD_PTR mask = 0;
- for (int i = 0; i < mMaxCores; ++i)
+ for (U32 i = 0; i < mMaxCores; ++i)
{
mask |= ((DWORD_PTR) 1) << i;
}
@@ -3706,13 +3706,13 @@ void LLSplashScreenWin32::updateImpl(const std::string& mesg)
{
if (!mWindow) return;
- int output_str_len = MultiByteToWideChar(CP_UTF8, 0, mesg.c_str(), mesg.length(), NULL, 0);
+ int output_str_len = MultiByteToWideChar(CP_UTF8, 0, mesg.c_str(), static_cast(mesg.length()), NULL, 0);
if( output_str_len>1024 )
return;
WCHAR w_mesg[1025];//big enought to keep null terminatos
- MultiByteToWideChar (CP_UTF8, 0, mesg.c_str(), mesg.length(), w_mesg, output_str_len);
+ MultiByteToWideChar (CP_UTF8, 0, mesg.c_str(), static_cast(mesg.length()), w_mesg, output_str_len);
//looks like MultiByteToWideChar didn't add null terminator to converted string, see EXT-4858
w_mesg[output_str_len] = 0;
@@ -4116,14 +4116,14 @@ U32 LLWindowWin32::fillReconvertString(const LLWString &text,
S32 focus, S32 focus_length, RECONVERTSTRING *reconvert_string)
{
const llutf16string text_utf16 = wstring_to_utf16str(text);
- const DWORD required_size = sizeof(RECONVERTSTRING) + (text_utf16.length() + 1) * sizeof(WCHAR);
+ const DWORD required_size = sizeof(RECONVERTSTRING) + (static_cast(text_utf16.length()) + 1) * sizeof(WCHAR);
if (reconvert_string && reconvert_string->dwSize >= required_size)
{
const DWORD focus_utf16_at = wstring_utf16_length(text, 0, focus);
const DWORD focus_utf16_length = wstring_utf16_length(text, focus, focus_length);
reconvert_string->dwVersion = 0;
- reconvert_string->dwStrLen = text_utf16.length();
+ reconvert_string->dwStrLen = static_cast(text_utf16.length());
reconvert_string->dwStrOffset = sizeof(RECONVERTSTRING);
reconvert_string->dwCompStrLen = focus_utf16_length;
reconvert_string->dwCompStrOffset = focus_utf16_at * sizeof(WCHAR);
@@ -4286,7 +4286,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes)
}
}
- S32 caret_position = preedit_string.length();
+ S32 caret_position = static_cast(preedit_string.length());
if (indexes & GCS_CURSORPOS)
{
const S32 caret_position_utf16 = LLWinImm::getCompositionString(himc, GCS_CURSORPOS, NULL, 0);
@@ -4332,7 +4332,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes)
{
if (preedit_segment_lengths.size() == 0)
{
- preedit_segment_lengths.assign(1, preedit_string.length());
+ preedit_segment_lengths.assign(1, static_cast(preedit_string.length()));
}
if (preedit_standouts.size() == 0)
{
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 33786f9b1b..49d5e89c47 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -670,7 +670,7 @@ bool LLXMLNode::parseFile(const std::string& filename, LLXMLNodePtr& node, LLXML
buffer[nread] = 0;
fclose(fp);
- bool rv = parseBuffer(buffer, nread, node, defaults_tree);
+ bool rv = parseBuffer(buffer, static_cast(nread), node, defaults_tree);
delete [] buffer;
return rv;
}
@@ -2719,7 +2719,7 @@ U32 LLXMLNode::getChildCount() const
{
if (mChildren.notNull())
{
- return mChildren->map.size();
+ return static_cast(mChildren->map.size());
}
return 0;
}
@@ -2738,7 +2738,7 @@ LLXMLNode *get_rand_node(LLXMLNode *node)
{
if (node->mChildren.notNull())
{
- U32 num_children = node->mChildren->map.size();
+ U32 num_children = static_cast(node->mChildren->map.size());
if (get_rand(2) == 0)
{
while (true)
diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp
index f5ac9555e9..81911bb0db 100644
--- a/indra/llxml/llxmltree.cpp
+++ b/indra/llxml/llxmltree.cpp
@@ -565,7 +565,7 @@ bool LLXmlTreeParser::parseString(const std::string &string, LLXmlTreeNode** roo
mKeepContents = keep_contents;
- bool success = LLXmlParser::parse(string.c_str(), string.length(), true);
+ bool success = LLXmlParser::parse(string.c_str(), static_cast(string.length()), 1);
*root = mRoot;
mRoot = NULL;
diff --git a/indra/newview/ao.cpp b/indra/newview/ao.cpp
index 6b28803145..d398c73afe 100644
--- a/indra/newview/ao.cpp
+++ b/indra/newview/ao.cpp
@@ -193,8 +193,8 @@ void FloaterAO::updateList()
}
}
- mSetSelector->selectNthItem(selected_index);
- mSetSelectorSmall->selectNthItem(selected_index);
+ mSetSelector->selectNthItem(static_cast(selected_index));
+ mSetSelectorSmall->selectNthItem(static_cast(selected_index));
enableSetControls(true);
if (mSetSelector->getSelectedItemLabel().empty())
diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp
index e9f8ca527e..6e58399e17 100644
--- a/indra/newview/aoengine.cpp
+++ b/indra/newview/aoengine.cpp
@@ -896,7 +896,7 @@ void AOEngine::cycle(eCycleMode cycleMode)
{
if (state->mCurrentAnimation == 0)
{
- state->mCurrentAnimation = state->mAnimations.size() - 1;
+ state->mCurrentAnimation = static_cast(state->mAnimations.size()) - 1;
}
else
{
@@ -1044,7 +1044,7 @@ void AOEngine::addAnimation(const AOSet* set, AOSet::AOState* state, const LLInv
anim.mInventoryUUID = item->getUUID();
anim.mOriginalUUID = item->getLinkedUUID();
anim.mName = item->getName();
- anim.mSortOrder = state->mAnimations.size() + 1;
+ anim.mSortOrder = static_cast(state->mAnimations.size()) + 1;
state->mAnimations.emplace_back(std::move(anim));
bool wasProtected = gSavedPerAccountSettings.getBOOL("LockAOFolders");
@@ -1118,11 +1118,11 @@ bool AOEngine::findForeignItems(const LLUUID& uuid) const
if (items)
{
- for (S32 index = items->size() - 1; index >= 0; --index)
+ for (S32 index = static_cast(items->size()) - 1; index >= 0; --index)
{
- bool move = false;
+ bool move{ false };
- LLPointer item = items->at(index);
+ const LLPointer& item = items->at(index);
if (item->getIsLinkType())
{
if (item->getInventoryType() != LLInventoryType::IT_ANIMATION)
@@ -2263,7 +2263,7 @@ void AOEngine::processImport(bool from_timer)
LL_DEBUGS("AOEngine") << "new_cat_id: " << new_cat_id << LL_ENDL;
state->mInventoryUUID = new_cat_id;
- S32 animationIndex = state->mAnimations.size() - 1;
+ S32 animationIndex = static_cast(state->mAnimations.size()) - 1;
while (!state->mAnimations.empty())
{
LL_DEBUGS("AOEngine") << "linking animation " << state->mAnimations[animationIndex].mName << LL_ENDL;
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c7473deeeb..7191028a3c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -16838,7 +16838,7 @@ Change of this parameter will affect the layout of buttons in notification toast
Persist
1
Type
- S32
+ U32
Value
8
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index 8627ab1852..d7d98477c0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file blurLightF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -42,16 +42,16 @@ in vec2 vary_fragcoord;
vec4 getPosition(vec2 pos_screen);
vec4 getNorm(vec2 pos_screen);
-void main()
+void main()
{
vec2 tc = vary_fragcoord.xy;
vec4 norm = getNorm(tc);
vec3 pos = getPosition(tc).xyz;
vec4 ccol = texture(lightMap, tc).rgba;
-
+
vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy);
dlt /= max(-pos.z*dist_factor, 1.0);
-
+
vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free'
vec4 col = defined_weight.xyxx * ccol;
@@ -75,15 +75,15 @@ void main()
k[1] = (k[0]+k[2])*0.5f;
k[3] = (k[2]+k[4])*0.5f;
k[5] = (k[4]+k[6])*0.5f;
-
+
for (int i = 1; i < 7; i++)
{
vec2 samptc = tc + k[i].z*dlt*2.0;
samptc /= screen_res;
- vec3 samppos = getPosition(samptc).xyz;
+ vec3 samppos = getPosition(samptc).xyz;
float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
-
+
if (d*d <= pointplanedist_tolerance_pow2)
{
col += texture(lightMap, samptc)*k[i].xyxx;
@@ -95,10 +95,10 @@ void main()
{
vec2 samptc = tc - k[i].z*dlt*2.0;
samptc /= screen_res;
- vec3 samppos = getPosition(samptc).xyz;
+ vec3 samppos = getPosition(samptc).xyz;
float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
-
+
if (d*d <= pointplanedist_tolerance_pow2)
{
col += texture(lightMap, samptc)*k[i].xyxx;
@@ -108,7 +108,7 @@ void main()
col /= defined_weight.xyxx;
//col.y *= col.y;
-
+
frag_color = max(col, vec4(0));
#ifdef IS_AMD_CARD
diff --git a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
index eff7221ae7..67890032df 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
@@ -1,28 +1,28 @@
-/**
+/**
* @file exposureF.glsl
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
@@ -43,7 +43,7 @@ float lum(vec3 col)
return dot(l, col);
}
-void main()
+void main()
{
vec2 tc = vec2(0.5,0.5);
@@ -53,13 +53,13 @@ void main()
L /= max_L;
L = pow(L, 2.0);
float s = mix(dynamic_exposure_params.z, dynamic_exposure_params.y, L);
-
+
#ifdef USE_LAST_EXPOSURE
float prev = texture(exposureMap, vec2(0.5,0.5)).r;
s = mix(prev, s, min(dt*2.0*abs(prev-s), 0.04));
#endif
-
+
frag_color = max(vec4(s, s, s, dt), vec4(0.0));
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 52dfed06ae..2b9cc6ae5a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -1,28 +1,28 @@
-/**
+/**
* @file deferred/fullbrightF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
@@ -52,7 +52,7 @@ vec4 applySkyAndWaterFog(vec3 pos, vec3 additive, vec3 atten, vec4 color);
void mirrorClip(vec3 pos);
-void main()
+void main()
{
mirrorClip(vary_position);
#ifdef IS_ALPHA
@@ -90,7 +90,7 @@ void main()
calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten);
color.rgb = applySkyAndWaterFog(pos, additive, atten, color).rgb;
-
+
#endif
#endif
diff --git a/indra/newview/app_settings/shaders/class1/deferred/globalF.glsl b/indra/newview/app_settings/shaders/class1/deferred/globalF.glsl
index 7e3e7d9271..a1b7a4b11f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/globalF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/globalF.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file class1/deferred/globalF.glsl
*
* $LicenseInfo:firstyear=2024&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2024, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
index 95b2f80e06..3432bf07ef 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
@@ -1,32 +1,32 @@
-/**
+/**
* @file luminanceF.glsl
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
/*[EXTRA_CODE_HERE]*/
-// take a luminance sample of diffuseRect and emissiveRect
+// take a luminance sample of diffuseRect and emissiveRect
out vec4 frag_color;
@@ -43,12 +43,12 @@ float lum(vec3 col)
return dot(l, col);
}
-void main()
+void main()
{
vec2 tc = vary_fragcoord*0.6+0.2;
tc.y -= 0.1; // HACK - nudge exposure sample down a little bit to favor ground over sky
vec3 c = texture(diffuseRect, tc).rgb;
-
+
vec4 norm = texture(normalMap, tc);
if (!GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_HDRI) &&
diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
index 6ef556d7e8..585de99e1d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
@@ -1,28 +1,28 @@
-/**
+/**
* @file class1\deferred\moonF.glsl
*
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2005, 2020 Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
/*[EXTRA_CODE_HERE]*/
out vec4 frag_data[4];
@@ -34,7 +34,7 @@ uniform sampler2D diffuseMap;
in vec2 vary_texcoord0;
-void main()
+void main()
{
// Restore Pre-EEP alpha fade moon near horizon
float fade = 1.0;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
index 35b7602569..07a2218db2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file pbrShadowAlphaMaskF.glsl
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -33,7 +33,7 @@ in vec4 vertex_color;
in vec2 vary_texcoord0;
uniform float minimum_alpha;
-void main()
+void main()
{
float alpha = texture(diffuseMap,vary_texcoord0.xy).a * vertex_color.a;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
index 380d493636..b521081af9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file pbropaqueF.glsl
*
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2022, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -28,7 +28,7 @@
#ifndef IS_HUD
-// deferred opaque implementation
+// deferred opaque implementation
uniform sampler2D diffuseMap; //always in sRGB space
@@ -85,7 +85,7 @@ void main()
float sign = vary_sign;
vec3 vN = vary_normal;
vec3 vT = vary_tangent.xyz;
-
+
vec3 vB = sign * cross(vN, vT);
vec3 tnorm = normalize( vNt.x * vT + vNt.y * vB + vNt.z * vN );
@@ -95,7 +95,7 @@ void main()
// roughness 0.0
// metal 0.0
vec3 spec = texture(specularMap, metallic_roughness_texcoord.xy).rgb;
-
+
spec.g *= roughnessFactor;
spec.b *= metallicFactor;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
index abb899a876..7c110c57f2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file class1\deferred\terrainF.glsl
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -378,7 +378,7 @@ void main()
vec3 tnorm = vary_normal;
#endif
tnorm *= gl_FrontFacing ? 1.0 : -1.0;
-
+
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_EMISSIVE)
#define mix_emissive pbr_mix.emissive
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl
index 7a7fd783ec..1ae9efe544 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file class1\deferred\pbrterrainUtilF.glsl
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -374,7 +374,7 @@ PBRMix terrain_sample_pbr(
default:
break;
}
-
+
return mix;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl
index 6791fe44d9..e77e972873 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl
@@ -25,7 +25,7 @@
// debug stub
-float random (vec2 uv)
+float random (vec2 uv)
{
return 0.f;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 785c748234..41e42b5173 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file class1/deferred/skyF.glsl
*
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2005, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -99,9 +99,9 @@ void main()
else
#endif
{
- // Potential Fill-rate optimization. Add cloud calculation
- // back in and output alpha of 0 (so that alpha culling kills
- // the fragment) if the sky wouldn't show up because the clouds
+ // Potential Fill-rate optimization. Add cloud calculation
+ // back in and output alpha of 0 (so that alpha culling kills
+ // the fragment) if the sky wouldn't show up because the clouds
// are fully opaque.
color = vary_HazeColor;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 24d2db2183..ea00d240df 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -102,7 +102,7 @@ void main()
// Initialize temp variables
vec3 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color * 0.7; //magic 0.7 to match legacy color
-
+
// Sunlight attenuation effect (hue and brightness) due to atmosphere
// this is used later for sunlight modulation at various altitudes
vec3 light_atten = (blue_density + vec3(haze_density * 0.25)) * (density_multiplier * max_y);
@@ -152,7 +152,7 @@ void main()
sunlight *= max(0.0, (1. - cloud_shadow));
// Haze color below cloud
- vec3 add_below_cloud = (blue_horizon * blue_weight * (sunlight + ambient)
+ vec3 add_below_cloud = (blue_horizon * blue_weight * (sunlight + ambient)
+ (haze_horizon * haze_weight) * (sunlight * haze_glow + ambient));
// Attenuate cloud color by atmosphere
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index 5c79fd7315..1fd31e0546 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -1,28 +1,28 @@
-/**
+/**
* @file class1\deferred\terrainF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
/*[EXTRA_CODE_HERE]*/
out vec4 frag_data[4];
@@ -44,7 +44,7 @@ void main()
{
mirrorClip(pos);
/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
-
+
vec4 color0 = texture(detail_0, vary_texcoord0.xy);
vec4 color1 = texture(detail_1, vary_texcoord0.xy);
vec4 color2 = texture(detail_2, vary_texcoord0.xy);
@@ -54,9 +54,9 @@ void main()
float alpha2 = texture(alpha_ramp,vary_texcoord1.xy).a;
float alphaFinal = texture(alpha_ramp, vary_texcoord1.zw).a;
vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
-
- outColor.a = 0.0; // yes, downstream atmospherics
-
+
+ outColor.a = 0.0; // yes, downstream atmospherics
+
frag_data[0] = max(outColor, vec4(0));
frag_data[1] = vec4(0.0,0.0,0.0,-1.0);
vec3 nvn = normalize(vary_normal);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
index b4ab7cd169..7fc0e98513 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file class1\environment\terrainV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -44,15 +44,15 @@ uniform vec4 object_plane_t;
vec2 texgen_object(vec4 vpos, mat4 mat, vec4 tp0, vec4 tp1)
{
vec4 tcoord;
-
+
tcoord.x = dot(vpos, tp0);
tcoord.y = dot(vpos, tp1);
tcoord.z = 0;
tcoord.w = 1;
- tcoord = mat * tcoord;
-
- return tcoord.xy;
+ tcoord = mat * tcoord;
+
+ return tcoord.xy;
}
void main()
@@ -65,12 +65,12 @@ void main()
pos = (modelview_matrix*pre_pos).xyz;
vary_normal = normalize(normal_matrix * normal);
-
+
// Transform and pass tex coords
vary_texcoord0.xy = texgen_object(vec4(position, 1.0), texture_matrix0, object_plane_s, object_plane_t);
-
+
vec4 t = vec4(texcoord1,0,1);
-
+
vary_texcoord0.zw = t.xy;
vary_texcoord1.xy = t.xy-vec2(2.0, 0.0);
vary_texcoord1.zw = t.xy-vec2(1.0, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl b/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl
index bf5d106dab..a70180c1b5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file class1/deferred/textureUtilV.glsl
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
diff --git a/indra/newview/app_settings/shaders/class1/interface/normaldebugG.glsl b/indra/newview/app_settings/shaders/class1/interface/normaldebugG.glsl
index 51d05cd507..50737d4742 100644
--- a/indra/newview/app_settings/shaders/class1/interface/normaldebugG.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/normaldebugG.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file normaldebugG.glsl
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
index d077670c96..55daa83750 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
@@ -57,9 +57,9 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
vec3 rel_pos_norm = normalize(rel_pos);
float rel_pos_len = length(rel_pos);
-
+
vec3 sunlight = (sun_up_factor == 1) ? sunlight_color: moonlight_color;
-
+
// sunlight attenuation effect (hue and brightness) due to atmosphere
// this is used later for sunlight modulation at various altitudes
vec3 light_atten = (blue_density + vec3(haze_density * 0.25)) * (density_multiplier * max_y);
@@ -119,7 +119,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
additive = (blue_horizon.rgb * blue_weight.rgb) * (cs + tmpAmbient.rgb) + (haze_horizon * haze_weight.rgb) * (cs * haze_glow + tmpAmbient.rgb);
// brightness of surface both sunlight and ambient
-
+
sunlit = sunlight.rgb;
amblit = tmpAmbient;
@@ -128,7 +128,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
vec3 srgb_to_linear(vec3 col);
-// provide a touch of lighting in the opposite direction of the sun light
+// provide a touch of lighting in the opposite direction of the sun light
// so areas in shadow don't lose all detail
float ambientLighting(vec3 norm, vec3 light_dir)
{
@@ -150,7 +150,7 @@ void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, ou
// (allows for mixing of light sources other than sunlight e.g. reflection probes)
sunlit *= sky_sunlight_scale;
amblit *= sky_ambient_scale;
-
+
amblit = srgb_to_linear(amblit);
amblit *= ambientLighting(norm, light_dir);
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index 1bd5f5a718..f6c75e6a9c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -1,24 +1,24 @@
-/**
+/**
* @file sunLightF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -41,7 +41,7 @@ vec4 getPosition(vec2 pos_screen);
float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen);
-void main()
+void main()
{
vec2 pos_screen = vary_fragcoord.xy;
vec4 pos = getPosition(pos_screen);
@@ -50,7 +50,7 @@ void main()
vec4 col;
col.r = sampleDirectionalShadow(pos.xyz, norm.xyz, pos_screen);
col.g = 1.0f;
- col.b = sampleSpotShadow(pos.xyz, norm.xyz, 0, pos_screen);
+ col.b = sampleSpotShadow(pos.xyz, norm.xyz, 0, pos_screen);
col.a = sampleSpotShadow(pos.xyz, norm.xyz, 1, pos_screen);
frag_color = clamp(col, vec4(0), vec4(1));
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index e0333b6044..3437ed4b4c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -1,27 +1,27 @@
-/**
+/**
* @file class2/deferred/sunLightSSAOF.glsl
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
@@ -38,7 +38,7 @@ float sampleDirectionalShadow(vec3 shadow_pos, vec3 norm, vec2 pos_screen);
float sampleSpotShadow(vec3 shadow_pos, vec3 norm, int index, vec2 pos_screen);
float calcAmbientOcclusion(vec4 pos, vec3 norm, vec2 pos_screen);
-void main()
+void main()
{
vec2 pos_screen = vary_fragcoord.xy;
vec4 pos = getPosition(pos_screen);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/hazeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/hazeF.glsl
index 4af57e3b80..87977eb28c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/hazeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/hazeF.glsl
@@ -67,16 +67,16 @@ void main()
calcAtmosphericVarsLinear(pos.xyz, norm.xyz, light_dir, sunlit, amblit, additive, atten);
vec3 sunlit_linear = srgb_to_linear(sunlit);
-
+
// mask off atmospherics below water (when camera is under water)
bool do_atmospherics = false;
-
+
if (dot(vec3(0), waterPlane.xyz) + waterPlane.w > 0.0 ||
dot(pos.xyz, waterPlane.xyz) + waterPlane.w > 0.0)
{
do_atmospherics = true;
}
-
+
vec3 irradiance = vec3(0);
vec3 radiance = vec3(0);
@@ -101,5 +101,5 @@ void main()
}
frag_color = max(vec4(color.rgb, alpha), vec4(0)); //output linear since local lights will be added to this shader's results
-
+
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
index edfd6cbced..ac3fec23f6 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
@@ -56,8 +56,8 @@ vec3 srgb_to_linear(vec3 c);
// Util
vec3 hue_to_rgb(float hue);
-vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
- float perceptualRoughness,
+vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
+ float perceptualRoughness,
float metallic,
vec3 n, // normal
vec3 v, // surface point to camera
@@ -91,7 +91,7 @@ void main()
float metallic = orm.b;
vec3 f0 = vec3(0.04);
vec3 baseColor = diffuse.rgb;
-
+
vec3 diffuseColor = baseColor.rgb*(vec3(1.0)-f0);
diffuseColor *= 1.0 - metallic;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
index 60be9f4407..e419525bd5 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
@@ -1,28 +1,28 @@
-/**
+/**
* @file class3\deferred\pointLightF.glsl
*
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2022, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
@@ -59,8 +59,8 @@ vec2 getScreenCoord(vec4 clip);
vec3 srgb_to_linear(vec3 c);
float getDepth(vec2 tc);
-vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
- float perceptualRoughness,
+vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
+ float perceptualRoughness,
float metallic,
vec3 n, // normal
vec3 v, // surface point to camera
@@ -93,13 +93,13 @@ void main()
if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
{
- vec3 colorEmissive = texture(emissiveRect, tc).rgb;
+ vec3 colorEmissive = texture(emissiveRect, tc).rgb;
vec3 orm = spec.rgb;
float perceptualRoughness = orm.g;
float metallic = orm.b;
vec3 f0 = vec3(0.04);
vec3 baseColor = diffuse.rgb;
-
+
vec3 diffuseColor = baseColor.rgb*(vec3(1.0)-f0);
diffuseColor *= 1.0 - metallic;
@@ -136,7 +136,7 @@ void main()
final_color += lit*scol*color.rgb*spec.rgb;
}
}
-
+
if (dot(final_color, final_color) <= 0.0)
{
discard;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
index 90c84cc428..5dfa196cf6 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
@@ -51,7 +51,7 @@ layout (std140) uniform ReflectionProbes
mat4 heroBox;
// list of bounding spheres for reflection probes sorted by distance to camera (closest first)
vec4 refSphere[MAX_REFMAP_COUNT];
- // extra parameters
+ // extra parameters
// x - irradiance scale
// y - radiance scale
// z - fade in
@@ -102,7 +102,7 @@ bool shouldSampleProbe(int i, vec3 pos)
if (refIndex[i].w < 0)
{
vec4 v = refBox[i] * vec4(pos, 1.0);
- if (abs(v.x) > 1 ||
+ if (abs(v.x) > 1 ||
abs(v.y) > 1 ||
abs(v.z) > 1)
{
@@ -229,7 +229,7 @@ void preProbeSample(vec3 pos)
}
}
count++;
-
+
++neighborIdx;
}
@@ -251,56 +251,56 @@ void preProbeSample(vec3 pos)
// original reference implementation:
/*
-bool intersect(const Ray &ray) const
-{
- float t0, t1; // solutions for t if the ray intersects
-#if 0
+bool intersect(const Ray &ray) const
+{
+ float t0, t1; // solutions for t if the ray intersects
+#if 0
// geometric solution
- Vec3f L = center - orig;
- float tca = L.dotProduct(dir);
+ Vec3f L = center - orig;
+ float tca = L.dotProduct(dir);
// if (tca < 0) return false;
- float d2 = L.dotProduct(L) - tca * tca;
- if (d2 > radius2) return false;
- float thc = sqrt(radius2 - d2);
- t0 = tca - thc;
- t1 = tca + thc;
-#else
+ float d2 = L.dotProduct(L) - tca * tca;
+ if (d2 > radius2) return false;
+ float thc = sqrt(radius2 - d2);
+ t0 = tca - thc;
+ t1 = tca + thc;
+#else
// analytic solution
- Vec3f L = orig - center;
- float a = dir.dotProduct(dir);
- float b = 2 * dir.dotProduct(L);
- float c = L.dotProduct(L) - radius2;
- if (!solveQuadratic(a, b, c, t0, t1)) return false;
-#endif
- if (t0 > t1) std::swap(t0, t1);
-
- if (t0 < 0) {
- t0 = t1; // if t0 is negative, let's use t1 instead
- if (t0 < 0) return false; // both t0 and t1 are negative
- }
-
- t = t0;
-
- return true;
+ Vec3f L = orig - center;
+ float a = dir.dotProduct(dir);
+ float b = 2 * dir.dotProduct(L);
+ float c = L.dotProduct(L) - radius2;
+ if (!solveQuadratic(a, b, c, t0, t1)) return false;
+#endif
+ if (t0 > t1) std::swap(t0, t1);
+
+ if (t0 < 0) {
+ t0 = t1; // if t0 is negative, let's use t1 instead
+ if (t0 < 0) return false; // both t0 and t1 are negative
+ }
+
+ t = t0;
+
+ return true;
} */
// adapted -- assume that origin is inside sphere, return intersection of ray with edge of sphere
vec3 sphereIntersect(vec3 origin, vec3 dir, vec3 center, float radius2)
-{
- float t0, t1; // solutions for t if the ray intersects
+{
+ float t0, t1; // solutions for t if the ray intersects
- vec3 L = center - origin;
+ vec3 L = center - origin;
float tca = dot(L,dir);
- float d2 = dot(L,L) - tca * tca;
+ float d2 = dot(L,L) - tca * tca;
+
+ float thc = sqrt(radius2 - d2);
+ t0 = tca - thc;
+ t1 = tca + thc;
- float thc = sqrt(radius2 - d2);
- t0 = tca - thc;
- t1 = tca + thc;
-
vec3 v = origin + dir * t1;
- return v;
-}
+ return v;
+}
void swap(inout float a, inout float b)
{
@@ -312,17 +312,17 @@ void swap(inout float a, inout float b)
// debug implementation, make no assumptions about origin
void sphereIntersectDebug(vec3 origin, vec3 dir, vec3 center, float radius2, float depth, inout vec4 col)
{
- float t[2]; // solutions for t if the ray intersects
+ float t[2]; // solutions for t if the ray intersects
// geometric solution
- vec3 L = center - origin;
+ vec3 L = center - origin;
float tca = dot(L, dir);
// if (tca < 0) return false;
- float d2 = dot(L, L) - tca * tca;
- if (d2 > radius2) return;
- float thc = sqrt(radius2 - d2);
- t[0] = tca - thc;
- t[1] = tca + thc;
+ float d2 = dot(L, L) - tca * tca;
+ if (d2 > radius2) return;
+ float thc = sqrt(radius2 - d2);
+ t[0] = tca - thc;
+ t[1] = tca + thc;
for (int i = 0; i < 2; ++i)
{
@@ -411,8 +411,8 @@ void debugBoxCol(vec3 ro, vec3 rd, float t, vec3 p, inout vec4 col)
bool behind = dot(v,v) > dot(pos,pos);
float w = 0.25;
-
- if (behind)
+
+ if (behind)
{
w *= 0.5;
w /= (length(v)-length(pos))*0.5+1.0;
@@ -426,7 +426,7 @@ void debugBoxCol(vec3 ro, vec3 rd, float t, vec3 p, inout vec4 col)
// cribbed from https://iquilezles.org/articles/intersectors/
// axis aligned box centered at the origin, with size boxSize
-void boxIntersectionDebug( in vec3 ro, in vec3 p, vec3 boxSize, inout vec4 col)
+void boxIntersectionDebug( in vec3 ro, in vec3 p, vec3 boxSize, inout vec4 col)
{
vec3 rd = normalize(p-ro);
@@ -453,7 +453,7 @@ void boxIntersectionDebug( in vec3 ro, in vec3 p, vec3 boxSize, inout vec4 col)
void boxIntersectDebug(vec3 origin, vec3 pos, mat4 i, inout vec4 col)
{
mat4 clipToLocal = i;
-
+
// transform into unit cube space
origin = (clipToLocal * vec4(origin, 1.0)).xyz;
pos = (clipToLocal * vec4(pos, 1.0)).xyz;
@@ -471,7 +471,7 @@ void boxIntersectDebug(vec3 origin, vec3 pos, mat4 i, inout vec4 col)
// dw - distance weight
float sphereWeight(vec3 pos, vec3 dir, vec3 origin, float r, vec4 i, out float dw)
{
- float r1 = r * 0.5; // 50% of radius (outer sphere to start interpolating down)
+ float r1 = r * 0.5; // 50% of radius (outer sphere to start interpolating down)
vec3 delta = pos.xyz - origin;
float d2 = max(length(delta), 0.001);
@@ -495,7 +495,7 @@ float sphereWeight(vec3 pos, vec3 dir, vec3 origin, float r, vec4 i, out float d
// lod - which mip to sample (lower is higher res, sharper reflections)
// c - center of probe
// r2 - radius of probe squared
-// i - index of probe
+// i - index of probe
vec3 tapRefMap(vec3 pos, vec3 dir, out float w, out float dw, float lod, vec3 c, int i)
{
// parallax adjustment
@@ -514,7 +514,7 @@ vec3 tapRefMap(vec3 pos, vec3 dir, out float w, out float dw, float lod, vec3 c,
float rr = r * r;
- v = sphereIntersect(pos, dir, c,
+ v = sphereIntersect(pos, dir, c,
refIndex[i].w < 1 ? 4096.0*4096.0 : // <== effectively disable parallax correction for automatically placed probes to keep from bombing the world with obvious spheres
rr);
@@ -525,7 +525,7 @@ vec3 tapRefMap(vec3 pos, vec3 dir, out float w, out float dw, float lod, vec3 c,
vec3 d = normalize(v);
v = env_mat * v;
-
+
vec4 ret = textureLod(reflectionProbes, vec4(v.xyz, refIndex[i].x), lod) * refParams[i].y;
return ret.rgb;
@@ -536,7 +536,7 @@ vec3 tapRefMap(vec3 pos, vec3 dir, out float w, out float dw, float lod, vec3 c,
// dir - pixel normal
// w - weight of sample (distance and angular attenuation)
// dw - weight of sample (distance only)
-// i - index of probe
+// i - index of probe
vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int i, vec3 amblit)
{
// parallax adjustment
@@ -554,7 +554,7 @@ vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int
// pad sphere for manual probe extending into automatic probe space
float rr = r * r;
- v = sphereIntersect(pos, dir, c,
+ v = sphereIntersect(pos, dir, c,
refIndex[i].w < 1 ? 4096.0*4096.0 : // <== effectively disable parallax correction for automatically placed probes to keep from bombing the world with obvious spheres
rr);
@@ -563,7 +563,7 @@ vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int
v -= c;
v = env_mat * v;
-
+
vec3 col = textureLod(irradianceProbes, vec4(v.xyz, refIndex[i].x), 0).rgb * refParams[i].x;
col = mix(amblit, col, min(refParams[i].x, 1.0));
@@ -625,7 +625,7 @@ vec3 sampleProbes(vec3 pos, vec3 dir, float lod)
col[1] *= 1.0/wsum[1];
col[0] = vec3(0);
}
-
+
return col[1]+col[0];
}
@@ -654,7 +654,7 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir, vec3 amblit)
{
continue;
}
-
+
{
float w = 0;
float dw = 0;
@@ -684,7 +684,7 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir, vec3 amblit)
col[1] *= 1.0/wsum[1];
col[0] = vec3(0);
}
-
+
return col[1]+col[0];
}
@@ -704,13 +704,13 @@ void tapHeroProbe(inout vec3 glossenv, vec3 pos, vec3 norm, float glossiness)
{
float d = 0;
boxIntersect(pos, norm, heroBox, d, 1.0);
-
+
w = max(d, 0);
}
else
{
float r = heroSphere.w;
-
+
w = sphereWeight(pos, refnormpersp, heroSphere.xyz, r, vec4(1), dw);
}
@@ -851,9 +851,9 @@ void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout
{
float lod = (1.0-glossiness)*reflection_lods;
glossenv = sampleProbes(pos, normalize(refnormpersp), lod);
-
+
}
-
+
if (envIntensity > 0.0)
{
legacyenv = sampleProbes(pos, normalize(refnormpersp), 0.0);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
index deb276ef9d..9ac389f926 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
@@ -52,7 +52,7 @@ float random (vec2 uv);
float tapScreenSpaceReflection(int totalSamples, vec2 tc, vec3 viewPos, vec3 n, inout vec4 collectedColor, sampler2D source, float glossiness);
-void main()
+void main()
{
vec2 tc = vary_fragcoord.xy;
float depth = linearDepth01(getDepth(tc), zNear, zFar);
@@ -60,13 +60,13 @@ void main()
vec3 pos = getPositionWithDepth(tc, getDepth(tc)).xyz;
vec4 spec = texture(specularRect, tc);
vec2 hitpixel;
-
+
vec4 diffuse = texture(diffuseRect, tc);
vec3 specCol = spec.rgb;
vec4 fcol = texture(diffuseMap, tc);
- if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
+ if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
{
vec3 orm = specCol.rgb;
float perceptualRoughness = orm.g;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 96c32734e4..529d1cba6b 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -105,8 +105,8 @@ vec3 pbrBaseLight(vec3 diffuseColor,
vec3 additive,
vec3 atten);
-vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
- float perceptualRoughness,
+vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
+ float perceptualRoughness,
float metallic,
vec3 n, // normal
vec3 v, // surface point to camera
@@ -169,15 +169,15 @@ void main()
if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
{
- vec3 orm = spec.rgb;
+ vec3 orm = spec.rgb;
float perceptualRoughness = orm.g;
float metallic = orm.b;
float ao = orm.r;
-
+
// PBR IBL
float gloss = 1.0 - perceptualRoughness;
-
+
sampleReflectionProbes(irradiance, radiance, tc, pos.xyz, norm.xyz, gloss, false, amblit_linear);
adjustIrradiance(irradiance, ambocc);
@@ -205,7 +205,7 @@ void main()
{
// legacy shaders are still writng sRGB to gbuffer
baseColor.rgb = srgb_to_linear(baseColor.rgb);
-
+
spec.rgb = srgb_to_linear(spec.rgb);
float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0);
@@ -224,7 +224,7 @@ void main()
vec3 sun_contrib = min(da, scol) * sunlit_linear;
color.rgb += sun_contrib;
color.rgb *= baseColor.rgb;
-
+
vec3 refnormpersp = reflect(pos.xyz, norm.xyz);
if (spec.a > 0.0)
@@ -254,7 +254,7 @@ void main()
}
color.rgb = mix(color.rgb, baseColor.rgb, baseColor.a);
-
+
if (envIntensity > 0.0)
{ // add environment map
applyLegacyEnv(color, legacyenv, spec, pos.xyz, norm.xyz, envIntensity);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
index 319fa86148..092b0c3c08 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
@@ -1,28 +1,28 @@
-/**
+/**
* @file class3\deferred\spotLightF.glsl
*
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2022, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
@@ -83,8 +83,8 @@ vec4 getPosition(vec2 pos_screen);
const float M_PI = 3.14159265;
-vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
- float perceptualRoughness,
+vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
+ float perceptualRoughness,
float metallic,
vec3 n, // normal
vec3 v, // surface point to camera
@@ -112,13 +112,13 @@ void main()
}
float shadow = 1.0;
-
+
if (proj_shadow_idx >= 0)
{
vec4 shd = texture(lightMap, tc);
shadow = (proj_shadow_idx==0)?shd.b:shd.a;
shadow += shadow_fade;
- shadow = clamp(shadow, 0.0, 1.0);
+ shadow = clamp(shadow, 0.0, 1.0);
}
vec4 norm = getNorm(tc);
@@ -149,7 +149,7 @@ void main()
float metallic = orm.b;
vec3 f0 = vec3(0.04);
vec3 baseColor = diffuse.rgb;
-
+
vec3 diffuseColor = baseColor.rgb*(vec3(1.0)-f0);
diffuseColor *= 1.0 - metallic;
@@ -167,7 +167,7 @@ void main()
if (nl > 0.0)
{
amb_da += (nl*0.5 + 0.5) * proj_ambiance;
-
+
dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy );
vec3 intensity = dist_atten * dlit * 3.25 * shadow; // Legacy attenuation, magic number to balance with legacy materials
@@ -205,11 +205,11 @@ void main()
// unshadowed for consistency between forward and deferred?
amb_da += (nl*0.5+0.5) /* * (1.0-shadow) */ * proj_ambiance;
}
-
+
amb_rgb = getProjectedLightAmbiance( amb_da, dist_atten, lit, nl, 1.0, proj_tc.xy );
final_color += diffuse.rgb * amb_rgb * max(dot(-normalize(lv), n), 0.0);
}
-
+
if (spec.a > 0.0)
{
dlit *= min(nl*6.0, 1.0) * dist_atten;
@@ -218,7 +218,7 @@ void main()
float gtdenom = 2 * nh;
float gt = max(0, min(gtdenom * nv / vh, gtdenom * nl / vh));
-
+
if (nh > 0.0)
{
float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
@@ -226,26 +226,26 @@ void main()
speccol = clamp(speccol, vec3(0), vec3(1));
final_color += speccol;
}
- }
+ }
if (envIntensity > 0.0)
{
vec3 ref = reflect(normalize(pos), n);
-
+
//project from point pos in direction ref to plane proj_p, proj_n
vec3 pdelta = proj_p-pos;
float ds = dot(ref, proj_n);
-
+
if (ds < 0.0)
{
vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
-
+
vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
if (stc.z > 0.0)
{
stc /= stc.w;
-
+
if (stc.x < 1.0 &&
stc.y < 1.0 &&
stc.x > 0.0 &&
diff --git a/indra/newview/app_settings/shaders/class3/deferred/waterHazeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/waterHazeF.glsl
index f6bef1e498..a5a37d80dd 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/waterHazeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/waterHazeF.glsl
@@ -43,7 +43,7 @@ void main()
float depth = getDepth(tc.xy);
if (above_water > 0)
- {
+ {
// we want to depth test when the camera is above water, but some GPUs have a hard time
// with depth testing against render targets that are bound for sampling in the same shader
// so we do it manually here
@@ -60,5 +60,5 @@ void main()
vec4 fogged = getWaterFogView(pos.xyz);
frag_color = max(fogged, vec4(0)); //output linear since local lights will be added to this shader's results
-
+
}
diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp
index adb974ca71..a62d4da495 100644
--- a/indra/newview/chatbar_as_cmdline.cpp
+++ b/indra/newview/chatbar_as_cmdline.cpp
@@ -389,7 +389,7 @@ private:
LLUUID mPackageDest;
std::string mFolderName;
EDeRezDestination mDest;
- U32 mPackSize;
+ size_t mPackSize;
EZtakeState mState;
};
@@ -519,9 +519,9 @@ private:
std::vector mToTake;
LLUUID mTarget;
S32 mCountdown;
- S32 zeroClearX;
- S32 zeroClearY;
- S32 zeroClearZ;
+ size_t zeroClearX;
+ size_t zeroClearY;
+ size_t zeroClearZ;
};
TMZtake* gMTake;
@@ -980,7 +980,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest
S32 random_min = atoi(random_nums[1].first);
S32 random_max = atoi(random_nums[2].first);
std::string look_for = "RAND(" + llformat("%d", random_min) + "," + llformat("%d", random_max) + ")";
- S32 random_string_pos = expr.find(look_for);
+ auto random_string_pos = expr.find(look_for);
if (random_string_pos != std::string::npos)
{
S32 random_number = 0;
diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp
index 225dedf4cb..4f29268e11 100644
--- a/indra/newview/daeexport.cpp
+++ b/indra/newview/daeexport.cpp
@@ -286,7 +286,7 @@ void ColladaExportFloater::addSelectedObjects()
mObjectName = "";
}
mSaver.updateTextureInfo();
- mNumTextures = mSaver.mTextures.size();
+ mNumTextures = static_cast(mSaver.mTextures.size());
mNumExportableTextures = getNumExportableTextures();
}
}
diff --git a/indra/newview/exoflickr.cpp b/indra/newview/exoflickr.cpp
index 28d0ef255f..625bdddc43 100644
--- a/indra/newview/exoflickr.cpp
+++ b/indra/newview/exoflickr.cpp
@@ -269,7 +269,7 @@ std::string exoFlickr::getSignatureForCall(const LLSD& parameters, std::string u
std::string key = std::string(EXO_FLICKR_API_SECRET) + "&" + gSavedPerAccountSettings.getString("ExodusFlickrTokenSecret");
std::string to_hash = q.str();
- HMAC(EVP_sha1(), (void*)key.c_str(), key.length(), (unsigned char*)to_hash.c_str(), to_hash.length(), data, &length);
+ HMAC(EVP_sha1(), (void*)key.c_str(), static_cast(key.length()), (unsigned char*)to_hash.c_str(), to_hash.length(), data, &length);
std::string signature = LLBase64::encode((U8*)data, length);
return signature;
}
diff --git a/indra/newview/fschathistory.cpp b/indra/newview/fschathistory.cpp
index 06c077a7cb..9f5ad93a32 100644
--- a/indra/newview/fschathistory.cpp
+++ b/indra/newview/fschathistory.cpp
@@ -836,8 +836,8 @@ public:
(mSourceType == CHAT_SOURCE_AGENT || (mSourceType == CHAT_SOURCE_SYSTEM && mType == CHAT_TYPE_RADAR)))
{
//if it's an avatar name with a username add formatting
- S32 username_start = chat.mFromName.rfind(" (");
- S32 username_end = chat.mFromName.rfind(')');
+ auto username_start = chat.mFromName.rfind(" (");
+ auto username_end = chat.mFromName.rfind(')');
if (username_start != std::string::npos &&
username_end == (chat.mFromName.length() - 1))
diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp
index 9323865030..c90be48d87 100644
--- a/indra/newview/fscommon.cpp
+++ b/indra/newview/fscommon.cpp
@@ -92,7 +92,7 @@ bool is_irc_me_prefix(std::string_view text)
std::string unescape_name(std::string_view name)
{
// bugfix for SL-46920: preventing filenames that break stuff.
- char * curl_str = curl_unescape(name.data(), name.size()); // Calling data() should be ok here because we also pass the length
+ char * curl_str = curl_unescape(name.data(), static_cast(name.size())); // Calling data() should be ok here because we also pass the length
std::string unescaped_name(curl_str);
curl_free(curl_str);
curl_str = NULL;
@@ -440,7 +440,7 @@ bool FSCommon::checkIsActionEnabled(const LLUUID& av_id, EFSRegistrarFunctionAct
LLSD FSCommon::populateGroupCount()
{
LLStringUtil::format_map_t args;
- S32 groupcount = gAgent.mGroups.size();
+ S32 groupcount = static_cast(gAgent.mGroups.size());
S32 maxgroup = LLAgentBenefitsMgr::current().getGroupMembershipLimit();
args["[COUNT]"] = llformat("%d", groupcount);
args["[REMAINING]"] = llformat("%d", maxgroup > groupcount ? maxgroup - groupcount : 0);
diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp
index 627446c523..7b58cac222 100644
--- a/indra/newview/fsdata.cpp
+++ b/indra/newview/fsdata.cpp
@@ -682,7 +682,7 @@ LLSD FSData::resolveClientTag(const LLUUID& id, bool new_system, const LLColor4&
{
if (client_tag_visibility >= 3)
{
- U32 tag_len = strnlen((const char*)&id.mData[0], UUID_BYTES);
+ auto tag_len = strnlen((const char*)&id.mData[0], UUID_BYTES);
std::string clienttagname = std::string((const char*)&id.mData[0], tag_len);
LLStringFn::replace_ascii_controlchars(clienttagname, LL_UNKNOWN_CHAR);
curtag["name"] = clienttagname;
diff --git a/indra/newview/fsdiscordconnect.cpp b/indra/newview/fsdiscordconnect.cpp
index af6044a189..cf32d27580 100644
--- a/indra/newview/fsdiscordconnect.cpp
+++ b/indra/newview/fsdiscordconnect.cpp
@@ -245,7 +245,7 @@ void FSDiscordConnect::updateRichPresence() const
std::string regionId = gAgent.getRegion()->getRegionID().asString();
discordPresence.partyId = regionId.c_str();
- discordPresence.partySize = gAgent.getRegion()->mMapAvatars.size();
+ discordPresence.partySize = static_cast(gAgent.getRegion()->mMapAvatars.size());
discordPresence.partyMax = LLRegionInfoModel::instance().mAgentLimit;
Discord_UpdatePresence(&discordPresence);
}
diff --git a/indra/newview/fsfloatercontacts.h b/indra/newview/fsfloatercontacts.h
index 122958f03a..88316a81ab 100644
--- a/indra/newview/fsfloatercontacts.h
+++ b/indra/newview/fsfloatercontacts.h
@@ -151,7 +151,7 @@ private:
LLGroupList* mGroupList;
bool mAllowRightsChange;
- S32 mNumRightsChanged;
+ size_t mNumRightsChanged;
bool mRightsChangeNotificationTriggered;
std::string mFriendListFontName;
diff --git a/indra/newview/fsfloaterexport.cpp b/indra/newview/fsfloaterexport.cpp
index dd3ad04377..0b60e8b00b 100644
--- a/indra/newview/fsfloaterexport.cpp
+++ b/indra/newview/fsfloaterexport.cpp
@@ -876,7 +876,7 @@ void FSFloaterObjectExport::onLoadComplete(const LLUUID& asset_uuid, LLAssetType
case LLAssetType::AT_BODYPART:
{
std::string asset(buffer.begin(), buffer.end());
- S32 position = asset.rfind("textures");
+ auto position = asset.rfind("textures");
boost::regex pattern("[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}");
boost::sregex_iterator m1(asset.begin() + position, asset.end(), pattern);
boost::sregex_iterator m2;
@@ -908,9 +908,8 @@ void FSFloaterObjectExport::onLoadComplete(const LLUUID& asset_uuid, LLAssetType
}
std::string name;
std::string description;
- S32 i;
- S32 count = gesture->mSteps.size();
- for (i = 0; i < count; ++i)
+ auto count = gesture->mSteps.size();
+ for (size_t i = 0; i < count; ++i)
{
LLGestureStep* step = gesture->mSteps[i];
@@ -1180,7 +1179,7 @@ void FSFloaterObjectExport::addSelectedObjects()
}
updateTextureInfo();
- mNumTextures = mTextures.size();
+ mNumTextures = static_cast(mTextures.size());
mNumExportableTextures = getNumExportableTextures();
}
else
diff --git a/indra/newview/fsfloaterexport.h b/indra/newview/fsfloaterexport.h
index 39d702d333..49c00854ae 100644
--- a/indra/newview/fsfloaterexport.h
+++ b/indra/newview/fsfloaterexport.h
@@ -124,7 +124,7 @@ private:
std::string mFilePath;
LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList;
LLFrameTimer mWaitTimer;
- S32 mLastRequest;
+ size_t mLastRequest;
bool mExported;
bool mAborted;
bool mDirty;
diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp
index 9560cc44f2..7c79f054fa 100644
--- a/indra/newview/fsfloaterim.cpp
+++ b/indra/newview/fsfloaterim.cpp
@@ -1892,7 +1892,7 @@ bool FSFloaterIM::dropCategory(LLInventoryCategory* category, bool drop)
items,
LLInventoryModel::EXCLUDE_TRASH,
buddies);
- S32 count = items.size();
+ auto count = items.size();
if (count == 0)
{
rv = false;
diff --git a/indra/newview/fsfloaterimport.cpp b/indra/newview/fsfloaterimport.cpp
index ad3a54fc40..32aabee57e 100644
--- a/indra/newview/fsfloaterimport.cpp
+++ b/indra/newview/fsfloaterimport.cpp
@@ -376,7 +376,7 @@ void FSFloaterImport::processPrim(LLSD& prim)
case LLAssetType::AT_BODYPART:
{
std::string asset(buffer.begin(), buffer.end());
- S32 position = asset.rfind("textures");
+ auto position = asset.rfind("textures");
boost::regex pattern("[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}");
boost::sregex_iterator m1(asset.begin() + position, asset.end(), pattern);
boost::sregex_iterator m2;
@@ -407,9 +407,8 @@ void FSFloaterImport::processPrim(LLSD& prim)
break;
}
- S32 i;
- S32 count = gesture->mSteps.size();
- for (i = 0; i < count; ++i)
+ auto count = gesture->mSteps.size();
+ for (size_t i = 0; i < count; ++i)
{
LLGestureStep* step = gesture->mSteps[i];
@@ -1247,8 +1246,8 @@ void FSFloaterImport::uploadAsset(LLUUID asset_id, LLUUID inventory_item)
perms_prefix = "Wearables";
std::string asset(asset_data.begin(), asset_data.end());
- S32 position = asset.rfind("type");
- S32 end = asset.find("\n", position);
+ auto position = asset.rfind("type");
+ auto end = asset.find("\n", position);
wearable_type = (LLWearableType::EType)boost::lexical_cast(asset.substr(position + 5, (end - (position + 5))));
if (getChild("temp_asset")->get())
@@ -1391,10 +1390,9 @@ void FSFloaterImport::uploadAsset(LLUUID asset_id, LLUUID inventory_item)
break;
}
- S32 i;
- S32 count = gesture->mSteps.size();
- bool replace = false;
- for (i = 0; i < count; ++i)
+ auto count = gesture->mSteps.size();
+ bool replace{ false };
+ for (size_t i = 0; i < count; ++i)
{
LLGestureStep* step = gesture->mSteps[i];
diff --git a/indra/newview/fsfloaternearbychat.cpp b/indra/newview/fsfloaternearbychat.cpp
index 2f42218ec9..22e5c7ccb6 100644
--- a/indra/newview/fsfloaternearbychat.cpp
+++ b/indra/newview/fsfloaternearbychat.cpp
@@ -531,8 +531,8 @@ void FSFloaterNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue)
bool FSFloaterNearbyChat::isWordsName(const std::string& name)
{
// checking to see if it's display name plus username in parentheses
- S32 open_paren = name.find(" (", 0);
- S32 close_paren = name.find(')', 0);
+ auto open_paren = name.find(" (", 0);
+ auto close_paren = name.find(')', 0);
if (open_paren != std::string::npos &&
close_paren == name.length() - 1)
@@ -542,7 +542,7 @@ bool FSFloaterNearbyChat::isWordsName(const std::string& name)
else
{
//checking for a single space
- S32 pos = name.find(' ', 0);
+ auto pos = name.find(' ', 0);
return std::string::npos != pos && name.rfind(' ', name.length()) == pos && 0 != pos && name.length()-1 != pos;
}
}
diff --git a/indra/newview/fsfloaternearbychat.h b/indra/newview/fsfloaternearbychat.h
index 66697c6c53..2a7f2e5d24 100644
--- a/indra/newview/fsfloaternearbychat.h
+++ b/indra/newview/fsfloaternearbychat.h
@@ -90,7 +90,7 @@ public:
LLChatEntry* getChatBox() { return mInputEditor; }
- S32 getMessageArchiveLength() {return mMessageArchive.size();}
+ S32 getMessageArchiveLength() { return static_cast(mMessageArchive.size()); }
virtual bool handleKeyHere( KEY key, MASK mask );
diff --git a/indra/newview/fsfloaterperformance.cpp b/indra/newview/fsfloaterperformance.cpp
index 78de092e4d..bdcce00042 100644
--- a/indra/newview/fsfloaterperformance.cpp
+++ b/indra/newview/fsfloaterperformance.cpp
@@ -379,7 +379,7 @@ void FSFloaterPerformance::draw()
getChild("frame_breakdown")->setText(getString("frame_stats", args));
auto button = getChild("AutoTuneFPS");
- if((bool)button->getToggleState() != LLPerfStats::tunables.userAutoTuneEnabled)
+ if (button->getToggleState() != LLPerfStats::tunables.userAutoTuneEnabled)
{
button->toggleState();
}
@@ -392,7 +392,7 @@ void FSFloaterPerformance::draw()
{
U32 non_avatar_time_ns = tot_frame_time_ns - tot_avatar_time_ns;
// If the target frame time < non avatar frame time then we can pototentially reach it.
- if (non_avatar_time_ns < target_frame_time_ns)
+ if (non_avatar_time_ns < (U32)target_frame_time_ns)
{
textbox->setColor(LLUIColorTable::instance().getColor("orange"));
}
diff --git a/indra/newview/fsfloatervramusage.cpp b/indra/newview/fsfloatervramusage.cpp
index 3d71f6b284..2082fa59de 100644
--- a/indra/newview/fsfloatervramusage.cpp
+++ b/indra/newview/fsfloatervramusage.cpp
@@ -166,7 +166,7 @@ U32 FSFloaterVRAMUsage::calcTexturSize( LLViewerObject *aObject, std::ostream *a
if( !pTex || pTex->isMissingAsset() )
continue;
- U32 textureId = stTextures.size();
+ U32 textureId = static_cast(stTextures.size());
bool bOldTexId( false );
if( stTextures.end() != stTextures.find( pTex->getID() ) )
diff --git a/indra/newview/fslslpreproc.cpp b/indra/newview/fslslpreproc.cpp
index 40e7bd0b25..b1bfe311b9 100644
--- a/indra/newview/fslslpreproc.cpp
+++ b/indra/newview/fslslpreproc.cpp
@@ -171,7 +171,7 @@ std::string FSLSLPreprocessor::encode(const std::string& script)
std::string FSLSLPreprocessor::decode(const std::string& script)
{
- static const S32 startpoint = encode_start.length();
+ static const auto startpoint = encode_start.length();
std::string tip = script.substr(0, startpoint);
@@ -182,9 +182,9 @@ std::string FSLSLPreprocessor::decode(const std::string& script)
return script;
}
- S32 end = script.find(encode_end);
+ auto end = script.find(encode_end);
- if (end == -1)
+ if (end == std::string::npos)
{
LL_DEBUGS("FSLSLPreprocessor") << "No end" << LL_ENDL;
return script;
@@ -362,7 +362,7 @@ std::string FSLSLPreprocessor::lslopt(std::string script)
while (boost::regex_search(std::string::const_iterator(top.begin()), std::string::const_iterator(top.end()), result, finddecls))
{
- S32 len;
+ size_t len;
if (result[1].matched)
{
@@ -697,7 +697,7 @@ void cache_script(std::string name, std::string content)
LLAPRFile infile(path.c_str(), LL_APR_WB);
if (infile.getFileHandle())
{
- infile.write(content.c_str(), content.length());
+ infile.write(content.c_str(), static_cast(content.length()));
}
infile.close();
@@ -988,14 +988,14 @@ static std::string reformat_switch_statements(std::string script, bool &lackDefa
break;
}
LL_DEBUGS("FSLSLPreprocessor") << "arg=[" << arg << "]" << LL_ENDL;;
- std::string rstate = scopeript2(buffer, res + slen + arg.length());
- S32 cutlen = slen + arg.length() + rstate.length();
+ std::string rstate = scopeript2(buffer, res + slen + static_cast(arg.length()));
+ S32 cutlen = slen + static_cast(arg.length() + rstate.length());
// Call recursively to process nested switch statements (FIRE-10517)
rstate = reformat_switch_statements(rstate, lackDefault);
//rip off the scope edges
- S32 slicestart = rstate.find("{") + 1;
+ auto slicestart = rstate.find("{") + 1;
rstate = rstate.substr(slicestart, (rstate.rfind("}") - slicestart) - 1);
LL_DEBUGS("FSLSLPreprocessor") << "rstate=[" << rstate << "]" << LL_ENDL;
@@ -1012,12 +1012,12 @@ static std::string reformat_switch_statements(std::string script, bool &lackDefa
if (statematches[1].matched)
{
S32 case_start = const_iterator_to_pos(rstate.begin(), statematches[1].first);
- S32 next_curl = rstate.find("{", case_start + 1);
- S32 next_semi = rstate.find(":", case_start + 1);
- S32 case_end = (next_semi == -1) ? next_curl :
- (next_curl < next_semi && next_curl != -1) ? next_curl : next_semi;
+ auto next_curl = rstate.find("{", case_start + 1);
+ auto next_semi = rstate.find(":", case_start + 1);
+ auto case_end = (next_semi == std::string::npos) ? next_curl :
+ (next_curl < next_semi && next_curl != std::string::npos) ? next_curl : next_semi;
S32 caselen = const_iterator_to_pos(statematches[1].first, statematches[1].second);
- if (case_end != -1)
+ if (case_end != std::string::npos)
{
std::string casearg = rstate.substr(case_start + caselen, case_end - (case_start + caselen));
LL_DEBUGS("FSLSLPreprocessor") << "casearg=[" << casearg << "]" << LL_ENDL;
diff --git a/indra/newview/fsmoneytracker.cpp b/indra/newview/fsmoneytracker.cpp
index c924108206..1ebad971e6 100644
--- a/indra/newview/fsmoneytracker.cpp
+++ b/indra/newview/fsmoneytracker.cpp
@@ -164,7 +164,7 @@ void FSMoneyTrackerListMenu::onContextMenuItemClick(const LLSD& userdata)
if (!copy_text.empty())
{
- LLClipboard::instance().copyToClipboard(utf8str_to_wstring(copy_text), 0, copy_text.size() );
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(copy_text), 0, static_cast(copy_text.size()));
}
}
}
diff --git a/indra/newview/fsnearbychathub.cpp b/indra/newview/fsnearbychathub.cpp
index 01db135876..da6df2f3d3 100644
--- a/indra/newview/fsnearbychathub.cpp
+++ b/indra/newview/fsnearbychathub.cpp
@@ -653,7 +653,7 @@ void FSNearbyChat::handleChatBarKeystroke(LLUICtrl* source, S32 channel /* = 0 *
// Select to end of line, starting from the character
// after the last one the user typed.
- chat_entry->selectByCursorPosition(utf8_out_str.size() - rest_of_match.size(), utf8_out_str.size());
+ chat_entry->selectByCursorPosition(static_cast(utf8_out_str.size() - rest_of_match.size()), static_cast(utf8_out_str.size()));
}
else
{
@@ -662,7 +662,7 @@ void FSNearbyChat::handleChatBarKeystroke(LLUICtrl* source, S32 channel /* = 0 *
// Select to end of line, starting from the character
// after the last one the user typed.
S32 outlength = line_editor->getLength(); // in characters
- line_editor->setSelection(length, outlength);
+ line_editor->setSelection(static_cast(length), outlength);
line_editor->setCursor(outlength);
}
}
@@ -827,12 +827,12 @@ void FSNearbyChat::handleChatBarKeystroke(LLUICtrl* source, S32 channel /* = 0 *
if (chat_entry)
{
chat_entry->setText(prefix + replaced_text + suffix);
- chat_entry->selectByCursorPosition(utf8string_to_wstring(prefix).size() + utf8string_to_wstring(match).size(), utf8string_to_wstring(prefix).size() + utf8string_to_wstring(replaced_text).size());
+ chat_entry->selectByCursorPosition(static_cast(utf8string_to_wstring(prefix).size() + utf8string_to_wstring(match).size()), static_cast(utf8string_to_wstring(prefix).size() + utf8string_to_wstring(replaced_text).size()));
}
else
{
line_editor->setText(prefix + replaced_text + suffix);
- line_editor->setSelection(utf8str_to_wstring(prefix + replaced_text).length(), cur_pos);
+ line_editor->setSelection(static_cast(utf8str_to_wstring(prefix + replaced_text).length()), cur_pos);
}
}
}
diff --git a/indra/newview/fspanelcontactsets.cpp b/indra/newview/fspanelcontactsets.cpp
index b569a3f748..20896a32c7 100644
--- a/indra/newview/fspanelcontactsets.cpp
+++ b/indra/newview/fspanelcontactsets.cpp
@@ -248,7 +248,7 @@ void FSPanelContactSets::onClickRemoveAvatar()
LLSD payload, args;
std::string set = mContactSetCombo->getValue().asString();
- S32 selected_size = mAvatarSelections.size();
+ auto selected_size = mAvatarSelections.size();
args["SET_NAME"] = set;
args["TARGET"] = (selected_size > 1 ? llformat("%d", selected_size) : LLSLURL("agent", mAvatarSelections.front(), "about").getSLURLString());
payload["contact_set"] = set;
diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp
index 1cdb5afbac..09a45e199d 100644
--- a/indra/newview/fspanellogin.cpp
+++ b/indra/newview/fspanellogin.cpp
@@ -334,8 +334,8 @@ void FSPanelLogin::addFavoritesToStartLocation()
// Load favorites into the combo.
std::string user_defined_name = getChild("username_combo")->getSimple();
std::string canonical_user_name = canonicalize_username(user_defined_name);
- U32 resident_pos = canonical_user_name.find("Resident");
- if (resident_pos > 0)
+ auto resident_pos = canonical_user_name.find("Resident");
+ if (resident_pos != std::string::npos)
{
canonical_user_name = canonical_user_name.substr(0, resident_pos - 1);
}
diff --git a/indra/newview/fspanellogin.h b/indra/newview/fspanellogin.h
index b7fa040496..9a817c0bcf 100644
--- a/indra/newview/fspanellogin.h
+++ b/indra/newview/fspanellogin.h
@@ -128,9 +128,9 @@ private:
static bool sCredentialSet;
- unsigned int mUsernameLength;
- unsigned int mPasswordLength;
- unsigned int mLocationLength;
+ size_t mUsernameLength;
+ size_t mPasswordLength;
+ size_t mLocationLength;
std::string mPreviousUsername;
static std::string sPassword;
diff --git a/indra/newview/fsradar.cpp b/indra/newview/fsradar.cpp
index 6696fecbab..8658ae1cc4 100644
--- a/indra/newview/fsradar.cpp
+++ b/indra/newview/fsradar.cpp
@@ -728,7 +728,7 @@ void FSRadar::updateRadarList()
U32 loop = 0;
while (loop < num_entering)
{
- for (S32 i = 0; i < num_this_pass; i++)
+ for (U32 i = 0; i < num_this_pass; i++)
{
msg = llformat("%s,%s", msg.c_str(), mRadarEnterAlerts[loop + i].asString().c_str());
}
@@ -757,7 +757,7 @@ void FSRadar::updateRadarList()
U32 loop = 0;
while (loop < num_leaving)
{
- for (S32 i = 0; i < num_this_pass; i++)
+ for (U32 i = 0; i < num_this_pass; i++)
{
msg = llformat("%s,%s", msg.c_str(), mRadarLeaveAlerts[loop + i].asString().c_str());
}
diff --git a/indra/newview/gltf/animation.cpp b/indra/newview/gltf/animation.cpp
index 45e9e1ddef..47c2284038 100644
--- a/indra/newview/gltf/animation.cpp
+++ b/indra/newview/gltf/animation.cpp
@@ -191,15 +191,15 @@ void Animation::Sampler::getFrameInfo(Asset& asset, F32 time, U32& frameIndex, F
{
if (time > mMaxTime)
{
- frameIndex = mFrameTimes.size() - 2;
+ frameIndex = (U32)mFrameTimes.size() - 2;
t = 1.0f;
return;
}
- frameIndex = mFrameTimes.size() - 2;
+ frameIndex = (U32)mFrameTimes.size() - 2;
t = 1.f;
- for (U32 i = 0; i < mFrameTimes.size() - 1; i++)
+ for (U32 i = 0; i < (U32)mFrameTimes.size() - 1; i++)
{
if (time >= mFrameTimes[i] && time < mFrameTimes[i + 1])
{
diff --git a/indra/newview/gltf/primitive.cpp b/indra/newview/gltf/primitive.cpp
index bc333aff69..e6946a3c90 100644
--- a/indra/newview/gltf/primitive.cpp
+++ b/indra/newview/gltf/primitive.cpp
@@ -619,8 +619,8 @@ const LLVolumeTriangle* Primitive::lineSegmentIntersect(const LLVector4a& start,
face.mTangents = mTangents.data();
face.mIndices = nullptr; // unreferenced
- face.mNumIndices = mIndexArray.size();
- face.mNumVertices = mPositions.size();
+ face.mNumIndices = (S32)mIndexArray.size();
+ face.mNumVertices = (S32)mPositions.size();
LLOctreeTriangleRayIntersect intersect(start, dir, &face, &closest_t, intersection, tex_coord, normal, tangent_out);
intersect.traverse(mOctree);
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index d7eb605489..54cef0e10b 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -756,7 +756,6 @@ LLMatrix4a inverse(const LLMatrix4a& mat)
bool GLTFSceneManager::lineSegmentIntersect(LLVOVolume* obj, Asset* asset, const LLVector4a& start, const LLVector4a& end, S32 face, bool pick_transparent, bool pick_rigged, bool pick_unselectable, S32* node_hit, S32* primitive_hit,
LLVector4a* intersection, LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent)
-
{
// line segment intersection test
// start and end should be in agent space
diff --git a/indra/newview/growlnotifierwin.cpp b/indra/newview/growlnotifierwin.cpp
index a618891f64..fff2e2e469 100644
--- a/indra/newview/growlnotifierwin.cpp
+++ b/indra/newview/growlnotifierwin.cpp
@@ -84,7 +84,7 @@ void GrowlNotifierWin::registerApplication(const std::string& application, const
strcpy(string, it->c_str());
arr[i] = string;
}
- mGrowlImpl = new Growl (GROWL_TCP, NULL, application.c_str(), (const char **const)arr, notificationTypes.size(),
+ mGrowlImpl = new Growl (GROWL_TCP, NULL, application.c_str(), (const char **const)arr, static_cast(notificationTypes.size()),
std::string(gDirUtilp->getDefaultSkinDir() + gDirUtilp->getDirDelimiter() + "textures" + gDirUtilp->getDirDelimiter() + "firestorm_icon.png").c_str());
for (i = 0; i < (S32)notificationTypes.size(); ++i)
diff --git a/indra/newview/installers/darwin/fix_application_icon_position.sh b/indra/newview/installers/darwin/fix_application_icon_position.sh
index 62abcdd07e..841defe96c 100755
--- a/indra/newview/installers/darwin/fix_application_icon_position.sh
+++ b/indra/newview/installers/darwin/fix_application_icon_position.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# just run this script each time after you change the installer's name to fix the icon misalignment
+# just run this script each time after you change the installer's name to fix the icon misalignment
mydir="$(dirname "$0")"
# If there's more than one DMG in more than one build directory, pick the most
# recent one.
diff --git a/indra/newview/linux_tools/register_secondlifeprotocol.sh b/indra/newview/linux_tools/register_secondlifeprotocol.sh
index 16e73cb854..33c34d7a76 100755
--- a/indra/newview/linux_tools/register_secondlifeprotocol.sh
+++ b/indra/newview/linux_tools/register_secondlifeprotocol.sh
@@ -27,7 +27,7 @@ for LLKDECONFIG in kde-config kde4-config; do
LLKDEPROTODIR=`$LLKDECONFIG --path services | cut -d ':' -f 1`
if [ -d "$LLKDEPROTODIR" ]; then
LLKDEPROTOFILE=${LLKDEPROTODIR}/secondlife.protocol
- cat > ${LLKDEPROTOFILE} < ${LLKDEPROTOFILE} <(mRegionsVisited.size());
}
//-----------------------------------------------------------------------------
@@ -3726,8 +3726,8 @@ bool LLAgent::isInGroup(const LLUUID& group_id, bool ignore_god_mode /* false */
if (!ignore_god_mode && isGodlike())
return true;
- U32 count = mGroups.size();
- for(U32 i = 0; i < count; ++i)
+ auto count = mGroups.size();
+ for(size_t i = 0; i < count; ++i)
{
if(mGroups[i].mID == group_id)
{
@@ -3746,8 +3746,8 @@ bool LLAgent::hasPowerInGroup(const LLUUID& group_id, U64 power) const
// GP_NO_POWERS can also mean no power is enough to grant an ability.
if (GP_NO_POWERS == power) return false;
- U32 count = mGroups.size();
- for(U32 i = 0; i < count; ++i)
+ auto count = mGroups.size();
+ for(size_t i = 0; i < count; ++i)
{
if(mGroups[i].mID == group_id)
{
@@ -3767,8 +3767,8 @@ U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const
if (isGodlike())
return GP_ALL_POWERS;
- U32 count = mGroups.size();
- for(U32 i = 0; i < count; ++i)
+ auto count = mGroups.size();
+ for(size_t i = 0; i < count; ++i)
{
if(mGroups[i].mID == group_id)
{
@@ -3781,8 +3781,8 @@ U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const
bool LLAgent::getGroupData(const LLUUID& group_id, LLGroupData& data) const
{
- S32 count = mGroups.size();
- for(S32 i = 0; i < count; ++i)
+ auto count = mGroups.size();
+ for(size_t i = 0; i < count; ++i)
{
if(mGroups[i].mID == group_id)
{
@@ -3795,8 +3795,8 @@ bool LLAgent::getGroupData(const LLUUID& group_id, LLGroupData& data) const
S32 LLAgent::getGroupContribution(const LLUUID& group_id) const
{
- S32 count = mGroups.size();
- for(S32 i = 0; i < count; ++i)
+ auto count = mGroups.size();
+ for(size_t i = 0; i < count; ++i)
{
if(mGroups[i].mID == group_id)
{
@@ -3809,8 +3809,8 @@ S32 LLAgent::getGroupContribution(const LLUUID& group_id) const
bool LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution)
{
- S32 count = mGroups.size();
- for(S32 i = 0; i < count; ++i)
+ auto count = mGroups.size();
+ for(size_t i = 0; i < count; ++i)
{
if(mGroups[i].mID == group_id)
{
@@ -3832,8 +3832,8 @@ bool LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution)
bool LLAgent::setUserGroupFlags(const LLUUID& group_id, bool accept_notices, bool list_in_profile)
{
- S32 count = mGroups.size();
- for(S32 i = 0; i < count; ++i)
+ auto count = mGroups.size();
+ for(size_t i = 0; i < count; ++i)
{
if(mGroups[i].mID == group_id)
{
diff --git a/indra/newview/llagentpicksinfo.cpp b/indra/newview/llagentpicksinfo.cpp
index 5724adb450..4f943d75a7 100644
--- a/indra/newview/llagentpicksinfo.cpp
+++ b/indra/newview/llagentpicksinfo.cpp
@@ -147,5 +147,5 @@ void LLAgentPicksInfo::onServerRespond(LLAvatarData* picks)
return;
}
- setNumberOfPicks(picks->picks_list.size());
+ setNumberOfPicks(static_cast(picks->picks_list.size()));
}
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 899546a43f..5e45766229 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1084,7 +1084,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
{
LL_INFOS() << "setWearableOutfit() start" << LL_ENDL;
- S32 count = wearables.size();
+ auto count = wearables.size();
llassert(items.size() == count);
// Check for whether outfit already matches the one requested
@@ -1093,7 +1093,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
S32 type_counts[arr_size];
bool update_inventory{ false };
std::fill(type_counts,type_counts+arr_size,0);
- for (S32 i = 0; i < count; i++)
+ for (size_t i = 0; i < count; i++)
{
LLViewerWearable* new_wearable = wearables[i];
LLPointer new_item = items[i];
@@ -1572,7 +1572,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo
void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array)
{
// Build a compound message to send all the objects that need to be rezzed.
- S32 obj_count = obj_item_array.size();
+ auto obj_count = obj_item_array.size();
if (obj_count > 0)
{
LL_DEBUGS("Avatar") << "ATT attaching multiple, total obj_count " << obj_count << LL_ENDL;
@@ -1941,7 +1941,7 @@ bool LLAgentWearables::itemUpdatePending(const LLUUID& item_id) const
U32 LLAgentWearables::itemUpdatePendingCount() const
{
- return mItemsAwaitingWearableUpdate.size();
+ return static_cast(mItemsAwaitingWearableUpdate.size());
}
// MULTI-WEARABLE: DEPRECATED (see backwards compatibility)
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index f980a073be..5a01d23b30 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -791,7 +791,7 @@ void AISAPI::FetchOrphans(completion_t callback)
void AISAPI::EnqueueAISCommand(const std::string &procName, LLCoprocedureManager::CoProcedure_t proc)
{
LLCoprocedureManager &inst = LLCoprocedureManager::instance();
- S32 pending_in_pool = inst.countPending("AIS");
+ auto pending_in_pool = inst.countPending("AIS");
std::string procFullName = "AIS(" + procName + ")";
if (pending_in_pool < MAX_SIMULTANEOUS_COROUTINES)
{
@@ -820,7 +820,7 @@ void AISAPI::onIdle(void *userdata)
if (!sPostponedQuery.empty())
{
LLCoprocedureManager &inst = LLCoprocedureManager::instance();
- S32 pending_in_pool = inst.countPending("AIS");
+ auto pending_in_pool = inst.countPending("AIS");
while (pending_in_pool < MAX_SIMULTANEOUS_COROUTINES && !sPostponedQuery.empty())
{
ais_query_item_t &item = sPostponedQuery.front();
@@ -1370,7 +1370,7 @@ void AISUpdate::parseCategory(const LLSD& category_map, S32 depth)
uuid_int_map_t::const_iterator lookup_it = mCatDescendentsKnown.find(category_id);
if (mCatDescendentsKnown.end() != lookup_it)
{
- S32 descendent_count = lookup_it->second;
+ S32 descendent_count = static_cast(lookup_it->second);
LL_DEBUGS("Inventory") << "Setting descendents count to " << descendent_count
<< " for category " << category_id << LL_ENDL;
new_cat->setDescendentCount(descendent_count);
@@ -1423,7 +1423,7 @@ void AISUpdate::parseCategory(const LLSD& category_map, S32 depth)
uuid_int_map_t::const_iterator lookup_it = mCatDescendentsKnown.find(category_id);
if (mCatDescendentsKnown.end() != lookup_it)
{
- S32 descendent_count = lookup_it->second;
+ S32 descendent_count = static_cast(lookup_it->second);
LL_DEBUGS("Inventory") << "Setting descendents count to " << descendent_count
<< " for new category " << category_id << LL_ENDL;
new_cat->setDescendentCount(descendent_count);
@@ -1599,7 +1599,7 @@ void AISUpdate::doUpdate()
checkTimeout();
// Do version/descendant accounting.
- for (std::map::const_iterator catit = mCatDescendentDeltas.begin();
+ for (std::map::const_iterator catit = mCatDescendentDeltas.begin();
catit != mCatDescendentDeltas.end(); ++catit)
{
LL_DEBUGS("Inventory") << "descendant accounting for " << catit->first << LL_ENDL;
@@ -1623,7 +1623,7 @@ void AISUpdate::doUpdate()
LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
if (cat)
{
- S32 descendent_delta = catit->second;
+ S32 descendent_delta = static_cast(catit->second);
S32 old_count = cat->getDescendentCount();
LL_DEBUGS("Inventory") << "Updating descendant count for "
<< cat->getName() << " " << cat_id
@@ -1747,7 +1747,7 @@ void AISUpdate::doUpdate()
ucv_it != mCatVersionsUpdated.end(); ++ucv_it)
{
const LLUUID id = ucv_it->first;
- S32 version = ucv_it->second;
+ S32 version = static_cast(ucv_it->second);
LLViewerInventoryCategory *cat = gInventory.getCategory(id);
LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL;
if (cat->getVersion() != version)
diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h
index 0dabd9f678..dd490c8268 100644
--- a/indra/newview/llaisapi.h
+++ b/indra/newview/llaisapi.h
@@ -134,7 +134,7 @@ private:
// Todo: make throttle work over all fetch requests isntead of per-request
const F32 AIS_EXPIRY_SECONDS = 0.008f;
- typedef std::map uuid_int_map_t;
+ typedef std::map uuid_int_map_t;
uuid_int_map_t mCatDescendentDeltas;
uuid_int_map_t mCatDescendentsKnown;
uuid_int_map_t mCatVersionsUpdated;
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 1a82552ad9..94d2084a93 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -728,7 +728,7 @@ public:
bool isMostRecent();
void handleLateArrivals();
void resetTime(F32 timeout);
- static S32 countActive() { return sActiveHoldingPatterns.size(); }
+ static S32 countActive() { return static_cast(sActiveHoldingPatterns.size()); }
S32 index() { return mIndex; }
private:
@@ -1383,7 +1383,7 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items)
// encountered, so we actually keep the *last* of each duplicate
// item. This is needed to give the right priority when adding
// duplicate items to an existing outfit.
- for (S32 i=items.size()-1; i>=0; i--)
+ for (S32 i = static_cast(items.size()) - 1; i >= 0; i--)
{
LLViewerInventoryItem *item = items.at(i);
LLUUID item_id = item->getLinkedUUID();
@@ -2207,14 +2207,14 @@ void LLAppearanceMgr::filterWearableItems(
items.clear();
for (S32 i=0; igetAllowMultiwear((LLWearableType::EType)i)) ? max_per_type : 1));
+ auto start_index = llmax(0, size - ((LLWearableType::getInstance()->getAllowMultiwear((LLWearableType::EType)i)) ? max_per_type : 1));
// [/SL:KB[
- for (S32 j = start_index; jgetType(), true);
}
- for (S32 idxItem = 0, cntItem = itemsNew.size(); idxItem < cntItem; idxItem++)
+ for (size_t idxItem = 0, cntItem = itemsNew.size(); idxItem < cntItem; idxItem++)
{
RlvBehaviourNotifyHandler::onWear(itemsNew.at(idxItem)->getWearableType(), true);
}
@@ -3904,7 +3904,7 @@ struct WearablesOrderComparator
LOG_CLASS(WearablesOrderComparator);
WearablesOrderComparator(const LLWearableType::EType type)
{
- mControlSize = build_order_string(type, 0).size();
+ mControlSize = static_cast(build_order_string(type, 0).size());
};
bool operator()(const LLInventoryItem* item1, const LLInventoryItem* item2)
@@ -3939,7 +3939,7 @@ void LLAppearanceMgr::getWearableOrderingDescUpdates(LLInventoryModel::item_arra
for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++)
{
- U32 size = items_by_type[type].size();
+ U32 size = static_cast(items_by_type[type].size());
if (!size) continue;
//sinking down invalid items which need reordering
@@ -5042,7 +5042,7 @@ public:
LLInventoryModel::item_array_t* items;
gInventory.getDirectDescendentsOf(mComplete.front(), cats, items);
- S32 count = items->size();
+ auto count = items->size();
if(!count)
{
LL_WARNS() << "Nothing fetched in category " << mComplete.front()
@@ -5058,7 +5058,7 @@ public:
S32 version = cat ? cat->getVersion() : -2;
LL_INFOS() << "stage1, category " << mComplete.front() << " got " << count << " items, version " << version << " passing to stage2 " << LL_ENDL;
uuid_vec_t ids;
- for(S32 i = 0; i < count; ++i)
+ for(size_t i = 0; i < count; ++i)
{
ids.push_back(items->at(i)->getUUID());
}
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 5fc5564551..9d986d74db 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -408,7 +408,7 @@ WorkQueue gMainloopWork("mainloop", 1024*1024);
std::string SafeFileName(std::string filename)
{
std::string invalidChars = "\"\'\\/?*:.<>| ";
- S32 position = filename.find_first_of(invalidChars);
+ auto position = filename.find_first_of(invalidChars);
while (position != filename.npos)
{
filename[position] = '_';
@@ -1932,7 +1932,7 @@ bool LLAppViewer::doFrame()
S32 LLAppViewer::updateTextureThreads(F32 max_time)
{
- S32 work_pending = 0;
+ size_t work_pending = 0;
{
LL_PROFILE_ZONE_NAMED_CATEGORY_APP("Texture Cache");
work_pending += LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread
@@ -1945,7 +1945,7 @@ S32 LLAppViewer::updateTextureThreads(F32 max_time)
LL_PROFILE_ZONE_NAMED_CATEGORY_APP("Image Fetch");
work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
}
- return work_pending;
+ return static_cast(work_pending);
}
void LLAppViewer::flushLFSIO()
@@ -2383,9 +2383,9 @@ bool LLAppViewer::cleanup()
while(1)
{
S32 pending = 0;
- pending += LLAppViewer::getTextureCache()->update(1); // unpauses the worker thread
- pending += LLAppViewer::getImageDecodeThread()->update(1); // unpauses the image thread
- pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread
+ pending += static_cast(LLAppViewer::getTextureCache()->update(1)); // unpauses the worker thread
+ pending += static_cast(LLAppViewer::getImageDecodeThread()->update(1)); // unpauses the image thread
+ pending += static_cast(LLAppViewer::getTextureFetch()->update(1)); // unpauses the texture fetch thread
pending += LLLFSThread::updateClass(0);
F64 idle_time = idleTimer.getElapsedTimeF64();
if(!pending)
@@ -3930,12 +3930,12 @@ LLSD LLAppViewer::getViewerInfo() const
info["CPU"] = gSysCPU.getCPUString();
info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits());
info["USED_RAM"] = LLSD::Real(LLMemory::getAllocatedMemKB().valueInUnits());
- info["CONCURRENCY"] = LLSD::Integer((S32)boost::thread::hardware_concurrency()); // Add hardware concurrency to info
+ info["CONCURRENCY"] = LLSD::Integer(std::thread::hardware_concurrency()); // Add hardware concurrency to info
// Moved hack adjustment to Windows memory size into llsys.cpp
info["OS_VERSION"] = LLOSInfo::instance().getOSString();
info["GRAPHICS_CARD_VENDOR"] = ll_safe_string((const char*)(glGetString(GL_VENDOR)));
info["GRAPHICS_CARD"] = ll_safe_string((const char*)(glGetString(GL_RENDERER)));
- info["GRAPHICS_CARD_MEMORY"] = gGLManager.mVRAM;
+ info["GRAPHICS_CARD_MEMORY"] = LLSD::Integer(gGLManager.mVRAM);
#if LL_WINDOWS
std::string drvinfo;
@@ -4184,7 +4184,7 @@ std::string LLAppViewer::getViewerInfoString(bool default_string) const
else
{
// array value: build KEY_0, KEY_1 etc. entries
- for (LLSD::Integer n(0), size(ii->second.size()); n < size; ++n)
+ for (LLSD::Integer n(0), size(static_cast(ii->second.size())); n < size; ++n)
{
args[STRINGIZE(ii->first << '_' << n)] = ii->second[n].asString();
}
@@ -4463,7 +4463,7 @@ void LLAppViewer::recordMarkerVersion(LLAPRFile& marker_file)
}
// record the viewer version in the marker file
- marker_file.write(marker_version.data(), marker_version.length());
+ marker_file.write(marker_version.data(), static_cast(marker_version.length()));
marker_file.flush(); // Make sure filesystem reflects what we wrote.
}
@@ -6028,7 +6028,7 @@ void LLAppViewer::updateNameLookupUrl(const LLViewerRegion * regionp)
if (have_capability)
{
// we have support for display names, use it
- U32 url_size = name_lookup_url.size();
+ auto url_size = name_lookup_url.size();
// capabilities require URLs with slashes before query params:
// https://:/cap//?ids=
// but the caps are granted like:
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp
index 2cb214ebf9..d3f54fb72c 100644
--- a/indra/newview/llappviewerlinux.cpp
+++ b/indra/newview/llappviewerlinux.cpp
@@ -69,15 +69,9 @@ extern "C"
#include "breakpad/common/linux/http_upload.h"
#include "lldir.h"
#include "../llcrashlogger/llcrashlogger.h"
-// Fix linux compile
-#if LL_USESYSTEMLIBS
-#include "jsoncpp/reader.h" // JSON
-#else
-#include "json/reader.h" // JSON
-#endif
-//
#endif
+#include "boost/json.hpp"
#include "fsversionvalues.h"
#define VIEWERAPI_SERVICE "com.secondlife.ViewerAppAPIService"
@@ -189,26 +183,28 @@ void setupBreadpad()
return;
}
- Json::Reader reader;
- Json::Value build_data;
- if(!reader.parse(inf, build_data, false))
+ boost::json::error_code ec;
+ boost::json::value build_data = boost::json::parse(inf, ec);
+ if(ec.failed())
{
LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, can't parse '" << build_data_fname << "': "
- << reader.getFormatedErrorMessages() << LL_ENDL;
+ << ec.what() << LL_ENDL;
return;
}
- Json::Value BugSplat_DB = build_data["BugSplat DB"];
- if(!BugSplat_DB)
+ if (!build_data.is_object() || !build_data.as_object().contains("BugSplat DB"))
{
LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, no 'BugSplat DB' entry in '" << build_data_fname
<< "'" << LL_ENDL;
return;
}
+
gVersion = STRINGIZE(
LL_VIEWER_VERSION_MAJOR << '.' << LL_VIEWER_VERSION_MINOR << '.' << LL_VIEWER_VERSION_PATCH
<< '.' << LL_VIEWER_VERSION_BUILD);
- gBugsplatDB = BugSplat_DB.asString();
+
+ boost::json::value BugSplat_DB = build_data.at("BugSplat DB");
+ gBugsplatDB = boost::json::value_to(BugSplat_DB);
LL_INFOS("BUGSPLAT") << "Initializing with crash logger: " << gCrashLogger << " database: " << gBugsplatDB << " version: " << gVersion << LL_ENDL;
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 489f45519c..642241cf47 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -1102,7 +1102,7 @@ bool LLAppViewerWin32::sendURLToOtherInstance(const std::string& url)
COPYDATASTRUCT cds;
const S32 SLURL_MESSAGE_TYPE = 0;
cds.dwData = SLURL_MESSAGE_TYPE;
- cds.cbData = url.length() + 1;
+ cds.cbData = static_cast(url.length()) + 1;
cds.lpData = (void*)url.c_str();
LRESULT msg_result = SendMessage(other_window, WM_COPYDATA, NULL, (LPARAM)&cds);
diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp
index 3882a99095..c0a4b29c59 100644
--- a/indra/newview/llattachmentsmgr.cpp
+++ b/indra/newview/llattachmentsmgr.cpp
@@ -328,7 +328,7 @@ void LLAttachmentsMgr::LLItemRequestTimes::addTime(const LLUUID& inv_item_id)
void LLAttachmentsMgr::LLItemRequestTimes::removeTime(const LLUUID& inv_item_id)
{
LLInventoryItem *item = gInventory.getItem(inv_item_id);
- S32 remove_count = (*this).erase(inv_item_id);
+ auto remove_count = (*this).erase(inv_item_id);
if (remove_count)
{
LL_DEBUGS("Avatar") << "ATT " << mOpName << " removing request time "
diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp
index e1d494f7c7..f200ca8e31 100644
--- a/indra/newview/llautoreplace.cpp
+++ b/indra/newview/llautoreplace.cpp
@@ -81,7 +81,7 @@ void LLAutoReplace::autoreplaceCallback(S32& replacement_start, S32& replacement
replacement_start = word_start;
replacement_length = word_end - word_start + 1;
replacement_string = utf8str_to_wstring(replacement_word);
- S32 size_change = replacement_string.size() - old_string.size();
+ S32 size_change = static_cast(replacement_string.size() - old_string.size());
cursor_pos += size_change;
}
}
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index d40c0797ea..41c14a171c 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -820,8 +820,8 @@ void LLAvatarActions::csr(const LLUUID& id, std::string name)
std::string url = "http://csr.lindenlab.com/agent/";
// slow and stupid, but it's late
- S32 len = name.length();
- for (S32 i = 0; i < len; i++)
+ auto len = name.length();
+ for (size_t i = 0; i < len; i++)
{
if (name[i] == ' ')
{
@@ -1039,11 +1039,11 @@ namespace action_give_inventory
return;
}
- S32 count = LLShareInfo::instance().mAvatarNames.size();
+ auto count = LLShareInfo::instance().mAvatarNames.size();
bool shared = count && !inventory_selected_uuids.empty();
// iterate through avatars
- for(S32 i = 0; i < count; ++i)
+ for(size_t i = 0; i < count; ++i)
{
const LLUUID& avatar_uuid = LLShareInfo::instance().mAvatarUuids[i];
@@ -1127,7 +1127,7 @@ namespace action_give_inventory
// [RLVa:KB] - @share
if ( (RlvActions::isRlvEnabled()) && (RlvActions::hasBehaviour(RLV_BHVR_SHARE)) )
{
- for (int idxAvatar = avatar_uuids.size() - 1; idxAvatar >= 0; idxAvatar--)
+ for (int idxAvatar = static_cast(avatar_uuids.size()) - 1; idxAvatar >= 0; idxAvatar--)
{
if (!RlvActions::canGiveInventory(avatar_uuids[idxAvatar]))
{
@@ -1985,7 +1985,7 @@ bool getRegionAndPosGlobalFromAgentID(const LLUUID& idAgent, const LLViewerRegio
for (; itRegion != endRegion; ++itRegion)
{
const LLViewerRegion* pRegion = *itRegion;
- for (S32 idxRegionAgent = 0, cntRegionAgent = pRegion->mMapAvatars.size(); idxRegionAgent < cntRegionAgent; idxRegionAgent++)
+ for (size_t idxRegionAgent = 0, cntRegionAgent = pRegion->mMapAvatars.size(); idxRegionAgent < cntRegionAgent; idxRegionAgent++)
{
if (pRegion->mMapAvatarIDs.at(idxRegionAgent) == idAgent)
{
diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp
index d782dc3e0c..5742c033c7 100644
--- a/indra/newview/llavatarrendernotifier.cpp
+++ b/indra/newview/llavatarrendernotifier.cpp
@@ -315,7 +315,7 @@ void LLHUDRenderNotifier::updateNotificationHUD(hud_complexity_list_t complexity
}
mHUDComplexityList = complexity;
- mHUDsCount = mHUDComplexityList.size();
+ mHUDsCount = static_cast(mHUDComplexityList.size());
static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20);
if (!show_my_complexity_changes)
diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp
index 1767092c25..5c437c433d 100644
--- a/indra/newview/llblocklist.cpp
+++ b/indra/newview/llblocklist.cpp
@@ -47,7 +47,7 @@ LLBlockList::LLBlockList(const Params& p)
{
LLMuteList::getInstance()->addObserver(this);
- mMuteListSize = LLMuteList::getInstance()->getMutes().size();
+ mMuteListSize = static_cast(LLMuteList::getInstance()->getMutes().size());
// Set up context menu.
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
@@ -92,7 +92,7 @@ void LLBlockList::createList()
BlockListActionType LLBlockList::getCurrentMuteListActionType()
{
BlockListActionType type = NONE;
- U32 curSize = LLMuteList::getInstance()->getMutes().size();
+ U32 curSize = static_cast(LLMuteList::getInstance()->getMutes().size());
if( curSize > mMuteListSize)
type = ADD;
else if(curSize < mMuteListSize)
@@ -266,7 +266,7 @@ void LLBlockList::refresh()
selectItemPair(getItemPair(next_selected), true);
}
}
- mMuteListSize = LLMuteList::getInstance()->getMutes().size();
+ mMuteListSize = static_cast(LLMuteList::getInstance()->getMutes().size());
// Sort the list.
sort();
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp
index ec972ae14a..38e5c6c3e3 100644
--- a/indra/newview/llcallingcard.cpp
+++ b/indra/newview/llcallingcard.cpp
@@ -26,16 +26,11 @@
#include "llviewerprecompiledheaders.h"
-#if LL_WINDOWS
-#pragma warning( disable : 4800 ) // performance warning in
-#endif
-
#include "llcallingcard.h"
#include
#include "indra_constants.h"
-//#include "llcachename.h"
#include "llstl.h"
#include "lltimer.h"
#include "lluuid.h"
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index d00d0344fa..e47e034bf3 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -471,7 +471,7 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
// to eat trailing spaces that might be part of a gesture.
LLWStringUtil::trimHead(raw_text);
- S32 length = raw_text.length();
+ auto length = raw_text.length();
if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences
{
@@ -519,7 +519,7 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
// Select to end of line, starting from the character
// after the last one the user typed.
- self->mInputEditor->setSelection(length, outlength);
+ self->mInputEditor->setSelection(static_cast(length), outlength);
}
}
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index dc54d2f11d..9aff427313 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -765,8 +765,8 @@ public:
mSourceType == CHAT_SOURCE_AGENT)
{
//if it's an avatar name with a username add formatting
- S32 username_start = chat.mFromName.rfind(" (");
- S32 username_end = chat.mFromName.rfind(')');
+ auto username_start = chat.mFromName.rfind(" (");
+ auto username_end = chat.mFromName.rfind(')');
if (username_start != std::string::npos &&
username_end == (chat.mFromName.length() - 1))
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 94ab1fc7e6..13c43be0ed 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -1049,7 +1049,7 @@ public:
/**
* Returns number of hosted chiclets.
*/
- S32 getChicletCount() {return mChicletList.size();};
+ S32 getChicletCount() { return static_cast(mChicletList.size()); }
/**
* Returns index of chiclet in list.
@@ -1285,7 +1285,7 @@ T* LLChicletPanel::createChiclet(const LLUUID& session_id, S32 index)
template
T* LLChicletPanel::createChiclet(const LLUUID& session_id)
{
- return createChiclet(session_id, mChicletList.size());
+ return createChiclet(session_id, static_cast(mChicletList.size()));
}
template
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index d323ed2e87..96cb459d65 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -644,13 +644,13 @@ void LLCOFWearables::populateClothingList(LLAppearanceMgr::wearables_by_type_t&
for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; ++type)
{
- U32 size = clothing_by_type[type].size();
+ auto size = clothing_by_type[type].size();
if (!size) continue;
LLAppearanceMgr::sortItemsByActualDescription(clothing_by_type[type]);
//clothing items are displayed in reverse order, from furthest ones to closest ones (relatively to the body)
- for (U32 i = size; i != 0; --i)
+ for (size_t i = size; i != 0; --i)
{
LLViewerInventoryItem* item = clothing_by_type[type][i-1];
@@ -673,8 +673,8 @@ void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by
for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++)
{
- U32 size = clothing_by_type[type].size();
- if (size) continue;
+ if (clothing_by_type[type].empty())
+ continue;
LLWearableType::EType w_type = static_cast(type);
LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type);
diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp
index 5b8d8b5480..f301af9511 100644
--- a/indra/newview/llcommandlineparser.cpp
+++ b/indra/newview/llcommandlineparser.cpp
@@ -378,8 +378,8 @@ bool LLCommandLineParser::parseCommandLineString(const std::string& str)
if (!str.empty())
{
bool add_last_c = true;
- S32 last_c_pos = str.size() - 1; //don't get out of bounds on pos+1, last char will be processed separately
- for (S32 pos = 0; pos < last_c_pos; ++pos)
+ auto last_c_pos = str.size() - 1; //don't get out of bounds on pos+1, last char will be processed separately
+ for (size_t pos = 0; pos < last_c_pos; ++pos)
{
cmd_line_string.append(&str[pos], 1);
if (str[pos] == '\\')
diff --git a/indra/newview/llcommunicationchannel.cpp b/indra/newview/llcommunicationchannel.cpp
index 074d60d879..810b282722 100644
--- a/indra/newview/llcommunicationchannel.cpp
+++ b/indra/newview/llcommunicationchannel.cpp
@@ -54,7 +54,7 @@ bool LLCommunicationChannel::filterByDoNotDisturbStatus(LLNotificationPtr)
S32 LLCommunicationChannel::getHistorySize() const
{
- return mHistory.size();
+ return static_cast(mHistory.size());
}
LLCommunicationChannel::history_list_t::const_iterator LLCommunicationChannel::beginHistory() const
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index f51a7934ba..daba7cff6f 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -413,11 +413,11 @@ void LLControlAvatar::updateDebugText()
S32 total_linkset_count = 0;
if (mRootVolp)
{
- total_linkset_count = 1 + mRootVolp->getChildren().size();
+ total_linkset_count = 1 + static_cast(mRootVolp->getChildren().size());
}
std::vector volumes;
getAnimatedVolumes(volumes);
- S32 animated_volume_count = volumes.size();
+ S32 animated_volume_count = static_cast(volumes.size());
std::string active_string;
std::string type_string;
std::string lod_string;
diff --git a/indra/newview/llcylinder.cpp b/indra/newview/llcylinder.cpp
index 6e1fd41b87..c347d3e1be 100644
--- a/indra/newview/llcylinder.cpp
+++ b/indra/newview/llcylinder.cpp
@@ -48,7 +48,7 @@ void LLCone::render(S32 sides)
gGL.begin(LLRender::TRIANGLE_FAN);
gGL.vertex3f(0,0,0);
- for (U32 i = 0; i < sides; i++)
+ for (S32 i = 0; i < sides; i++)
{
F32 a = (F32) i/sides * F_PI*2.f;
F32 x = cosf(a)*0.5f;
@@ -61,7 +61,7 @@ void LLCone::render(S32 sides)
gGL.begin(LLRender::TRIANGLE_FAN);
gGL.vertex3f(0.f, 0.f, 0.5f);
- for (U32 i = 0; i < sides; i++)
+ for (S32 i = 0; i < sides; i++)
{
F32 a = (F32) i/sides * F_PI*2.f;
F32 x = cosf(a)*0.5f;
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 08861ebedf..3dd2513c47 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -346,7 +346,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
face = new LLFace(this, mVObjp);
- face->setTEOffset(mFaces.size());
+ face->setTEOffset(static_cast(mFaces.size()));
face->setTexture(texturep);
face->setPoolType(gPipeline.getPoolTypeFromTE(te, texturep));
@@ -368,7 +368,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep,
LLFace *face;
face = new LLFace(this, mVObjp);
- face->setTEOffset(mFaces.size());
+ face->setTEOffset(static_cast(mFaces.size()));
face->setTexture(texturep);
face->setNormalMap(normalp);
face->setPoolType(gPipeline.getPoolTypeFromTE(te, texturep));
@@ -391,7 +391,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep,
LLFace *face;
face = new LLFace(this, mVObjp);
- face->setTEOffset(mFaces.size());
+ face->setTEOffset(static_cast(mFaces.size()));
face->setTexture(texturep);
face->setNormalMap(normalp);
face->setSpecularMap(specularp);
@@ -424,7 +424,7 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerText
else // (newFaces > mFaces.size())
{
mFaces.reserve(newFaces);
- for (int i = mFaces.size(); i mFaces.size())
{
mFaces.reserve(newFaces);
- for (int i = mFaces.size(); imFaces.size();
+ auto face_count = mFaces.size() + src->mFaces.size();
mFaces.reserve(face_count);
- for (U32 i = 0; i < src->mFaces.size(); i++)
+ for (size_t i = 0; i < src->mFaces.size(); i++)
{
LLFace* facep = src->mFaces[i];
facep->setDrawable(this);
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index a9c15abc01..9ba4f7f300 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -315,7 +315,7 @@ void LLFacePool::addFaceReference(LLFace *facep)
{
if (-1 == facep->getReferenceIndex())
{
- facep->setReferenceIndex(mReferences.size());
+ facep->setReferenceIndex(static_cast(mReferences.size()));
mReferences.push_back(facep);
}
}
@@ -672,7 +672,7 @@ bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinI
return false;
}
const LLVOAvatar::MatrixPaletteCache& mpc = avatar->updateSkinInfoMatrixPalette(skinInfo);
- U32 count = mpc.mMatrixPalette.size();
+ U32 count = static_cast(mpc.mMatrixPalette.size());
if (count == 0)
{
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index d653b9de79..bc6b374639 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -952,7 +952,7 @@ bool LLDrawPoolAlpha::uploadMatrixPalette(const LLDrawInfo& params)
return false;
}
const LLVOAvatar::MatrixPaletteCache& mpc = params.mAvatar.get()->updateSkinInfoMatrixPalette(params.mSkinInfo);
- U32 count = mpc.mMatrixPalette.size();
+ U32 count = static_cast(mpc.mMatrixPalette.size());
if (count == 0)
{
diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp
index 07834c58b4..bbc93c2af9 100644
--- a/indra/newview/lldrawpoolmaterials.cpp
+++ b/indra/newview/lldrawpoolmaterials.cpp
@@ -250,7 +250,7 @@ void LLDrawPoolMaterials::renderDeferred(S32 pass)
if (params.mAvatar != lastAvatar)
{
const LLVOAvatar::MatrixPaletteCache& mpc = params.mAvatar->updateSkinInfoMatrixPalette(params.mSkinInfo);
- U32 count = mpc.mMatrixPalette.size();
+ U32 count = static_cast(mpc.mMatrixPalette.size());
if (count == 0)
{
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 2681b04266..cfc8071c4e 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -262,7 +262,7 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass)
if (mShaderLevel == 1)
{
- fog_color.mV[VW] = log(fog_density) / log(2);
+ fog_color.mV[VALPHA] = log(fog_density) / log(2);
}
F32 water_height = environment.getWaterHeight();
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 60c2726418..ce6799ec92 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -220,8 +220,8 @@ bool LLViewerDynamicTexture::updateAllInstances()
if (dynamicTexture->needsRender())
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("needsRender");
- llassert(dynamicTexture->getFullWidth() <= LLPipeline::MAX_BAKE_WIDTH);
- llassert(dynamicTexture->getFullHeight() <= LLPipeline::MAX_BAKE_WIDTH);
+ llassert(dynamicTexture->getFullWidth() <= (S32)LLPipeline::MAX_BAKE_WIDTH);
+ llassert(dynamicTexture->getFullHeight() <= (S32)LLPipeline::MAX_BAKE_WIDTH);
glClear(GL_DEPTH_BUFFER_BIT);
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index c2a9a6f449..c38260037e 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -764,7 +764,7 @@ namespace
LLEnvironment::DayInstance::ptr_t getBaseDayInstance() const { return mBaseDayInstance; }
void setBaseDayInstance(const LLEnvironment::DayInstance::ptr_t &baseday);
- S32 countExperiencesActive() const { return mActiveExperiences.size(); }
+ S32 countExperiencesActive() const { return static_cast(mActiveExperiences.size()); }
bool isOverriddenSky() const { return !mSkyExperience.isNull(); }
bool isOverriddenWater() const { return !mWaterExperience.isNull(); }
@@ -2657,7 +2657,7 @@ LLSettingsDay::ptr_t LLEnvironment::createDayCycleFromEnvironment(EnvSelection_t
if (type == "sky")
{
- for (S32 idx = 1; idx < LLSettingsDay::TRACK_MAX; ++idx)
+ for (U32 idx = 1; idx < LLSettingsDay::TRACK_MAX; ++idx)
day->clearCycleTrack(idx);
day->setSettingsAtKeyframe(settings, 0.0f, 1);
}
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 95a31914a8..03cbd03baa 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1235,7 +1235,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
if (mVertexBuffer.notNull())
{
- if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices())
+ if (num_indices + mIndicesIndex > mVertexBuffer->getNumIndices())
{
if (gDebugGL)
{
@@ -1251,7 +1251,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
return false;
}
- if (num_vertices + mGeomIndex > mVertexBuffer->getNumVerts())
+ if (num_vertices + (U32)mGeomIndex > mVertexBuffer->getNumVerts())
{
if (gDebugGL)
{
@@ -1312,14 +1312,15 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
clearState(GLOBAL);
}
- // Protection against faces w/o te set.
- // LLColor4U color = tep->getColor();
- LLColor4U color = (tep ? tep->getColor() : LLColor4());
- //
-
- if (tep && tep->getGLTFRenderMaterial())
+ LLColor4U color{};
+ if (tep)
{
- color = tep->getGLTFRenderMaterial()->mBaseColor;
+ color = tep->getColor();
+
+ if (tep->getGLTFRenderMaterial())
+ {
+ color = tep->getGLTFRenderMaterial()->mBaseColor;
+ }
}
if (rebuild_color)
@@ -1676,7 +1677,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
mask.setElement<2>();
mask.setElement<3>();
- U32 count = num_vertices/2 + num_vertices%2;
+ S32 count = num_vertices/2 + num_vertices%2;
for (S32 i = 0; i < count; i++)
{
@@ -2422,7 +2423,7 @@ bool LLFace::verify(const U32* indices_array) const
}
// First, check whether the face data fits within the pool's range.
- if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
+ if ((U32)(mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
{
ok = false;
LL_INFOS() << "Face references invalid vertices!" << LL_ENDL;
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index ae1ac476db..f1cb8d5cfe 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -256,7 +256,7 @@ bool LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
TimerBar* hover_bar = NULL;
F32Seconds mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay;
- for (int bar_index = 0, end_index = LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount();
+ for (size_t bar_index = 0, end_index = LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount();
bar_index < end_index;
++bar_index)
{
@@ -730,7 +730,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t
gGL.color3fv(base_col.mV);
U32 count = 0;
- U32 total_count = base_execution.size();
+ U32 total_count = static_cast(base_execution.size());
last_p.clear();
@@ -752,7 +752,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t
LLGLEnable blend(GL_BLEND);
gGL.color3fv(cur_col.mV);
count = 0;
- total_count = cur_execution.size();
+ total_count = static_cast(cur_execution.size());
for (std::vector::iterator iter = cur_execution.begin(); iter != cur_execution.end(); ++iter)
{
@@ -1044,7 +1044,7 @@ void LLFastTimerView::drawLineGraph()
//highlight visible range
{
- S32 first_frame = mRecording.getNumRecordedPeriods() - mScrollIndex;
+ S32 first_frame = static_cast(mRecording.getNumRecordedPeriods()) - mScrollIndex;
S32 last_frame = first_frame - MAX_VISIBLE_HISTORY;
F32 frame_delta = ((F32) (mGraphRect.getWidth()))/(mRecording.getNumRecordedPeriods()-1);
@@ -1109,7 +1109,7 @@ void LLFastTimerView::drawLineGraph()
F32 time_scale_factor = (F32)mGraphRect.getHeight() / max_time.value();
F32 hz_scale_factor = (F32) mGraphRect.getHeight() / (1.f / max_time.value());
- for (U32 j = mRecording.getNumRecordedPeriods();
+ for (U32 j = static_cast(mRecording.getNumRecordedPeriods());
j > 0;
j--)
{
@@ -1700,7 +1700,7 @@ S32 LLFastTimerView::drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width,
bool children_visible = visible && !time_block->getTreeNode().mCollapsed;
bar_index++;
- const U32 num_bars = LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount();
+ const auto num_bars = LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount();
if (bar_index < num_bars && row.mBars[bar_index].mFirstChild)
{
bool is_last = false;
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 4af294741e..8400311d63 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1417,7 +1417,7 @@ void LLFavoritesBarCtrl::fitLabelWidth(LLMenuItemCallGL* menu_item)
// Check whether item name wider than menu
if (menu_item->getNominalWidth() > max_width)
{
- S32 chars_total = item_name.length();
+ S32 chars_total = static_cast(item_name.length());
S32 chars_fitted = 1;
menu_item->setLabel(LLStringExplicit(""));
S32 label_space = max_width - menu_item->getFont()->getWidth("...") -
@@ -1542,7 +1542,7 @@ bool LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
}
void copy_slurl_to_clipboard_cb(std::string& slurl)
{
- LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl), 0, static_cast(slurl.size()));
LLSD args;
args["SLURL"] = slurl;
@@ -1692,8 +1692,8 @@ bool LLFavoritesBarCtrl::isClipboardPasteable() const
std::vector objects;
LLClipboard::instance().pasteFromClipboard(objects);
- S32 count = objects.size();
- for(S32 i = 0; i < count; i++)
+ auto count = objects.size();
+ for(size_t i = 0; i < count; i++)
{
const LLUUID &item_id = objects.at(i);
@@ -1721,9 +1721,9 @@ void LLFavoritesBarCtrl::pasteFromClipboard() const
LLInventoryItem* item = NULL;
std::vector objects;
LLClipboard::instance().pasteFromClipboard(objects);
- S32 count = objects.size();
+ auto count = objects.size();
LLUUID parent_id(mFavoriteFolderId);
- for(S32 i = 0; i < count; i++)
+ for(size_t i = 0; i < count; i++)
{
item = model->getItem(objects.at(i));
if (item)
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index a90d2675e8..7e9b2a8267 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -201,7 +201,7 @@ static const std::vector sGraphicsLevelNames = boost::assign::list_
U32 LLFeatureManager::getMaxGraphicsLevel() const
{
- return sGraphicsLevelNames.size() - 1;
+ return static_cast(sGraphicsLevelNames.size()) - 1;
}
bool LLFeatureManager::isValidGraphicsLevel(U32 level) const
diff --git a/indra/newview/llfetchedgltfmaterial.cpp b/indra/newview/llfetchedgltfmaterial.cpp
index ee4f1b0fe5..c2821d56d6 100644
--- a/indra/newview/llfetchedgltfmaterial.cpp
+++ b/indra/newview/llfetchedgltfmaterial.cpp
@@ -46,7 +46,7 @@ LLFetchedGLTFMaterial::LLFetchedGLTFMaterial()
LLFetchedGLTFMaterial::~LLFetchedGLTFMaterial()
{
-
+
}
LLFetchedGLTFMaterial& LLFetchedGLTFMaterial::operator=(const LLFetchedGLTFMaterial& rhs)
@@ -253,4 +253,3 @@ void LLFetchedGLTFMaterial::materialComplete(bool success)
materialCompleteCallbacks.clear();
materialCompleteCallbacks.shrink_to_fit();
}
-
diff --git a/indra/newview/llfetchedgltfmaterial.h b/indra/newview/llfetchedgltfmaterial.h
index 7550c75b45..634a4853b0 100644
--- a/indra/newview/llfetchedgltfmaterial.h
+++ b/indra/newview/llfetchedgltfmaterial.h
@@ -70,7 +70,7 @@ public:
static LLFetchedGLTFMaterial sDefault;
protected:
// Lifetime management
-
+
void materialBegin();
void materialComplete(bool success);
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index 4d82611def..367803b78a 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -72,13 +72,13 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD
mVO->mDrawable->makeActive() ;
}
- mInstanceIndex = sInstanceList.size();
+ mInstanceIndex = static_cast(sInstanceList.size());
sInstanceList.push_back(this);
}//-----------------------------------------------
LLVolumeImplFlexible::~LLVolumeImplFlexible()
{
- S32 end_idx = sInstanceList.size()-1;
+ S32 end_idx = static_cast(sInstanceList.size()) - 1;
if (end_idx != mInstanceIndex)
{
diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp
index 122ef60757..50ea83353b 100644
--- a/indra/newview/llfloater360capture.cpp
+++ b/indra/newview/llfloater360capture.cpp
@@ -91,7 +91,7 @@ LLFloater360Capture::~LLFloater360Capture()
// gAgent.set360CaptureActive(false); // make FS Area search work again
// gAgent.changeInterestListMode(mStartILMode);
// }
- if ( !LLApp::isExiting() )
+ if (!LLApp::isExiting())
{
gAgent.set360CaptureActive(false); // make FS Area search work again
gAgent.changeInterestListMode(IL_MODE_DEFAULT);// The Change Interest Mode target mode is indicative only. If something else is holding the 360 mode open then this will be ignored.
@@ -430,9 +430,9 @@ void LLFloater360Capture::mockSnapShot(LLImageRaw* raw)
unsigned int depth = raw->getComponents();
unsigned char* pixels = raw->getData();
- for (int y = 0; y < height; y++)
+ for (unsigned int y = 0; y < height; y++)
{
- for (int x = 0; x < width; x++)
+ for (unsigned int x = 0; x < width; x++)
{
unsigned long offset = y * width * depth + x * depth;
unsigned char red = x * 256 / width;
diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp
index 497fe3b9ba..c09c02d32b 100644
--- a/indra/newview/llfloaterbulkpermission.cpp
+++ b/indra/newview/llfloaterbulkpermission.cpp
@@ -223,7 +223,7 @@ bool LLFloaterBulkPermission::start()
// Go to the next object and start if found. Returns false if no objects left, true otherwise.
bool LLFloaterBulkPermission::nextObject()
{
- S32 count;
+ size_t count;
bool successful_start = false;
do
{
@@ -251,7 +251,7 @@ bool LLFloaterBulkPermission::popNext()
{
// get the head element from the container, and attempt to get its inventory.
bool rv = false;
- S32 count = mObjectIDs.size();
+ auto count = mObjectIDs.size();
if(mCurrentObjectID.isNull() && (count > 0))
{
mCurrentObjectID = mObjectIDs.at(0);
diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp
index 70eef55206..54dcaf4a8a 100644
--- a/indra/newview/llfloaterbump.cpp
+++ b/indra/newview/llfloaterbump.cpp
@@ -391,7 +391,7 @@ void FSBumpListMenu::onContextMenuItemClick(const LLSD& userdata)
if (!bumps_text.empty())
{
- LLClipboard::instance().copyToClipboard(utf8str_to_wstring(bumps_text), 0, bumps_text.size() );
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(bumps_text), 0, static_cast(bumps_text.size()));
}
}
}
diff --git a/indra/newview/llfloatercamerapresets.h b/indra/newview/llfloatercamerapresets.h
index 9b07987755..4e12617242 100644
--- a/indra/newview/llfloatercamerapresets.h
+++ b/indra/newview/llfloatercamerapresets.h
@@ -1,24 +1,24 @@
-/**
+/**
* @file llfloatercamerapresets.h
*
* $LicenseInfo:firstyear=2019&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2019, Linden Research, Inc.
-*
+*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
-*
+*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
-*
+*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*
+*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp
index 8037d45616..6008d954b3 100644
--- a/indra/newview/llfloaterchangeitemthumbnail.cpp
+++ b/indra/newview/llfloaterchangeitemthumbnail.cpp
@@ -1,25 +1,25 @@
-/**
+/**
* @file llfloaterchangeitemthumbnail.cpp
* @brief LLFloaterChangeItemThumbnail class implementation
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -97,7 +97,7 @@ void LLThumbnailImagePicker::notify(const std::vector& filenames)
{
return;
}
-
+
LLFloaterSimpleSnapshot::uploadThumbnail(file_path, mInventoryId, mTaskId, mCallback);
}
@@ -637,7 +637,7 @@ void LLFloaterChangeItemThumbnail::onRemove(void *userdata)
LLNotificationsUtil::add("DeleteThumbnail", LLSD(), payload, boost::bind(&LLFloaterChangeItemThumbnail::onRemovalConfirmation, _1, _2, self->getHandle()));
}
-// static
+// static
void LLFloaterChangeItemThumbnail::onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle