From: Marc Dietrich Date: Fri, 23 Mar 2018 10:01:23 +0000 (+0100) Subject: glsl: fix gcc 8 parenthesis warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=268d8f244b3450461de5448f3f9a2ed2aa05e223;p=mesa.git glsl: fix gcc 8 parenthesis warning fixes warnings like this: [184/1137] Compiling C++ object 'src/compiler/glsl/glsl@sta/lower_jumps.cpp.o'. In file included from ../src/mesa/main/mtypes.h:48, from ../src/compiler/glsl_types.h:149, from ../src/compiler/glsl/lower_jumps.cpp:59: ../src/compiler/glsl/lower_jumps.cpp: In member function '{anonymous}::block_record {anonymous}::ir_lower_jumps_visitor::visit_block(exec_list*)': ../src/compiler/glsl/list.h:650:17: warning: unnecessary parentheses in declaration of 'node' [-Wparentheses] for (__type *(__inst) = (__type *)(__list)->head_sentinel.next; \ ^ ../src/compiler/glsl/lower_jumps.cpp:510:7: note: in expansion of macro 'foreach_in_list' foreach_in_list(ir_instruction, node, list) { ^~~~~~~~~~~~~~~ Signed-off-by: Marc Dietrich Reviewed-by: Emil Velikov Reviewed-by: Timothy Arceri --- diff --git a/src/compiler/glsl/list.h b/src/compiler/glsl/list.h index f77fe12991c..2bfa2735544 100644 --- a/src/compiler/glsl/list.h +++ b/src/compiler/glsl/list.h @@ -647,12 +647,12 @@ inline void exec_node::insert_before(exec_list *before) #endif #define foreach_in_list(__type, __inst, __list) \ - for (__type *(__inst) = (__type *)(__list)->head_sentinel.next; \ + for (__type *__inst = (__type *)(__list)->head_sentinel.next; \ !(__inst)->is_tail_sentinel(); \ (__inst) = (__type *)(__inst)->next) #define foreach_in_list_reverse(__type, __inst, __list) \ - for (__type *(__inst) = (__type *)(__list)->tail_sentinel.prev; \ + for (__type *__inst = (__type *)(__list)->tail_sentinel.prev; \ !(__inst)->is_head_sentinel(); \ (__inst) = (__type *)(__inst)->prev)