From 4660a7dca6512b6e658759d00cff7d4ad2a2059d Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 31 Mar 2020 18:43:46 -0300 Subject: texturator: Fix float to bool conversion warning The following build warning is seen: ../texturator.c:603:45: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context] *complemented = (((float)rgba[2]) / 255.0) / 0.25; Fix it by using the != 0.0f construction to properly convert from float to bool. Signed-off-by: Fabio Estevam --- texturator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texturator.c b/texturator.c index a450dfe..8695a63 100644 --- a/texturator.c +++ b/texturator.c @@ -602,7 +602,7 @@ static void extract_pix(uint8_t *rgba, int *slice, int *level, bool *complemente { *slice = (((float)rgba[0]) / 255.0) * 8.0; *level = (((float)rgba[1]) / 255.0) * 16.0; - *complemented = (((float)rgba[2]) / 255.0) / 0.25; + *complemented = (((float)rgba[2]) / 255.0) / 0.25 != 0.0f; } static bool probe_pix(int x, int y, int w, int h, int s, int m) -- cgit v1.2.1