From 18914e63305314b36e550439b41e0bf157cf338d Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 12 Nov 2011 11:41:51 +0400 Subject: [PATCH] BR3392198: Fix compilation warning on prefixes insn->prefixes might contain not only values from 'enum prefixes' but from 'enum reg_enum' as well so make it generic 'int' instead. This calms down the compiler about enum's mess and eliminates a wrong assumption that we always have values by particular type in this field. Signed-off-by: Cyrill Gorcunov --- assemble.c | 2 +- nasm.h | 2 +- parser.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assemble.c b/assemble.c index 7374139f..f1583fd8 100644 --- a/assemble.c +++ b/assemble.c @@ -213,7 +213,7 @@ static void add_asp(insn *, int); static enum ea_type process_ea(operand *, ea *, int, int, int, opflags_t); -static int has_prefix(insn * ins, enum prefix_pos pos, enum prefixes prefix) +static int has_prefix(insn * ins, enum prefix_pos pos, int prefix) { return ins->prefixes[pos] == prefix; } diff --git a/nasm.h b/nasm.h index 46fa6f50..01f9ffc4 100644 --- a/nasm.h +++ b/nasm.h @@ -561,7 +561,7 @@ enum prefix_pos { typedef struct insn { /* an instruction itself */ char *label; /* the label defined, or NULL */ - enum prefixes prefixes[MAXPREFIX]; /* instruction prefixes, if any */ + int prefixes[MAXPREFIX]; /* instruction prefixes, if any */ enum opcode opcode; /* the opcode - not just the string */ enum ccode condition; /* the condition code, if Jcc/SETcc */ int operands; /* how many operands? 0-3 (more if db et al) */ diff --git a/parser.c b/parser.c index e8794ac2..37d71389 100644 --- a/parser.c +++ b/parser.c @@ -68,7 +68,7 @@ void parser_global_info(struct location * locp) location = locp; } -static int prefix_slot(enum prefixes prefix) +static int prefix_slot(int prefix) { switch (prefix) { case P_WAIT: -- 2.11.4.GIT