Fix compiler warnings (-Wfloat-equal)

Origin commit data
------------------
Branch: ni/coolstream
Commit: 3f0400a23e
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-02-21 (Fri, 21 Feb 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2014-02-21 00:00:51 +01:00
parent 2814582bbe
commit 9fe57a5272
2 changed files with 7 additions and 3 deletions

View File

@@ -35,7 +35,11 @@
#include <gui/color.h>
#include <stdio.h>
#include <math.h>
#ifndef FLT_EPSILON
#define FLT_EPSILON 1E-5
#endif
int convertSetupColor2RGB(const unsigned char r, const unsigned char g, const unsigned char b)
{
@@ -145,7 +149,7 @@ void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb)
float f_H = hsv->h;
float f_S = hsv->s;
float f_V = hsv->v;
if (f_S == 0) {
if (fabsf(f_S) < FLT_EPSILON) {
rgb->r = (uint8_t)(f_V * 255);
rgb->g = (uint8_t)(f_V * 255);
rgb->b = (uint8_t)(f_V * 255);
@@ -204,7 +208,7 @@ void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv)
float f_H = 0;
float f_S = 0;
if (delta == 0) { //gray
if (fabsf(delta) < FLT_EPSILON) { //gray
f_S = 0;
f_H = 0;
} else {