diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2023-02-11 21:31:04 -0800 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2023-02-11 21:31:04 -0800 |
| commit | 5989629a7951e544ad4656672025a99ecd08c7c9 (patch) | |
| tree | 89e2ca80f73d8dcf16a9fadcea41b2e141bdf4eb /bytecode/encoding.c | |
| parent | aafc502de6f9ecbeb4638b1862f4fa5ac82199d7 (diff) | |
| download | sml-5989629a7951e544ad4656672025a99ecd08c7c9.tar.zst | |
Change how slices work.
I'm switching to a more macro-heavy solution. Hopefully it
proves robust.
Diffstat (limited to 'bytecode/encoding.c')
| -rw-r--r-- | bytecode/encoding.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bytecode/encoding.c b/bytecode/encoding.c index 520b6c3..246e944 100644 --- a/bytecode/encoding.c +++ b/bytecode/encoding.c @@ -2,19 +2,19 @@ #include <stdlib.h> #include "panic.h" -#include "slice.h" +#include "byte_slice.h" #include "value.h" #include "encoding.h" struct reader { - struct slice data; + uint8_t_slice data; int n; }; static void advance(struct reader *r, int size) { - r->data = slice1(r->data, size); + r->data = uint8_t_slice1(r->data, size); r->n += size; } @@ -69,7 +69,7 @@ static uint8_t parse_offset(struct reader *r) return res; } -struct result parse(struct slice data) +struct result parse(uint8_t_slice data) { struct reader r = { .data = data, .n = 0 }; |
