Skip to content
Browse files

Fixed static analyzer warnings.

  • Loading branch information...
1 parent eaa0890 commit 78ee38eefc37fec70f1676c0236bf7e9491f3c60 @ksuther committed
Showing with 13 additions and 12 deletions.
  1. +1 −1 MainController.m
  2. +1 −1 PagerController.m
  3. +2 −0 Warp.xcodeproj/project.pbxproj
  4. +9 −10 WarpPreferences.m
View
2 MainController.m
@@ -476,7 +476,7 @@ + (void)timerFired:(NSTimer *)timer
+ (void)warpInDirection:(NSUInteger)direction edge:(Edge *)edge
{
if (!_timeMachineActive && ![self isSecurityAgentActive] && ![self isFullscreenAppActive]) {
- CGPoint mouseLocation, warpLocation;
+ CGPoint mouseLocation = CGPointZero, warpLocation = CGPointZero;
NSInteger row, col;
BOOL switchedSpace = NO;
NSUserDefaults *df = [NSUserDefaults standardUserDefaults];
View
2 PagerController.m
@@ -298,7 +298,7 @@ - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
error = GetProcessBundleLocation(&psn, &processLocation);
NSAssert1(error == noErr, @"GetProcessBundleLocation() failed! %d", error);
- NSURL *applicationURL = (NSURL *)CFURLCreateFromFSRef(kCFAllocatorDefault, &processLocation);
+ NSURL *applicationURL = [(NSURL *)CFURLCreateFromFSRef(kCFAllocatorDefault, &processLocation) autorelease];
NSImage *image = [[NSWorkspace sharedWorkspace] iconForFile:[applicationURL path]];
NSSize imageSize = image.size;
View
2 Warp.xcodeproj/project.pbxproj
@@ -666,6 +666,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
+ RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Debug;
@@ -678,6 +679,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
+ RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Release;
View
19 WarpPreferences.m
@@ -210,18 +210,17 @@ - (BOOL)isWarpDaemonRunning
{
ProcessSerialNumber number = {kNoProcess, kNoProcess};
NSDictionary *processInfo;
-
- while (GetNextProcess(&number) == noErr) {
- processInfo = (NSDictionary *)ProcessInformationCopyDictionary(&number, kProcessDictionaryIncludeAllInformationMask);
-
- if ([[processInfo objectForKey:(NSString *)kCFBundleIdentifierKey] isEqualToString:WarpBundleIdentifier]) {
- return YES;
+ BOOL isRunning = NO;
+
+ while (!isRunning && GetNextProcess(&number) == noErr) {
+ processInfo = [NSMakeCollectable(ProcessInformationCopyDictionary(&number, kProcessDictionaryIncludeAllInformationMask)) autorelease];
+
+ if ([[(NSDictionary *)processInfo objectForKey:(NSString *)kCFBundleIdentifierKey] isEqualToString:WarpBundleIdentifier]) {
+ isRunning = YES;
}
-
- [processInfo release];
}
- return NO;
+ return isRunning;
}
- (void)setWarpEnabled:(BOOL)enabled
@@ -379,7 +378,7 @@ - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
- NSString *string = [[NSString alloc] initWithData:_updateResponseData encoding:NSASCIIStringEncoding];
+ NSString *string = [[[NSString alloc] initWithData:_updateResponseData encoding:NSASCIIStringEncoding] autorelease];
NSArray *lines = [string componentsSeparatedByString:@"\n"];
NSDictionary *infoDictionary = [[self bundle] infoDictionary];
NSString *currentVersionString = [infoDictionary objectForKey:@"CFBundleVersion"];

0 comments on commit 78ee38e

Please sign in to comment.
Something went wrong with that request. Please try again.