From b6a4a520d5acf4d5599ea29e389880b0dd069127 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 1 Dec 2006 08:17:55 +0000 Subject: [PATCH] silence bison's new warnings --- tools/qfcc/source/qc-parse.y | 72 ++++++++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index 5a8cb2443..5ac5baf2b 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -273,6 +273,8 @@ cfunction { build_code_function ($5, $2, $6); current_func = 0; + (void) ($4); + (void) ($7); } ; @@ -313,7 +315,7 @@ struct_defs ; struct_def - : type { $$ = $1; } struct_def_list { } + : type { $$ = $1; } struct_def_list { $$ = $2; } ; enum_list @@ -437,6 +439,7 @@ array_decl struct_def_list : struct_def_list ',' { $$ = $0; } struct_def_item + { (void) ($3); } | struct_def_item ; @@ -448,7 +451,7 @@ struct_def_item ; def_list - : def_list ',' { $$ = $0; } def_item + : def_list ',' { $$ = $0; } def_item { (void) ($3); } | def_item ; @@ -477,7 +480,7 @@ func_def_list ; fdef_name - : { $$ = $-1; } func_def { $$ = $2; } + : { $$ = $-1; } func_def { $$ = $2; (void) ($1); } ; func_def @@ -517,6 +520,8 @@ code_func { build_code_function ($5, $2, $6); current_func = 0; + (void) ($4); + (void) ($7); } ; @@ -538,7 +543,7 @@ def_name opt_initializer : /*empty*/ { } | { $$ = $0; } - var_initializer { } + var_initializer { (void) ($1); } ; var_initializer @@ -607,6 +612,7 @@ think : { $$ = &type_function; } def_name { $$ = new_def_expr ($2); + (void) ($1); } | '(' fexpr ')' { @@ -856,6 +862,7 @@ statement { $$ = local_expr; local_expr = 0; + (void) ($3); } | IF '(' fexpr ')' save_inits statement { @@ -1258,38 +1265,68 @@ protocol_name classdef : INTERFACE new_class_name - protocolrefs { class_add_protocols ($2, $3);} + protocolrefs { class_add_protocols ($2, $3); } '{' { $$ = $2; } ivar_decl_list '}' { class_add_ivars ($2, $7); $$ = $2; } methodprotolist { class_add_methods ($2, $10); } - END { current_class = 0; } + END + { + current_class = 0; + (void) ($6); + (void) ($9); + } | INTERFACE new_class_name protocolrefs { class_add_protocols ($2, $3); } { class_add_ivars ($2, class_new_ivars ($2)); $$ = $2; } methodprotolist { class_add_methods ($2, $6); } - END { current_class = 0; } + END + { + current_class = 0; + (void) ($5); + } | INTERFACE new_class_with_super protocolrefs { class_add_protocols ($2, $3);} '{' { $$ = $2; } ivar_decl_list '}' { class_add_ivars ($2, $7); $$ = $2; } methodprotolist { class_add_methods ($2, $10); } - END { current_class = 0; } + END + { + current_class = 0; + (void) ($6); + (void) ($9); + } | INTERFACE new_class_with_super protocolrefs { class_add_protocols ($2, $3); } { class_add_ivars ($2, class_new_ivars ($2)); $$ = $2; } methodprotolist { class_add_methods ($2, $6); } - END { current_class = 0; } + END + { + current_class = 0; + (void) ($5); + } | INTERFACE new_category_name protocolrefs { category_add_protocols ($2, $3); $$ = $2->class;} methodprotolist { category_add_methods ($2, $5); } - END { current_class = 0; } + END + { + current_class = 0; + (void) ($4); + } | IMPLEMENTATION class_name { class_begin (&$2->class_type); } '{' { $$ = $2; } - ivar_decl_list '}' { class_check_ivars ($2, $6); } + ivar_decl_list '}' + { + class_check_ivars ($2, $6); + (void) ($5); + } | IMPLEMENTATION class_name { class_begin (&$2->class_type); } | IMPLEMENTATION class_with_super { class_begin (&$2->class_type); } '{' { $$ = $2; } - ivar_decl_list '}' { class_check_ivars ($2, $6); } + ivar_decl_list '}' + { + class_check_ivars ($2, $6); + (void) ($5); + } | IMPLEMENTATION class_with_super { class_begin (&$2->class_type); } | IMPLEMENTATION category_name { class_begin (&$2->class_type); } ; @@ -1298,13 +1335,13 @@ protocoldef : PROTOCOL protocol_name protocolrefs { protocol_add_protocols ($2, $3); $$ = 0; } methodprotolist { protocol_add_methods ($2, $5); } - END + END { (void) ($4); } ; protocolrefs : /* emtpy */ { $$ = 0; } | LT { $$ = new_protocol_list (); } - protocol_list GT { $$ = $3; } + protocol_list GT { $$ = $3; (void) ($2); } ; protocol_list @@ -1328,6 +1365,7 @@ ivar_decl_list { $$ = current_ivars; current_ivars = 0; + (void) ($1); } ; @@ -1348,12 +1386,12 @@ ivar_decls ; ivar_decl - : type { $$ = $1; } ivars { } + : type { $$ = $1; } ivars { (void) ($2); } ; ivars : ivar_declarator - | ivars ',' { $$ = $0; } ivar_declarator + | ivars ',' { $$ = $0; } ivar_declarator { (void) ($3); } ; ivar_declarator @@ -1379,6 +1417,8 @@ methoddef { $2->func = build_code_function ($7, $4, $8); current_func = 0; + (void) ($6); + (void) ($9); } | ci methoddecl '=' '#' const ';' {