From d0d7fd46e8080cb5945fce4e48a0ab7634197d50 Mon Sep 17 00:00:00 2001 From: kdx Date: Thu, 13 Apr 2023 13:11:07 +0200 Subject: fast --- src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index bd145ad..8e1aa3f 100644 --- a/src/main.c +++ b/src/main.c @@ -107,7 +107,7 @@ opcmp(const char *s0, const char *s1) static void write_opcode(const char *s) { - for (int i = 0; i < sizeof(ops) / sizeof(ops[0]); i++) { + for (unsigned i = 0; i < sizeof(ops) / sizeof(ops[0]); i++) { if (opcmp(s, ops[i])) { write_short(i); return; @@ -130,10 +130,10 @@ write_literal(const char *s) fprintf(stderr, "invalid literal '%s'\n", s); exit(fail()); } - write_short((hextable[s[0]] * 0x1000) | - (hextable[s[1]] * 0x100) | - (hextable[s[2]] * 0x10) | - (hextable[s[3]])); + write_short((hextable[(int)s[0]] * 0x1000) | + (hextable[(int)s[1]] * 0x100) | + (hextable[(int)s[2]] * 0x10) | + (hextable[(int)s[3]])); } static void -- cgit v1.2.3