aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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