From 7c9790d7726e0bb3f44bec15eff7631080d45b03 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 4 Aug 2023 18:20:32 +0100 Subject: valty_str -> typename_str --- dis.c | 2 +- val.c | 2 +- val.h | 2 +- vm.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dis.c b/dis.c index b96f07c..0eb2720 100644 --- a/dis.c +++ b/dis.c @@ -18,7 +18,7 @@ void disasm_chunk(Chunk *ch) { uint8_t ix = ch->b[ip++]; printf("loadk #%d\t; ",ix); Val k = ch->c[ix]; - printf("%-4s : ",valty_str(k)); + printf("%-4s : ",typename_str(k)); println_val(k); break; SIMPLE_INSTR(OP_PRINT, "print") diff --git a/val.c b/val.c index 41d3a06..cd76595 100644 --- a/val.c +++ b/val.c @@ -42,7 +42,7 @@ void println_val(Val v) { } -const char *valty_str(Val v) { +const char *typename_str(Val v) { switch(v.ty) { case TY_NIL: return "nil"; case TY_NUM: return "num"; diff --git a/val.h b/val.h index 1ab716b..6e4cc18 100644 --- a/val.h +++ b/val.h @@ -24,7 +24,7 @@ typedef struct _val { } Val; void print_val(Val v); void println_val(Val v); -const char *valty_str(Val v); +const char *typename_str(Val v); typedef enum { diff --git a/vm.c b/vm.c index f7887d3..c420774 100644 --- a/vm.c +++ b/vm.c @@ -112,7 +112,7 @@ void runvm(Chunk *ch) { Val a = POP(); \ if (!IS_NUM(a) || !IS_NUM(b)) { \ printf("can't do arithmetic on %s and %s\n", \ - valty_str(a), valty_str(b)); \ + typename_str(a), typename_str(b)); \ goto done; \ } \ PUSH(VAL_NUM(AS_NUM(a) OP AS_NUM(b))); \ -- cgit v1.2.3