[Mesa-dev] [PATCH 2/3] mesa: Fix compiler warnings when ALIGN's alignment is "1 << value".
Ian Romanick
idr at freedesktop.org
Tue Oct 8 11:22:35 PDT 2013
On 10/08/2013 10:36 AM, Eric Anholt wrote:
> We hadn't run into order of operation warnings before, apparently, since
> addition is so low on the order.
>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: "9.1 9.2" <mesa-stable at lists.freedesktop.org>
> ---
> src/mesa/main/macros.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
> index 1052f75..05aad4e 100644
> --- a/src/mesa/main/macros.h
> +++ b/src/mesa/main/macros.h
> @@ -673,7 +673,7 @@ minify(unsigned value, unsigned levels)
> *
> * \sa ROUND_DOWN_TO()
> */
> -#define ALIGN(value, alignment) (((value) + alignment - 1) & ~(alignment - 1))
> +#define ALIGN(value, alignment) (((value) + (alignment) - 1) & ~((alignment) - 1))
>
>
>
More information about the mesa-dev
mailing list