From bfe6e5dda5fcf65a3941ed4cca5eea755421979a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 8 Oct 2013 00:23:29 -0700 Subject: 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 --- src/mesa/main/macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') 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)) -- cgit v1.2.3