From c0fad3028fd55c2067ce6a0ae4382cffe1014284 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 10 Jun 2024 16:42:43 +0200 Subject: Re-enable compiler warnings C4018, C4100, C4231 and C4506 --- indra/llmath/lloctree.h | 2 +- indra/llmath/llvolume.cpp | 28 ++++++++++++++-------------- indra/llmath/llvolumeoctree.cpp | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'indra/llmath') diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 475ce20ae6..eaa2763d2d 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -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 diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index b6f710f979..bbe08f3c9c 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -410,7 +410,7 @@ public: llassert(!branch->isLeaf()); // Empty leaf } - for (S32 i = 0; i < branch->getChildCount(); ++i) + for (U32 i = 0; i < branch->getChildCount(); ++i) { //stretch by child extents LLVolumeOctreeListener* child = (LLVolumeOctreeListener*) branch->getChild(i)->getListener(0); min.setMin(min, child->mExtents[0]); @@ -2717,7 +2717,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]; @@ -2754,7 +2754,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]); } @@ -3850,7 +3850,7 @@ void LLVolume::generateSilhouetteVertices(std::vector &vertices, LLVector4a* v = (LLVector4a*)face.mPositions; LLVector4a* n = (LLVector4a*)face.mNormals; - for (U32 j = 0; j < face.mNumIndices / 3; j++) + for (S32 j = 0; j < face.mNumIndices / 3; j++) { for (S32 k = 0; k < 3; k++) { @@ -3976,7 +3976,7 @@ void LLVolume::generateSilhouetteVertices(std::vector &vertices, LLVector4a* v = (LLVector4a*) face.mPositions; LLVector4a* n = (LLVector4a*) face.mNormals; - for (U32 j = 0; j < face.mNumIndices/3; j++) + for (S32 j = 0; j < face.mNumIndices/3; j++) { //approximate normal S32 v1 = face.mIndices[j*3+0]; @@ -4013,7 +4013,7 @@ void LLVolume::generateSilhouetteVertices(std::vector &vertices, } //for each triangle - for (U32 j = 0; j < face.mNumIndices/3; j++) + for (S32 j = 0; j < face.mNumIndices/3; j++) { if (fFacing[j] == (AWAY | TOWARDS)) { //this is a degenerate triangle @@ -5066,7 +5066,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]; @@ -5452,7 +5452,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]; @@ -5463,7 +5463,7 @@ struct MikktData n[i].normalize(); tc[i].set(face->mTexCoords[idx]); - if (idx >= face->mNumVertices) + if (idx >= (U32)face->mNumVertices) { // invalid index // replace with a valid index to avoid crashes @@ -5582,11 +5582,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. @@ -5613,7 +5613,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); @@ -6472,7 +6472,7 @@ void LLVolumeFace::createTangents() CalculateTangentArray(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(); @@ -6744,7 +6744,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) { // Get s value for tex-coord. S32 index = mBeginS + s; - if (index >= profile.size()) + if (index >= (S32)profile.size()) { // edge? ss = flat ? 1.f - begin_stex : 1.f; diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp index 74d496fa02..abcd47ea23 100644 --- a/indra/llmath/llvolumeoctree.cpp +++ b/indra/llmath/llvolumeoctree.cpp @@ -113,7 +113,7 @@ void LLOctreeTriangleRayIntersect::traverse(const LLOctreeNodemBounds[0], vl->mBounds[1])) { node->accept(this); - for (S32 i = 0; i < node->getChildCount(); ++i) + for (U32 i = 0; i < node->getChildCount(); ++i) { traverse(node->getChild(i)); } -- cgit v1.2.3