make clang happy

SVN revision: 45192
This commit is contained in:
Sebastian Dransfeld 2010-01-15 19:44:25 +00:00
parent 9490a51ff6
commit 604892a3c4
3 changed files with 7 additions and 15 deletions

View File

@ -63,9 +63,8 @@ static int errstart; /* line number at which the instruction started */
int int
error(int number, ...) error(int number, ...)
{ {
static char *prefix[3] = { "error", "fatal error", "warning" };
static int lastline, lastfile, errorcount; static int lastline, lastfile, errorcount;
char *msg, *pre; char *msg;
va_list argptr; va_list argptr;
char string[1024]; char string[1024];
int start; int start;
@ -82,20 +81,17 @@ error(int number, ...)
if (number < 100) if (number < 100)
{ {
msg = errmsg[number - 1]; msg = errmsg[number - 1];
pre = prefix[0];
errflag = TRUE; /* set errflag (skip rest of erroneous expression) */ errflag = TRUE; /* set errflag (skip rest of erroneous expression) */
errnum++; errnum++;
} }
else if (number < 200) else if (number < 200)
{ {
msg = fatalmsg[number - 100]; msg = fatalmsg[number - 100];
pre = prefix[1];
errnum++; /* a fatal error also counts as an error */ errnum++; /* a fatal error also counts as an error */
} }
else else
{ {
msg = warnmsg[number - 200]; msg = warnmsg[number - 200];
pre = prefix[2];
warnnum++; warnnum++;
} }

View File

@ -661,7 +661,7 @@ assemble(FILE * fout, FILE * fin)
constvalue *constptr; constvalue *constptr;
cell mainaddr; cell mainaddr;
int nametable, tags, libraries, publics, natives, pubvars; int nametable, tags, libraries, publics, natives, pubvars;
int cod, dat, hea, stp, cip, size, defsize; int cod, defsize;
#if !defined NDEBUG #if !defined NDEBUG
/* verify that the opcode list is sorted (skip entry 1; it is reserved /* 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); tags = hdr.tags = hdr.pubvars + numpubvars * sizeof(FUNCSTUB);
nametable = hdr.nametable = hdr.tags + numtags * sizeof(FUNCSTUB); nametable = hdr.nametable = hdr.tags + numtags * sizeof(FUNCSTUB);
cod = hdr.cod = hdr.nametable + nametablesize + padding; cod = hdr.cod = hdr.nametable + nametablesize + padding;
dat = hdr.dat = hdr.cod + code_idx; hdr.dat = hdr.cod + code_idx;
hea = hdr.hea = hdr.dat + glb_declared * sizeof(cell); hdr.hea = hdr.dat + glb_declared * sizeof(cell);
stp = hdr.stp = hdr.hea + sc_stksize * sizeof(cell); hdr.stp = hdr.hea + sc_stksize * sizeof(cell);
cip = hdr.cip = mainaddr; hdr.cip = mainaddr;
size = hdr.size = hdr.hea; /* preset, this is incorrect in case of compressed output */ hdr.size = hdr.hea; /* preset, this is incorrect in case of compressed output */
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
align32(&hdr.size); align32(&hdr.size);
align16(&hdr.magic); align16(&hdr.magic);

View File

@ -680,13 +680,11 @@ embryo_program_variable_count_get(Embryo_Program *ep)
EAPI Embryo_Cell EAPI Embryo_Cell
embryo_program_variable_get(Embryo_Program *ep, int num) embryo_program_variable_get(Embryo_Program *ep, int num)
{ {
Embryo_Header *hdr;
Embryo_Cell paddr; Embryo_Cell paddr;
char pname[sNAMEMAX + 1]; char pname[sNAMEMAX + 1];
if (!ep) return EMBRYO_CELL_NONE; if (!ep) return EMBRYO_CELL_NONE;
if (!ep->base) 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) if (_embryo_var_get(ep, num, pname, &paddr) == EMBRYO_ERROR_NONE)
return paddr; return paddr;
return EMBRYO_CELL_NONE; return EMBRYO_CELL_NONE;
@ -964,12 +962,10 @@ EAPI Embryo_Cell
embryo_data_heap_push(Embryo_Program *ep, int cells) embryo_data_heap_push(Embryo_Program *ep, int cells)
{ {
Embryo_Header *hdr; Embryo_Header *hdr;
unsigned char *data;
Embryo_Cell addr; Embryo_Cell addr;
if ((!ep) || (!ep->base)) return EMBRYO_CELL_NONE; if ((!ep) || (!ep->base)) return EMBRYO_CELL_NONE;
hdr = (Embryo_Header *)ep->base; hdr = (Embryo_Header *)ep->base;
data = ep->base + (int)hdr->dat;
if (ep->stk - ep->hea - (cells * sizeof(Embryo_Cell)) < STKMARGIN) if (ep->stk - ep->hea - (cells * sizeof(Embryo_Cell)) < STKMARGIN)
return EMBRYO_CELL_NONE; return EMBRYO_CELL_NONE;
addr = ep->hea; addr = ep->hea;