mirror of
https://github.com/nothings/stb
synced 2024-12-15 04:22:35 +03:00
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 <filip.wasil@gmail.com>
This commit is contained in:
parent
385927fb4b
commit
8cea0090b2
@ -467,7 +467,7 @@ void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)
|
|||||||
int exponent;
|
int exponent;
|
||||||
float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2]));
|
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;
|
rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0;
|
||||||
} else {
|
} else {
|
||||||
float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp;
|
float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp;
|
||||||
|
Loading…
Reference in New Issue
Block a user