From: Ville Syrjälä Date: Mon, 30 Jun 2014 15:42:31 +0000 (+0300) Subject: i915: Protect macro argument for TEXTURE_SET() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4747b2638c785337fccec2f17ef77fc870e68c2e;p=mesa.git i915: Protect macro argument for TEXTURE_SET() TEXTURE_SET() is the only register macro that forgets to wrap the argument evaluation in parens. Only simple integers are passed to this macro so there's no bug but sitll it seems prudent to add the parens. Reviewed-by: Eric Anholt Signed-off-by: Ville Syrjälä --- diff --git a/src/mesa/drivers/dri/i915/i830_reg.h b/src/mesa/drivers/dri/i915/i830_reg.h index e08cbe52a35..d7ccc165a3b 100644 --- a/src/mesa/drivers/dri/i915/i830_reg.h +++ b/src/mesa/drivers/dri/i915/i830_reg.h @@ -256,7 +256,7 @@ #define _3DSTATE_MAP_COORD_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8c<<16)) #define DISABLE_TEX_TRANSFORM (1<<28) -#define TEXTURE_SET(x) (x<<29) +#define TEXTURE_SET(x) ((x)<<29) #define _3DSTATE_VERTEX_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8b<<16)) #define DISABLE_VIEWPORT_TRANSFORM (1<<31)