소스 검색

Static analysis fix: uninitialized variables.

This is actually a false-positive, in this case, since Clang doesn't know
 that SDL_SetError() only ever returns -1. Feature request to improve that,
 with explanation about these specific SDL patches, is here:

   http://llvm.org/bugs/show_bug.cgi?id=19208
Ryan C. Gordon 11 년 전
부모
커밋
b659c70080
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/render/SDL_render.c

+ 4 - 4
src/render/SDL_render.c

@@ -970,8 +970,8 @@ static void
 SDL_UnlockTextureYUV(SDL_Texture * texture)
 {
     SDL_Texture *native = texture->native;
-    void *native_pixels;
-    int native_pitch;
+    void *native_pixels = NULL;
+    int native_pitch = 0;
     SDL_Rect rect;
 
     rect.x = 0;
@@ -991,8 +991,8 @@ static void
 SDL_UnlockTextureNative(SDL_Texture * texture)
 {
     SDL_Texture *native = texture->native;
-    void *native_pixels;
-    int native_pitch;
+    void *native_pixels = NULL;
+    int native_pitch = 0;
     const SDL_Rect *rect = &texture->locked_rect;
     const void* pixels = (void *) ((Uint8 *) texture->pixels +
                         rect->y * texture->pitch +