From 8729c0d2c41d7acb2357a5ba9f3a713fe9bcc426 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Wed, 12 Jun 2024 11:41:20 -0700 Subject: Fixup more signed/unsigned warnings after merge. --- indra/newview/gltf/primitive.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/gltf/primitive.cpp') diff --git a/indra/newview/gltf/primitive.cpp b/indra/newview/gltf/primitive.cpp index dd37b5b4d0..2280c7004e 100644 --- a/indra/newview/gltf/primitive.cpp +++ b/indra/newview/gltf/primitive.cpp @@ -56,9 +56,9 @@ struct MikktMesh bool copy(const Primitive* prim) { bool indexed = !prim->mIndexArray.empty(); - auto vert_count = indexed ? prim->mIndexArray.size() : prim->mPositions.size(); + size_t vert_count = indexed ? prim->mIndexArray.size() : prim->mPositions.size(); - U32 triangle_count = 0; + size_t triangle_count = 0; if (prim->mMode == Primitive::Mode::TRIANGLE_STRIP || prim->mMode == Primitive::Mode::TRIANGLE_FAN) @@ -76,6 +76,7 @@ struct MikktMesh } vert_count = triangle_count * 3; + llassert(vert_count <= size_t(U32_MAX)); // triangle_count will also naturally be under the limit p.resize(vert_count); n.resize(vert_count); @@ -106,7 +107,7 @@ struct MikktMesh tc1.resize(vert_count); } - for (int tri_idx = 0; tri_idx < triangle_count; ++tri_idx) + for (U32 tri_idx = 0; tri_idx < U32(triangle_count); ++tri_idx) { U32 idx[3]; @@ -222,7 +223,7 @@ struct MikktMesh std::vector remap; remap.resize(p.size()); - U32 stream_count = mos.size(); + size_t stream_count = mos.size(); size_t vert_count = meshopt_generateVertexRemapMulti(&remap[0], nullptr, p.size(), p.size(), mos.data(), stream_count); -- cgit v1.2.3