From 6269c4d47ad98829dc716583a834406e2394ee73 Mon Sep 17 00:00:00 2001 From: Evan Johnston Date: Tue, 27 Dec 2022 22:47:56 +0000 Subject: [PATCH] add defaults to switch statements to silence warnings --- main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.c b/main.c index 192321d..dfb1d5c 100644 --- a/main.c +++ b/main.c @@ -88,6 +88,7 @@ eval(char *program, unsigned int x, unsigned int y, unsigned int *stack) case HEIGHT: push(height); continue; case WIDTH: push(width); continue; case LIT: push(t.data); continue; + default: break; }; if (--sp < stack) goto error; unsigned int b = *sp; @@ -97,6 +98,7 @@ eval(char *program, unsigned int x, unsigned int y, unsigned int *stack) /* shhhhhhhh it's fine portability is overrated */ case COUNT: push(__builtin_popcount(b)); continue; case DUP: push(b); push(b); continue; + default: break; }; if (--sp < stack) goto error; unsigned int a = *sp; @@ -125,6 +127,7 @@ eval(char *program, unsigned int x, unsigned int y, unsigned int *stack) case SWAP: push(b); push(a); continue; case LEFT: push(a << b); continue; case RIGHT: push(b >> b); continue; + default: break; } } return sp; -- 2.38.5