From 2762b410fed870cc5db29a4e34e4eedaaf84f368 Mon Sep 17 00:00:00 2001 From: Michaelangel007 Date: Tue, 30 Jun 2015 08:02:24 -0600 Subject: [PATCH 1/2] Fix unused vars warning in stbi_is_hdr_from_file stbi_is_hdr_from_callbacks --- stb_image.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stb_image.h b/stb_image.h index d0fa9c2..ea5cc9f 100644 --- a/stb_image.h +++ b/stb_image.h @@ -1153,6 +1153,7 @@ STBIDEF int stbi_is_hdr_from_file(FILE *f) stbi__start_file(&s,f); return stbi__hdr_test(&s); #else + STBI_NOTUSED(f); return 0; #endif } @@ -1165,6 +1166,8 @@ STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); return stbi__hdr_test(&s); #else + STBI_NOTUSED(clbk); + STBI_NOTUSED(user); return 0; #endif } From c11532b8723d548a2444d67691b2cd27a1111152 Mon Sep 17 00:00:00 2001 From: Michaelangel007 Date: Tue, 30 Jun 2015 08:54:14 -0600 Subject: [PATCH 2/2] Cleanup unused functions --- stb_image.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stb_image.h b/stb_image.h index ea5cc9f..57a24d3 100644 --- a/stb_image.h +++ b/stb_image.h @@ -989,6 +989,7 @@ static unsigned char *stbi__load_flip(stbi__context *s, int *x, int *y, int *com return result; } +#ifndef STBI_NO_HDR static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp) { if (stbi__vertically_flip_on_load && result != NULL) { @@ -1009,7 +1010,7 @@ static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, in } } } - +#endif #ifndef STBI_NO_STDIO @@ -1288,17 +1289,22 @@ static stbi__uint32 stbi__get32be(stbi__context *s) return (z << 16) + stbi__get16be(s); } +#if defined (STBI_NO_BMP) && (STBI_NO_TGA) && (STBI_NO_GIF) +#else static int stbi__get16le(stbi__context *s) { int z = stbi__get8(s); return z + (stbi__get8(s) << 8); } +#endif +#ifndef STBI_NO_BMP static stbi__uint32 stbi__get32le(stbi__context *s) { stbi__uint32 z = stbi__get16le(s); return z + (stbi__get16le(s) << 16); } +#endif #define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings