From 239b3ab10b460da34c490a7e06a21c984e21ffb6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 26 Nov 2021 20:21:12 +0000 Subject: Enable all Jason Turner recommended warnings --- gfx/image.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gfx/image.cpp') 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(w); + height = static_cast(h); + numComponents = static_cast(nc); if (!bytes) { throw std::runtime_error {std::string {"Unable to load image: "} + fileName}; -- cgit v1.2.3