Browse Source

fixed uninitialized warnings from gcc7, gcc8, and gcc9.

Ozkan Sezer 2 years ago
parent
commit
0ef85873a2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/render/SDL_render.c

+ 2 - 2
src/render/SDL_render.c

@@ -2123,7 +2123,7 @@ static int UpdateLogicalPresentation(SDL_Renderer *renderer)
         }
 
         if (renderer->logical_target) {
-            int existing_w, existing_h;
+            int existing_w = 0, existing_h = 0;
 
             if (SDL_QueryTexture(renderer->logical_target, NULL, NULL, &existing_w, &existing_h) < 0) {
                 goto error;
@@ -2240,7 +2240,7 @@ int SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_R
         }
     } else if (mode != SDL_LOGICAL_PRESENTATION_MATCH) {
         if (renderer->logical_target) {
-            int existing_w, existing_h;
+            int existing_w = 0, existing_h = 0;
 
             if (SDL_QueryTexture(renderer->logical_target, NULL, NULL, &existing_w, &existing_h) < 0) {
                 goto error;