Update VS2012 solution - add missing files; fix some static analysis warnings

This commit is contained in:
Andreas Schiffler 2012-12-01 23:30:53 -08:00
parent d4bfe07a4f
commit fb3b70940c
5 changed files with 21 additions and 16 deletions

View file

@ -255,6 +255,7 @@
<ClInclude Include="..\..\include\SDL_types.h" /> <ClInclude Include="..\..\include\SDL_types.h" />
<ClInclude Include="..\..\include\SDL_version.h" /> <ClInclude Include="..\..\include\SDL_version.h" />
<ClInclude Include="..\..\include\SDL_video.h" /> <ClInclude Include="..\..\include\SDL_video.h" />
<ClInclude Include="..\..\include\SDL_gamecontroller.h" />
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" /> <ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
<ClInclude Include="..\..\src\events\blank_cursor.h" /> <ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" /> <ClInclude Include="..\..\src\events\default_cursor.h" />
@ -445,6 +446,7 @@
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" /> <ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" /> <ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" /> <ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" /> <ResourceCompile Include="..\..\src\main\windows\version.rc" />

View file

@ -27,7 +27,7 @@ UnEscapeQuotes(char *arg)
char *last = NULL; char *last = NULL;
while (*arg) { while (*arg) {
if (*arg == '"' && *last == '\\') { if (*arg == '"' && (last != NULL && *last == '\\')) {
char *c_curr = arg; char *c_curr = arg;
char *c_last = last; char *c_last = last;

View file

@ -263,7 +263,7 @@ SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool vali
size = SDLTest_GenerateUnsignedBoundaryValues(maxValue, size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
(Uint64) boundary1, (Uint64) boundary2, (Uint64) boundary1, (Uint64) boundary2,
validDomain, buffer); validDomain, buffer);
if (size == 0) { if (buffer == NULL || size == 0) {
return 0; return 0;
} }
@ -291,7 +291,7 @@ SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool v
size = SDLTest_GenerateUnsignedBoundaryValues(maxValue, size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
(Uint64) boundary1, (Uint64) boundary2, (Uint64) boundary1, (Uint64) boundary2,
validDomain, buffer); validDomain, buffer);
if(size == 0) { if (buffer == NULL || size == 0) {
return 0; return 0;
} }
@ -319,7 +319,7 @@ SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool v
size = SDLTest_GenerateUnsignedBoundaryValues(maxValue, size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
(Uint64) boundary1, (Uint64) boundary2, (Uint64) boundary1, (Uint64) boundary2,
validDomain, buffer); validDomain, buffer);
if(size == 0) { if (buffer == NULL || size == 0) {
return 0; return 0;
} }
@ -347,7 +347,7 @@ SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool v
size = SDLTest_GenerateUnsignedBoundaryValues(maxValue, size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
(Uint64) boundary1, (Uint64) boundary2, (Uint64) boundary1, (Uint64) boundary2,
validDomain, buffer); validDomain, buffer);
if(size == 0) { if (buffer == NULL || size == 0) {
return 0; return 0;
} }
@ -467,7 +467,7 @@ SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool vali
size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
(Sint64) boundary1, (Sint64) boundary2, (Sint64) boundary1, (Sint64) boundary2,
validDomain, buffer); validDomain, buffer);
if(size == 0) { if (buffer == NULL || size == 0) {
return CHAR_MIN; return CHAR_MIN;
} }
@ -495,7 +495,7 @@ SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool v
size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
(Sint64) boundary1, (Sint64) boundary2, (Sint64) boundary1, (Sint64) boundary2,
validDomain, buffer); validDomain, buffer);
if(size == 0) { if (buffer == NULL || size == 0) {
return SHRT_MIN; return SHRT_MIN;
} }
@ -524,7 +524,7 @@ SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool v
size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
(Sint64) boundary1, (Sint64) boundary2, (Sint64) boundary1, (Sint64) boundary2,
validDomain, buffer); validDomain, buffer);
if(size == 0) { if (buffer == NULL || size == 0) {
return INT_MIN; return INT_MIN;
} }
@ -553,7 +553,7 @@ SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool v
size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
(Sint64) boundary1, (Sint64) boundary2, (Sint64) boundary1, (Sint64) boundary2,
validDomain, buffer); validDomain, buffer);
if(size == 0) { if (buffer == NULL || size == 0) {
return LLONG_MIN; return LLONG_MIN;
} }

View file

@ -31,6 +31,8 @@
#include "SDL_config.h" #include "SDL_config.h"
#include <stdarg.h> /* va_list */ #include <stdarg.h> /* va_list */
#include <stdio.h>
#include <string.h>
#include <time.h> #include <time.h>
#include "SDL_test.h" #include "SDL_test.h"

View file

@ -212,7 +212,7 @@ static void surface_testBlit( SDL_Surface *testsur )
/** /**
* @brief Tests a blend mode. * @brief Tests a blend mode.
*/ */
static int surface_testBlitBlendMode( SDL_Surface *testsur, SDL_Surface *face, int mode ) static int surface_testBlitBlendMode( SDL_Surface *testsur, SDL_Surface *face, SDL_BlendMode bMode )
{ {
int ret; int ret;
int i, j, ni, nj; int i, j, ni, nj;
@ -236,7 +236,7 @@ static int surface_testBlitBlendMode( SDL_Surface *testsur, SDL_Surface *face, i
for (j=0; j <= nj; j+=4) { for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) { for (i=0; i <= ni; i+=4) {
/* Set blend mode. */ /* Set blend mode. */
ret = SDL_SetSurfaceBlendMode( face, mode ); ret = SDL_SetSurfaceBlendMode( face, bMode );
if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0)) if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0))
return 1; return 1;
@ -263,6 +263,7 @@ static void surface_testBlitBlend( SDL_Surface *testsur )
SDL_Surface *face; SDL_Surface *face;
int i, j, ni, nj; int i, j, ni, nj;
int mode; int mode;
SDL_BlendMode bMode;
SDL_ATbegin( "Blit Blending Tests" ); SDL_ATbegin( "Blit Blending Tests" );
@ -353,11 +354,11 @@ static void surface_testBlitBlend( SDL_Surface *testsur )
/* Crazy blending mode magic. */ /* Crazy blending mode magic. */
mode = (i/4*j/4) % 4; mode = (i/4*j/4) % 4;
if (mode==0) mode = SDL_BLENDMODE_NONE; if (mode==0) bMode = SDL_BLENDMODE_NONE;
else if (mode==1) mode = SDL_BLENDMODE_BLEND; else if (mode==1) bMode = SDL_BLENDMODE_BLEND;
else if (mode==2) mode = SDL_BLENDMODE_ADD; else if (mode==2) bMode = SDL_BLENDMODE_ADD;
else if (mode==3) mode = SDL_BLENDMODE_MOD; else if (mode==3) bMode = SDL_BLENDMODE_MOD;
ret = SDL_SetSurfaceBlendMode( face, mode ); ret = SDL_SetSurfaceBlendMode( face, bMode );
if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0)) if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0))
return; return;