From 8cea0090b2fcb193b32d9c33a5ee0155f23dfa64 Mon Sep 17 00:00:00 2001 From: Filip Wasil Date: Thu, 29 Oct 2015 16:09:21 +0100 Subject: [PATCH] Removie implicit cast to float When compiling with more restrictive compiler options such casting from double to float will cause a warning. Ex. GCC -Wdouble-promotion Signed-off-by: Filip Wasil --- stb_image_write.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_image_write.h b/stb_image_write.h index 38d3835..6c241ea 100644 --- a/stb_image_write.h +++ b/stb_image_write.h @@ -467,7 +467,7 @@ void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) int exponent; float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2])); - if (maxcomp < 1e-32) { + if (maxcomp < 1e-32f) { rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0; } else { float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp;