From 604892a3c463590de93a8a71d9e617d07c23a024 Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Fri, 15 Jan 2010 19:44:25 +0000 Subject: [PATCH] make clang happy SVN revision: 45192 --- legacy/embryo/src/bin/embryo_cc_sc5.c | 6 +----- legacy/embryo/src/bin/embryo_cc_sc6.c | 12 ++++++------ legacy/embryo/src/lib/embryo_amx.c | 4 ---- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/legacy/embryo/src/bin/embryo_cc_sc5.c b/legacy/embryo/src/bin/embryo_cc_sc5.c index 06cf7aeaf7..9960108990 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc5.c +++ b/legacy/embryo/src/bin/embryo_cc_sc5.c @@ -63,9 +63,8 @@ static int errstart; /* line number at which the instruction started */ int error(int number, ...) { - static char *prefix[3] = { "error", "fatal error", "warning" }; static int lastline, lastfile, errorcount; - char *msg, *pre; + char *msg; va_list argptr; char string[1024]; int start; @@ -82,20 +81,17 @@ error(int number, ...) if (number < 100) { msg = errmsg[number - 1]; - pre = prefix[0]; errflag = TRUE; /* set errflag (skip rest of erroneous expression) */ errnum++; } else if (number < 200) { msg = fatalmsg[number - 100]; - pre = prefix[1]; errnum++; /* a fatal error also counts as an error */ } else { msg = warnmsg[number - 200]; - pre = prefix[2]; warnnum++; } diff --git a/legacy/embryo/src/bin/embryo_cc_sc6.c b/legacy/embryo/src/bin/embryo_cc_sc6.c index 7c16a9895f..aae62c9595 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc6.c +++ b/legacy/embryo/src/bin/embryo_cc_sc6.c @@ -661,7 +661,7 @@ assemble(FILE * fout, FILE * fin) constvalue *constptr; cell mainaddr; int nametable, tags, libraries, publics, natives, pubvars; - int cod, dat, hea, stp, cip, size, defsize; + int cod, defsize; #if !defined NDEBUG /* verify that the opcode list is sorted (skip entry 1; it is reserved @@ -784,11 +784,11 @@ assemble(FILE * fout, FILE * fin) tags = hdr.tags = hdr.pubvars + numpubvars * sizeof(FUNCSTUB); nametable = hdr.nametable = hdr.tags + numtags * sizeof(FUNCSTUB); cod = hdr.cod = hdr.nametable + nametablesize + padding; - dat = hdr.dat = hdr.cod + code_idx; - hea = hdr.hea = hdr.dat + glb_declared * sizeof(cell); - stp = hdr.stp = hdr.hea + sc_stksize * sizeof(cell); - cip = hdr.cip = mainaddr; - size = hdr.size = hdr.hea; /* preset, this is incorrect in case of compressed output */ + hdr.dat = hdr.cod + code_idx; + hdr.hea = hdr.dat + glb_declared * sizeof(cell); + hdr.stp = hdr.hea + sc_stksize * sizeof(cell); + hdr.cip = mainaddr; + hdr.size = hdr.hea; /* preset, this is incorrect in case of compressed output */ #ifdef WORDS_BIGENDIAN align32(&hdr.size); align16(&hdr.magic); diff --git a/legacy/embryo/src/lib/embryo_amx.c b/legacy/embryo/src/lib/embryo_amx.c index 2af81de719..f19dfda9e2 100644 --- a/legacy/embryo/src/lib/embryo_amx.c +++ b/legacy/embryo/src/lib/embryo_amx.c @@ -680,13 +680,11 @@ embryo_program_variable_count_get(Embryo_Program *ep) EAPI Embryo_Cell embryo_program_variable_get(Embryo_Program *ep, int num) { - Embryo_Header *hdr; Embryo_Cell paddr; char pname[sNAMEMAX + 1]; if (!ep) return EMBRYO_CELL_NONE; if (!ep->base) return EMBRYO_CELL_NONE; - hdr = (Embryo_Header *)ep->base; if (_embryo_var_get(ep, num, pname, &paddr) == EMBRYO_ERROR_NONE) return paddr; return EMBRYO_CELL_NONE; @@ -964,12 +962,10 @@ EAPI Embryo_Cell embryo_data_heap_push(Embryo_Program *ep, int cells) { Embryo_Header *hdr; - unsigned char *data; Embryo_Cell addr; if ((!ep) || (!ep->base)) return EMBRYO_CELL_NONE; hdr = (Embryo_Header *)ep->base; - data = ep->base + (int)hdr->dat; if (ep->stk - ep->hea - (cells * sizeof(Embryo_Cell)) < STKMARGIN) return EMBRYO_CELL_NONE; addr = ep->hea;