diff options
Diffstat (limited to 'src/cmd/hoc')
-rw-r--r-- | src/cmd/hoc/code.c | 19 | ||||
-rw-r--r-- | src/cmd/hoc/mkfile | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/cmd/hoc/code.c b/src/cmd/hoc/code.c index 26762452..7ed3ed1e 100644 --- a/src/cmd/hoc/code.c +++ b/src/cmd/hoc/code.c @@ -38,6 +38,11 @@ initcode(void) } void +nop(void) +{ +} + +void push(Datum d) { if (stackp >= &stack[NSTACK]) @@ -558,10 +563,17 @@ diveq(void) } 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 diff --git a/src/cmd/hoc/mkfile b/src/cmd/hoc/mkfile index a226a5e8..d3bfd274 100644 --- a/src/cmd/hoc/mkfile +++ b/src/cmd/hoc/mkfile @@ -15,6 +15,6 @@ OFILES=\ YFILES=hoc.y\ +SHORTLIB=bio 9 <$PLAN9/src/mkone -LDFLAGS=$LDFLAGS -lbio -l9 |