mesa/macros: add power-of-two assertions for alignment macros
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 27 May 2015 20:25:30 +0000 (13:25 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Wed, 26 Aug 2015 21:36:43 +0000 (14:36 -0700)
commit97f4efd573aed7ffc0ea9395f4e69ccdeb5041f6
tree0aba606a6f9f482fa49a544f797913d3a5ce2d68
parent8b1f008e9acf94645a28c27fa261f6450a3edb84
mesa/macros: add power-of-two assertions for alignment macros

ALIGN and ROUND_DOWN_TO both require that the alignment value passed
into the macro be a power of two in the comments. Using software assertions
verifies this to be the case.

v2: use static inline functions instead of gcc-specific statement expressions (Brian).
v3: fix indendation (Brian).
v4: add greater than zero requirement (Anuj).

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/main/macros.h