diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-11-26 20:21:12 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-11-26 20:21:12 +0000 |
commit | 239b3ab10b460da34c490a7e06a21c984e21ffb6 (patch) | |
tree | 4ce09f5d091ffbcf063a9d0fc076659dfe9e3142 /gfx/image.cpp | |
parent | Don't run the app by default (diff) | |
download | ilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.tar.bz2 ilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.tar.xz ilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.zip |
Enable all Jason Turner recommended warnings
Diffstat (limited to 'gfx/image.cpp')
-rw-r--r-- | gfx/image.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gfx/image.cpp b/gfx/image.cpp index 41c59a2..e3e3b01 100644 --- a/gfx/image.cpp +++ b/gfx/image.cpp @@ -6,7 +6,11 @@ Image::Image(const char * fileName, int flags) : width {}, height {}, numComponents {} { stbi_set_flip_vertically_on_load(1); - unsigned char * bytes = stbi_load(fileName, &width, &height, &numComponents, flags); + int w, h, nc; + unsigned char * bytes = stbi_load(fileName, &w, &h, &nc, flags); + width = static_cast<unsigned int>(w); + height = static_cast<unsigned int>(h); + numComponents = static_cast<unsigned int>(nc); if (!bytes) { throw std::runtime_error {std::string {"Unable to load image: "} + fileName}; |