From 5989629a7951e544ad4656672025a99ecd08c7c9 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sat, 11 Feb 2023 21:31:04 -0800 Subject: Change how slices work. I'm switching to a more macro-heavy solution. Hopefully it proves robust. --- bytecode/oper.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bytecode/oper.c') diff --git a/bytecode/oper.c b/bytecode/oper.c index fcb7d77..0bdb8f6 100644 --- a/bytecode/oper.c +++ b/bytecode/oper.c @@ -1,11 +1,12 @@ #include #include +#include "byte_slice.h" #include "encoding.h" #include "heap.h" #include "panic.h" -#include "slice.h" #include "value.h" +#include "value_slice.h" #include "oper.h" @@ -81,15 +82,15 @@ static void op(struct st *s, struct op oper) } } -void run(struct slice prog) +void run(uint8_t_slice prog) { struct st s = { .i = 0, .locals = { 0 }, }; - s.heap = new_heap((struct val_slice) { .size = NUM_LOCALS, .buf = s.locals }); + s.heap = new_heap((value_slice) { .size = NUM_LOCALS, .buf = s.locals }); while (true) { - struct result oper = parse(slice1(prog, s.i)); + struct result oper = parse(uint8_t_slice1(prog, s.i)); s.i += oper.n; op(&s, oper.op); } -- cgit v1.3.1