From 74c81af3ddd0af8488983acedf860fe44868ceb2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 30 Aug 2006 11:10:45 -0700 Subject: [PATCH] Fix a compiler warning by defining struct {in,}direct_reg at the top level. --- assembler/src/gen4asm.h | 17 +++++++++++++++++ assembler/src/gram.y | 9 ++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/assembler/src/gen4asm.h b/assembler/src/gen4asm.h index 2db36994..b61e1bd1 100644 --- a/assembler/src/gen4asm.h +++ b/assembler/src/gen4asm.h @@ -38,6 +38,23 @@ typedef float GLfloat; void yyerror (char *msg); +/** + * This structure is the internal representation of directly-addressed + * registers in the parser. + */ +struct direct_reg { + int reg_file, reg_nr, subreg_nr; +}; + +/** + * This structure is the internal representation of register-indirect addressed + * registers in the parser. + */ + +struct indirect_reg { + int reg_file, address_subreg_nr, indirect_offset; +}; + /** * This structure is the internal representation of destination operands in the * parser. diff --git a/assembler/src/gram.y b/assembler/src/gram.y index 7b886f19..47a8a473 100644 --- a/assembler/src/gram.y +++ b/assembler/src/gram.y @@ -31,7 +31,6 @@ #include "gen4asm.h" #include "brw_defines.h" - int set_instruction_dest(struct brw_instruction *instr, struct dst_operand *dest); int set_instruction_src1(struct brw_instruction *instr, @@ -60,12 +59,8 @@ void set_direct_src_operand(struct src_operand *src, struct direct_reg *reg, struct region { int vert_stride, width, horiz_stride; } region; - struct direct_reg { - int reg_file, reg_nr, subreg_nr; - } direct_reg; - struct indirect_reg { - int reg_file, address_subreg_nr, indirect_offset; - } indirect_reg; + struct direct_reg direct_reg; + struct indirect_reg indirect_reg; double imm32;