changeset 2089:dcca36701cdd

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 19 Feb 2019 12:18:12 +0200
parents e900e6e2593d
children 0d7c73f42a0b
files tools/64vw.c tools/ppl.c
diffstat 2 files changed, 9 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/tools/64vw.c	Tue Feb 19 09:33:29 2019 +0200
+++ b/tools/64vw.c	Tue Feb 19 12:18:12 2019 +0200
@@ -544,17 +544,10 @@
     // Cleanup
     dmFree(optFilenames);
 
-    if (texture != NULL)
-        SDL_DestroyTexture(texture);
-
-    if (renderer != NULL)
-        SDL_DestroyRenderer(renderer);
-
-    if (window != NULL)
-        SDL_DestroyWindow(window);
-
-    if (surf != NULL)
-        SDL_FreeSurface(surf);
+    SDL_DestroyTexture(texture);
+    SDL_DestroyRenderer(renderer);
+    SDL_DestroyWindow(window);
+    SDL_FreeSurface(surf);
 
     if (initSDL)
         SDL_Quit();
--- a/tools/ppl.c	Tue Feb 19 09:33:29 2019 +0200
+++ b/tools/ppl.c	Tue Feb 19 12:18:12 2019 +0200
@@ -527,8 +527,7 @@
 
 void dmMuteChannels(BOOL mute)
 {
-    int i;
-    for (i = 0; i < eng.mod->nchannels; i++)
+    for (int i = 0; i < eng.mod->nchannels; i++)
         jvmMute(eng.dev, i, mute);
 }
 
@@ -921,17 +920,10 @@
     }
 
 error_exit:
-    if (eng.texture != NULL)
-        SDL_DestroyTexture(eng.texture);
-
-    if (eng.renderer != NULL)
-        SDL_DestroyRenderer(eng.renderer);
-
-    if (eng.window != NULL)
-        SDL_DestroyWindow(eng.window);
-
-    if (eng.screen != NULL)
-        SDL_FreeSurface(eng.screen);
+    SDL_DestroyTexture(eng.texture);
+    SDL_DestroyRenderer(eng.renderer);
+    SDL_DestroyWindow(eng.window);
+    SDL_FreeSurface(eng.screen);
 
     dmMsg(0, "Audio shutdown.\n");
     if (audioInit)