Skip to content

Commit 28f4c49

Browse files
Jan Weißbrotherbard
Jan Weiß
authored andcommitted
Fixing compiler warnings.
1 parent 0765121 commit 28f4c49

9 files changed

+15
-13
lines changed

PBEasyPipe.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ + (NSString*) outputForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir
120120
data = [handle readDataToEndOfFile];
121121
}
122122
@catch (NSException * e) {
123-
NSLog(@"Got a bad file descriptor in %s!", _cmd);
123+
NSLog(@"Got a bad file descriptor in %@!", NSStringFromSelector(_cmd));
124124
if ([NSThread currentThread] != [NSThread mainThread])
125125
[task waitUntilExit];
126126

PBGitHistoryController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ - (NSInteger)numberOfPreviewItemsInPreviewPanel:(id)panel
676676
PBGitTree *treeItem = (PBGitTree *)[[treeController selectedObjects] objectAtIndex:index];
677677
NSURL *previewURL = [NSURL fileURLWithPath:[treeItem tmpFileNameForContents]];
678678

679-
return (<QLPreviewItem>)previewURL;
679+
return (id <QLPreviewItem>)previewURL;
680680
}
681681

682682
#pragma mark <QLPreviewPanelDelegate>

PBGitRepository.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ - (void) addRef: (PBGitRef *) ref fromParameters: (NSArray *) components
232232
sha = [PBGitSHA shaWithString:[components objectAtIndex:2]];
233233

234234
NSMutableArray* curRefs;
235-
if (curRefs = [refs objectForKey:sha])
235+
if ( (curRefs = [refs objectForKey:sha]) != nil )
236236
[curRefs addObject:ref];
237237
else
238238
[refs setObject:[NSMutableArray arrayWithObject:ref] forKey:sha];

PBGitRevList.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
165165
if (parentString.size() != 0)
166166
{
167167
if (((parentString.size() + 1) % 41) != 0) {
168-
NSLog(@"invalid parents: %i", parentString.size());
168+
NSLog(@"invalid parents: %zu", parentString.size());
169169
continue;
170170
}
171171
int nParents = (parentString.size() + 1) / 41;
@@ -225,7 +225,7 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
225225
[self performSelectorOnMainThread:@selector(finishedParsing) withObject:nil waitUntilDone:NO];
226226
}
227227
else {
228-
NSLog(@"[%@ %s] thread has been canceled", [self class], _cmd);
228+
NSLog(@"[%@ %s] thread has been canceled", [self class], NSStringFromSelector(_cmd));
229229
}
230230

231231
[task terminate];

PBGitSidebarController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ - (void) selectCurrentBranch
125125

126126
PBSourceViewItem *item = nil;
127127
for (PBSourceViewItem *it in items)
128-
if (item = [it findRev:rev])
128+
if ( (item = [it findRev:rev]) != nil )
129129
break;
130130

131131
if (!item) {
132132
[self addRevSpec:rev];
133133
// Try to find the just added item again.
134134
// TODO: refactor with above.
135135
for (PBSourceViewItem *it in items)
136-
if (item = [it findRev:rev])
136+
if ( (item = [it findRev:rev]) != nil )
137137
break;
138138
}
139139

@@ -147,7 +147,7 @@ - (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev
147147
{
148148
PBSourceViewItem *foundItem = nil;
149149
for (PBSourceViewItem *item in items)
150-
if (foundItem = [item findRev:rev])
150+
if ( (foundItem = [item findRev:rev]) != nil )
151151
return foundItem;
152152
return nil;
153153
}

PBGitTree.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ - (BOOL) isLocallyCached
6565

6666
- (BOOL)hasBinaryHeader:(NSString*)contents
6767
{
68-
if(!contents)
68+
if (!contents)
6969
return NO;
7070

71-
return [contents rangeOfString:@"\0" options:0 range:NSMakeRange(0, ([contents length] >= 8000) ? 7999 : [contents length])].location != NSNotFound;
71+
return [contents rangeOfString:@"\0"
72+
options:0
73+
range:NSMakeRange(0, ([contents length] >= 8000) ? 7999 : [contents length])].location != NSNotFound;
7274
}
7375

7476
- (BOOL)hasBinaryAttributes

PBRemoteProgressSheet.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ - (void) taskCompleted:(NSNotification *)notification
130130
- (void) checkTask:(NSTimer *)timer
131131
{
132132
if (![gitTask isRunning]) {
133-
NSLog(@"[%@ %s] gitTask terminated without notification", [self class], _cmd);
133+
NSLog(@"[%@ %@] gitTask terminated without notification", [self class], NSStringFromSelector(_cmd));
134134
[self taskCompleted:nil];
135135
}
136136
}

PBSourceViewItem.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ - (PBSourceViewItem *)findRev:(PBGitRevSpecifier *)rev
103103

104104
PBSourceViewItem *item = nil;
105105
for (PBSourceViewItem *child in children)
106-
if (item = [child findRev:rev])
106+
if ( (item = [child findRev:rev]) != nil )
107107
return item;
108108

109109
return nil;

gitx.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// Now attempt to connect, allowing the app time to startup
3434
int attempt;
3535
for (attempt = 0; proxy == nil && attempt < 50; ++attempt) {
36-
if (proxy = connect())
36+
if ( (proxy = connect()) != nil )
3737
return proxy;
3838

3939
usleep(15000);

0 commit comments

Comments
 (0)