diff options
author | Fabio Estevam <festevam@gmail.com> | 2020-03-31 18:43:46 -0300 |
---|---|---|
committer | Fabio Estevam <festevam@gmail.com> | 2020-03-31 22:43:48 -0300 |
commit | 4660a7dca6512b6e658759d00cff7d4ad2a2059d (patch) | |
tree | b6a016d6beccd49d5677d20724bc91ec24ff101c | |
parent | c60e990876588f8b2c48402d949d112bfa35d4b1 (diff) | |
download | kmscube-4660a7dca6512b6e658759d00cff7d4ad2a2059d.tar.gz |
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 <festevam@gmail.com>
-rw-r--r-- | texturator.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |