diff --git a/Classes/AMIndeterminateProgressIndicatorCell.m b/Classes/AMIndeterminateProgressIndicatorCell.m index 11567bc..90f4087 100644 --- a/Classes/AMIndeterminateProgressIndicatorCell.m +++ b/Classes/AMIndeterminateProgressIndicatorCell.m @@ -37,23 +37,17 @@ - (id)init return self; } -- (void)dealloc -{ - [NSColor release]; - [super dealloc]; -} - (NSColor *)color { - return [[color retain] autorelease]; + return color; } - (void)setColor:(NSColor *)value { CGFloat alphaComponent; if (color != value) { - [color release]; - color = [value retain]; + color = value; [[color colorUsingColorSpaceName:@"NSCalibratedRGBColorSpace"] getRed:&redComponent green:&greenComponent blue:&blueComponent alpha:&alphaComponent]; // NSAssert((alphaComponent > 0.999), @"color must be opaque"); // gives a warning in xcode4 } diff --git a/Classes/CPXcodeWrapper.m b/Classes/CPXcodeWrapper.m index 28ee54a..0ecff04 100644 --- a/Classes/CPXcodeWrapper.m +++ b/Classes/CPXcodeWrapper.m @@ -247,11 +247,9 @@ - (NSArray *)filesAndSymbolsFromProjectForQuery:(NSString *)query { query = [self normalizedQueryForQuery:query]; - NSArray *resultArray = [NSArray array]; - NSArray *files = [NSArray array]; NSArray *symbols = [NSArray array]; - files = [self cpFileReferencesMatchingQuery:query]; + NSArray *files = [self cpFileReferencesMatchingQuery:query]; if ([files count] < MAX_OBJECT_COUNT_FOR_SORT_AND_FILTER) { symbols = [self topLevelCPSymbolsMatchingQuery:query]; @@ -259,7 +257,7 @@ - (NSArray *)filesAndSymbolsFromProjectForQuery:(NSString *)query USER_LOG(@"not adding symbols - we already have %d entries.", MAX_OBJECT_COUNT_FOR_SORT_AND_FILTER); } - resultArray = [symbols arrayByAddingObjectsFromArray:files]; + NSArray* resultArray = [symbols arrayByAddingObjectsFromArray:files]; // TODO/FIXME: We could add API search here resultArray = [self arrayByFilteringAndSortingArray:resultArray @@ -622,11 +620,10 @@ - (NSArray *)recursiveChildrenOfIDEIndexSymbol:(IDEIndexSymbol *)ideIndexSymbol - (NSArray *)allIDEIndexSymbolsFromCPFileReference:(CPFileReference *)fileReference { NSMutableArray *objects = [NSMutableArray array]; - NSArray *topLevelSymbols = [NSArray array]; PBXFileReference *pbxFileReference = [self pbxFileReferenceForCPFileReference:fileReference]; - topLevelSymbols = [[self currentIndex] topLevelSymbolsInFile:[pbxFileReference absolutePath]]; + NSArray * topLevelSymbols = [[self currentIndex] topLevelSymbolsInFile:[pbxFileReference absolutePath]]; for (IDEIndexSymbol *ideSymbol in topLevelSymbols) { [objects addObject:ideSymbol]; diff --git a/CodePilot.xcodeproj/project.pbxproj b/CodePilot.xcodeproj/project.pbxproj index f153669..eeb8ef1 100644 --- a/CodePilot.xcodeproj/project.pbxproj +++ b/CodePilot.xcodeproj/project.pbxproj @@ -547,7 +547,7 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0630; ORGANIZATIONNAME = Macoscope; }; buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "CodePilot" */; @@ -629,7 +629,6 @@ 4BEE524A1339193600DA9881 /* NSAppleEventDescriptor+ToObject.m in Sources */, 4BEE524B1339193600DA9881 /* MCLog.m in Sources */, 4BEE524E1339193600DA9881 /* CPFileReferenceCell.m in Sources */, - 4BEE524F1339193600DA9881 /* RegexKitLite.m in Sources */, 4BEE52501339193600DA9881 /* CPStatusLabel.m in Sources */, 4BEE52511339193600DA9881 /* NSArray+MiscExtensions.m in Sources */, 4BEE52521339193600DA9881 /* NSView+AllSubviews.m in Sources */, @@ -690,6 +689,7 @@ 1DEB913F08733D840010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_GC = supported; GCC_OPTIMIZATION_LEVEL = 0; @@ -704,6 +704,7 @@ 1DEB914008733D840010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_GC = supported; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -717,6 +718,7 @@ 4BE2963F12E60EBB0026BDAC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_GC = unsupported; @@ -728,6 +730,7 @@ 4BE2964012E60EBB0026BDAC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_OBJC_GC = unsupported; @@ -739,7 +742,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_OBJC_ARC = NO; + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEPLOYMENT_LOCATION = YES; @@ -747,7 +750,7 @@ DSTROOT = "$(HOME)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_GC = unsupproted; + GCC_ENABLE_OBJC_GC = unsupported; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -771,14 +774,14 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_OBJC_ARC = NO; + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_LOCATION = YES; DEPLOYMENT_POSTPROCESSING = YES; DSTROOT = "$(HOME)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_ENABLE_OBJC_GC = unsupproted; + GCC_ENABLE_OBJC_GC = unsupported; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Other Sources/CodePilot_Prefix.pch"; diff --git a/MCCommons/MCLog.m b/MCCommons/MCLog.m index 9879424..1df27a9 100644 --- a/MCCommons/MCLog.m +++ b/MCCommons/MCLog.m @@ -12,58 +12,53 @@ @implementation MCLog + (void)prefix:(NSString *)prefixString format:(NSString *)format, ... { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - va_list ap; - NSString *message; - va_start(ap,format); - - message = [[NSString alloc] initWithFormat:format arguments:ap]; - va_end(ap); - - NSLog(@"%@ %@", prefixString, message); - - [message release]; - [pool release]; + @autoreleasepool { + va_list ap; + NSString *message; + va_start(ap,format); + + message = [[NSString alloc] initWithFormat:format arguments:ap]; + va_end(ap); + + NSLog(@"%@ %@", prefixString, message); + + } } + (void)file:(char *)sourceFile function:(char *)functionName lineNumber:(int)lineNumber format:(NSString *)format, ... { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - va_list ap; - NSString *print, *file, *function; - va_start(ap,format); - - file = [[NSString alloc] initWithBytes:sourceFile length:strlen(sourceFile) encoding:NSUTF8StringEncoding]; - - - function = [NSString stringWithCString:functionName encoding:NSASCIIStringEncoding]; - print = [[NSString alloc] initWithFormat:format arguments:ap]; - va_end(ap); - + @autoreleasepool { + va_list ap; + NSString *print, *file, *function; + va_start(ap,format); + + file = [[NSString alloc] initWithBytes:sourceFile length:strlen(sourceFile) encoding:NSUTF8StringEncoding]; + + + function = [NSString stringWithCString:functionName encoding:NSASCIIStringEncoding]; + print = [[NSString alloc] initWithFormat:format arguments:ap]; + va_end(ap); + NSString *fileLocation = [file lastPathComponent]; - - NSLog(@"%@:%d %@; %@", fileLocation, lineNumber, function, print); - - [print release]; - [file release]; - [pool release]; + + NSLog(@"%@:%d %@; %@", fileLocation, lineNumber, function, print); + + } } + (NSString *)messageWithFile:(char *)sourceFile function:(char *)functionName lineNumber:(int)lineNumber format:(NSString *)format, ... { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - va_list ap; - NSString *print, *file, *function; - va_start(ap,format); - file = [[NSString alloc] initWithBytes:sourceFile length:strlen(sourceFile) encoding:NSUTF8StringEncoding]; - - function = [NSString stringWithCString:functionName encoding:NSASCIIStringEncoding]; - print = [[NSString alloc] initWithFormat:format arguments:ap]; - va_end(ap); - NSString * buffer = [NSString stringWithFormat:@"%@:%d %@; %@", [file lastPathComponent], lineNumber, function, print]; - [print release]; - [file release]; - [pool release]; - return buffer; + @autoreleasepool { + va_list ap; + NSString *print, *file, *function; + va_start(ap,format); + file = [[NSString alloc] initWithBytes:sourceFile length:strlen(sourceFile) encoding:NSUTF8StringEncoding]; + + function = [NSString stringWithCString:functionName encoding:NSASCIIStringEncoding]; + print = [[NSString alloc] initWithFormat:format arguments:ap]; + va_end(ap); + NSString * buffer = [NSString stringWithFormat:@"%@:%d %@; %@", [file lastPathComponent], lineNumber, function, print]; + return buffer; + } } NSString * MCToStringFromTypeAndValue(const char * typeCode, void * value) @@ -87,11 +82,9 @@ + (NSString *)messageWithFile:(char *)sourceFile function:(char *)functionName l return NSStringFromRange(*(NSRange *)value); } else if (strcmp(typeCode, @encode(id)) == 0) { - return MCNSStringWithFormat(@"%@", *(id *)value); - + return MCNSStringWithFormat(@"%@", (__bridge id)(value)); } else if (strcmp(typeCode, @encode(BOOL)) == 0) { return (*(BOOL *)value) ? @"YES" : @"NO"; - } else if (strcmp(typeCode, @encode(int)) == 0) { return MCNSStringWithFormat(@"%d", *(int *)value); diff --git a/MCCommons/MCStringScoring.c b/MCCommons/MCStringScoring.c index b877370..2251f32 100644 --- a/MCCommons/MCStringScoring.c +++ b/MCCommons/MCStringScoring.c @@ -187,8 +187,8 @@ float MCStringScoring_scoreStringForQuery(const char *scoredString, const char * queryCharMatchIndexes = malloc(sizeof(int *)*queryLength); for (index = 0; index < queryLength; index++) { - queryCharMatchIndexes[index] = malloc(sizeof(int *)*(valueLength+1)); - memset(queryCharMatchIndexes[index], -1, sizeof(int *)*(valueLength+1)); + queryCharMatchIndexes[index] = (int *)malloc(sizeof(int)*(valueLength+1)); + memset(queryCharMatchIndexes[index], -1, sizeof(int)*(valueLength+1)); } for (valueIndex = 0; valueIndex < valueLength; valueIndex++) { @@ -453,8 +453,8 @@ float MCStringScoring_scoreStringForQueryNEW(const char *scoredString, const cha queryCharMatchIndexes = malloc(sizeof(int *)*queryLength); for (index = 0; index < queryLength; index++) { - queryCharMatchIndexes[index] = malloc(sizeof(int *)*(valueLength+1)); - memset(queryCharMatchIndexes[index], -1, sizeof(int *)*(valueLength+1)); + queryCharMatchIndexes[index] = (int *)malloc(sizeof(int)*(valueLength+1)); + memset(queryCharMatchIndexes[index], -1, sizeof(int)*(valueLength+1)); } for (valueIndex = 0; valueIndex < valueLength; valueIndex++) {