Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Update VS2012 solution - add missing files; fix some static analysis …
Browse files Browse the repository at this point in the history
…warnings
  • Loading branch information
ferzkopp committed Dec 2, 2012
1 parent 21528b5 commit 6533cd7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
2 changes: 2 additions & 0 deletions VisualC/SDL/SDL_VS2012.vcxproj
Expand Up @@ -255,6 +255,7 @@
<ClInclude Include="..\..\include\SDL_types.h" />
<ClInclude Include="..\..\include\SDL_version.h" />
<ClInclude Include="..\..\include\SDL_video.h" />
<ClInclude Include="..\..\include\SDL_gamecontroller.h" />
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
Expand Down Expand Up @@ -445,6 +446,7 @@
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" />
Expand Down
2 changes: 1 addition & 1 deletion src/main/windows/SDL_windows_main.c
Expand Up @@ -27,7 +27,7 @@ UnEscapeQuotes(char *arg)
char *last = NULL;

while (*arg) {
if (*arg == '"' && *last == '\\') {
if (*arg == '"' && (last != NULL && *last == '\\')) {
char *c_curr = arg;
char *c_last = last;

Expand Down
16 changes: 8 additions & 8 deletions src/test/SDL_test_fuzzer.c
Expand Up @@ -263,7 +263,7 @@ SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool vali
size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
(Uint64) boundary1, (Uint64) boundary2,
validDomain, buffer);
if (size == 0) {
if (buffer == NULL || size == 0) {
return 0;
}

Expand Down Expand Up @@ -291,7 +291,7 @@ SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool v
size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
(Uint64) boundary1, (Uint64) boundary2,
validDomain, buffer);
if(size == 0) {
if (buffer == NULL || size == 0) {
return 0;
}

Expand Down Expand Up @@ -319,7 +319,7 @@ SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool v
size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
(Uint64) boundary1, (Uint64) boundary2,
validDomain, buffer);
if(size == 0) {
if (buffer == NULL || size == 0) {
return 0;
}

Expand Down Expand Up @@ -347,7 +347,7 @@ SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool v
size = SDLTest_GenerateUnsignedBoundaryValues(maxValue,
(Uint64) boundary1, (Uint64) boundary2,
validDomain, buffer);
if(size == 0) {
if (buffer == NULL || size == 0) {
return 0;
}

Expand Down Expand Up @@ -467,7 +467,7 @@ SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool vali
size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
(Sint64) boundary1, (Sint64) boundary2,
validDomain, buffer);
if(size == 0) {
if (buffer == NULL || size == 0) {
return CHAR_MIN;
}

Expand Down Expand Up @@ -495,7 +495,7 @@ SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool v
size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
(Sint64) boundary1, (Sint64) boundary2,
validDomain, buffer);
if(size == 0) {
if (buffer == NULL || size == 0) {
return SHRT_MIN;
}

Expand Down Expand Up @@ -524,7 +524,7 @@ SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool v
size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
(Sint64) boundary1, (Sint64) boundary2,
validDomain, buffer);
if(size == 0) {
if (buffer == NULL || size == 0) {
return INT_MIN;
}

Expand Down Expand Up @@ -553,7 +553,7 @@ SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool v
size = SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
(Sint64) boundary1, (Sint64) boundary2,
validDomain, buffer);
if(size == 0) {
if (buffer == NULL || size == 0) {
return LLONG_MIN;
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/SDL_test_log.c
Expand Up @@ -31,6 +31,8 @@
#include "SDL_config.h"

#include <stdarg.h> /* va_list */
#include <stdio.h>
#include <string.h>
#include <time.h>

#include "SDL_test.h"
Expand Down
15 changes: 8 additions & 7 deletions test/automated/surface/surface.c
Expand Up @@ -212,7 +212,7 @@ static void surface_testBlit( SDL_Surface *testsur )
/**
* @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 i, j, ni, nj;
Expand All @@ -236,7 +236,7 @@ static int surface_testBlitBlendMode( SDL_Surface *testsur, SDL_Surface *face, i
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
/* Set blend mode. */
ret = SDL_SetSurfaceBlendMode( face, mode );
ret = SDL_SetSurfaceBlendMode( face, bMode );
if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0))
return 1;

Expand All @@ -263,6 +263,7 @@ static void surface_testBlitBlend( SDL_Surface *testsur )
SDL_Surface *face;
int i, j, ni, nj;
int mode;
SDL_BlendMode bMode;

SDL_ATbegin( "Blit Blending Tests" );

Expand Down Expand Up @@ -353,11 +354,11 @@ static void surface_testBlitBlend( SDL_Surface *testsur )

/* Crazy blending mode magic. */
mode = (i/4*j/4) % 4;
if (mode==0) mode = SDL_BLENDMODE_NONE;
else if (mode==1) mode = SDL_BLENDMODE_BLEND;
else if (mode==2) mode = SDL_BLENDMODE_ADD;
else if (mode==3) mode = SDL_BLENDMODE_MOD;
ret = SDL_SetSurfaceBlendMode( face, mode );
if (mode==0) bMode = SDL_BLENDMODE_NONE;
else if (mode==1) bMode = SDL_BLENDMODE_BLEND;
else if (mode==2) bMode = SDL_BLENDMODE_ADD;
else if (mode==3) bMode = SDL_BLENDMODE_MOD;
ret = SDL_SetSurfaceBlendMode( face, bMode );
if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0))
return;

Expand Down

0 comments on commit 6533cd7

Please sign in to comment.