Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #246 from Daij-Djan/master

'Fixed' warnings & analyzer issues (Xcode 4.4.1 / 4.5dp4)
  • Loading branch information...
commit 700b4931519676717e7000957c348e6206a5afb8 2 parents 1690b35 + a630098
@tomaz authored
View
2  Common/GBLog.m
@@ -174,7 +174,7 @@ - (NSString *)formatLogMessage:(DDLogMessage *)m {
case LOG_FLAG_DEBUG: level = @"debug"; break;
default: level = @"unknown"; break;
}
- return [NSString stringWithFormat:@"%@:%u: %@: %@", m->originalFilename, m->originalLine, level, GBLogMessage(m)];
+ return [NSString stringWithFormat:@"%@:%lu: %@: %@", m->originalFilename, m->originalLine, level, GBLogMessage(m)];
}
return GBLogMessage(m);
}
View
2  Common/NSException+GBException.m
@@ -46,7 +46,7 @@ + (NSString *)reasonWithError:(NSError *)error message:(NSString *)message {
NSMutableString *result = [NSMutableString string];
if (message) [result appendFormat:@"%@\n", message];
- [result appendFormat:@"Error: %@, code %i: %@\n", domain, code, description];
+ [result appendFormat:@"Error: %@, code %li: %@\n", domain, code, description];
if (reason) [result appendFormat:@"Reason: %@", reason];
return result;
}
View
8 Common/ThirdParty/CocoaLumberjack/DDFileLogger.m
@@ -103,7 +103,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
[self deleteOldLogFiles];
- [pool release];
+ [pool drain];
};
dispatch_async([DDLog loggingQueue], block);
@@ -569,7 +569,7 @@ - (void)setMaximumFileSize:(unsigned long long)newMaximumFileSize
maximumFileSize = newMaximumFileSize;
[self maybeRollLogFileDueToSize];
- [pool release];
+ [pool drain];
};
if (dispatch_get_current_queue() == loggerQueue)
@@ -675,7 +675,7 @@ - (void)setRollingFrequency:(NSTimeInterval)newRollingFrequency
rollingFrequency = newRollingFrequency;
[self maybeRollLogFileDueToAge:nil];
- [pool release];
+ [pool drain];
};
if (dispatch_get_current_queue() == loggerQueue)
@@ -795,7 +795,7 @@ - (void)rollLogFile
dispatch_block_t block = ^{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[self rollLogFileNow];
- [pool release];
+ [pool drain];
};
dispatch_async([DDLog loggingQueue], block);
View
14 Common/ThirdParty/CocoaLumberjack/DDLog.m
@@ -233,7 +233,7 @@ + (void)addLogger:(id <DDLogger>)logger
[self lt_addLogger:logger];
- [pool release];
+ [pool drain];
};
dispatch_async(loggingQueue, addLoggerBlock);
@@ -263,7 +263,7 @@ + (void)removeLogger:(id <DDLogger>)logger
[self lt_removeLogger:logger];
- [pool release];
+ [pool drain];
};
dispatch_async(loggingQueue, removeLoggerBlock);
@@ -291,7 +291,7 @@ + (void)removeAllLoggers
[self lt_removeAllLoggers];
- [pool release];
+ [pool drain];
};
dispatch_async(loggingQueue, removeAllLoggersBlock);
@@ -448,7 +448,7 @@ + (void)queueLogMessage:(DDLogMessage *)logMessage synchronously:(BOOL)flag
[self lt_log:logMessage];
- [pool release];
+ [pool drain];
};
if (flag)
@@ -522,7 +522,7 @@ + (void)flushLog
[self lt_flush];
- [pool release];
+ [pool drain];
};
dispatch_sync(loggingQueue, flushBlock);
@@ -895,7 +895,7 @@ + (void)lt_log:(DDLogMessage *)logMessage
[currentNode->logger logMessage:logMessage];
- [pool release];
+ [pool drain];
};
dispatch_group_async(loggingGroup, currentNode->loggerQueue, loggerBlock);
@@ -918,7 +918,7 @@ + (void)lt_log:(DDLogMessage *)logMessage
[currentNode->logger logMessage:logMessage];
- [pool release];
+ [pool drain];
};
dispatch_sync(currentNode->loggerQueue, loggerBlock);
View
2  Common/ThirdParty/GRMustache/GRMustacheCompiler.m
@@ -158,7 +158,7 @@ - (void)tokenProducerDidFinish:(id<GRMustacheTokenProducer>)tokenProducer withEr
- (NSError *)parseErrorAtLine:(NSInteger)line description:(NSString *)description {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity:3];
- [userInfo setObject:[NSString stringWithFormat:@"Parse error at line %d: %@", line, description]
+ [userInfo setObject:[NSString stringWithFormat:@"Parse error at line %ld: %@", line, description]
forKey:NSLocalizedDescriptionKey];
[userInfo setObject:[NSNumber numberWithInteger:line]
forKey:GRMustacheErrorLine];
View
4 Common/ThirdParty/GRMustache/GRMustacheContext.m
@@ -66,10 +66,10 @@ + (BOOL)class:(Class)class hasBOOLPropertyNamed:(NSString *)propertyName {
classes = [[NSMutableDictionary dictionaryWithCapacity:12] retain];
}
- NSMutableDictionary *propertyNames = [classes objectForKey:class];
+ NSMutableDictionary *propertyNames = [classes objectForKey:NSStringFromClass(class)];
if (propertyNames == nil) {
propertyNames = [[NSMutableDictionary dictionaryWithCapacity:4] retain];
- [classes setObject:propertyNames forKey:class];
+ [classes setObject:propertyNames forKey:NSStringFromClass(class)];
}
NSNumber *boolNumber = [propertyNames objectForKey:propertyName];
View
4 Common/ThirdParty/GRMustache/GRMustacheTemplate.m
@@ -142,7 +142,9 @@ + (id)templateWithString:(NSString *)templateString templateId:(id)templateId te
- (id)initWithString:(NSString *)theTemplateString templateId:(id)theTemplateId templateLoader:(GRMustacheTemplateLoader *)theTemplateLoader {
NSAssert(theTemplateLoader, @"Can't init GRMustacheTemplate with nil template loader");
NSAssert(theTemplateString, @"Can't init GRMustacheTemplate with nil template string");
- if (self == [self init]) {
+
+ self = [super init];
+ if (self) {
self.templateId = theTemplateId;
self.templateLoader = theTemplateLoader;
self.templateString = theTemplateString;
View
2  Common/ThirdParty/GRMustache/GRMustacheTokenizer.m
@@ -298,7 +298,7 @@ - (void)didFinish {
- (void)didFinishWithParseErrorAtLine:(NSInteger)line description:(NSString *)description {
if (tokenConsumer) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity:3];
- [userInfo setObject:[NSString stringWithFormat:@"Parse error at line %d: %@", line, description]
+ [userInfo setObject:[NSString stringWithFormat:@"Parse error at line %ld: %@", line, description]
forKey:NSLocalizedDescriptionKey];
[userInfo setObject:[NSNumber numberWithInteger:line]
forKey:GRMustacheErrorLine];
View
2  Common/ThirdParty/RegexKitLite/RegexKitLite.m
@@ -1199,7 +1199,7 @@ static void rkl_handleDelayedAssert(id self, SEL _cmd, id exception) {
else {
id functionString = [exception objectForKey:@"function"], fileString = [exception objectForKey:@"file"], descriptionString = [exception objectForKey:@"description"], lineNumber = [exception objectForKey:@"line"];
RKLCHardAbortAssert((functionString != NULL) && (fileString != NULL) && (descriptionString != NULL) && (lineNumber != NULL));
- [[NSAssertionHandler currentHandler] handleFailureInFunction:functionString file:fileString lineNumber:(NSInteger)[lineNumber longValue] description:descriptionString];
+ [[NSAssertionHandler currentHandler] handleFailureInFunction:functionString file:fileString lineNumber:(NSInteger)[lineNumber longValue] description:@"%@",descriptionString];
}
}
}
View
2  Model/GBStore.m
@@ -33,7 +33,7 @@ - (id)init {
#pragma mark Overriden methods
- (NSString *)debugDescription {
- return [NSString stringWithFormat:@"%@{ %u classes, %u categories, %u protocols }", [self className], [self.classes count], [self.categories count], [self.protocols count]];
+ return [NSString stringWithFormat:@"%@{ %lu classes, %lu categories, %lu protocols }", [self className], [self.classes count], [self.categories count], [self.protocols count]];
}
#pragma mark Helper methods
View
21 Processing/GBCommentsProcessor.m
@@ -676,7 +676,7 @@ - (NSString *)stringByConvertingSimpleCrossReferencesInString:(NSString *)string
}
// If there is some text skipped after previous link (or search range), append it to output first.
- if (linkData->range.location > lastUsedLocation) {
+ if (linkData && linkData->range.location > lastUsedLocation) {
NSRange skippedRange = NSMakeRange(lastUsedLocation, linkData->range.location - lastUsedLocation);
NSString *skippedText = [string substringWithRange:skippedRange];
//NSLog(@"adding skipped text to result : %@", skippedText);
@@ -684,11 +684,13 @@ - (NSString *)stringByConvertingSimpleCrossReferencesInString:(NSString *)string
}
// Convert the raw link to Markdown syntax and append to output.
- NSString *markdownLink = isInsideMarkdown ? linkData->address : linkData->markdown;
- [result appendString:markdownLink];
-
+ if(linkData) {
+ NSString *markdownLink = isInsideMarkdown ? linkData->address : linkData->markdown;
+ [result appendString:markdownLink];
+ }
+
// Update range and remove the link from the temporary array.
- NSUInteger location = linkData->range.location + linkData->range.length;
+ NSUInteger location = linkData ? linkData->range.location + linkData->range.length : 0;
searchRange.location = location;
searchRange.length = searchEndLocation - location;
lastUsedLocation = location;
@@ -710,12 +712,15 @@ - (NSString *)stringByConvertingSimpleCrossReferencesInString:(NSString *)string
- (BOOL)isCrossReference:(GBCrossRefData *)data matchingObject:(id)object {
if ([object isTopLevelObject]) {
- if ([object isKindOfClass:[GBClassData class]])
+ if ([object isKindOfClass:[GBClassData class]]) {
if ([data->description isEqualToString:[object nameOfClass]]) return YES;
- else if ([object isKindOfClass:[GBCategoryData class]])
+ }
+ else if ([object isKindOfClass:[GBCategoryData class]]) {
if ([data->description isEqualToString:[object idOfCategory]]) return YES;
- else if ([object isKindOfClass:[GBProtocolData class]])
+ }
+ else if ([object isKindOfClass:[GBProtocolData class]]) {
if ([data->description isEqualToString:[object nameOfProtocol]]) return YES;
+ }
} else {
if (![object isKindOfClass:[GBDocumentData class]] && [data->description isEqualToString:[object methodSelector]]) return YES;
}
View
7 Testing/GBCommentTesting.m
@@ -38,10 +38,10 @@ - (void)testHtmlString_shouldUseAssignedSettings {
component.settings = settings;
[[settings expect] stringByConvertingMarkdownToHTML:component.markdownValue];
// execute
- NSString *html = component.htmlValue;
+ (void)component.htmlValue;
// verify
[settings verify];
- html = nil; // just to suppress compiler warning of unused var...
+
}
- (void)testTextString_shouldUseAssignedSettings {
@@ -52,10 +52,9 @@ - (void)testTextString_shouldUseAssignedSettings {
component.settings = settings;
[[settings expect] stringByConvertingMarkdownToText:component.markdownValue];
// execute
- NSString *html = component.textValue;
+ (void)component.textValue;
// verify
[settings verify];
- html = nil; // just to suppress compiler warning of unused var...
}
@end
View
2  Testing/GBObjectsAssertor.m
@@ -209,7 +209,7 @@ - (void)assertMethodArguments:(NSArray *)arguments matches:(NSString *)name, ...
[expectedComps removeObjectAtIndex:0];
char *argList = NULL;
if ([expectedComps count] > 0) {
- argList = (char *)malloc(sizeof(NSString *) * [expectedComps count]);
+ argList = (char *)malloc(sizeof(char) * [expectedComps count]);
[expectedComps getObjects:(id *)argList];
}
[self assertCommentComponents:argument.argumentDescription matchesValues:firstExpectedComp values:(__va_list_tag *)argList];
View
5 Testing/GBTemplateHandlerTesting.m
@@ -16,7 +16,12 @@ @interface GBTemplateHandler (TestingAPI)
@end
@implementation GBTemplateHandler (TestingAPI)
+//method below is intenionally overwritten so we want to silent the warning
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
- (NSString *)templateString { return [self valueForKey:@"_templateString"]; }
+#pragma clang diagnostic pop
+
- (NSDictionary *)templateSections { return [self valueForKey:@"_templateSections"]; }
- (GRMustacheTemplate *)template { return [self valueForKey:@"_template"]; }
@end
View
4 appledoc.xcodeproj/project.pbxproj
@@ -1120,7 +1120,7 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0430;
+ LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Gentle Bytes";
};
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "appledoc" */;
@@ -1453,6 +1453,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -1493,6 +1494,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
View
BIN  icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.