From 148dae4ebd37e9936bb4a2aec867383455b9f432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Wed, 29 Dec 2021 18:33:23 +0100 Subject: [PATCH] fix a few "set and not used" warnings --- src/uxnasm.c | 2 +- src/uxnemu.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/uxnasm.c b/src/uxnasm.c index 39009a7..7fd2f12 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -236,7 +236,7 @@ doinclude(const char *filename) static int parse(char *w, FILE *f) { - int i = 0; + int i; char word[64], subw[64], c; Macro *m; if(slen(w) >= 63) diff --git a/src/uxnemu.c b/src/uxnemu.c index b8e45a9..690584b 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -137,7 +137,6 @@ redraw(Uxn *u) static int init(void) { - SDL_Joystick *gGameController; SDL_AudioSpec as; SDL_zero(as); as.freq = SAMPLE_FREQUENCY; @@ -157,7 +156,7 @@ init(void) audio_id = SDL_OpenAudioDevice(NULL, 0, &as, NULL, 0); if(!audio_id) error("sdl_audio", SDL_GetError()); - if(SDL_NumJoysticks() > 0 && !(gGameController = SDL_JoystickOpen(0))) + if(SDL_NumJoysticks() > 0 && SDL_JoystickOpen(0) == NULL) error("sdl_joystick", SDL_GetError()); stdin_event = SDL_RegisterEvents(1); audio0_event = SDL_RegisterEvents(POLYPHONY); @@ -429,7 +428,7 @@ run(Uxn *u) redraw(u); while(!devsystem->dat[0xf]) { SDL_Event event; - double elapsed, begin = 0; + double elapsed, begin; if(!BENCH) begin = SDL_GetPerformanceCounter(); while(SDL_PollEvent(&event) != 0) {