aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-04-13 13:11:07 +0200
committerkdx <kikoodx@paranoici.org>2023-04-13 13:11:07 +0200
commitd0d7fd46e8080cb5945fce4e48a0ab7634197d50 (patch)
tree82f635829a299914e2cdb06121460ab1a4f365cf
parent12789bcc949a60ba59cee1d21fed12c7d699aadb (diff)
downloadorga-d0d7fd46e8080cb5945fce4e48a0ab7634197d50.tar.gz
fast
-rw-r--r--src/main.c10
1 files 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