Skip to content

Commit

Permalink
Krzysztof domanski fix type compare warning (#88)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
KrzysztofDomanski committed Oct 28, 2021
1 parent 05718d5 commit d806b75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GLTFSDK/Inc/GLTFSDK/GLTFResourceReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ namespace Microsoft
for (size_t i = 0; i < indices.size(); i++)
{
// Verify provided index is valid before storing value
if ((indices[i] * typeCount + (typeCount - 1)) < static_cast<int>(baseData.size()))
if ((indices[i] * typeCount + (typeCount - 1)) < static_cast<I>(baseData.size()))
{
for (size_t j = 0; j < typeCount; j++)
{
Expand Down

0 comments on commit d806b75

Please sign in to comment.