Skip to content

Commit b257f00

Browse files
committed
Fix compiler warnings
1 parent 2676a20 commit b257f00

12 files changed

+155
-82
lines changed

English.lproj/MainMenu.xib

+61-11
Original file line numberDiff line numberDiff line change
@@ -1119,14 +1119,6 @@
11191119
</object>
11201120
<int key="connectionID">920</int>
11211121
</object>
1122-
<object class="IBConnectionRecord">
1123-
<object class="IBOutletConnection" key="connection">
1124-
<string key="label">viewMenu</string>
1125-
<reference key="source" ref="859235683"/>
1126-
<reference key="destination" ref="245837913"/>
1127-
</object>
1128-
<int key="connectionID">922</int>
1129-
</object>
11301122
<object class="IBConnectionRecord">
11311123
<object class="IBActionConnection" key="connection">
11321124
<string key="label">setDetailedView:</string>
@@ -2245,9 +2237,49 @@
22452237
<string key="minorKey"/>
22462238
</object>
22472239
</object>
2240+
<object class="IBPartialClassDescription">
2241+
<string key="className">PBGitCommitController</string>
2242+
<string key="superclassName">PBViewController</string>
2243+
<object class="NSMutableDictionary" key="actions">
2244+
<bool key="EncodedWithXMLCoder">YES</bool>
2245+
<object class="NSMutableArray" key="dict.sortedKeys">
2246+
<bool key="EncodedWithXMLCoder">YES</bool>
2247+
<string>commit:</string>
2248+
<string>refresh:</string>
2249+
</object>
2250+
<object class="NSMutableArray" key="dict.values">
2251+
<bool key="EncodedWithXMLCoder">YES</bool>
2252+
<string>id</string>
2253+
<string>id</string>
2254+
</object>
2255+
</object>
2256+
<object class="NSMutableDictionary" key="outlets">
2257+
<bool key="EncodedWithXMLCoder">YES</bool>
2258+
<object class="NSMutableArray" key="dict.sortedKeys">
2259+
<bool key="EncodedWithXMLCoder">YES</bool>
2260+
<string>cachedButtonCell</string>
2261+
<string>cachedFilesController</string>
2262+
<string>commitMessageView</string>
2263+
<string>unstagedButtonCell</string>
2264+
<string>unstagedFilesController</string>
2265+
</object>
2266+
<object class="NSMutableArray" key="dict.values">
2267+
<bool key="EncodedWithXMLCoder">YES</bool>
2268+
<string>PBIconAndTextCell</string>
2269+
<string>NSArrayController</string>
2270+
<string>NSTextView</string>
2271+
<string>PBIconAndTextCell</string>
2272+
<string>NSArrayController</string>
2273+
</object>
2274+
</object>
2275+
<object class="IBClassDescriptionSource" key="sourceIdentifier">
2276+
<string key="majorKey">IBProjectSource</string>
2277+
<string key="minorKey">PBGitCommitController.h</string>
2278+
</object>
2279+
</object>
22482280
<object class="IBPartialClassDescription">
22492281
<string key="className">PBGitHistoryController</string>
2250-
<string key="superclassName">NSViewController</string>
2282+
<string key="superclassName">PBViewController</string>
22512283
<object class="NSMutableDictionary" key="actions">
22522284
<bool key="EncodedWithXMLCoder">YES</bool>
22532285
<object class="NSMutableArray" key="dict.sortedKeys">
@@ -2276,15 +2308,13 @@
22762308
<string>commitController</string>
22772309
<string>commitList</string>
22782310
<string>fileBrowser</string>
2279-
<string>searchField</string>
22802311
<string>treeController</string>
22812312
</object>
22822313
<object class="NSMutableArray" key="dict.values">
22832314
<bool key="EncodedWithXMLCoder">YES</bool>
22842315
<string>NSArrayController</string>
22852316
<string>NSTableView</string>
22862317
<string>NSOutlineView</string>
2287-
<string>NSSearchField</string>
22882318
<string>NSTreeController</string>
22892319
</object>
22902320
</object>
@@ -2300,12 +2330,16 @@
23002330
<bool key="EncodedWithXMLCoder">YES</bool>
23012331
<object class="NSMutableArray" key="dict.sortedKeys">
23022332
<bool key="EncodedWithXMLCoder">YES</bool>
2333+
<string>branchesController</string>
23032334
<string>contentView</string>
2335+
<string>searchController</string>
23042336
<string>searchField</string>
23052337
</object>
23062338
<object class="NSMutableArray" key="dict.values">
23072339
<bool key="EncodedWithXMLCoder">YES</bool>
2340+
<string>NSArrayController</string>
23082341
<string>NSView</string>
2342+
<string>NSArrayController</string>
23092343
<string>NSSearchField</string>
23102344
</object>
23112345
</object>
@@ -2360,6 +2394,14 @@
23602394
<string key="minorKey"/>
23612395
</object>
23622396
</object>
2397+
<object class="IBPartialClassDescription">
2398+
<string key="className">PBIconAndTextCell</string>
2399+
<string key="superclassName">NSTextFieldCell</string>
2400+
<object class="IBClassDescriptionSource" key="sourceIdentifier">
2401+
<string key="majorKey">IBProjectSource</string>
2402+
<string key="minorKey">PBIconAndTextCell.h</string>
2403+
</object>
2404+
</object>
23632405
<object class="IBPartialClassDescription">
23642406
<string key="className">PBRepositoryDocumentController</string>
23652407
<string key="superclassName">NSDocumentController</string>
@@ -2376,6 +2418,14 @@
23762418
<string key="minorKey"/>
23772419
</object>
23782420
</object>
2421+
<object class="IBPartialClassDescription">
2422+
<string key="className">PBViewController</string>
2423+
<string key="superclassName">NSViewController</string>
2424+
<object class="IBClassDescriptionSource" key="sourceIdentifier">
2425+
<string key="majorKey">IBProjectSource</string>
2426+
<string key="minorKey">PBViewController.h</string>
2427+
</object>
2428+
</object>
23792429
</object>
23802430
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
23812431
<bool key="EncodedWithXMLCoder">YES</bool>

