Skip to content
Snippets Groups Projects
Unverified Commit b4664a5b authored by Kaspar Schleiser's avatar Kaspar Schleiser Committed by GitHub
Browse files

Merge pull request #10067 from gebart/pr/color-Wdouble-promotion

color: Fix -Wdouble-promotion warnings
parents f2d28f88 de786359
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ void color_rgb2hsv(color_rgb_t *rgb, color_hsv_t *hsv) ...@@ -55,7 +55,7 @@ void color_rgb2hsv(color_rgb_t *rgb, color_hsv_t *hsv)
/* compute hue */ /* compute hue */
hsv->h = 0.0f; hsv->h = 0.0f;
if (hsv->s != 0.0) { if (hsv->s != 0.0f) {
float rc, gc, bc; float rc, gc, bc;
rc = (hsv->v - rd) / delta; rc = (hsv->v - rd) / delta;
...@@ -73,7 +73,7 @@ void color_rgb2hsv(color_rgb_t *rgb, color_hsv_t *hsv) ...@@ -73,7 +73,7 @@ void color_rgb2hsv(color_rgb_t *rgb, color_hsv_t *hsv)
} }
hsv->h *= 60.0f; hsv->h *= 60.0f;
if (hsv->h < 0.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) ...@@ -90,7 +90,7 @@ void color_hsv2rgb(color_hsv_t *hsv, color_rgb_t *rgb)
return; return;
} }
h = (hsv->h == 360.0f) ? 0.0 : hsv->h; h = (hsv->h == 360.0f) ? 0.0f : hsv->h;
h /= 60.0f; h /= 60.0f;
i = (int)h; i = (int)h;
f = h - i; f = h - i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment