Skip to content

Commit d806b75

Browse files
Krzysztof domanski fix type compare warning (#88)
* Change static cast from "int" to use the index type By using "int", this produces "error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]" Static cast is technically not needed at all here since all usages of this function specialize it with an unsigned int, but in order to be future proof static cast it to the type of indices.
1 parent 05718d5 commit d806b75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GLTFSDK/Inc/GLTFSDK/GLTFResourceReader.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ namespace Microsoft
390390
for (size_t i = 0; i < indices.size(); i++)
391391
{
392392
// Verify provided index is valid before storing value
393-
if ((indices[i] * typeCount + (typeCount - 1)) < static_cast<int>(baseData.size()))
393+
if ((indices[i] * typeCount + (typeCount - 1)) < static_cast<I>(baseData.size()))
394394
{
395395
for (size_t j = 0; j < typeCount; j++)
396396
{

0 commit comments

Comments
 (0)