GitX.xcodeproj/project.pbxproj

+8-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; };
2323
F50FE0E30E07BE9600854FCD /* PBGitRevisionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */; };
2424
F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; };
25+
F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; };
2526
F52BCE030E84208300AA3741 /* PBGitHistoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */; };
2627
F52BCE070E84211300AA3741 /* PBGitHistoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = F52BCE060E84211300AA3741 /* PBGitHistoryController.m */; };
2728
F53FF2050E7ABB5300389171 /* PBGitRevSpecifier.m in Sources */ = {isa = PBXBuildFile; fileRef = F53FF2040E7ABB5300389171 /* PBGitRevSpecifier.m */; };
@@ -56,8 +57,7 @@
5657
F5E927F80E883E7200056E75 /* PBChangedFile.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E927F70E883E7200056E75 /* PBChangedFile.m */; };
5758
F5E927FC0E883F0700056E75 /* PBWebChangesController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E927FB0E883F0700056E75 /* PBWebChangesController.m */; };
5859
F5E9281D0E8840CF00056E75 /* diff.html in Resources */ = {isa = PBXBuildFile; fileRef = F5E9281C0E8840CF00056E75 /* diff.html */; };
59-
F5E928210E88414000056E75 /* diff.js in Sources */ = {isa = PBXBuildFile; fileRef = F5E928200E88414000056E75 /* diff.js */; };
60-
F5E928550E8841FB00056E75 /* diff.js in Sources */ = {isa = PBXBuildFile; fileRef = F5E928540E8841FB00056E75 /* diff.js */; };
60+
F5E928550E8841FB00056E75 /* diff.js in Resources */ = {isa = PBXBuildFile; fileRef = F5E928540E8841FB00056E75 /* diff.js */; };
6161
F5E92A1B0E88550E00056E75 /* empty_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F5E92A1A0E88550E00056E75 /* empty_file.png */; };
6262
F5E92A230E88569500056E75 /* new_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F5E92A220E88569500056E75 /* new_file.png */; };
6363
F5FF4E180E0829C20006317A /* PBGitRevList.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FF4E170E0829C20006317A /* PBGitRevList.m */; };
@@ -115,6 +115,8 @@
115115
F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRevisionCell.m; sourceTree = "<group>"; };
116116
F51308590E0740F2000C8BCD /* PBQLOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLOutlineView.h; sourceTree = "<group>"; };
117117
F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBQLOutlineView.m; sourceTree = "<group>"; };
118+
F5140DC70E8A8EB20091E9F3 /* RoundedRectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRectangle.h; sourceTree = "<group>"; };
119+
F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoundedRectangle.m; sourceTree = "<group>"; };
118120
F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitHistoryView.xib; sourceTree = "<group>"; };
119121
F52BCE050E84211300AA3741 /* PBGitHistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitHistoryController.h; sourceTree = "<group>"; };
120122
F52BCE060E84211300AA3741 /* PBGitHistoryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitHistoryController.m; sourceTree = "<group>"; };
@@ -168,7 +170,6 @@
168170
F5E927FA0E883F0700056E75 /* PBWebChangesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBWebChangesController.h; sourceTree = "<group>"; };
169171
F5E927FB0E883F0700056E75 /* PBWebChangesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBWebChangesController.m; sourceTree = "<group>"; };
170172
F5E9281C0E8840CF00056E75 /* diff.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = diff.html; path = html/diff.html; sourceTree = "<group>"; };
171-
F5E928200E88414000056E75 /* diff.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = diff.js; sourceTree = "<group>"; };
172173
F5E928540E8841FB00056E75 /* diff.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = diff.js; path = html/diff.js; sourceTree = "<group>"; };
173174
F5E92A1A0E88550E00056E75 /* empty_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = empty_file.png; path = Images/empty_file.png; sourceTree = "<group>"; };
174175
F5E92A220E88569500056E75 /* new_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = new_file.png; path = Images/new_file.png; sourceTree = "<group>"; };
@@ -355,6 +356,8 @@
355356
F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */,
356357
91B103CA0E898EC300C84364 /* PBIconAndTextCell.h */,
357358
91B103CB0E898EC300C84364 /* PBIconAndTextCell.mm */,
359+
F5140DC70E8A8EB20091E9F3 /* RoundedRectangle.h */,
360+
F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */,
358361
);
359362
name = Aux;
360363
sourceTree = "<group>";
@@ -371,7 +374,6 @@
371374
F57ABDDE0E0441DE00A088B8 /* commit.js */,
372375
F57ABE180E04431D00A088B8 /* prototype.js */,
373376
F56173270E056ED2001DCD79 /* diffHighlighter.js */,
374-
F5E928200E88414000056E75 /* diff.js */,
375377
);
376378
name = HTML;
377379
sourceTree = "<group>";
@@ -493,6 +495,7 @@
493495
isa = PBXResourcesBuildPhase;
494496
buildActionMask = 2147483647;
495497
files = (
498+
F5E928550E8841FB00056E75 /* diff.js in Resources */,
496499
F561E6CD0E7AFDDF00521636 /* keyboardNavigation.js in Resources */,
497500
F5E92A1B0E88550E00056E75 /* empty_file.png in Resources */,
498501
913D5E500E55645900CECEA2 /* gitx in Resources */,
@@ -549,9 +552,8 @@
549552
F5E926060E8827D300056E75 /* PBViewController.m in Sources */,
550553
F5E927F80E883E7200056E75 /* PBChangedFile.m in Sources */,
551554
F5E927FC0E883F0700056E75 /* PBWebChangesController.m in Sources */,
552-
F5E928210E88414000056E75 /* diff.js in Sources */,
553-
F5E928550E8841FB00056E75 /* diff.js in Sources */,
554555
91B103CC0E898EC300C84364 /* PBIconAndTextCell.mm in Sources */,
556+
F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */,
555557
);
556558
runOnlyForDeploymentPostprocessing = 0;
557559
};

