From: Matt Turner Date: Mon, 13 Jul 2015 01:01:42 +0000 (-0700) Subject: gallium/auxiliary: Avoid double promotion. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29ef7a9f19265308e7852c0f8920e0f520f08df3;p=mesa.git gallium/auxiliary: Avoid double promotion. Reviewed-by: Iago Toral Quiroga Reviewed-by: Eric Anholt --- diff --git a/src/gallium/auxiliary/util/u_format_rgb9e5.h b/src/gallium/auxiliary/util/u_format_rgb9e5.h index 1c12a668d81..9e4b1d607d7 100644 --- a/src/gallium/auxiliary/util/u_format_rgb9e5.h +++ b/src/gallium/auxiliary/util/u_format_rgb9e5.h @@ -75,7 +75,7 @@ typedef union { static inline float rgb9e5_ClampRange(float x) { - if (x > 0.0) { + if (x > 0.0f) { if (x >= MAX_RGB9E5) { return MAX_RGB9E5; } else { diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index f5c409dbdf2..56bd185f527 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -240,7 +240,7 @@ util_iround(float f) static inline boolean util_is_approx(float a, float b, float tol) { - return fabs(b - a) <= tol; + return fabsf(b - a) <= tol; }