Skip to content

Commit

Permalink
Add size_t casts
Browse files Browse the repository at this point in the history
  • Loading branch information
j9liu committed Jan 9, 2024
1 parent 338b3e4 commit 4c22bae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CesiumGltf/test/TestAccessorUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ TEST_CASE("Test IndicesForFaceFromAccessor") {
REQUIRE(model.accessors.size() > 0);
IndexAccessorType indexAccessor =
AccessorView<uint32_t>(model, model.accessors[0]);
const size_t numFaces = std::visit(CountFromAccessor{}, indexAccessor) / 3;
const size_t numFaces =
static_cast<size_t>(std::visit(CountFromAccessor{}, indexAccessor) / 3);

for (size_t i = 0; i < numFaces; i++) {
auto indicesForFace = std::visit(
Expand All @@ -439,7 +440,8 @@ TEST_CASE("Test IndicesForFaceFromAccessor") {
REQUIRE(model.accessors.size() > 1);
IndexAccessorType indexAccessor =
AccessorView<uint32_t>(model, model.accessors[1]);
const size_t numFaces = std::visit(CountFromAccessor{}, indexAccessor) - 2;
const size_t numFaces =
static_cast<size_t>(std::visit(CountFromAccessor{}, indexAccessor) - 2);
for (size_t i = 0; i < numFaces; i++) {
auto indicesForFace = std::visit(
IndicesForFaceFromAccessor{
Expand All @@ -459,7 +461,8 @@ TEST_CASE("Test IndicesForFaceFromAccessor") {
REQUIRE(model.accessors.size() > 1);
IndexAccessorType indexAccessor =
AccessorView<uint32_t>(model, model.accessors[1]);
const size_t numFaces = std::visit(CountFromAccessor{}, indexAccessor) - 2;
const size_t numFaces =
static_cast<size_t>(std::visit(CountFromAccessor{}, indexAccessor) - 2);
for (size_t i = 0; i < numFaces; i++) {
auto indicesForFace = std::visit(
IndicesForFaceFromAccessor{
Expand Down

0 comments on commit 4c22bae

Please sign in to comment.