Skip to content

Commit 1fbf1d1

Browse files
Silence build warnings
* Correct specifiers in format strings * Capture return value of assignment in conditionals
1 parent 0f24607 commit 1fbf1d1

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Classes/PBGitIndex.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ - (BOOL)applyPatch:(NSString *)hunk stage:(BOOL)stage reverse:(BOOL)reverse
355355

356356
- (NSString *)diffForFile:(PBChangedFile *)file staged:(BOOL)staged contextLines:(NSUInteger)context
357357
{
358-
NSString *parameter = [NSString stringWithFormat:@"-U%u", context];
358+
NSString *parameter = [NSString stringWithFormat:@"-U%ld", context];
359359
if (staged) {
360360
NSString *indexPath = [@":0:" stringByAppendingString:file.path];
361361

Classes/PBGitRepository.m

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

221221
NSMutableArray* curRefs;
222-
if (curRefs = [refs objectForKey:sha])
222+
if ((curRefs = [refs objectForKey:sha]))
223223
[curRefs addObject:ref];
224224
else
225225
[refs setObject:[NSMutableArray arrayWithObject:ref] forKey:sha];

Classes/PBGitRevList.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ - (void) walkRevisionListWithSpecifier: (PBGitRevSpecifier*) rev
156156
if (parentString.size() != 0)
157157
{
158158
if (((parentString.size() + 1) % 41) != 0) {
159-
NSLog(@"invalid parents: %i", parentString.size());
159+
NSLog(@"invalid parents: %ld", parentString.size());
160160
continue;
161161
}
162162
int nParents = (parentString.size() + 1) / 41;

Classes/PBGitTree.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ - (NSString *)textContents
148148
return [NSString stringWithFormat:@"This is a tree with path %@", [self fullPath]];
149149

150150
if ([self hasBinaryAttributes])
151-
return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]];
151+
return [NSString stringWithFormat:@"%@ appears to be a binary file of %lld bytes", [self fullPath], [self fileSize]];
152152

153153
if ([self fileSize] > 52428800) // ~50MB
154-
return [NSString stringWithFormat:@"%@ is too big to be displayed (%d bytes)", [self fullPath], [self fileSize]];
154+
return [NSString stringWithFormat:@"%@ is too big to be displayed (%lld bytes)", [self fullPath], [self fileSize]];
155155

156156
NSString* contents = [self contents];
157157

158158
if ([self hasBinaryHeader:contents])
159-
return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]];
159+
return [NSString stringWithFormat:@"%@ appears to be a binary file of %lld bytes", [self fullPath], [self fileSize]];
160160

161161
return contents;
162162
}

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()))
3737
return proxy;
3838

3939
usleep(15000);

0 commit comments

Comments
 (0)