From de7863598f89118aee2216a4ba729b5cfeb31814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Fri, 28 Sep 2018 09:32:26 +0200 Subject: [PATCH] color: Fix -Wdouble-promotion warnings --- sys/color/color.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/color/color.c b/sys/color/color.c index a682d2adf6..c36e06ce98 100644 --- a/sys/color/color.c +++ b/sys/color/color.c @@ -55,7 +55,7 @@ void color_rgb2hsv(color_rgb_t *rgb, color_hsv_t *hsv) /* compute hue */ hsv->h = 0.0f; - if (hsv->s != 0.0) { + if (hsv->s != 0.0f) { float rc, gc, bc; rc = (hsv->v - rd) / delta; @@ -73,7 +73,7 @@ void color_rgb2hsv(color_rgb_t *rgb, color_hsv_t *hsv) } hsv->h *= 60.0f; if (hsv->h < 0.0f) { - hsv->h += 360.0; + hsv->h += 360.0f; } } } @@ -90,7 +90,7 @@ void color_hsv2rgb(color_hsv_t *hsv, color_rgb_t *rgb) return; } - h = (hsv->h == 360.0f) ? 0.0 : hsv->h; + h = (hsv->h == 360.0f) ? 0.0f : hsv->h; h /= 60.0f; i = (int)h; f = h - i;