Various tweaks.

This commit is contained in:
rsc 2004-02-29 23:20:28 +00:00
parent c3a72d77dc
commit d21d62e2fc
15 changed files with 34 additions and 20 deletions

View file

@ -37,6 +37,11 @@ initcode(void)
indef = 0;
}
void
nop(void)
{
}
void
push(Datum d)
{
@ -557,11 +562,18 @@ diveq(void)
push(d2);
}
void
ppush(Datum *d)
{
push(*d);
}
void
modeq(void)
{
Datum d1, d2;
long x;
d1 = pop();
d2 = pop();
if (d1.sym->type != VAR && d1.sym->type != UNDEF)
@ -570,9 +582,12 @@ modeq(void)
/* d2.val = d1.sym->u.val %= d2.val; */
x = d1.sym->u.val;
x %= (long) d2.val;
d2.val = d1.sym->u.val = x;
d2.val = x;
d1.sym->u.val = x;
d1.sym->type = VAR;
push(d2);
/* push(d2) generates a compiler error on Linux w. gcc 2.95.4 */
ppush(&d2);
}
void

View file

@ -15,6 +15,6 @@ OFILES=\
YFILES=hoc.y\
SHORTLIB=bio 9
<$PLAN9/src/mkone
LDFLAGS=$LDFLAGS -lbio -l9