PBCLIProxy.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ - (BOOL)openRepository:(NSURL*)repositoryPath arguments: (NSArray*) args error:(
3535
NSURL* url = [NSURL fileURLWithPath:[repositoryPath path]];
3636
NSArray* arguments = [NSArray arrayWithArray:args];
3737
PBGitRevSpecifier* rev = [[PBGitRevSpecifier alloc] initWithParameters:arguments];
38-
if (id document = [[PBRepositoryDocumentController sharedDocumentController] openRepositoryAtLocation: url RevSpecifier: rev]) {
38+
if ([[PBRepositoryDocumentController sharedDocumentController] openRepositoryAtLocation: url RevSpecifier: rev]) {
3939
[NSApp activateIgnoringOtherApps:YES];
4040
return YES;
4141
}

PBGitCommitController.m

+2-7
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ - (IBAction) commit:(id) sender
123123

124124
- (void) cellClicked:(NSCell*) sender
125125
{
126-
NSTableView* tableView = [sender controlView];
126+
NSTableView *tableView = (NSTableView *)[sender controlView];
127127
if([tableView numberOfSelectedRows] == 1)
128128
{
129129
NSUInteger selectionIndex = [[tableView selectedRowIndexes] firstIndex];
@@ -135,16 +135,11 @@ - (void) cellClicked:(NSCell*) sender
135135
else {
136136
[selectedItem unstageChanges];
137137
}
138-
[self refreshControllers];
138+
[self refresh: self];
139139

140140
}
141141
}
142142

143-
- (void) refreshControllers
144-
{
145-
[self refresh:self];
146-
}
147-
148143
- (void)tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(int)rowIndex
149144
{
150145
[[tableColumn dataCell] setImage:[[[(([tableView tag] == 0) ? unstagedFilesController : cachedFilesController) arrangedObjects] objectAtIndex:rowIndex] icon]];

PBGitLane.h

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
#import <Cocoa/Cocoa.h>
1010

11-
static int PBGITLANE_CURRENT_INDEX = 0;
12-
1311
@interface PBGitLane : NSObject {
1412
NSString* sha;
1513
int index;

PBGitLane.m

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
@implementation PBGitLane
1313

14+
static int PBGITLANE_CURRENT_INDEX = 0;
15+
1416
@synthesize sha, index;
1517
- (id) initWithCommit: (NSString*) c
1618
{

PBGitRevList.m

+5-6
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ - (void) walkRevisionListWithSpecifier: (PBGitRevSpecifier*) rev
9090
NSFileHandle* handle = [repository handleForArguments: arguments];
9191

9292
// We decorate the commits in a separate thread.
93-
struct decorateParameters params = { newArray, rev };
94-
NSThread * decorationThread = [[NSThread alloc] initWithTarget: self selector: @selector(decorateRevisions:) object:&params];
93+
NSArray *decorationArguments = [NSArray arrayWithObjects:newArray, rev, nil];
94+
NSThread * decorationThread = [[NSThread alloc] initWithTarget: self selector: @selector(decorateRevisions:) object:decorationArguments];
9595
[decorationThread start];
9696

9797
int fd = [handle fileDescriptor];
@@ -142,11 +142,10 @@ - (void) walkRevisionListWithSpecifier: (PBGitRevSpecifier*) rev
142142
[NSThread exit];
143143
}
144144

145-
// We're not supposed to pass on structs, only objects, but this is much easier
146-
- (void) decorateRevisions: (struct decorateParameters*) params
145+
- (void) decorateRevisions:(NSArray *)params
147146
{
148-
NSMutableArray* revisions = params->revisions;
149-
PBGitRevSpecifier* rev = params->rev;
147+
NSMutableArray* revisions = [params objectAtIndex:0];
148+
PBGitRevSpecifier* rev = [params objectAtIndex:1];
150149
NSDictionary* refs = [repository refs];
151150

152151
BOOL decorateCommits = ![rev hasPathLimiter];

PBGitRevisionCell.m

+1-47
Original file line numberDiff line numberDiff line change
@@ -8,53 +8,7 @@
88

99
#import "PBGitRevisionCell.h"
1010
#import "PBGitRef.h"
11-
12-
@implementation NSBezierPath (RoundedRectangle)
13-
+ (NSBezierPath *)bezierPathWithRoundedRect: (NSRect) aRect cornerRadius: (double) cRadius
14-
{
15-
double left = aRect.origin.x, bottom = aRect.origin.y, width = aRect.size.width, height = aRect.size.height;
16-
17-
//now, crop the radius so we don't get weird effects
18-
double lesserDim = width < height ? width : height;
19-
if ( cRadius > lesserDim / 2 )
20-
{
21-
cRadius = lesserDim / 2;
22-
}
23-
24-
//these points describe the rectangle as start and stop points of the
25-
//arcs making up its corners --points c, e, & g are implicit endpoints of arcs
26-
//and are unnecessary
27-
NSPoint a = NSMakePoint( 0, cRadius ), b = NSMakePoint( 0, height - cRadius ),
28-
d = NSMakePoint( width - cRadius, height ), f = NSMakePoint( width, cRadius ),
29-
h = NSMakePoint( cRadius, 0 );
30-
31-
//these points describe the center points of the corner arcs
32-
NSPoint cA = NSMakePoint( cRadius, height - cRadius ),
33-
cB = NSMakePoint( width - cRadius, height - cRadius ),
34-
cC = NSMakePoint( width - cRadius, cRadius ),
35-
cD = NSMakePoint( cRadius, cRadius );
36-
37-
//start
38-
NSBezierPath *bp = [NSBezierPath bezierPath];
39-
[bp moveToPoint: a ];
40-
[bp lineToPoint: b ];
41-
[bp appendBezierPathWithArcWithCenter: cA radius: cRadius startAngle:180 endAngle:90 clockwise: YES];
42-
[bp lineToPoint: d ];
43-
[bp appendBezierPathWithArcWithCenter: cB radius: cRadius startAngle:90 endAngle:0 clockwise: YES];
44-
[bp lineToPoint: f ];
45-
[bp appendBezierPathWithArcWithCenter: cC radius: cRadius startAngle:0 endAngle:270 clockwise: YES];
46-
[bp lineToPoint: h ];
47-
[bp appendBezierPathWithArcWithCenter: cD radius: cRadius startAngle:270 endAngle:180 clockwise: YES];
48-
[bp closePath];
49-
50-
//Transform path to rectangle's origin
51-
NSAffineTransform *transform = [NSAffineTransform transform];
52-
[transform translateXBy: left yBy: bottom];
53-
[bp transformUsingAffineTransform: transform];
54-
55-
return bp; //it's already been autoreleased
56-
}
57-
@end
11+
#import "RoundedRectangle.h"
5812

5913
@implementation PBGitRevisionCell
6014

PBGitWindowController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ - (id)initWithRepository:(PBGitRepository*)theRepository;
2222
{
2323
self.repository = theRepository;
2424
[self showWindow:nil];
25-
[[NSUserDefaults standardUserDefaults] addObserver:self forKeyPath:@"selectedViewIndex" options:NULL context:NULL];
25+
[[NSUserDefaults standardUserDefaults] addObserver:self forKeyPath:@"selectedViewIndex" options:0 context:NULL];
2626
}
2727
return self;
2828
}

PBWebGitController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ - (void) sendKey: (NSString*) key
8989

9090
- (void) copySource
9191
{
92-
NSString *source = [[[[view mainFrame] DOMDocument] documentElement] outerHTML];
92+
NSString *source = [(DOMHTMLElement *)[[[view mainFrame] DOMDocument] documentElement] outerHTML];
9393
NSPasteboard *a =[NSPasteboard generalPasteboard];
9494
[a declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
9595
[a setString:source forType: NSStringPboardType];

RoundedRectangle.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// RoundedRectangle.h
3+
// GitX
4+
//
5+
// Created by Pieter de Bie on 24-09-08.
6+
// Copyright 2008 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
11+
12+
@interface NSBezierPath (RoundedRectangle)
13+
14+
+ (NSBezierPath *)bezierPathWithRoundedRect: (NSRect) aRect cornerRadius: (double) cRadius;
15+
16+
@end

0 commit comments

Comments
 (0)