Browse code

fix a few long-standing compilation warnings

Sigrid Solveig Haflínudóttir authored on 20/03/2023 15:58:09
Showing 1 changed files
... ...
@@ -22,6 +22,9 @@
22 22
 #include <windows.h>
23 23
 #include <string.h>
24 24
 #endif
25
+#ifndef __plan9__
26
+#define USED(x) (void)(x)
27
+#endif
25 28
 #pragma GCC diagnostic pop
26 29
 #pragma clang diagnostic pop
27 30
 
... ...
@@ -157,12 +160,12 @@ audio_callback(void *u, Uint8 *stream, int len)
157 160
 {
158 161
 	int instance, running = 0;
159 162
 	Sint16 *samples = (Sint16 *)stream;
163
+	USED(u);
160 164
 	SDL_memset(stream, 0, len);
161 165
 	for(instance = 0; instance < POLYPHONY; instance++)
162 166
 		running += audio_render(instance, samples, samples + len / 2);
163 167
 	if(!running)
164 168
 		SDL_PauseAudioDevice(audio_id, 1);
165
-	(void)u;
166 169
 }
167 170
 
168 171
 void
... ...
@@ -177,11 +180,11 @@ static int
177 180
 stdin_handler(void *p)
178 181
 {
179 182
 	SDL_Event event;
183
+	USED(p);
180 184
 	event.type = stdin_event;
181 185
 	while(read(0, &event.cbutton.button, 1) > 0 && SDL_PushEvent(&event) >= 0)
182 186
 		;
183 187
 	return 0;
184
-	(void)p;
185 188
 }
186 189
 
187 190
 static void
... ...
@@ -465,7 +468,6 @@ run(Uxn *u)
465 468
 		} else
466 469
 			SDL_WaitEvent(NULL);
467 470
 	}
468
-	return error("SDL_WaitEvent", SDL_GetError());
469 471
 }
470 472
 
471 473
 int