From cd24bd05b4fe44f46b009a7fdcfe0efe5a03cbb2 Mon Sep 17 00:00:00 2001 From: grischka Date: Tue, 25 Mar 2008 21:05:48 +0000 Subject: [PATCH] get rid of a warning and fix .bat --- i386-asm.c | 15 +++++++-------- win32/build-tcc.bat | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/i386-asm.c b/i386-asm.c index 899e9d80..21b28d7a 100644 --- a/i386-asm.c +++ b/i386-asm.c @@ -424,15 +424,15 @@ static inline void asm_modrm(int reg, Operand *op) static void asm_opcode(TCCState *s1, int opcode) { const ASMInstr *pa; - int i, modrm_index, reg, v, op1, is_short_jmp, has_seg_prefix; + int i, modrm_index, reg, v, op1, is_short_jmp, seg_prefix; int nb_ops, s, ss; - Operand ops[MAX_OPERANDS], *pop, seg_prefix; + Operand ops[MAX_OPERANDS], *pop; int op_type[3]; /* decoded op type */ /* get operands */ pop = ops; nb_ops = 0; - has_seg_prefix = 0; + seg_prefix = 0; for(;;) { if (tok == ';' || tok == TOK_LINEFEED) break; @@ -441,11 +441,10 @@ static void asm_opcode(TCCState *s1, int opcode) } parse_operand(s1, pop); if (tok == ':') { - if (pop->type != OP_SEG || has_seg_prefix) { + if (pop->type != OP_SEG || seg_prefix) { error("incorrect prefix"); } - seg_prefix = *pop; - has_seg_prefix = 1; + seg_prefix = segment_prefixes[pop->reg]; next(); parse_operand(s1, pop); if (!(pop->type & OP_EA)) { @@ -565,8 +564,8 @@ static void asm_opcode(TCCState *s1, int opcode) /* now generates the operation */ if (pa->instr_type & OPC_FWAIT) g(0x9b); - if (has_seg_prefix) - g(segment_prefixes[seg_prefix.reg]); + if (seg_prefix) + g(seg_prefix); v = pa->opcode; if (v == 0x69 || v == 0x69) { diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat index e21fdebe..21da4faa 100644 --- a/win32/build-tcc.bat +++ b/win32/build-tcc.bat @@ -4,7 +4,7 @@ : @echo>..\config.h #define TCC_VERSION "0.9.24" @echo>>..\config.h #define TCC_TARGET_PE 1 -@echo>>..\config.h #define CONFIG_TCCDIR NULL +@echo>>..\config.h #define CONFIG_TCCDIR "." : gcc -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s gcc -Os -fno-strict-aliasing ../tcc.c -D LIBTCC -c -o libtcc.o -- 2.11.4.GIT