summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2024-06-01 15:49:26 +0200
committerAnsariel <ansariel.hiller@phoenixviewer.com>2024-06-01 15:49:26 +0200
commitb42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 (patch)
treed73404c2fbacce379a57e2d03a6cd54558590859 /indra/llmath
parentcb3bd8865aa0f9fb8a247ea595cf1973057ba91f (diff)
Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llsphere.cpp2
-rw-r--r--indra/llmath/lltreenode.h2
-rw-r--r--indra/llmath/llvolume.cpp18
-rw-r--r--indra/llmath/llvolume.h2
4 files changed, 12 insertions, 12 deletions
diff --git a/indra/llmath/llsphere.cpp b/indra/llmath/llsphere.cpp
index 89349af6c8..5f48764455 100644
--- a/indra/llmath/llsphere.cpp
+++ b/indra/llmath/llsphere.cpp
@@ -185,7 +185,7 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<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
diff --git a/indra/llmath/lltreenode.h b/indra/llmath/lltreenode.h
index f648a114ca..e3d30206b7 100644
--- a/indra/llmath/lltreenode.h
+++ b/indra/llmath/lltreenode.h
@@ -57,7 +57,7 @@ public:
virtual bool remove(T* data);
virtual void notifyRemoval(T* data);
virtual U32 hasListeners() const { return !mListeners.empty(); }
- virtual U32 getListenerCount() const { return mListeners.size(); }
+ virtual U32 getListenerCount() const { return static_cast<U32>(mListeners.size()); }
virtual LLTreeListener<T>* getListener(U32 index) const
{
if (index < mListeners.size())
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index e6001626f3..b6f710f979 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2392,7 +2392,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
@@ -2424,7 +2424,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)
{
@@ -2432,7 +2432,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)
{
@@ -2453,7 +2453,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)
@@ -5015,13 +5015,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;
@@ -5565,7 +5565,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)
{
@@ -6648,8 +6648,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)
{
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 44a24f8496..e812e5f0cc 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -1019,7 +1019,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; }