Skip to content

Commit

Permalink
Fixed compiler warnings after upgrading to Xcode 4.3. Closes #186.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaz committed Feb 25, 2012
1 parent c49e3ad commit a136f4d
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion AppledocTests-Info.plist
Expand Up @@ -17,6 +17,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>765</string>
<string>771</string>
</dict>
</plist>
6 changes: 3 additions & 3 deletions Application/GBAppledocApplication.m
Expand Up @@ -573,11 +573,11 @@ - (void)injectSettingsFromSettingsFile:(NSString *)path usingBlock:(BOOL (^)(NSS
NSError* error = nil;
NSData* data = [NSData dataWithContentsOfFile:path options:0 error:&error];
if (!data) [NSException raise:@"Failed reading settings from '%@'!", path];
NSDictionary *settings = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:NULL error:&error];
if (!settings) [NSException raiseWithError:error format:@"Failed reaing settings plist from '%@'!", path];
NSDictionary *theSettings = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:NULL error:&error];
if (!theSettings) [NSException raiseWithError:error format:@"Failed reaing settings plist from '%@'!", path];

// We first pass each option and it's value to the block. The block can return YES to allow handling it, NO otherwise. It can also pass back a different value (we're passing a pointer to the value!).
[settings enumerateKeysAndObjectsUsingBlock:^(NSString *option, id value, BOOL *stop) {
[theSettings enumerateKeysAndObjectsUsingBlock:^(NSString *option, id value, BOOL *stop) {
while ([option hasPrefix:@"-"]) option = [option substringFromIndex:1];
NSString *key = [DDGetoptLongParser keyFromOption:option];
if (!block(option, &value, stop)) return;
Expand Down
2 changes: 1 addition & 1 deletion Application/GBApplicationStringsProvider.m
Expand Up @@ -139,7 +139,7 @@ - (NSDictionary *)appledocData {
result = [[NSMutableDictionary alloc] init];
[result setObject:@"appledoc" forKey:@"tool"];
[result setObject:@"2.0.5" forKey:@"version"];
[result setObject:@"765" forKey:@"build"];
[result setObject:@"771" forKey:@"build"];
[result setObject:@"http://appledoc.gentlebytes.com" forKey:@"homepage"];
}
return result;
Expand Down
12 changes: 6 additions & 6 deletions Generating/GBGenerator.m
Expand Up @@ -46,11 +46,11 @@ - (id)initWithSettingsProvider:(id)settingsProvider {

#pragma mark Generation handling

- (void)generateOutputFromStore:(id)store {
NSParameterAssert(store != nil);
- (void)generateOutputFromStore:(id)aStore {
NSParameterAssert(aStore != nil);
GBLogInfo(@"Generating output from parsed objects...");
[self setupGeneratorStepsWithStore:store];
[self runGeneratorStepsWithStore:store];
[self setupGeneratorStepsWithStore:aStore];
[self runGeneratorStepsWithStore:aStore];
}

- (void)setupGeneratorStepsWithStore:(id)store {
Expand All @@ -66,7 +66,7 @@ - (void)setupGeneratorStepsWithStore:(id)store {
[self.outputGenerators addObject:[GBDocSetPublishGenerator generatorWithSettingsProvider:self.settings]];
}

- (void)runGeneratorStepsWithStore:(id)store {
- (void)runGeneratorStepsWithStore:(id)aStore {
GBLogDebug(@"Running generation steps...");
NSUInteger stepsCount = [self.outputGenerators count];
if (stepsCount == 0) {
Expand All @@ -85,7 +85,7 @@ - (void)runGeneratorStepsWithStore:(id)store {
*stop = YES;
return;
}
if (![generator generateOutputWithStore:store error:&error]) {
if (![generator generateOutputWithStore:aStore error:&error]) {
GBLogNSError(error, @"Generation step %ld/%ld failed: %@ failed generaing output, aborting!", index, stepsCount, [generator className]);
*stop = YES;
return;
Expand Down
24 changes: 12 additions & 12 deletions Generating/GBHTMLTemplateVariablesProvider.m
Expand Up @@ -93,8 +93,8 @@ - (id)initWithSettingsProvider:(id)settingsProvider {

#pragma mark Object variables handling

- (NSDictionary *)variablesForClass:(GBClassData *)object withStore:(id)store {
self.store = store;
- (NSDictionary *)variablesForClass:(GBClassData *)object withStore:(id)aStore {
self.store = aStore;
NSMutableDictionary *page = [NSMutableDictionary dictionary];
[page setObject:[self pageTitleForClass:object] forKey:@"title"];
[page setObject:[self specificationsForClass:object] forKey:@"specifications"];
Expand All @@ -108,8 +108,8 @@ - (NSDictionary *)variablesForClass:(GBClassData *)object withStore:(id)store {
return result;
}

- (NSDictionary *)variablesForCategory:(GBCategoryData *)object withStore:(id)store {
self.store = store;
- (NSDictionary *)variablesForCategory:(GBCategoryData *)object withStore:(id)aStore {
self.store = aStore;
NSMutableDictionary *page = [NSMutableDictionary dictionary];
[page setObject:[self pageTitleForCategory:object] forKey:@"title"];
[page setObject:[self specificationsForCategory:object] forKey:@"specifications"];
Expand All @@ -124,8 +124,8 @@ - (NSDictionary *)variablesForCategory:(GBCategoryData *)object withStore:(id)st
return result;
}

- (NSDictionary *)variablesForProtocol:(GBProtocolData *)object withStore:(id)store {
self.store = store;
- (NSDictionary *)variablesForProtocol:(GBProtocolData *)object withStore:(id)aStore {
self.store = aStore;
NSMutableDictionary *page = [NSMutableDictionary dictionary];
[page setObject:[self pageTitleForProtocol:object] forKey:@"title"];
[page setObject:[self specificationsForProtocol:object] forKey:@"specifications"];
Expand All @@ -139,8 +139,8 @@ - (NSDictionary *)variablesForProtocol:(GBProtocolData *)object withStore:(id)st
return result;
}

- (NSDictionary *)variablesForDocument:(GBDocumentData *)object withStore:(id)store {
self.store = store;
- (NSDictionary *)variablesForDocument:(GBDocumentData *)object withStore:(id)aStore {
self.store = aStore;
NSString *path = [self.settings htmlRelativePathToIndexFromObject:object];
NSMutableDictionary *page = [NSMutableDictionary dictionary];
[page setObject:[self pageTitleForDocument:object] forKey:@"title"];
Expand All @@ -159,8 +159,8 @@ - (NSDictionary *)variablesForDocument:(GBDocumentData *)object withStore:(id)st

#pragma mark Index variables handling

- (NSDictionary *)variablesForIndexWithStore:(id)store {
self.store = store;
- (NSDictionary *)variablesForIndexWithStore:(id)aStore {
self.store = aStore;
NSMutableDictionary *page = [NSMutableDictionary dictionary];
[page setObject:[self pageTitleForIndex] forKey:@"title"];
[self addFooterVarsToDictionary:page];
Expand All @@ -178,8 +178,8 @@ - (NSDictionary *)variablesForIndexWithStore:(id)store {
return result;
}

- (NSDictionary *)variablesForHierarchyWithStore:(id)store {
self.store = store;
- (NSDictionary *)variablesForHierarchyWithStore:(id)aStore {
self.store = aStore;
NSMutableDictionary *page = [NSMutableDictionary dictionary];
[page setObject:[self pageTitleForHierarchy] forKey:@"title"];
[self addFooterVarsToDictionary:page];
Expand Down
4 changes: 2 additions & 2 deletions Generating/GBOutputGenerator.m
Expand Up @@ -39,9 +39,9 @@ - (id)initWithSettingsProvider:(id)settingsProvider {

#pragma mark Generation handling

- (BOOL)generateOutputWithStore:(id)store error:(NSError **)error {
- (BOOL)generateOutputWithStore:(id)aStore error:(NSError **)error {
GBLogVerbose(@"%@ is generating output...", [self className]);
self.store = store;
self.store = aStore;
return YES;
}

Expand Down
8 changes: 4 additions & 4 deletions Model/GBModelBase.m
Expand Up @@ -46,12 +46,12 @@ - (void)mergeDataFromObject:(id)source {
}

// Merge comment.
GBComment *comment = [(GBModelBase *)source comment];
if (self.comment && comment) {
GBLogXWarn(self.prefferedSourceInfo, @"%@: Comment found in %@ and %@!", self, self.comment.sourceInfo, comment.sourceInfo);
GBComment *theComment = [(GBModelBase *)source comment];
if (self.comment && theComment) {
GBLogXWarn(self.prefferedSourceInfo, @"%@: Comment found in %@ and %@!", self, self.comment.sourceInfo, theComment.sourceInfo);

This comment has been minimized.

Copy link
@hlfcoding

hlfcoding Apr 9, 2013

Is there any way to have a command-line option for disabling this warning? I get this everywhere, and I'm not sure what's needed to make sure there's no 'redundant' comments. Thanks in advance!

This comment has been minimized.

Copy link
@tomaz

tomaz via email Apr 9, 2013

Author Owner
return;
}
if (!self.comment && comment) self.comment = comment;
if (!self.comment && theComment) self.comment = theComment;
}

#pragma mark Source information handling
Expand Down
6 changes: 3 additions & 3 deletions Parsing/GBObjectiveCParser.m
Expand Up @@ -87,13 +87,13 @@ - (id)initWithSettingsProvider:(id)settingsProvider {

#pragma mark Parsing handling

- (void)parseObjectsFromString:(NSString *)input sourceFile:(NSString *)filename toStore:(id)store {
- (void)parseObjectsFromString:(NSString *)input sourceFile:(NSString *)filename toStore:(id)aStore {
NSParameterAssert(input != nil);
NSParameterAssert(filename != nil);
NSParameterAssert([filename length] > 0);
NSParameterAssert(store != nil);
NSParameterAssert(aStore != nil);
GBLogDebug(@"Parsing objective-c objects...");
self.store = store;
self.store = aStore;
self.tokenizer = [GBTokenizer tokenizerWithSource:[self tokenizerWithInputString:input] filename:filename settings:self.settings];
self.includeInOutput = YES;
self.propertyAfterPragma = NO;
Expand Down
18 changes: 9 additions & 9 deletions Parsing/GBParser.m
Expand Up @@ -53,11 +53,11 @@ - (id)initWithSettingsProvider:(id)settingsProvider {

#pragma mark File system parsing handling

- (void)parseObjectsFromPaths:(NSArray *)paths toStore:(id)store {
- (void)parseObjectsFromPaths:(NSArray *)paths toStore:(id)aStore {
NSParameterAssert(paths != nil);
NSParameterAssert(store != nil);
NSParameterAssert(aStore != nil);
GBLogVerbose(@"Parsing objects from %lu paths...", [paths count]);
self.store = store;
self.store = aStore;
self.numberOfParsedFiles = 0;
for (NSString *input in paths) {
[self parsePath:input usingBlock:^(NSString *path) {
Expand All @@ -78,11 +78,11 @@ - (void)parseObjectsFromPaths:(NSArray *)paths toStore:(id)store {
GBLogVerbose(@"Parsed %lu source files.", self.numberOfParsedFiles);
}

- (void)parseDocumentsFromPaths:(NSArray *)paths toStore:(id)store {
- (void)parseDocumentsFromPaths:(NSArray *)paths toStore:(id)aStore {
NSParameterAssert(paths != nil);
NSParameterAssert(store != nil);
NSParameterAssert(aStore != nil);
GBLogVerbose(@"Parsing static documents from %u paths...", [paths count]);
self.store = store;
self.store = aStore;
self.numberOfParsedDocuments = 0;
for (NSString *input in paths) {
[self parsePath:input usingBlock:^(NSString *path) {
Expand All @@ -107,11 +107,11 @@ - (void)parseDocumentsFromPaths:(NSArray *)paths toStore:(id)store {
GBLogVerbose(@"Parsed %lu static document files.", self.numberOfParsedDocuments);
}

- (void)parseCustomDocumentFromPath:(NSString *)path outputSubpath:(NSString *)subpath key:(id)key toStore:(id)store {
- (void)parseCustomDocumentFromPath:(NSString *)path outputSubpath:(NSString *)subpath key:(id)key toStore:(id)aStore {
if (!path || [path length] == 0) return;
NSParameterAssert(key != nil);
NSParameterAssert(store != nil);
self.store = store;
NSParameterAssert(aStore != nil);
self.store = aStore;
GBLogInfo(@"Parsing custom document from '%@'...", path);

NSError *error = nil;
Expand Down
10 changes: 5 additions & 5 deletions Parsing/GBTokenizer.m
Expand Up @@ -51,21 +51,21 @@ + (id)tokenizerWithSource:(PKTokenizer *)tokenizer filename:(NSString *)filename
return [[[self alloc] initWithSourceTokenizer:tokenizer filename:filename settings:settings] autorelease];
}

- (id)initWithSourceTokenizer:(PKTokenizer *)tokenizer filename:(NSString *)filename settings:(id)settings {
- (id)initWithSourceTokenizer:(PKTokenizer *)tokenizer filename:(NSString *)aFilename settings:(id)theSettings {
NSParameterAssert(tokenizer != nil);
NSParameterAssert(filename != nil);
NSParameterAssert([filename length] > 0);
NSParameterAssert(aFilename != nil);
NSParameterAssert([aFilename length] > 0);
GBLogDebug(@"Initializing tokenizer...");
self = [super init];
if (self) {
self.settings = settings;
self.settings = theSettings;
self.singleLineCommentRegex = @"(?m-s:\\s*///(.*)$)";
self.multiLineCommentRegex = @"(?s:/\\*[*!](.*)\\*/)";
self.commentDelimiterRegex = @"^[!@#$%^&*()_=+`~,<.>/?;:'\"-]{3,}$";
self.tokenIndex = 0;
self.lastCommentBuilder = [NSMutableString string];
self.previousCommentBuilder = [NSMutableString string];
self.filename = filename;
self.filename = aFilename;
self.input = tokenizer.string;
self.tokens = [self allTokensFromTokenizer:tokenizer];
[self consumeComments];
Expand Down
6 changes: 3 additions & 3 deletions Processing/GBCommentsProcessor.m
Expand Up @@ -125,16 +125,16 @@ - (id)initWithSettingsProvider:(id)settingsProvider {

#pragma mark Processing handling

- (void)processComment:(GBComment *)comment withContext:(id)context store:(id)store {
- (void)processComment:(GBComment *)comment withContext:(id)context store:(id)aStore {
NSParameterAssert(comment != nil);
NSParameterAssert(store != nil);
NSParameterAssert(aStore != nil);
if (comment.originalContext != nil && comment.originalContext != context) return;
if (comment.isProcessed) return;
GBLogDebug(@"Processing %@ found in %@...", comment, comment.sourceInfo.filename);
self.reservedShortDescriptionData = nil;
self.currentComment = comment;
self.currentContext = context;
self.store = store;
self.store = aStore;
NSArray *lines = [comment.stringValue arrayOfLines];
NSUInteger line = comment.sourceInfo.lineNumber;
NSRange blockRange = NSMakeRange(0, 0);
Expand Down
6 changes: 3 additions & 3 deletions Processing/GBProcessor.m
Expand Up @@ -66,11 +66,11 @@ - (id)initWithSettingsProvider:(id)settingsProvider {

#pragma mark Processing handling

- (void)processObjectsFromStore:(id)store {
NSParameterAssert(store != nil);
- (void)processObjectsFromStore:(id)aStore {
NSParameterAssert(aStore != nil);
GBLogVerbose(@"Processing parsed objects...");
self.currentContext = nil;
self.store = store;
self.store = aStore;
[self setupKnownObjectsFromStore];
[self mergeKnownCategoriesFromStore];
[self processClasses];
Expand Down
2 changes: 1 addition & 1 deletion appledoc.xcodeproj/project.pbxproj
Expand Up @@ -1101,7 +1101,7 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
LastUpgradeCheck = 0430;
ORGANIZATIONNAME = "Gentle Bytes";
};
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "appledoc" */;
Expand Down

0 comments on commit a136f4d

Please sign in to comment.