Merge remote-tracking branch 'origin/DRTVWR-600-maint-A' into project/gltf_development
commit
7c42711ca3
|
|
@ -0,0 +1,8 @@
|
|||
# Replace tabs with spaces
|
||||
1b68f71348ecf3983b76b40d7940da8377f049b7
|
||||
# Trim trailing whitespace
|
||||
a0b3021bdcf76859054fda8e30abb3ed47749e83
|
||||
# Wrong line endings
|
||||
1b67dd855c41f5a0cda7ec2a68d98071986ca703
|
||||
6cc7dd09d5e69cf57e6de7fb568a0ad2693f9c9a
|
||||
e2e37cced861b98de8c1a7c9c0d3a50d2d90e433
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
llappearance:
|
||||
- indra/llappearance/**/*
|
||||
|
||||
|
||||
llaudio:
|
||||
- indra/llaudio/**/*
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
name: Stale PRs
|
||||
name: Stale PRs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
|
|
|
|||
|
|
@ -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)$
|
||||
|
|
|
|||
|
|
@ -1418,6 +1418,14 @@
|
|||
</map>
|
||||
<key>llphysicsextensions_source</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
<string>Copyright (c) 2010, Linden Research, Inc.</string>
|
||||
<key>license</key>
|
||||
<string>internal</string>
|
||||
<key>license_file</key>
|
||||
<string>LICENSES/llphysicsextensions.txt</string>
|
||||
<key>name</key>
|
||||
<string>llphysicsextensions_source</string>
|
||||
<key>platforms</key>
|
||||
<map>
|
||||
<key>darwin64</key>
|
||||
|
|
@ -1427,11 +1435,11 @@
|
|||
<key>creds</key>
|
||||
<string>github</string>
|
||||
<key>hash</key>
|
||||
<string>b037cc0b29ea70ee834cfae6dda5b7a25cd57174</string>
|
||||
<string>755a3de464149ae88b048f976828a8c0c46e3bdb</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>sha1</string>
|
||||
<key>url</key>
|
||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851460</string>
|
||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966323</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -1443,11 +1451,11 @@
|
|||
<key>creds</key>
|
||||
<string>github</string>
|
||||
<key>hash</key>
|
||||
<string>bdea1fd5c4da9da5afde088d16188b45d0853e04</string>
|
||||
<string>813e7b5e294d7958e3d69e2252752ff346953b0c</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>sha1</string>
|
||||
<key>url</key>
|
||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851461</string>
|
||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966322</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
|
|
@ -1459,26 +1467,18 @@
|
|||
<key>creds</key>
|
||||
<string>github</string>
|
||||
<key>hash</key>
|
||||
<string>f652ce0d6aef864689f0ed44255da4d9cd65a43f</string>
|
||||
<string>67f647538b1b49d0152fd9d03cfb9bdf978e33d1</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>sha1</string>
|
||||
<key>url</key>
|
||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/144851463</string>
|
||||
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966328</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>license</key>
|
||||
<string>internal</string>
|
||||
<key>license_file</key>
|
||||
<string>LICENSES/llphysicsextensions.txt</string>
|
||||
<key>copyright</key>
|
||||
<string>Copyright (c) 2010, Linden Research, Inc.</string>
|
||||
<key>version</key>
|
||||
<string>1.0.479d20a</string>
|
||||
<key>name</key>
|
||||
<string>llphysicsextensions_source</string>
|
||||
<string>1.0.b8b1f73</string>
|
||||
</map>
|
||||
<key>llphysicsextensions_stub</key>
|
||||
<map>
|
||||
|
|
|
|||
12
build.sh
12
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
|
||||
|
|
@ -499,7 +499,7 @@ then
|
|||
fi
|
||||
done
|
||||
end_section "Upload Debian Repository"
|
||||
|
||||
|
||||
else
|
||||
record_event "debian build not enabled"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -533,8 +533,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))
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -537,11 +525,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;
|
||||
|
|
@ -1459,9 +1447,9 @@ void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_
|
|||
U32 param_name[3];
|
||||
if( teToColorParams( te, param_name ) )
|
||||
{
|
||||
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[VRED]);
|
||||
setVisualParamWeight( param_name[1], new_color.mV[VGREEN]);
|
||||
setVisualParamWeight( param_name[2], new_color.mV[VBLUE]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1471,9 +1459,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
@ -135,8 +135,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 };
|
||||
|
||||
typedef std::map<std::string, LLJoint*> joint_map_t;
|
||||
joint_map_t mJointMap;
|
||||
|
|
@ -165,7 +165,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;
|
||||
|
|
@ -182,30 +182,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
|
||||
|
|
@ -225,7 +225,7 @@ protected:
|
|||
** 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
|
||||
|
|
@ -288,9 +288,9 @@ public:
|
|||
LLColor4 getGlobalColor(const std::string& color_name ) const;
|
||||
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0;
|
||||
protected:
|
||||
LLTexGlobalColor* mTexSkinColor;
|
||||
LLTexGlobalColor* mTexHairColor;
|
||||
LLTexGlobalColor* mTexEyeColor;
|
||||
LLTexGlobalColor* mTexSkinColor{ nullptr };
|
||||
LLTexGlobalColor* mTexHairColor{ nullptr };
|
||||
LLTexGlobalColor* mTexEyeColor{ nullptr };
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Visibility
|
||||
|
|
@ -313,7 +313,7 @@ public:
|
|||
virtual bool isWearingWearableType(LLWearableType::EType type ) const;
|
||||
|
||||
private:
|
||||
LLWearableData* mWearableData;
|
||||
LLWearableData* mWearableData{ nullptr };
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
|
|
@ -331,11 +331,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;
|
||||
|
|
@ -352,9 +352,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);
|
||||
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po
|
|||
|
||||
S32 LLDriverParam::getDrivenParamsCount() const
|
||||
{
|
||||
return mDriven.size();
|
||||
return static_cast<S32>(mDriven.size());
|
||||
}
|
||||
|
||||
const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
|
||||
|
|
|
|||
|
|
@ -130,10 +130,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
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name)
|
|||
|
||||
U32 LLLocalTextureObject::getNumTexLayers() const
|
||||
{
|
||||
return mTexLayers.size();
|
||||
return static_cast<U32>(mTexLayers.size());
|
||||
}
|
||||
|
||||
LLUUID LLLocalTextureObject::getID() const
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -384,8 +384,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);
|
||||
|
|
|
|||
|
|
@ -1038,7 +1038,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;
|
||||
}
|
||||
|
|
@ -1213,7 +1213,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 );
|
||||
}
|
||||
|
|
@ -1232,7 +1232,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;
|
||||
|
|
@ -1373,7 +1373,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);
|
||||
|
|
|
|||
|
|
@ -464,10 +464,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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -744,7 +744,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."
|
||||
|
|
|
|||
|
|
@ -334,7 +334,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<U32>(wearable_vec.size());
|
||||
}
|
||||
|
||||
U32 LLWearableData::getWearableCount(const U32 tex_index) const
|
||||
|
|
|
|||
|
|
@ -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<S32>(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<S32>(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<S32>(mWAVBuffer.size()),
|
||||
new WriteResponder(this));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public:
|
|||
bool triggerAndReviseString(const std::string &string, std::string* revised_string);
|
||||
|
||||
// Used for construction from UI
|
||||
S32 count() const { return mList.size(); }
|
||||
S32 count() const { return static_cast<S32>(mList.size()); }
|
||||
virtual LLGesture* get(S32 i) const { return mList.at(i); }
|
||||
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
|
||||
void deleteAll();
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ void LLVector3OverrideMap::showJointVector3Overrides( std::ostringstream& os ) c
|
|||
|
||||
U32 LLVector3OverrideMap::count() const
|
||||
{
|
||||
return m_map.size();
|
||||
return static_cast<U32>(m_map.size());
|
||||
}
|
||||
|
||||
void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
|
||||
|
|
@ -86,7 +86,7 @@ void LLVector3OverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
|
|||
|
||||
bool LLVector3OverrideMap::remove(const LLUUID& mesh_id)
|
||||
{
|
||||
U32 remove_count = m_map.erase(mesh_id);
|
||||
auto remove_count = m_map.erase(mesh_id);
|
||||
return (remove_count > 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -430,8 +430,9 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
|
|||
//-----------------------------------------------------------------------------
|
||||
LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
|
||||
: LLMotion(id),
|
||||
mJointMotionList(NULL),
|
||||
mPelvisp(NULL),
|
||||
mJointMotionList(nullptr),
|
||||
mPelvisp(nullptr),
|
||||
mCharacter(nullptr),
|
||||
mLastSkeletonSerialNum(0),
|
||||
mLastUpdateTime(0.f),
|
||||
mLastLoopedTime(0.f),
|
||||
|
|
@ -2079,7 +2080,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
|
|||
JointMotion* joint_motionp = mJointMotionList->getJointMotion(i);
|
||||
success &= dp.packString(joint_motionp->mJointName, "joint_name");
|
||||
success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
|
||||
success &= dp.packS32(joint_motionp->mRotationCurve.mKeys.size(), "num_rot_keys");
|
||||
success &= dp.packS32(static_cast<S32>(joint_motionp->mRotationCurve.mKeys.size()), "num_rot_keys");
|
||||
|
||||
LL_DEBUGS("BVH") << "Joint " << i
|
||||
<< " name: " << joint_motionp->mJointName
|
||||
|
|
@ -2105,7 +2106,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
|
|||
LL_DEBUGS("BVH") << " rot: t " << rot_key.mTime << " angles " << rot_angles.mV[VX] <<","<< rot_angles.mV[VY] <<","<< rot_angles.mV[VZ] << LL_ENDL;
|
||||
}
|
||||
|
||||
success &= dp.packS32(joint_motionp->mPositionCurve.mKeys.size(), "num_pos_keys");
|
||||
success &= dp.packS32(static_cast<S32>(joint_motionp->mPositionCurve.mKeys.size()), "num_pos_keys");
|
||||
for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys)
|
||||
{
|
||||
PositionKey& pos_key = pos_pair.second;
|
||||
|
|
@ -2125,7 +2126,7 @@ bool LLKeyframeMotion::serialize(LLDataPacker& dp) const
|
|||
}
|
||||
}
|
||||
|
||||
success &= dp.packS32(mJointMotionList->mConstraints.size(), "num_constraints");
|
||||
success &= dp.packS32(static_cast<S32>(mJointMotionList->mConstraints.size()), "num_constraints");
|
||||
LL_DEBUGS("BVH") << "num_constraints " << mJointMotionList->mConstraints.size() << LL_ENDL;
|
||||
for (JointConstraintSharedData* shared_constraintp : mJointMotionList->mConstraints)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ public:
|
|||
~JointMotionList();
|
||||
U32 dumpDiagInfo();
|
||||
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
|
||||
U32 getNumJointMotions() const { return mJointMotionArray.size(); }
|
||||
U32 getNumJointMotions() const { return static_cast<U32>(mJointMotionArray.size()); }
|
||||
};
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -156,11 +156,11 @@ LLMotionController::~LLMotionController()
|
|||
|
||||
void LLMotionController::incMotionCounts(S32& num_motions, S32& num_loading_motions, S32& num_loaded_motions, S32& num_active_motions, S32& num_deprecated_motions)
|
||||
{
|
||||
num_motions += mAllMotions.size();
|
||||
num_loading_motions += mLoadingMotions.size();
|
||||
num_loaded_motions += mLoadedMotions.size();
|
||||
num_active_motions += mActiveMotions.size();
|
||||
num_deprecated_motions += mDeprecatedMotions.size();
|
||||
num_motions += static_cast<S32>(mAllMotions.size());
|
||||
num_loading_motions += static_cast<S32>(mLoadingMotions.size());
|
||||
num_loaded_motions += static_cast<S32>(mLoadedMotions.size());
|
||||
num_active_motions += static_cast<S32>(mActiveMotions.size());
|
||||
num_deprecated_motions += static_cast<S32>(mDeprecatedMotions.size());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -222,7 +222,7 @@ void LLMotionController::purgeExcessMotions()
|
|||
}
|
||||
|
||||
// clean up all inactive, loaded motions
|
||||
for (LLUUID motion_id : motions_to_kill)
|
||||
for (const LLUUID& motion_id : motions_to_kill)
|
||||
{
|
||||
// look up the motion again by ID to get canonical instance
|
||||
// and kill it only if that one is inactive
|
||||
|
|
@ -233,7 +233,7 @@ void LLMotionController::purgeExcessMotions()
|
|||
}
|
||||
}
|
||||
|
||||
U32 loaded_count = mLoadedMotions.size();
|
||||
U32 loaded_count = static_cast<U32>(mLoadedMotions.size());
|
||||
if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge)
|
||||
{
|
||||
LL_WARNS_ONCE("Animation") << loaded_count << " Loaded Motions. Amount of motions is over limit." << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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$
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ void LLAlignedArray<T, alignment>::resize(U32 size)
|
|||
template <class T, U32 alignment>
|
||||
T& LLAlignedArray<T, alignment>::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<T, alignment>::operator[](int idx)
|
|||
template <class T, U32 alignment>
|
||||
const T& LLAlignedArray<T, alignment>::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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -31,64 +31,64 @@
|
|||
#include <type_traits>
|
||||
|
||||
// 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<<EAST;
|
||||
const U8 NORTH_MASK = 0x1<<NORTH;
|
||||
const U8 WEST_MASK = 0x1<<WEST;
|
||||
const U8 SOUTH_MASK = 0x1<<SOUTH;
|
||||
constexpr U8 EAST_MASK = 0x1<<EAST;
|
||||
constexpr U8 NORTH_MASK = 0x1<<NORTH;
|
||||
constexpr U8 WEST_MASK = 0x1<<WEST;
|
||||
constexpr U8 SOUTH_MASK = 0x1<<SOUTH;
|
||||
|
||||
const U8 NORTHEAST_MASK = NORTH_MASK | EAST_MASK;
|
||||
const U8 NORTHWEST_MASK = NORTH_MASK | WEST_MASK;
|
||||
const U8 SOUTHWEST_MASK = SOUTH_MASK | WEST_MASK;
|
||||
const U8 SOUTHEAST_MASK = SOUTH_MASK | EAST_MASK;
|
||||
constexpr U8 NORTHEAST_MASK = NORTH_MASK | EAST_MASK;
|
||||
constexpr U8 NORTHWEST_MASK = NORTH_MASK | WEST_MASK;
|
||||
constexpr U8 SOUTHWEST_MASK = SOUTH_MASK | WEST_MASK;
|
||||
constexpr U8 SOUTHEAST_MASK = SOUTH_MASK | EAST_MASK;
|
||||
|
||||
const U32 gDirOpposite[8] = {2, 3, 0, 1, 6, 7, 4, 5};
|
||||
const U32 gDirAdjacent[8][2] = {
|
||||
{4, 7},
|
||||
{4, 5},
|
||||
{5, 6},
|
||||
{6, 7},
|
||||
{0, 1},
|
||||
{1, 2},
|
||||
{2, 3},
|
||||
{0, 3}
|
||||
};
|
||||
constexpr U32 gDirOpposite[8] = {2, 3, 0, 1, 6, 7, 4, 5};
|
||||
constexpr U32 gDirAdjacent[8][2] = {
|
||||
{4, 7},
|
||||
{4, 5},
|
||||
{5, 6},
|
||||
{6, 7},
|
||||
{0, 1},
|
||||
{1, 2},
|
||||
{2, 3},
|
||||
{0, 3}
|
||||
};
|
||||
|
||||
// Magnitude along the x and y axis
|
||||
const S32 gDirAxes[8][2] = {
|
||||
{ 1, 0}, // east
|
||||
{ 0, 1}, // north
|
||||
{-1, 0}, // west
|
||||
{ 0,-1}, // south
|
||||
{ 1, 1}, // ne
|
||||
{-1, 1}, // nw
|
||||
{-1,-1}, // sw
|
||||
{ 1,-1}, // se
|
||||
};
|
||||
constexpr S32 gDirAxes[8][2] = {
|
||||
{ 1, 0}, // east
|
||||
{ 0, 1}, // north
|
||||
{-1, 0}, // west
|
||||
{ 0,-1}, // south
|
||||
{ 1, 1}, // ne
|
||||
{-1, 1}, // nw
|
||||
{-1,-1}, // sw
|
||||
{ 1,-1}, // se
|
||||
};
|
||||
|
||||
const S32 gDirMasks[8] = {
|
||||
constexpr S32 gDirMasks[8] = {
|
||||
EAST_MASK,
|
||||
NORTH_MASK,
|
||||
WEST_MASK,
|
||||
|
|
@ -117,22 +117,22 @@ const S32 gDirMasks[8] = {
|
|||
// | / -6- | /
|
||||
// |/ / |/
|
||||
// +------------------+
|
||||
const U32 NO_SIDE = 0;
|
||||
const U32 FRONT_SIDE = 1;
|
||||
const U32 BACK_SIDE = 2;
|
||||
const U32 LEFT_SIDE = 3;
|
||||
const U32 RIGHT_SIDE = 4;
|
||||
const U32 TOP_SIDE = 5;
|
||||
const U32 BOTTOM_SIDE = 6;
|
||||
constexpr U32 NO_SIDE = 0;
|
||||
constexpr U32 FRONT_SIDE = 1;
|
||||
constexpr U32 BACK_SIDE = 2;
|
||||
constexpr U32 LEFT_SIDE = 3;
|
||||
constexpr U32 RIGHT_SIDE = 4;
|
||||
constexpr U32 TOP_SIDE = 5;
|
||||
constexpr U32 BOTTOM_SIDE = 6;
|
||||
|
||||
const U8 LL_SOUND_FLAG_NONE = 0x0;
|
||||
const U8 LL_SOUND_FLAG_LOOP = 1<<0;
|
||||
const U8 LL_SOUND_FLAG_SYNC_MASTER = 1<<1;
|
||||
const U8 LL_SOUND_FLAG_SYNC_SLAVE = 1<<2;
|
||||
const U8 LL_SOUND_FLAG_SYNC_PENDING = 1<<3;
|
||||
const U8 LL_SOUND_FLAG_QUEUE = 1<<4;
|
||||
const U8 LL_SOUND_FLAG_STOP = 1<<5;
|
||||
const U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYNC_SLAVE | LL_SOUND_FLAG_SYNC_PENDING;
|
||||
constexpr U8 LL_SOUND_FLAG_NONE = 0x0;
|
||||
constexpr U8 LL_SOUND_FLAG_LOOP = 1<<0;
|
||||
constexpr U8 LL_SOUND_FLAG_SYNC_MASTER = 1<<1;
|
||||
constexpr U8 LL_SOUND_FLAG_SYNC_SLAVE = 1<<2;
|
||||
constexpr U8 LL_SOUND_FLAG_SYNC_PENDING = 1<<3;
|
||||
constexpr U8 LL_SOUND_FLAG_QUEUE = 1<<4;
|
||||
constexpr U8 LL_SOUND_FLAG_STOP = 1<<5;
|
||||
constexpr U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYNC_SLAVE | LL_SOUND_FLAG_SYNC_PENDING;
|
||||
|
||||
//
|
||||
// *NOTE: These values may be used as hard-coded numbers in scanf() variants.
|
||||
|
|
@ -141,17 +141,17 @@ const U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYN
|
|||
// DO NOT CHANGE.
|
||||
// --------------
|
||||
//
|
||||
const U32 LL_MAX_PATH = 1024; // buffer size of maximum path + filename string length
|
||||
constexpr U32 LL_MAX_PATH = 1024; // buffer size of maximum path + filename string length
|
||||
|
||||
// For strings we send in messages
|
||||
const U32 STD_STRING_BUF_SIZE = 255; // Buffer size
|
||||
const U32 STD_STRING_STR_LEN = 254; // Length of the string (not including \0)
|
||||
constexpr U32 STD_STRING_BUF_SIZE = 255; // Buffer size
|
||||
constexpr U32 STD_STRING_STR_LEN = 254; // Length of the string (not including \0)
|
||||
|
||||
// *NOTE: This value is used as hard-coded numbers in scanf() variants.
|
||||
// DO NOT CHANGE.
|
||||
const U32 MAX_STRING = STD_STRING_BUF_SIZE; // Buffer size
|
||||
constexpr U32 MAX_STRING = STD_STRING_BUF_SIZE; // Buffer size
|
||||
|
||||
const U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 + 1 for good luck
|
||||
constexpr U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 + 1 for good luck
|
||||
|
||||
// C++ is our friend. . . use template functions to make life easier!
|
||||
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ private:
|
|||
|
||||
private:
|
||||
U64 mStartTime;
|
||||
BlockTimerStackRecord mParentTimerData;
|
||||
BlockTimerStackRecord mParentTimerData{};
|
||||
|
||||
public:
|
||||
// statics
|
||||
|
|
|
|||
|
|
@ -27,6 +27,12 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llfile.h"
|
||||
#include "llstring.h"
|
||||
#include "llerror.h"
|
||||
#include "stringize.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include "llwin32headerslean.h"
|
||||
#include <stdlib.h> // Windows errno
|
||||
|
|
@ -35,12 +41,6 @@
|
|||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llfile.h"
|
||||
#include "llstring.h"
|
||||
#include "llerror.h"
|
||||
#include "stringize.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
static std::string empty;
|
||||
|
|
@ -345,7 +345,7 @@ const char *LLFile::tmpdir()
|
|||
sep = '\\';
|
||||
|
||||
std::vector<wchar_t> utf16path(MAX_PATH + 1);
|
||||
GetTempPathW(utf16path.size(), &utf16path[0]);
|
||||
GetTempPathW(static_cast<DWORD>(utf16path.size()), &utf16path[0]);
|
||||
utf8path = ll_convert_wide_to_string(&utf16path[0]);
|
||||
#else
|
||||
sep = '/';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public:
|
|||
typedef typename std::vector<Type>::size_type size_type;
|
||||
protected:
|
||||
std::vector<Type> mVector;
|
||||
std::map<Key, U32> mIndexMap;
|
||||
std::map<Key, size_t> mIndexMap;
|
||||
|
||||
public:
|
||||
LLIndexedVector() { mVector.reserve(BlockSize); }
|
||||
|
|
@ -68,10 +68,10 @@ public:
|
|||
|
||||
Type& operator[](const Key& k)
|
||||
{
|
||||
typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
|
||||
typename std::map<Key, size_t>::const_iterator iter = mIndexMap.find(k);
|
||||
if (iter == mIndexMap.end())
|
||||
{
|
||||
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<Key, U32>::const_iterator iter = mIndexMap.find(k);
|
||||
typename std::map<Key, size_t>::const_iterator iter = mIndexMap.find(k);
|
||||
if(iter == mIndexMap.end())
|
||||
{
|
||||
return mVector.end();
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ public:
|
|||
|
||||
LL_DEBUGS("EventHost") << "Sending: "
|
||||
<< static_cast<U64>(buffer.tellp()) << ':';
|
||||
std::string::size_type truncate(80);
|
||||
llssize truncate(80);
|
||||
if (buffer.tellp() <= truncate)
|
||||
{
|
||||
LL_CONT << buffer.str();
|
||||
|
|
|
|||
|
|
@ -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$
|
||||
|
|
|
|||
|
|
@ -120,44 +120,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 <map> include file
|
||||
|
||||
#if ADDRESS_SIZE == 64
|
||||
// That one is all over the place for x64 builds.
|
||||
#pragma warning( disable : 4267 ) // 'var' : conversion from 'size_t' to 'type', possible loss of data)
|
||||
#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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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$
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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 <boost/json.hpp>
|
||||
|
||||
/// 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
|
||||
|
|
|
|||
|
|
@ -1546,7 +1546,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<u_long>(data.size()));
|
||||
ostr.write((const char*)(&size_nbo), sizeof(U32));
|
||||
LLSD::map_const_iterator iter = data.beginMap();
|
||||
LLSD::map_const_iterator end = data.endMap();
|
||||
|
|
@ -1563,7 +1563,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<u_long>(data.size()));
|
||||
ostr.write((const char*)(&size_nbo), sizeof(U32));
|
||||
LLSD::array_const_iterator iter = data.beginArray();
|
||||
LLSD::array_const_iterator end = data.endArray();
|
||||
|
|
@ -1630,7 +1630,7 @@ S32 LLSDBinaryFormatter::format_impl(const LLSD& data, std::ostream& ostr,
|
|||
{
|
||||
ostr.put('b');
|
||||
const std::vector<U8>& buffer = data.asBinary();
|
||||
U32 size_nbo = htonl(buffer.size());
|
||||
U32 size_nbo = htonl(static_cast<u_long>(buffer.size()));
|
||||
ostr.write((const char*)(&size_nbo), sizeof(U32));
|
||||
if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size());
|
||||
break;
|
||||
|
|
@ -1648,7 +1648,7 @@ void LLSDBinaryFormatter::formatString(
|
|||
const std::string& string,
|
||||
std::ostream& ostr) const
|
||||
{
|
||||
U32 size_nbo = htonl(string.size());
|
||||
U32 size_nbo = htonl(static_cast<u_long>(string.size()));
|
||||
ostr.write((const char*)(&size_nbo), sizeof(U32));
|
||||
ostr.write(string.c_str(), string.size());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
@ -528,6 +532,7 @@ public:
|
|||
classname<DERIVED_TYPE>(),
|
||||
" -- creating new instance"});
|
||||
// fall through
|
||||
[[fallthrough]];
|
||||
case UNINITIALIZED:
|
||||
case QUEUED:
|
||||
// QUEUED means some secondary thread has already requested an
|
||||
|
|
@ -826,7 +831,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 T>
|
||||
class LLSimpleton
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ inline bool vector_replace_with_last(std::vector<T>& invec, const T& val)
|
|||
template <typename T>
|
||||
inline T* vector_append(std::vector<T>& invec, S32 N)
|
||||
{
|
||||
U32 sz = invec.size();
|
||||
auto sz = invec.size();
|
||||
invec.resize(sz+N);
|
||||
return &(invec[sz]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ std::streamsize LLGenericStreamQueue<Ch>::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++);
|
||||
|
|
|
|||
|
|
@ -809,7 +809,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<int>(len_in),
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
|
|
@ -824,7 +824,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<int>(len_in),
|
||||
pout,
|
||||
len_out,
|
||||
0,
|
||||
|
|
@ -851,8 +851,8 @@ std::wstring ll_convert_string_to_wide(const char* in, size_t len, unsigned int
|
|||
std::vector<wchar_t> 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<int>(len),
|
||||
&w_out[0], static_cast<int>(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;
|
||||
|
|
@ -943,7 +943,7 @@ std::optional<std::wstring> 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<wchar_t> buffer(1024);
|
||||
auto n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], buffer.size());
|
||||
auto n = GetEnvironmentVariableW(wkey.c_str(), &buffer[0], static_cast<DWORD>(buffer.size()));
|
||||
// If our initial guess was too short, n will indicate the size (in
|
||||
// wchar_t's) that buffer should have been, including the terminating nul.
|
||||
if (n > (buffer.size() - 1))
|
||||
|
|
@ -951,7 +951,7 @@ std::optional<std::wstring> 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<DWORD>(buffer.size()));
|
||||
}
|
||||
// did that (ultimately) succeed?
|
||||
if (n)
|
||||
|
|
|
|||
|
|
@ -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); }
|
||||
|
||||
static id_t currentID(); // Return ID of current thread
|
||||
static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure.
|
||||
|
|
@ -90,11 +90,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();
|
||||
|
||||
|
|
@ -111,21 +111,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())); }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<S32>(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<S32>(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<S32>(strlen(HELLO_WORLD))); /* Flawfinder: ignore */
|
||||
std::string hello;
|
||||
std::string world;
|
||||
mem >> hello >> world;
|
||||
|
|
|
|||
|
|
@ -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<LLSD::Integer>(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<LLSD::Integer>(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<LLSD::Integer>(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<LLSD::Integer>(params[a].size() - dft_array_partial[a].size()));
|
||||
leftreq[a] = zipmap(llsd_copy_array(params[a].beginArray(),
|
||||
params[a].beginArray() + partition),
|
||||
LLSD::emptyArray());
|
||||
|
|
|
|||
|
|
@ -701,7 +701,7 @@ namespace tut
|
|||
"<key>cam</key><real>1.23</real>"
|
||||
"</map></llsd>",
|
||||
v,
|
||||
v.size() + 1);
|
||||
static_cast<S32>(v.size()) + 1);
|
||||
}
|
||||
|
||||
template<> template<>
|
||||
|
|
@ -721,7 +721,7 @@ namespace tut
|
|||
"<key>cam</key><real>1.23</real>"
|
||||
"</map></llsd>",
|
||||
v,
|
||||
v.size() + 1);
|
||||
static_cast<S32>(v.size()) + 1);
|
||||
|
||||
v.clear();
|
||||
v["amy"] = 23;
|
||||
|
|
@ -734,7 +734,7 @@ namespace tut
|
|||
"<key>cam</key><real>1.23</real>"
|
||||
"</map></llsd>",
|
||||
v,
|
||||
v.size() + 1);
|
||||
static_cast<S32>(v.size()) + 1);
|
||||
|
||||
v.clear();
|
||||
v["amy"] = 23;
|
||||
|
|
@ -751,7 +751,7 @@ namespace tut
|
|||
"<key>cam</key><real>1.23</real>"
|
||||
"</map></llsd>",
|
||||
v,
|
||||
v.size() + 1);
|
||||
static_cast<S32>(v.size()) + 1);
|
||||
|
||||
v.clear();
|
||||
v[0] = 23;
|
||||
|
|
@ -766,7 +766,7 @@ namespace tut
|
|||
"<real>1.23</real>"
|
||||
"</array></llsd>",
|
||||
v,
|
||||
v.size() + 1);
|
||||
static_cast<S32>(v.size()) + 1);
|
||||
|
||||
v.clear();
|
||||
v[0] = 23;
|
||||
|
|
@ -782,7 +782,7 @@ namespace tut
|
|||
"<real>1.23</real>"
|
||||
"</array></llsd>",
|
||||
v,
|
||||
v.size() + 1);
|
||||
static_cast<S32>(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));
|
||||
|
|
|
|||
|
|
@ -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$
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
{
|
||||
|
|
@ -442,18 +442,18 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode
|
|||
|
||||
int HttpLibcurl::getActiveCount() const
|
||||
{
|
||||
return mActiveOps.size();
|
||||
return static_cast<int>(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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -267,7 +267,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<unsigned int>(mReplyLength), static_cast<unsigned int>(mReplyFullLength));
|
||||
}
|
||||
response->setContentType(mReplyConType);
|
||||
response->setRetries(mPolicyRetries, mPolicy503Retries);
|
||||
|
|
@ -328,7 +328,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<off_t>(offset);
|
||||
mReqLength = len;
|
||||
if (offset || len)
|
||||
{
|
||||
|
|
@ -607,7 +607,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
|
|||
long data_size(0);
|
||||
if (mReqBody)
|
||||
{
|
||||
data_size = mReqBody->size();
|
||||
data_size = static_cast<long>(mReqBody->size());
|
||||
}
|
||||
check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast<void *>(NULL));
|
||||
check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size);
|
||||
|
|
@ -618,13 +618,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<long>(mReqBody->size());
|
||||
}
|
||||
check_curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size);
|
||||
mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:");
|
||||
|
|
|
|||
|
|
@ -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<HttpRequest::policy_t>(mClasses.size()));
|
||||
if (policy_class >= HTTP_POLICY_CLASS_LIMIT)
|
||||
{
|
||||
return HttpRequest::INVALID_POLICY_ID;
|
||||
|
|
@ -432,8 +432,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<int>((mClasses[policy_class]->mReadyQueue.size()
|
||||
+ mClasses[policy_class]->mRetryQueue.size()));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
|
@ -33,8 +35,6 @@
|
|||
#include <pthread.h>
|
||||
#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<long>(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<int>(mAssets.size());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ std::string getStartupStateFromLog(std::string& sllog)
|
|||
std::string startup_state = "STATE_FIRST";
|
||||
std::string startup_token = "Startup state changing from ";
|
||||
|
||||
int index = sllog.rfind(startup_token);
|
||||
auto index = sllog.rfind(startup_token);
|
||||
if (index < 0 || index + startup_token.length() > sllog.length()) {
|
||||
return startup_state;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -638,7 +638,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;
|
||||
}
|
||||
|
|
@ -883,8 +883,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] = '_';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -233,7 +233,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);
|
||||
|
|
|
|||
|
|
@ -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<S32>(sLocal->update((F32)ms_elapsed));
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
|
|||
|
|
@ -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<S32>(llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t)));
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -467,7 +467,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;
|
||||
}
|
||||
|
|
@ -1179,7 +1179,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;
|
||||
|
|
@ -1206,7 +1206,7 @@ bool LLImageTGA::loadFile( const std::string& path )
|
|||
}
|
||||
|
||||
U8* buffer = allocateData(file_size);
|
||||
S32 bytes_read = fread(buffer, 1, file_size, file);
|
||||
S32 bytes_read = static_cast<S32>(fread(buffer, 1, file_size, file));
|
||||
if( bytes_read != file_size )
|
||||
{
|
||||
deleteData();
|
||||
|
|
|
|||
|
|
@ -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<S32>(destSize);
|
||||
png_set_write_fn(mWritePngPtr, &dataPtr, &writeDataCallback, &writeFlush);
|
||||
|
||||
// Setup image params
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ static OPJ_OFF_T opj_skip(OPJ_OFF_T bytes, void* user_data)
|
|||
JPEG2KBase* jpeg_codec = static_cast<JPEG2KBase*>(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
|
||||
|
|
@ -793,7 +793,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;
|
||||
|
|
|
|||
|
|
@ -111,10 +111,10 @@ const LLSettingsDay::Seconds LLSettingsDay::MINIMUM_DAYOFFSET(0);
|
|||
const LLSettingsDay::Seconds LLSettingsDay::DEFAULT_DAYOFFSET(57600); // +16 hours == -8 hours (SLT time offset)
|
||||
const LLSettingsDay::Seconds LLSettingsDay::MAXIMUM_DAYOFFSET(86400); // 24 hours
|
||||
|
||||
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);
|
||||
|
||||
|
|
@ -462,7 +462,7 @@ namespace
|
|||
// Trim extra tracks.
|
||||
while (value.size() > LLSettingsDay::TRACK_MAX)
|
||||
{
|
||||
value.erase(value.size() - 1);
|
||||
value.erase(static_cast<LLSD::Integer>(value.size()) - 1);
|
||||
}
|
||||
|
||||
S32 framecount(0);
|
||||
|
|
@ -511,7 +511,7 @@ namespace
|
|||
|
||||
}
|
||||
|
||||
int waterTracks = value[0].size();
|
||||
int waterTracks = static_cast<int>(value[0].size());
|
||||
int skyTracks = framecount - waterTracks;
|
||||
|
||||
if (waterTracks < 1)
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@ public:
|
|||
static const Seconds DEFAULT_DAYOFFSET;
|
||||
static const Seconds MAXIMUM_DAYOFFSET;
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ public:
|
|||
|
||||
S32 i = data->getBinIndex();
|
||||
|
||||
if (i >= 0 && i < getElementCount())
|
||||
if (i >= 0 && i < (S32)getElementCount())
|
||||
{
|
||||
if (mData[i] == data)
|
||||
{ //found it
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public:
|
|||
inline operator bool() const { return static_cast<const bool&>(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
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<LLSphere>& 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
|
||||
|
|
|
|||
|
|
@ -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<U32>(mListeners.size()); }
|
||||
virtual LLTreeListener<T>* getListener(U32 index) const
|
||||
{
|
||||
if (index < mListeners.size())
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
LLQuad mQ;
|
||||
LLQuad mQ{};
|
||||
};
|
||||
|
||||
#endif //LL_VECTOR4ALOGICAL_H
|
||||
|
|
|
|||
|
|
@ -2320,7 +2320,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
|
||||
|
|
@ -2352,7 +2352,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)
|
||||
{
|
||||
|
|
@ -2360,7 +2360,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<S32>(num_indices));
|
||||
|
||||
if (num_indices > 2 && !face.mIndices)
|
||||
{
|
||||
|
|
@ -2381,7 +2381,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
|
|||
}
|
||||
|
||||
//copy out vertices
|
||||
U32 num_verts = pos.size()/(3*2);
|
||||
U32 num_verts = static_cast<U32>(pos.size())/(3*2);
|
||||
face.resizeVertices(num_verts);
|
||||
|
||||
if (num_verts > 0 && !face.mPositions)
|
||||
|
|
@ -2645,7 +2645,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];
|
||||
|
|
@ -2682,7 +2682,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]);
|
||||
}
|
||||
|
|
@ -3778,7 +3778,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &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++)
|
||||
{
|
||||
|
|
@ -3904,7 +3904,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &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];
|
||||
|
|
@ -3941,7 +3941,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &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
|
||||
|
|
@ -4943,13 +4943,13 @@ void LLVolumeFace::remap()
|
|||
{
|
||||
// Generate a remap buffer
|
||||
std::vector<unsigned int> remap(mNumVertices);
|
||||
S32 remap_vertices_count = LLMeshOptimizer::generateRemapMultiU16(&remap[0],
|
||||
S32 remap_vertices_count = static_cast<S32>(LLMeshOptimizer::generateRemapMultiU16(&remap[0],
|
||||
mIndices,
|
||||
mNumIndices,
|
||||
mPositions,
|
||||
mNormals,
|
||||
mTexCoords,
|
||||
mNumVertices);
|
||||
mNumVertices));
|
||||
|
||||
// Allocate new buffers
|
||||
S32 size = ((mNumIndices * sizeof(U16)) + 0xF) & ~0xF;
|
||||
|
|
@ -4994,7 +4994,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];
|
||||
|
||||
|
|
@ -5380,7 +5380,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];
|
||||
|
||||
|
|
@ -5391,17 +5391,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());
|
||||
|
|
@ -5473,7 +5462,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<S32>(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count));
|
||||
|
||||
if (vert_count < 65535 && vert_count != 0)
|
||||
{
|
||||
|
|
@ -5487,11 +5476,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.
|
||||
|
|
@ -5518,7 +5507,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);
|
||||
|
|
@ -6373,7 +6362,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();
|
||||
|
|
@ -6549,8 +6538,8 @@ void LLVolumeFace::pushIndex(const U16& idx)
|
|||
|
||||
void LLVolumeFace::fillFromLegacyData(std::vector<LLVolumeFace::VertexData>& v, std::vector<U16>& idx)
|
||||
{
|
||||
resizeVertices(v.size());
|
||||
resizeIndices(idx.size());
|
||||
resizeVertices(static_cast<S32>(v.size()));
|
||||
resizeIndices(static_cast<S32>(idx.size()));
|
||||
|
||||
for (U32 i = 0; i < v.size(); ++i)
|
||||
{
|
||||
|
|
@ -6645,7 +6634,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;
|
||||
|
|
|
|||
|
|
@ -1022,7 +1022,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<S32>(mVolumeFaces.size()); }
|
||||
F32 getDetail() const { return mDetail; }
|
||||
F32 getSurfaceArea() const { return mSurfaceArea; }
|
||||
const LLVolumeParams& getParams() const { return mParams; }
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void LLOctreeTriangleRayIntersect::traverse(const LLOctreeNode<LLVolumeTriangle,
|
|||
if (LLLineSegmentBoxIntersect(mStart, mEnd, vl->mBounds[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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<>
|
||||
|
|
|
|||
|
|
@ -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])));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,17 +196,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
|
||||
|
|
@ -226,11 +226,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)
|
||||
|
|
|
|||
|
|
@ -133,57 +133,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);
|
||||
}
|
||||
|
||||
|
|
@ -191,22 +191,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);
|
||||
}
|
||||
|
|
@ -214,10 +214,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);
|
||||
}
|
||||
|
||||
|
|
@ -257,45 +257,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;
|
||||
}
|
||||
|
||||
|
|
@ -408,10 +408,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())
|
||||
|
|
@ -422,18 +422,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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,10 +242,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)
|
||||
|
|
@ -255,113 +255,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<F32>(vec[VX]);
|
||||
mV[VY] = static_cast<F32>(vec[VY]);
|
||||
mV[VZ] = static_cast<F32>(vec[VZ]);
|
||||
mV[VW] = static_cast<F32>(vec[VW]);
|
||||
mV[VRED] = static_cast<F32>(vec[VRED]);
|
||||
mV[VGREEN] = static_cast<F32>(vec[VGREEN]);
|
||||
mV[VBLUE] = static_cast<F32>(vec[VBLUE]);
|
||||
mV[VALPHA] = static_cast<F32>(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);
|
||||
}
|
||||
|
|
@ -369,20 +369,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);
|
||||
}
|
||||
|
||||
|
|
@ -390,16 +390,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);
|
||||
}
|
||||
|
||||
|
|
@ -407,25 +407,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);
|
||||
}
|
||||
|
|
@ -433,27 +433,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);
|
||||
}
|
||||
|
|
@ -464,135 +464,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;
|
||||
}
|
||||
|
||||
|
|
@ -614,10 +614,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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<typename T, typename... U>
|
||||
// bool operator == (const std::function<T(U...)> &a, const std::function <T(U...)> &b)
|
||||
// {
|
||||
// typedef T(fnType)(U...);
|
||||
//
|
||||
//
|
||||
// auto fnPtrA = a.target<T(*)(U...)>();
|
||||
// auto fnPtrB = b.target<T(*)(U...)>();
|
||||
// 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<S32>(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<void(*)(const LLUUID &, LLAssetType::EType, void *, S32, LLExtStat)>();
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -248,7 +248,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; "
|
||||
|
|
|
|||
|
|
@ -562,13 +562,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)
|
||||
|
|
@ -577,7 +577,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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -781,8 +781,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())
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public:
|
|||
///
|
||||
inline S32 count() const
|
||||
{
|
||||
return countPending() + countActive();
|
||||
return static_cast<S32>(countPending() + countActive());
|
||||
}
|
||||
|
||||
void close();
|
||||
|
|
|
|||
|
|
@ -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_INFOS()
|
||||
<< "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<LLSD::Binary &>( 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<completionCallback_t>(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success));
|
||||
completionCallback_t cbFailure = (failure.empty()) ? NULL :
|
||||
static_cast<completionCallback_t>(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);
|
||||
|
|
|
|||
|
|
@ -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<S32>(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<S32>(value.length()) + 1; /*Flawfinder: ignore*/
|
||||
}
|
||||
|
||||
// snprintf returns number of bytes that would have been written
|
||||
|
|
|
|||
|
|
@ -274,12 +274,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<int>(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<int>(buffer.size()));
|
||||
ostr.write(b64_buffer, b64_buffer_length - 1);
|
||||
delete[] b64_buffer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<S32>(header.size()));
|
||||
PUMP_DEBUG;
|
||||
return STATUS_DONE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -346,7 +346,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<S32>(len));
|
||||
} while((APR_SUCCESS == status) && (READ_BUFFER_SIZE == len));
|
||||
LL_DEBUGS() << "socket read status: " << status << LL_ENDL;
|
||||
LLIOPipe::EStatus rv = STATUS_OK;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue