[Mesa-dev] [PATCH 06/13] gallium/auxiliary: Avoid double promotion.

Eric Anholt eric at anholt.net
Tue Jul 14 12:04:01 PDT 2015


Matt Turner <mattst88 at gmail.com> writes:

> ---
>  src/gallium/auxiliary/util/u_format_rgb9e5.h | 2 +-
>  src/gallium/auxiliary/util/u_math.h          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_format_rgb9e5.h b/src/gallium/auxiliary/util/u_format_rgb9e5.h
> index 7a01f7f..d1ace3f 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 3b4040f..9c3cb6a 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;
>  }

Reviewed-by: Eric Anholt <eric at anholt.net>

(I did the same in u_math.h when looking at -Wdouble-promotion in my own
driver).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150714/a6ce511a/attachment.sig>


More information about the mesa-dev mailing list