summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-10-08 00:23:29 -0700
committerEric Anholt <[email protected]>2013-10-09 11:28:19 -0700
commitbfe6e5dda5fcf65a3941ed4cca5eea755421979a (patch)
tree033744e22465d66a3ef28cc81d5b55766723e737
parent791550aa8e70dd5e0bdd5a996ef66b5964cf9095 (diff)
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" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r--src/mesa/main/macros.h2
1 files changed, 1 insertions, 1 deletions
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))