Skip to content

Commit

Permalink
suppress some compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
syoyo committed Aug 3, 2024
1 parent 2c9d944 commit 5bc3cb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/image-types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ struct Image {

inline std::string to_string(Image::PixelFormat fmt) {
std::string s{"[[InvalidPixelFormat]]"};
switch (fmt) {
case Image::PixelFormat::UInt: { s = "uint"; break; }
case Image::PixelFormat::Int: { s = "int"; break; }
case Image::PixelFormat::Float: { s = "float"; break; }
}
// work around for false-positive behavior of `error: 'switch' missing 'default' label [-Werror,-Wswitch-default]`
// happens in NDK 27 clang
if (Image::PixelFormat::UInt == fmt) { s = "uint"; }
else if (Image::PixelFormat::Int == fmt) { s = "int"; }
else if (Image::PixelFormat::Float == fmt) { s = "float"; }

return s;
}
Expand Down
1 change: 1 addition & 0 deletions src/image-util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif

#if !defined(TINYUSDZ_NO_STB_IMAGE_RESIZE_IMPLEMENTATION)
Expand Down

0 comments on commit 5bc3cb7

Please sign in to comment.