diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2016-01-05 01:52:15 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2016-01-05 01:52:15 +0100 |
commit | f7af0d8e74978d83539a804991c708dec846baf3 (patch) | |
tree | 4e764fa0173e7b74fd3302b920c7414185281623 /src/blackbody.c | |
parent | fix makefile (diff) | |
download | libred-f7af0d8e74978d83539a804991c708dec846baf3.tar.gz libred-f7af0d8e74978d83539a804991c708dec846baf3.tar.bz2 libred-f7af0d8e74978d83539a804991c708dec846baf3.tar.xz |
suppress warnings
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src/blackbody.c')
-rw-r--r-- | src/blackbody.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/blackbody.c b/src/blackbody.c index aacde5d..0368156 100644 --- a/src/blackbody.c +++ b/src/blackbody.c @@ -14,6 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#if __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunsuffixed-float-constants" +#endif + + #ifndef LIBRED_COMPILING_PARSER #include "libred.h" #include "macros.h" @@ -74,9 +80,16 @@ static void ciexyy_to_srgb(double x, double y, double Y, double *r, double *g, d #define SRGB(C) (((C) <= 0.0031308) ? (12.92 * (C)) : ((1.0 + 0.055) * pow((C), 1.0 / 2.4) - 0.055)) double X, Z; +#if __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif /* Convert CIE xyY to CIE XYZ. */ X = Y * (y == 0.0 ? 0.0 : (x / y)); Z = Y * (y == 0.0 ? 0.0 : ((1.0 - x - y) / y)); +#if __GNUC__ +# pragma GCC diagnostic pop +#endif /* Convert CIE XYZ to [0, 1] linear RGB. (ciexyz_to_linear) */ *r = ( 3.240450 * X) + (-1.537140 * Y) + (-0.4985320 * Z); @@ -153,7 +166,14 @@ int libred_get_colour(long int temp, double* r, double* g, double* b) /* Adjust colours for use. */ max = fmax(fmax(fabs(*r), fabs(*g)), fabs(*b)); - if (max != 0) *r /= max, *g /= max, *b /= max; +#if __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + if (max != 0.0) *r /= max, *g /= max, *b /= max; +#if __GNUC__ +# pragma GCC diagnostic pop +#endif *r = *r > 0.0 ? *r : 0.0; *g = *g > 0.0 ? *g : 0.0; *b = *b > 0.0 ? *b : 0.0; @@ -164,3 +184,8 @@ int libred_get_colour(long int temp, double* r, double* g, double* b) } #endif + +#if __GNUC__ +# pragma GCC diagnostic pop +#endif + |