Skip to content

Commit

Permalink
examples: fix -Wsign-compare
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Jul 13, 2024
1 parent 061b19d commit df838ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example1/example1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static bool print_dds_info(const void* pData, crn_uint32 data_size) {
"DDSD_TEXTURESTAGE", "DDSD_FVF", "DDSD_SRCVBHANDLE", "DDSD_DEPTH"};

printf("DDSD Flags: 0x%08X ", desc.dwFlags);
for (int i = 0; i < sizeof(pDDSDFlagNames) / sizeof(pDDSDFlagNames[0]); i++)
for (uint i = 0; i < sizeof(pDDSDFlagNames) / sizeof(pDDSDFlagNames[0]); i++)
if ((pDDSDFlagNames[i]) && (desc.dwFlags & (1 << i)))
printf("%s ", pDDSDFlagNames[i]);
printf("\n\n");
Expand Down Expand Up @@ -229,7 +229,7 @@ static bool print_dds_info(const void* pData, crn_uint32 data_size) {
"DDSCAPS2_CUBEMAP_POSITIVEY", "DDSCAPS2_CUBEMAP_NEGATIVEY", "DDSCAPS2_CUBEMAP_POSITIVEZ", "DDSCAPS2_CUBEMAP_NEGATIVEZ",
NULL, NULL, NULL, NULL,
NULL, "DDSCAPS2_VOLUME"};
for (int i = 0; i < sizeof(pDDCAPS2FlagNames) / sizeof(pDDCAPS2FlagNames[0]); i++)
for (uint i = 0; i < sizeof(pDDCAPS2FlagNames) / sizeof(pDDCAPS2FlagNames[0]); i++)
if ((pDDCAPS2FlagNames[i]) && (desc.ddsCaps.dwCaps2 & (1 << i)))
printf("%s ", pDDCAPS2FlagNames[i]);
printf("\n");
Expand Down
4 changes: 2 additions & 2 deletions example3/example3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ int main(int argc, char* argv[]) {

// Exact block from image, clamping at the sides of non-divisible by 4 images to avoid artifacts.
crn_uint32* pDst_pixels = pixels;
for (int y = 0; y < cDXTBlockSize; y++) {
for (uint y = 0; y < cDXTBlockSize; y++) {
const uint actual_y = std::min(height - 1U, (block_y * cDXTBlockSize) + y);
for (int x = 0; x < cDXTBlockSize; x++) {
for (uint x = 0; x < cDXTBlockSize; x++) {
const uint actual_x = std::min(width - 1U, (block_x * cDXTBlockSize) + x);
*pDst_pixels++ = pSrc_image[actual_x + actual_y * width];
}
Expand Down

0 comments on commit df838ce

Please sign in to comment.