From 1e9795e1795c5da69e94923840f444d40942c1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Thu, 29 Aug 2024 17:21:18 +0200 Subject: [PATCH] fix all the warnings --- src/uxn.c | 2 +- src/uxnasm.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uxn.c b/src/uxn.c index 4e0bdbe..91ce7e4 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -58,7 +58,7 @@ uxn_eval(Uint16 pc) /* L2r */ case 0xe0: INC(rst) = uxn.ram[pc++]; /* LIr */ case 0xc0: INC(rst) = uxn.ram[pc++]; break; /* INC */ OPC(0x01, POx(a), PUx(a + 1)) - /* POP */ OPC(0x02, REM, 0) + /* POP */ OPC(0x02, REM, {}) /* NIP */ OPC(0x03, GET(x) REM,PUT(x)) /* SWP */ OPC(0x04, GET(x) GET(y),PUT(x) PUT(y)) /* ROT */ OPC(0x05, GET(x) GET(y) GET(z),PUT(y) PUT(x) PUT(z)) diff --git a/src/uxnasm.c b/src/uxnasm.c index 89b726a..2e0fb23 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -61,7 +61,7 @@ static int parse(char *w, FILE *f, Context *ctx); static char * push(char *s, char c) { - char *d = dict; + char *d; for(d = dict; d < dictnext; d++) { char *ss = s, *dd = d, a, b; while((a = *dd++) == (b = *ss++)) @@ -126,7 +126,7 @@ walkmacro(Item *m, Context *ctx) char *dataptr = m->data, *_token = token; while((c = *dataptr++)) { if(c < 0x21) { - *_token++ = 0x00; + *_token = 0x00; if(token[0] && !parse(token, NULL, ctx)) return 0; _token = token; } else if(_token - token < 0x2f) @@ -144,7 +144,7 @@ walkfile(FILE *f, Context *ctx) char *_token = token; while(f && fread(&c, 1, 1, f)) { if(c < 0x21) { - *_token++ = 0x00; + *_token = 0x00; if(token[0] && !parse(token, f, ctx)) return 0; if(c == 0xa) ctx->line++; _token = token; @@ -153,7 +153,7 @@ walkfile(FILE *f, Context *ctx) else return error_asm("Token size exceeded"); } - *_token++ = 0; + *_token = 0; return parse(token, f, ctx); } @@ -293,7 +293,7 @@ static int assemble(char *filename) { FILE *f; - int res = 0; + int res; Context ctx; ctx.line = 1; ctx.path = push(filename, 0);