Skip to content

Commit 98f685f

Browse files
authored
Merge pull request gitx#19 from nanotech/f/intconv
Fix incorrect implicit integer-pointer conversions
2 parents d003643 + c594e7d commit 98f685f

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Classes/Controllers/PBRepositoryDocumentController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ - (id)makeUntitledDocumentOfType:(NSString *)typeName error:(NSError *__autorele
4242
return nil;
4343
}
4444

45-
BOOL success = [GTRepository initializeEmptyRepositoryAtFileURL:[op URL] options:nil error:outError];
46-
if (!success)
45+
GTRepository *repo = [GTRepository initializeEmptyRepositoryAtFileURL:[op URL] options:nil error:outError];
46+
if (!repo)
4747
return nil; // Repo creation failed
4848

4949
return [[PBGitRepositoryDocument alloc] initWithContentsOfURL:[op URL] ofType:PBGitRepositoryDocumentType error:outError];

Classes/Util/NSApplication+GitXScripting.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ - (void)initRepositoryScriptCommand:(NSScriptCommand *)command
5757
if (!repositoryURL)
5858
return;
5959

60-
BOOL success = [GTRepository initializeEmptyRepositoryAtFileURL:repositoryURL options:nil error:&error];
61-
if (!success) {
60+
GTRepository *repo = [GTRepository initializeEmptyRepositoryAtFileURL:repositoryURL options:nil error:&error];
61+
if (!repo) {
6262
NSLog(@"Failed to create repository at %@: %@", repositoryURL, error);
6363
return;
6464
}

Classes/git/PBGitRepository.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,7 @@ - (PBGitStash *)stashForRef:(PBGitRef *)ref {
535535
PBGitStash *stash = [[PBGitStash alloc] initWithRepository:self stashOID:oid index:index message:message];
536536
if ([stash.ref isEqualToRef:ref]) {
537537
found = stash;
538-
stop = YES;
539-
(void)stop;
538+
*stop = YES;
540539
}
541540
}];
542541
return found;
@@ -1125,8 +1124,7 @@ - (BOOL)executeHook:(NSString *)name arguments:(NSArray *)arguments output:(NSSt
11251124
NSString *hookPath = [[[[self gitURL] path] stringByAppendingPathComponent:@"hooks"] stringByAppendingPathComponent:name];
11261125
if (![[NSFileManager defaultManager] isExecutableFileAtPath:hookPath]) {
11271126
// XXX: Maybe return error ?
1128-
// We *
1129-
return @"";
1127+
return YES;
11301128
}
11311129

11321130
NSDictionary *info = @{

GitX.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,8 @@
16581658
buildSettings = {
16591659
ALWAYS_SEARCH_USER_PATHS = NO;
16601660
CLANG_ENABLE_OBJC_ARC = YES;
1661+
CLANG_WARN_BOOL_CONVERSION = YES;
1662+
CLANG_WARN_INT_CONVERSION = YES;
16611663
COPY_PHASE_STRIP = NO;
16621664
CURRENT_PROJECT_VERSION = 0.12;
16631665
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -1686,6 +1688,8 @@
16861688
buildSettings = {
16871689
ALWAYS_SEARCH_USER_PATHS = NO;
16881690
CLANG_ENABLE_OBJC_ARC = YES;
1691+
CLANG_WARN_BOOL_CONVERSION = YES;
1692+
CLANG_WARN_INT_CONVERSION = YES;
16891693
CURRENT_PROJECT_VERSION = 0.12;
16901694
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
16911695
GCC_PREPROCESSOR_DEFINITIONS = GITX_NO_DEPRECATE;

0 commit comments

Comments
 (0)