Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix some clang analyzer warnings.

This fixes some analyzer warnings and a couple of minor memory leaks.
  • Loading branch information
jorgenpt committed Jul 24, 2013
1 parent 140f063 commit 8a0ae244a120bb0d9c603c69c37d1de359bc08ec
@@ -392,7 +392,7 @@ static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points)
static float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch)
{

SDL_FloatPoint points[DOLLARNPOINTS];
SDL_FloatPoint points[DOLLARNPOINTS] = {};
int i;
float bestDiff = 10000;

@@ -1467,7 +1467,7 @@ SDL_RenderDrawRects(SDL_Renderer * renderer,
int
SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect)
{
SDL_Rect full_rect;
SDL_Rect full_rect = {};

CHECK_RENDERER_MAGIC(renderer, -1);

@@ -619,6 +619,8 @@ SDL_UpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect,
/* If the destination rectangle is NULL, use the entire dest surface */
if (dstrect == NULL) {
fulldst.x = fulldst.y = 0;
fulldst.w = dst->w;
fulldst.h = dst->h;
dstrect = &fulldst;
}

@@ -3062,8 +3062,11 @@ static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData *messagebo
}

SDL_VERSION(&info.version);
SDL_GetWindowWMInfo(window, &info);
return (info.subsystem == drivertype);
if (!SDL_GetWindowWMInfo(window, &info)) {
return SDL_TRUE;
} else {
return (info.subsystem == drivertype);
}
}

int
@@ -138,6 +138,10 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam
NSMenu *windowMenu;
NSMenuItem *menuItem;

if (!NSApp) {
return;
}

/* Create the main menu bar */
[NSApp setMainMenu:[[NSMenu alloc] init]];

@@ -228,7 +232,7 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam
}
[NSApp finishLaunching];
}
if ([NSApp delegate] == nil) {
if (NSApp && ![NSApp delegate]) {
[NSApp setDelegate:[[SDLAppDelegate alloc] init]];
}
[pool release];
@@ -96,6 +96,7 @@
closure.window = shaper->window;
SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure);
[closure.path addClip];
[pool release];

return 0;
}

0 comments on commit 8a0ae24

Please sign in to comment.