fix a few "set and not used" warnings

This commit is contained in:
Sigrid Solveig Haflínudóttir 2021-12-29 18:33:23 +01:00
parent e0746c2be7
commit 148dae4ebd
2 changed files with 3 additions and 4 deletions

View File

@ -236,7 +236,7 @@ doinclude(const char *filename)
static int static int
parse(char *w, FILE *f) parse(char *w, FILE *f)
{ {
int i = 0; int i;
char word[64], subw[64], c; char word[64], subw[64], c;
Macro *m; Macro *m;
if(slen(w) >= 63) if(slen(w) >= 63)

View File

@ -137,7 +137,6 @@ redraw(Uxn *u)
static int static int
init(void) init(void)
{ {
SDL_Joystick *gGameController;
SDL_AudioSpec as; SDL_AudioSpec as;
SDL_zero(as); SDL_zero(as);
as.freq = SAMPLE_FREQUENCY; as.freq = SAMPLE_FREQUENCY;
@ -157,7 +156,7 @@ init(void)
audio_id = SDL_OpenAudioDevice(NULL, 0, &as, NULL, 0); audio_id = SDL_OpenAudioDevice(NULL, 0, &as, NULL, 0);
if(!audio_id) if(!audio_id)
error("sdl_audio", SDL_GetError()); 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()); error("sdl_joystick", SDL_GetError());
stdin_event = SDL_RegisterEvents(1); stdin_event = SDL_RegisterEvents(1);
audio0_event = SDL_RegisterEvents(POLYPHONY); audio0_event = SDL_RegisterEvents(POLYPHONY);
@ -429,7 +428,7 @@ run(Uxn *u)
redraw(u); redraw(u);
while(!devsystem->dat[0xf]) { while(!devsystem->dat[0xf]) {
SDL_Event event; SDL_Event event;
double elapsed, begin = 0; double elapsed, begin;
if(!BENCH) if(!BENCH)
begin = SDL_GetPerformanceCounter(); begin = SDL_GetPerformanceCounter();
while(SDL_PollEvent(&event) != 0) { while(SDL_PollEvent(&event) != 0) {