diff options
author | rsc <devnull@localhost> | 2004-02-29 23:20:28 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-02-29 23:20:28 +0000 |
commit | d21d62e2fc51e0a6aecd716c47785155b318f5f4 (patch) | |
tree | cb895e3ea1c90f96ae8b301d046e89006b5eebdd /src/cmd/hoc | |
parent | c3a72d77dc9e59e2498d68692feb098bf565e119 (diff) | |
download | plan9port-d21d62e2fc51e0a6aecd716c47785155b318f5f4.tar.gz plan9port-d21d62e2fc51e0a6aecd716c47785155b318f5f4.tar.bz2 plan9port-d21d62e2fc51e0a6aecd716c47785155b318f5f4.zip |
Various tweaks.
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 |