From: Eric Anholt Date: Tue, 8 Oct 2013 07:23:29 +0000 (-0700) Subject: mesa: Fix compiler warnings when ALIGN's alignment is "1 << value". X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bfe6e5dda5fcf65a3941ed4cca5eea755421979a;p=mesa.git mesa: Fix compiler warnings when ALIGN's alignment is "1 << value". We hadn't run into order of operation warnings before, apparently, since addition is so low on the order. Cc: "9.1 9.2" Reviewed-by: Brian Paul Reviewed-by: Chad Versace Reviewed-by: Kenneth Graunke Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 1052f756074..05aad4eb8b1 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))