forked from enlightenment/efl
parent
9490a51ff6
commit
604892a3c4
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue