Changed identifier name to make it acceptable for our ANSI C compiler
This commit is contained in:
parent
40e580cae6
commit
4bb6c5c4e8
|
@ -131,7 +131,7 @@ void code_val(e) register struct expr *e;
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
case E_CONST:
|
case E_CONST:
|
||||||
Loc(e->u.const);
|
Loc(e->u.cst);
|
||||||
break;
|
break;
|
||||||
case E_NOW:
|
case E_NOW:
|
||||||
cal("now");
|
cal("now");
|
||||||
|
@ -172,7 +172,7 @@ static void subscript(e, av) register struct expr *e; enum addr_val av;
|
||||||
lsiz-=(e->arr_siz -1);
|
lsiz-=(e->arr_siz -1);
|
||||||
|
|
||||||
if (constant(index)) {
|
if (constant(index)) {
|
||||||
if (index->u.const<0 || index->u.const>=lsiz) {
|
if (index->u.cst<0 || index->u.cst>=lsiz) {
|
||||||
warning("constant index outside vector");
|
warning("constant index outside vector");
|
||||||
lin();
|
lin();
|
||||||
loc(0);
|
loc(0);
|
||||||
|
@ -189,7 +189,7 @@ static void subscript(e, av) register struct expr *e; enum addr_val av;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (constant(index)) {
|
if (constant(index)) {
|
||||||
register offset=index->u.const;
|
register offset=index->u.cst;
|
||||||
|
|
||||||
if ((left->type&T_TYPE)==T_CHAN)
|
if ((left->type&T_TYPE)==T_CHAN)
|
||||||
offset*=(wz+vz);
|
offset*=(wz+vz);
|
||||||
|
@ -518,9 +518,9 @@ void rep_init(v, e1, e2, r_info)
|
||||||
Stl(v->s_info.vc.offset);
|
Stl(v->s_info.vc.offset);
|
||||||
|
|
||||||
if (!constant(e1) || !constant(e2)) {
|
if (!constant(e1) || !constant(e2)) {
|
||||||
if (constant(e2) && word_constant(e2->u.const)) {
|
if (constant(e2) && word_constant(e2->u.cst)) {
|
||||||
r_info->counter=memory(wz);
|
r_info->counter=memory(wz);
|
||||||
loc((int) e2->u.const);
|
loc((int) e2->u.cst);
|
||||||
stl(r_info->counter);
|
stl(r_info->counter);
|
||||||
} else {
|
} else {
|
||||||
r_info->counter=memory(vz);
|
r_info->counter=memory(vz);
|
||||||
|
@ -528,7 +528,7 @@ void rep_init(v, e1, e2, r_info)
|
||||||
Stl(r_info->counter);
|
Stl(r_info->counter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!constant(e2) || e2->u.const<=0L)
|
if (!constant(e2) || e2->u.cst<=0L)
|
||||||
branch(&r_info->END);
|
branch(&r_info->END);
|
||||||
Label(new_label(&r_info->BEGIN));
|
Label(new_label(&r_info->BEGIN));
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ void rep_test(v, e1, e2, r_info)
|
||||||
|
|
||||||
if (constant(e1) && constant(e2)) {
|
if (constant(e1) && constant(e2)) {
|
||||||
Lol(v->s_info.vc.offset);
|
Lol(v->s_info.vc.offset);
|
||||||
Loc(e1->u.const+e2->u.const);
|
Loc(e1->u.cst+e2->u.cst);
|
||||||
if (vz>wz) {
|
if (vz>wz) {
|
||||||
cmi();
|
cmi();
|
||||||
zlt(r_info->BEGIN);
|
zlt(r_info->BEGIN);
|
||||||
|
@ -552,7 +552,7 @@ void rep_test(v, e1, e2, r_info)
|
||||||
blt(r_info->BEGIN);
|
blt(r_info->BEGIN);
|
||||||
Label(r_info->END);
|
Label(r_info->END);
|
||||||
} else {
|
} else {
|
||||||
if (constant(e2) && word_constant(e2->u.const)) {
|
if (constant(e2) && word_constant(e2->u.cst)) {
|
||||||
del(r_info->counter);
|
del(r_info->counter);
|
||||||
Label(r_info->END);
|
Label(r_info->END);
|
||||||
lol(r_info->counter);
|
lol(r_info->counter);
|
||||||
|
|
|
@ -121,9 +121,9 @@ void cvw()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Loc(const) long const;
|
void Loc(cst) long cst;
|
||||||
{
|
{
|
||||||
if (vz>wz) C_ldc((arith) const); else C_loc((arith) const);
|
if (vz>wz) C_ldc((arith) cst); else C_loc((arith) cst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lol(offset) int offset;
|
void Lol(offset) int offset;
|
||||||
|
|
|
@ -27,8 +27,8 @@ struct expr *new_node(op, left, right, byte)
|
||||||
if (op!=FOR && constant(left) && (right==nil || constant(right))) {
|
if (op!=FOR && constant(left) && (right==nil || constant(right))) {
|
||||||
register long lc, rc;
|
register long lc, rc;
|
||||||
|
|
||||||
lc=left->u.const;
|
lc=left->u.cst;
|
||||||
if (right) rc=right->u.const; else rc = 0;
|
if (right) rc=right->u.cst; else rc = 0;
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case '+': lc+=rc; break;
|
case '+': lc+=rc; break;
|
||||||
|
@ -61,7 +61,7 @@ struct expr *new_node(op, left, right, byte)
|
||||||
}
|
}
|
||||||
destroy(right);
|
destroy(right);
|
||||||
|
|
||||||
left->u.const=lc;
|
left->u.cst=lc;
|
||||||
return left;
|
return left;
|
||||||
} else {
|
} else {
|
||||||
register struct expr *pe;
|
register struct expr *pe;
|
||||||
|
@ -128,8 +128,8 @@ struct expr *new_var(var)
|
||||||
return pe;
|
return pe;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct expr *new_const(const)
|
struct expr *new_const(cst)
|
||||||
long const;
|
long cst;
|
||||||
/* Make a constant, which is a VALUE, of course. */
|
/* Make a constant, which is a VALUE, of course. */
|
||||||
{
|
{
|
||||||
register struct expr *pe;
|
register struct expr *pe;
|
||||||
|
@ -138,7 +138,7 @@ struct expr *new_const(const)
|
||||||
|
|
||||||
pe->kind=E_CONST;
|
pe->kind=E_CONST;
|
||||||
pe->type=T_VALUE;
|
pe->type=T_VALUE;
|
||||||
pe->u.const=const;
|
pe->u.cst=cst;
|
||||||
|
|
||||||
return pe;
|
return pe;
|
||||||
}
|
}
|
||||||
|
@ -389,7 +389,7 @@ static void subscriptable(l, r, byte, atype, arr_siz)
|
||||||
if (r->u.node.right->kind!=E_CONST)
|
if (r->u.node.right->kind!=E_CONST)
|
||||||
report("slice must be of constant size");
|
report("slice must be of constant size");
|
||||||
else
|
else
|
||||||
*arr_siz=r->u.node.right->u.const;
|
*arr_siz=r->u.node.right->u.cst;
|
||||||
used(r->u.node.left);
|
used(r->u.node.left);
|
||||||
} else
|
} else
|
||||||
used(r);
|
used(r);
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct expr {
|
||||||
|
|
||||||
struct symbol *var;
|
struct symbol *var;
|
||||||
|
|
||||||
long const;
|
long cst;
|
||||||
|
|
||||||
int tab;
|
int tab;
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ subscript(register *byte; register struct expr **e; )
|
||||||
destroy(e1);
|
destroy(e1);
|
||||||
e1=new_const(0L);
|
e1=new_const(0L);
|
||||||
} else
|
} else
|
||||||
if (e1->u.const<=0)
|
if (e1->u.cst<=0)
|
||||||
nonpositive(siz);
|
nonpositive(siz);
|
||||||
*e=new_node(FOR, *e, e1, *byte);
|
*e=new_node(FOR, *e, e1, *byte);
|
||||||
slice=1;
|
slice=1;
|
||||||
|
@ -304,10 +304,10 @@ chan { register type, arr_siz=1; register char *name; struct expr *e; }:
|
||||||
if (!constant(e))
|
if (!constant(e))
|
||||||
nonconst(siz);
|
nonconst(siz);
|
||||||
else
|
else
|
||||||
if (e->u.const<0)
|
if (e->u.cst<0)
|
||||||
nonpositive(siz);
|
nonpositive(siz);
|
||||||
else
|
else
|
||||||
arr_siz=e->u.const;
|
arr_siz=e->u.cst;
|
||||||
destroy(e);
|
destroy(e);
|
||||||
type|=T_ARR;
|
type|=T_ARR;
|
||||||
}
|
}
|
||||||
|
@ -331,10 +331,10 @@ var { register type, byte=0, arr_siz=1;
|
||||||
if (!constant(e))
|
if (!constant(e))
|
||||||
nonconst(siz);
|
nonconst(siz);
|
||||||
else
|
else
|
||||||
if (e->u.const<=0)
|
if (e->u.cst<=0)
|
||||||
nonpositive(siz);
|
nonpositive(siz);
|
||||||
else
|
else
|
||||||
arr_siz=e->u.const;
|
arr_siz=e->u.cst;
|
||||||
destroy(e);
|
destroy(e);
|
||||||
type|=T_ARR|byte;
|
type|=T_ARR|byte;
|
||||||
}
|
}
|
||||||
|
@ -550,14 +550,14 @@ table(register struct expr **e;)
|
||||||
expression(&e1) { if (!constant(e1))
|
expression(&e1) { if (!constant(e1))
|
||||||
nonconst("table element");
|
nonconst("table element");
|
||||||
else
|
else
|
||||||
table_add(&apt, e1->u.const);
|
table_add(&apt, e1->u.cst);
|
||||||
destroy(e1);
|
destroy(e1);
|
||||||
}
|
}
|
||||||
[ ',' expression(&e1)
|
[ ',' expression(&e1)
|
||||||
{ if (!constant(e1))
|
{ if (!constant(e1))
|
||||||
nonconst("table element");
|
nonconst("table element");
|
||||||
else
|
else
|
||||||
table_add(&apt, e1->u.const);
|
table_add(&apt, e1->u.cst);
|
||||||
destroy(e1);
|
destroy(e1);
|
||||||
}
|
}
|
||||||
]*
|
]*
|
||||||
|
|
Loading…
Reference in a new issue