From f7af0d8e74978d83539a804991c708dec846baf3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 5 Jan 2016 01:52:15 +0100 Subject: suppress warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blackbody.c | 27 ++++++++++++++++++++++++++- src/solar.c | 10 ++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) 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 . */ +#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 + diff --git a/src/solar.c b/src/solar.c index eb06ae7..e132522 100644 --- a/src/solar.c +++ b/src/solar.c @@ -23,6 +23,11 @@ #include #include +#if __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunsuffixed-float-constants" +#endif + /* Select clock. */ @@ -302,3 +307,8 @@ int libred_check_timetravel(void) return 0; } + +#if __GNUC__ +# pragma GCC diagnostic pop +#endif + -- cgit v1.2.3-70-g09d2