From be6cee51c06dc72ac159bd75b4201c61952515bd Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sat, 5 Jan 2019 17:45:01 +0100 Subject: [PATCH] amd/common: Add some parentheses to silence warning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit [1/59] Compiling C object 'src/amd/common/src@amd@common@@amd_common@sta/ac_nir_to_llvm.c.o'. ../mesa/src/amd/common/ac_nir_to_llvm.c: In function ‘get_inst_tessfactor_writemask’: ../mesa/src/amd/common/ac_nir_to_llvm.c:4089:32: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses] writemask = ((1 << num_comps + 1) - 1) << first_component; ~~~~~~~~~~^~~ ../mesa/src/amd/common/ac_nir_to_llvm.c:4091:33: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses] writemask = (((1 << num_comps + 1) - 1) << first_component) << 4; Reviewed-by: Samuel Pitoiset --- src/amd/common/ac_nir_to_llvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 8dea35178b3..5bf91b51710 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -4095,9 +4095,9 @@ get_inst_tessfactor_writemask(nir_intrinsic_instr *intrin) unsigned num_comps = intrin->dest.ssa.num_components; if (location == VARYING_SLOT_TESS_LEVEL_INNER) - writemask = ((1 << num_comps + 1) - 1) << first_component; + writemask = ((1 << (num_comps + 1)) - 1) << first_component; else if (location == VARYING_SLOT_TESS_LEVEL_OUTER) - writemask = (((1 << num_comps + 1) - 1) << first_component) << 4; + writemask = (((1 << (num_comps + 1)) - 1) << first_component) << 4; return writemask; } -- 2.30.2