BR3392198: Fix compilation warning on prefixes
authorCyrill Gorcunov <gorcunov@gmail.com>
Sat, 12 Nov 2011 07:41:51 +0000 (11:41 +0400)
committerCyrill Gorcunov <gorcunov@gmail.com>
Sat, 12 Nov 2011 07:41:51 +0000 (11:41 +0400)
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 <gorcunov@gmail.com>
assemble.c
nasm.h
parser.c

index 7374139..f1583fd 100644 (file)
@@ -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 46fa6f5..01f9ffc 100644 (file)
--- 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) */
index e8794ac..37d7138 100644 (file)
--- 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: