Update VS2012 solution - add missing files; fix some static analysis warnings
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Sat, 01 Dec 2012 23:30:53 -0800
changeset 6719c250f633c040
parent 6718 918ba414168b
child 6720 5d20f1296bca
Update VS2012 solution - add missing files; fix some static analysis warnings
VisualC/SDL/SDL_VS2012.vcxproj
src/main/windows/SDL_windows_main.c
src/test/SDL_test_fuzzer.c
src/test/SDL_test_log.c
test/automated/surface/surface.c
     1.1 --- a/VisualC/SDL/SDL_VS2012.vcxproj	Sat Dec 01 14:48:30 2012 -0800
     1.2 +++ b/VisualC/SDL/SDL_VS2012.vcxproj	Sat Dec 01 23:30:53 2012 -0800
     1.3 @@ -255,6 +255,7 @@
     1.4      <ClInclude Include="..\..\include\SDL_types.h" />
     1.5      <ClInclude Include="..\..\include\SDL_version.h" />
     1.6      <ClInclude Include="..\..\include\SDL_video.h" />
     1.7 +    <ClInclude Include="..\..\include\SDL_gamecontroller.h" />
     1.8      <ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
     1.9      <ClInclude Include="..\..\src\events\blank_cursor.h" />
    1.10      <ClInclude Include="..\..\src\events\default_cursor.h" />
    1.11 @@ -445,6 +446,7 @@
    1.12      <ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
    1.13      <ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
    1.14      <ClCompile Include="..\..\src\events\SDL_windowevents.c" />
    1.15 +    <ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
    1.16    </ItemGroup>
    1.17    <ItemGroup>
    1.18      <ResourceCompile Include="..\..\src\main\windows\version.rc" />
     2.1 --- a/src/main/windows/SDL_windows_main.c	Sat Dec 01 14:48:30 2012 -0800
     2.2 +++ b/src/main/windows/SDL_windows_main.c	Sat Dec 01 23:30:53 2012 -0800
     2.3 @@ -27,7 +27,7 @@
     2.4      char *last = NULL;
     2.5  
     2.6      while (*arg) {
     2.7 -        if (*arg == '"' && *last == '\\') {
     2.8 +        if (*arg == '"' && (last != NULL && *last == '\\')) {
     2.9              char *c_curr = arg;
    2.10              char *c_last = last;
    2.11  
     3.1 --- a/src/test/SDL_test_fuzzer.c	Sat Dec 01 14:48:30 2012 -0800
     3.2 +++ b/src/test/SDL_test_fuzzer.c	Sat Dec 01 23:30:53 2012 -0800
     3.3 @@ -263,7 +263,7 @@
     3.4  	size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
     3.5  				(Uint64) boundary1, (Uint64) boundary2,
     3.6  				validDomain, buffer);
     3.7 -	if (size == 0) {
     3.8 +	if (buffer == NULL || size == 0) {
     3.9  		return 0;
    3.10  	}
    3.11  
    3.12 @@ -291,7 +291,7 @@
    3.13  	size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
    3.14  				(Uint64) boundary1, (Uint64) boundary2,
    3.15  				validDomain, buffer);
    3.16 -	if(size == 0) {
    3.17 +	if (buffer == NULL || size == 0) {
    3.18  		return 0;
    3.19  	}
    3.20  
    3.21 @@ -319,7 +319,7 @@
    3.22  	size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
    3.23  				(Uint64) boundary1, (Uint64) boundary2,
    3.24  				validDomain, buffer);
    3.25 -	if(size == 0) {
    3.26 +	if (buffer == NULL || size == 0) {
    3.27  		return 0;
    3.28  	}
    3.29  
    3.30 @@ -347,7 +347,7 @@
    3.31  	size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
    3.32  				(Uint64) boundary1, (Uint64) boundary2,
    3.33  				validDomain, buffer);
    3.34 -	if(size == 0) {
    3.35 +	if (buffer == NULL || size == 0) {
    3.36  		return 0;
    3.37  	}
    3.38  
    3.39 @@ -467,7 +467,7 @@
    3.40  	size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
    3.41  				(Sint64) boundary1, (Sint64) boundary2,
    3.42  				validDomain, buffer);
    3.43 -	if(size == 0) {
    3.44 +	if (buffer == NULL || size == 0) {
    3.45  		return CHAR_MIN;
    3.46  	}
    3.47  
    3.48 @@ -495,7 +495,7 @@
    3.49  	size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
    3.50  					(Sint64) boundary1, (Sint64) boundary2,
    3.51  					validDomain, buffer);
    3.52 -	if(size == 0) {
    3.53 +	if (buffer == NULL || size == 0) {
    3.54  		return SHRT_MIN;
    3.55  	}
    3.56  
    3.57 @@ -524,7 +524,7 @@
    3.58  	size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
    3.59  				(Sint64) boundary1, (Sint64) boundary2,
    3.60  				validDomain, buffer);
    3.61 -	if(size == 0) {
    3.62 +	if (buffer == NULL || size == 0) {
    3.63  		return INT_MIN;
    3.64  	}
    3.65  
    3.66 @@ -553,7 +553,7 @@
    3.67  	size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
    3.68  				(Sint64) boundary1, (Sint64) boundary2,
    3.69  				validDomain, buffer);
    3.70 -	if(size == 0) {
    3.71 +	if (buffer == NULL || size == 0) {
    3.72  		return LLONG_MIN;
    3.73  	}
    3.74  
     4.1 --- a/src/test/SDL_test_log.c	Sat Dec 01 14:48:30 2012 -0800
     4.2 +++ b/src/test/SDL_test_log.c	Sat Dec 01 23:30:53 2012 -0800
     4.3 @@ -31,6 +31,8 @@
     4.4  #include "SDL_config.h"
     4.5  
     4.6  #include <stdarg.h> /* va_list */
     4.7 +#include <stdio.h>
     4.8 +#include <string.h>
     4.9  #include <time.h>
    4.10  
    4.11  #include "SDL_test.h"
     5.1 --- a/test/automated/surface/surface.c	Sat Dec 01 14:48:30 2012 -0800
     5.2 +++ b/test/automated/surface/surface.c	Sat Dec 01 23:30:53 2012 -0800
     5.3 @@ -212,7 +212,7 @@
     5.4  /**
     5.5   * @brief Tests a blend mode.
     5.6   */
     5.7 -static int surface_testBlitBlendMode( SDL_Surface *testsur, SDL_Surface *face, int mode )
     5.8 +static int surface_testBlitBlendMode( SDL_Surface *testsur, SDL_Surface *face, SDL_BlendMode bMode )
     5.9  {
    5.10     int ret;
    5.11     int i, j, ni, nj;
    5.12 @@ -236,7 +236,7 @@
    5.13     for (j=0; j <= nj; j+=4) {
    5.14        for (i=0; i <= ni; i+=4) {
    5.15           /* Set blend mode. */
    5.16 -         ret = SDL_SetSurfaceBlendMode( face, mode );
    5.17 +         ret = SDL_SetSurfaceBlendMode( face, bMode );
    5.18           if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0))
    5.19              return 1;
    5.20  
    5.21 @@ -263,6 +263,7 @@
    5.22     SDL_Surface *face;
    5.23     int i, j, ni, nj;
    5.24     int mode;
    5.25 +   SDL_BlendMode bMode;
    5.26  
    5.27     SDL_ATbegin( "Blit Blending Tests" );
    5.28  
    5.29 @@ -353,11 +354,11 @@
    5.30  
    5.31           /* Crazy blending mode magic. */
    5.32           mode = (i/4*j/4) % 4;
    5.33 -         if (mode==0) mode = SDL_BLENDMODE_NONE;
    5.34 -         else if (mode==1) mode = SDL_BLENDMODE_BLEND;
    5.35 -         else if (mode==2) mode = SDL_BLENDMODE_ADD;
    5.36 -         else if (mode==3) mode = SDL_BLENDMODE_MOD;
    5.37 -         ret = SDL_SetSurfaceBlendMode( face, mode );
    5.38 +         if (mode==0) bMode = SDL_BLENDMODE_NONE;
    5.39 +         else if (mode==1) bMode = SDL_BLENDMODE_BLEND;
    5.40 +         else if (mode==2) bMode = SDL_BLENDMODE_ADD;
    5.41 +         else if (mode==3) bMode = SDL_BLENDMODE_MOD;
    5.42 +         ret = SDL_SetSurfaceBlendMode( face, bMode );
    5.43           if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0))
    5.44              return;
    5.45