Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix compiler warnings

  • Loading branch information...
commit b257f0090a0ee049c4d4a71c5660023ee6552d24 1 parent 2676a20
@pieter pieter authored
View
72 English.lproj/MainMenu.xib
@@ -1120,14 +1120,6 @@
<int key="connectionID">920</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">viewMenu</string>
- <reference key="source" ref="859235683"/>
- <reference key="destination" ref="245837913"/>
- </object>
- <int key="connectionID">922</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">setDetailedView:</string>
<reference key="source" ref="954860085"/>
@@ -2246,8 +2238,48 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">PBGitCommitController</string>
+ <string key="superclassName">PBViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>commit:</string>
+ <string>refresh:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>cachedButtonCell</string>
+ <string>cachedFilesController</string>
+ <string>commitMessageView</string>
+ <string>unstagedButtonCell</string>
+ <string>unstagedFilesController</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>PBIconAndTextCell</string>
+ <string>NSArrayController</string>
+ <string>NSTextView</string>
+ <string>PBIconAndTextCell</string>
+ <string>NSArrayController</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">PBGitCommitController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">PBGitHistoryController</string>
- <string key="superclassName">NSViewController</string>
+ <string key="superclassName">PBViewController</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
@@ -2276,7 +2308,6 @@
<string>commitController</string>
<string>commitList</string>
<string>fileBrowser</string>
- <string>searchField</string>
<string>treeController</string>
</object>
<object class="NSMutableArray" key="dict.values">
@@ -2284,7 +2315,6 @@
<string>NSArrayController</string>
<string>NSTableView</string>
<string>NSOutlineView</string>
- <string>NSSearchField</string>
<string>NSTreeController</string>
</object>
</object>
@@ -2300,12 +2330,16 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>branchesController</string>
<string>contentView</string>
+ <string>searchController</string>
<string>searchField</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSArrayController</string>
<string>NSView</string>
+ <string>NSArrayController</string>
<string>NSSearchField</string>
</object>
</object>
@@ -2361,6 +2395,14 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">PBIconAndTextCell</string>
+ <string key="superclassName">NSTextFieldCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">PBIconAndTextCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">PBRepositoryDocumentController</string>
<string key="superclassName">NSDocumentController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -2376,6 +2418,14 @@
<string key="minorKey"/>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">PBViewController</string>
+ <string key="superclassName">NSViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">PBViewController.h</string>
+ </object>
+ </object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
<bool key="EncodedWithXMLCoder">YES</bool>
View
14 GitX.xcodeproj/project.pbxproj
@@ -22,6 +22,7 @@
D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; };
F50FE0E30E07BE9600854FCD /* PBGitRevisionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */; };
F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; };
+ F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; };
F52BCE030E84208300AA3741 /* PBGitHistoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */; };
F52BCE070E84211300AA3741 /* PBGitHistoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = F52BCE060E84211300AA3741 /* PBGitHistoryController.m */; };
F53FF2050E7ABB5300389171 /* PBGitRevSpecifier.m in Sources */ = {isa = PBXBuildFile; fileRef = F53FF2040E7ABB5300389171 /* PBGitRevSpecifier.m */; };
@@ -56,8 +57,7 @@
F5E927F80E883E7200056E75 /* PBChangedFile.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E927F70E883E7200056E75 /* PBChangedFile.m */; };
F5E927FC0E883F0700056E75 /* PBWebChangesController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E927FB0E883F0700056E75 /* PBWebChangesController.m */; };
F5E9281D0E8840CF00056E75 /* diff.html in Resources */ = {isa = PBXBuildFile; fileRef = F5E9281C0E8840CF00056E75 /* diff.html */; };
- F5E928210E88414000056E75 /* diff.js in Sources */ = {isa = PBXBuildFile; fileRef = F5E928200E88414000056E75 /* diff.js */; };
- F5E928550E8841FB00056E75 /* diff.js in Sources */ = {isa = PBXBuildFile; fileRef = F5E928540E8841FB00056E75 /* diff.js */; };
+ F5E928550E8841FB00056E75 /* diff.js in Resources */ = {isa = PBXBuildFile; fileRef = F5E928540E8841FB00056E75 /* diff.js */; };
F5E92A1B0E88550E00056E75 /* empty_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F5E92A1A0E88550E00056E75 /* empty_file.png */; };
F5E92A230E88569500056E75 /* new_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F5E92A220E88569500056E75 /* new_file.png */; };
F5FF4E180E0829C20006317A /* PBGitRevList.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FF4E170E0829C20006317A /* PBGitRevList.m */; };
@@ -115,6 +115,8 @@
F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRevisionCell.m; sourceTree = "<group>"; };
F51308590E0740F2000C8BCD /* PBQLOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLOutlineView.h; sourceTree = "<group>"; };
F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBQLOutlineView.m; sourceTree = "<group>"; };
+ F5140DC70E8A8EB20091E9F3 /* RoundedRectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRectangle.h; sourceTree = "<group>"; };
+ F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoundedRectangle.m; sourceTree = "<group>"; };
F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitHistoryView.xib; sourceTree = "<group>"; };
F52BCE050E84211300AA3741 /* PBGitHistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitHistoryController.h; sourceTree = "<group>"; };
F52BCE060E84211300AA3741 /* PBGitHistoryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitHistoryController.m; sourceTree = "<group>"; };
@@ -168,7 +170,6 @@
F5E927FA0E883F0700056E75 /* PBWebChangesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBWebChangesController.h; sourceTree = "<group>"; };
F5E927FB0E883F0700056E75 /* PBWebChangesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBWebChangesController.m; sourceTree = "<group>"; };
F5E9281C0E8840CF00056E75 /* diff.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = diff.html; path = html/diff.html; sourceTree = "<group>"; };
- F5E928200E88414000056E75 /* diff.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = diff.js; sourceTree = "<group>"; };
F5E928540E8841FB00056E75 /* diff.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = diff.js; path = html/diff.js; sourceTree = "<group>"; };
F5E92A1A0E88550E00056E75 /* empty_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = empty_file.png; path = Images/empty_file.png; sourceTree = "<group>"; };
F5E92A220E88569500056E75 /* new_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = new_file.png; path = Images/new_file.png; sourceTree = "<group>"; };
@@ -355,6 +356,8 @@
F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */,
91B103CA0E898EC300C84364 /* PBIconAndTextCell.h */,
91B103CB0E898EC300C84364 /* PBIconAndTextCell.mm */,
+ F5140DC70E8A8EB20091E9F3 /* RoundedRectangle.h */,
+ F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */,
);
name = Aux;
sourceTree = "<group>";
@@ -371,7 +374,6 @@
F57ABDDE0E0441DE00A088B8 /* commit.js */,
F57ABE180E04431D00A088B8 /* prototype.js */,
F56173270E056ED2001DCD79 /* diffHighlighter.js */,
- F5E928200E88414000056E75 /* diff.js */,
);
name = HTML;
sourceTree = "<group>";
@@ -493,6 +495,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ F5E928550E8841FB00056E75 /* diff.js in Resources */,
F561E6CD0E7AFDDF00521636 /* keyboardNavigation.js in Resources */,
F5E92A1B0E88550E00056E75 /* empty_file.png in Resources */,
913D5E500E55645900CECEA2 /* gitx in Resources */,
@@ -549,9 +552,8 @@
F5E926060E8827D300056E75 /* PBViewController.m in Sources */,
F5E927F80E883E7200056E75 /* PBChangedFile.m in Sources */,
F5E927FC0E883F0700056E75 /* PBWebChangesController.m in Sources */,
- F5E928210E88414000056E75 /* diff.js in Sources */,
- F5E928550E8841FB00056E75 /* diff.js in Sources */,
91B103CC0E898EC300C84364 /* PBIconAndTextCell.mm in Sources */,
+ F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
2  PBCLIProxy.mm
@@ -35,7 +35,7 @@ - (BOOL)openRepository:(NSURL*)repositoryPath arguments: (NSArray*) args error:(
NSURL* url = [NSURL fileURLWithPath:[repositoryPath path]];
NSArray* arguments = [NSArray arrayWithArray:args];
PBGitRevSpecifier* rev = [[PBGitRevSpecifier alloc] initWithParameters:arguments];
- if (id document = [[PBRepositoryDocumentController sharedDocumentController] openRepositoryAtLocation: url RevSpecifier: rev]) {
+ if ([[PBRepositoryDocumentController sharedDocumentController] openRepositoryAtLocation: url RevSpecifier: rev]) {
[NSApp activateIgnoringOtherApps:YES];
return YES;
}
View
9 PBGitCommitController.m
@@ -123,7 +123,7 @@ - (IBAction) commit:(id) sender
- (void) cellClicked:(NSCell*) sender
{
- NSTableView* tableView = [sender controlView];
+ NSTableView *tableView = (NSTableView *)[sender controlView];
if([tableView numberOfSelectedRows] == 1)
{
NSUInteger selectionIndex = [[tableView selectedRowIndexes] firstIndex];
@@ -135,16 +135,11 @@ - (void) cellClicked:(NSCell*) sender
else {
[selectedItem unstageChanges];
}
- [self refreshControllers];
+ [self refresh: self];
}
}
-- (void) refreshControllers
-{
- [self refresh:self];
-}
-
- (void)tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(int)rowIndex
{
[[tableColumn dataCell] setImage:[[[(([tableView tag] == 0) ? unstagedFilesController : cachedFilesController) arrangedObjects] objectAtIndex:rowIndex] icon]];
View
2  PBGitLane.h
@@ -8,8 +8,6 @@
#import <Cocoa/Cocoa.h>
-static int PBGITLANE_CURRENT_INDEX = 0;
-
@interface PBGitLane : NSObject {
NSString* sha;
int index;
View
2  PBGitLane.m
@@ -11,6 +11,8 @@
@implementation PBGitLane
+static int PBGITLANE_CURRENT_INDEX = 0;
+
@synthesize sha, index;
- (id) initWithCommit: (NSString*) c
{
View
11 PBGitRevList.m
@@ -90,8 +90,8 @@ - (void) walkRevisionListWithSpecifier: (PBGitRevSpecifier*) rev
NSFileHandle* handle = [repository handleForArguments: arguments];
// We decorate the commits in a separate thread.
- struct decorateParameters params = { newArray, rev };
- NSThread * decorationThread = [[NSThread alloc] initWithTarget: self selector: @selector(decorateRevisions:) object:&params];
+ NSArray *decorationArguments = [NSArray arrayWithObjects:newArray, rev, nil];
+ NSThread * decorationThread = [[NSThread alloc] initWithTarget: self selector: @selector(decorateRevisions:) object:decorationArguments];
[decorationThread start];
int fd = [handle fileDescriptor];
@@ -142,11 +142,10 @@ - (void) walkRevisionListWithSpecifier: (PBGitRevSpecifier*) rev
[NSThread exit];
}
-// We're not supposed to pass on structs, only objects, but this is much easier
-- (void) decorateRevisions: (struct decorateParameters*) params
+- (void) decorateRevisions:(NSArray *)params
{
- NSMutableArray* revisions = params->revisions;
- PBGitRevSpecifier* rev = params->rev;
+ NSMutableArray* revisions = [params objectAtIndex:0];
+ PBGitRevSpecifier* rev = [params objectAtIndex:1];
NSDictionary* refs = [repository refs];
BOOL decorateCommits = ![rev hasPathLimiter];
View
48 PBGitRevisionCell.m
@@ -8,53 +8,7 @@
#import "PBGitRevisionCell.h"
#import "PBGitRef.h"
-
-@implementation NSBezierPath (RoundedRectangle)
-+ (NSBezierPath *)bezierPathWithRoundedRect: (NSRect) aRect cornerRadius: (double) cRadius
-{
- double left = aRect.origin.x, bottom = aRect.origin.y, width = aRect.size.width, height = aRect.size.height;
-
- //now, crop the radius so we don't get weird effects
- double lesserDim = width < height ? width : height;
- if ( cRadius > lesserDim / 2 )
- {
- cRadius = lesserDim / 2;
- }
-
- //these points describe the rectangle as start and stop points of the
- //arcs making up its corners --points c, e, & g are implicit endpoints of arcs
- //and are unnecessary
- NSPoint a = NSMakePoint( 0, cRadius ), b = NSMakePoint( 0, height - cRadius ),
- d = NSMakePoint( width - cRadius, height ), f = NSMakePoint( width, cRadius ),
- h = NSMakePoint( cRadius, 0 );
-
- //these points describe the center points of the corner arcs
- NSPoint cA = NSMakePoint( cRadius, height - cRadius ),
- cB = NSMakePoint( width - cRadius, height - cRadius ),
- cC = NSMakePoint( width - cRadius, cRadius ),
- cD = NSMakePoint( cRadius, cRadius );
-
- //start
- NSBezierPath *bp = [NSBezierPath bezierPath];
- [bp moveToPoint: a ];
- [bp lineToPoint: b ];
- [bp appendBezierPathWithArcWithCenter: cA radius: cRadius startAngle:180 endAngle:90 clockwise: YES];
- [bp lineToPoint: d ];
- [bp appendBezierPathWithArcWithCenter: cB radius: cRadius startAngle:90 endAngle:0 clockwise: YES];
- [bp lineToPoint: f ];
- [bp appendBezierPathWithArcWithCenter: cC radius: cRadius startAngle:0 endAngle:270 clockwise: YES];
- [bp lineToPoint: h ];
- [bp appendBezierPathWithArcWithCenter: cD radius: cRadius startAngle:270 endAngle:180 clockwise: YES];
- [bp closePath];
-
- //Transform path to rectangle's origin
- NSAffineTransform *transform = [NSAffineTransform transform];
- [transform translateXBy: left yBy: bottom];
- [bp transformUsingAffineTransform: transform];
-
- return bp; //it's already been autoreleased
-}
-@end
+#import "RoundedRectangle.h"
@implementation PBGitRevisionCell
View
2  PBGitWindowController.m
@@ -22,7 +22,7 @@ - (id)initWithRepository:(PBGitRepository*)theRepository;
{
self.repository = theRepository;
[self showWindow:nil];
- [[NSUserDefaults standardUserDefaults] addObserver:self forKeyPath:@"selectedViewIndex" options:NULL context:NULL];
+ [[NSUserDefaults standardUserDefaults] addObserver:self forKeyPath:@"selectedViewIndex" options:0 context:NULL];
}
return self;
}
View
2  PBWebGitController.m
@@ -89,7 +89,7 @@ - (void) sendKey: (NSString*) key
- (void) copySource
{
- NSString *source = [[[[view mainFrame] DOMDocument] documentElement] outerHTML];
+ NSString *source = [(DOMHTMLElement *)[[[view mainFrame] DOMDocument] documentElement] outerHTML];
NSPasteboard *a =[NSPasteboard generalPasteboard];
[a declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
[a setString:source forType: NSStringPboardType];
View
16 RoundedRectangle.h
@@ -0,0 +1,16 @@
+//
+// RoundedRectangle.h
+// GitX
+//
+// Created by Pieter de Bie on 24-09-08.
+// Copyright 2008 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface NSBezierPath (RoundedRectangle)
+
++ (NSBezierPath *)bezierPathWithRoundedRect: (NSRect) aRect cornerRadius: (double) cRadius;
+
+@end
View
57 RoundedRectangle.m
@@ -0,0 +1,57 @@
+//
+// RoundedRectangle.m
+// GitX
+//
+// Created by Pieter de Bie on 24-09-08.
+// Copyright 2008 __MyCompanyName__. All rights reserved.
+//
+
+#import "RoundedRectangle.h"
+
+
+@implementation NSBezierPath (RoundedRectangle)
++ (NSBezierPath *)bezierPathWithRoundedRect: (NSRect) aRect cornerRadius: (double) cRadius
+{
+ double left = aRect.origin.x, bottom = aRect.origin.y, width = aRect.size.width, height = aRect.size.height;
+
+ //now, crop the radius so we don't get weird effects
+ double lesserDim = width < height ? width : height;
+ if ( cRadius > lesserDim / 2 )
+ {
+ cRadius = lesserDim / 2;
+ }
+
+ //these points describe the rectangle as start and stop points of the
+ //arcs making up its corners --points c, e, & g are implicit endpoints of arcs
+ //and are unnecessary
+ NSPoint a = NSMakePoint( 0, cRadius ), b = NSMakePoint( 0, height - cRadius ),
+ d = NSMakePoint( width - cRadius, height ), f = NSMakePoint( width, cRadius ),
+ h = NSMakePoint( cRadius, 0 );
+
+ //these points describe the center points of the corner arcs
+ NSPoint cA = NSMakePoint( cRadius, height - cRadius ),
+ cB = NSMakePoint( width - cRadius, height - cRadius ),
+ cC = NSMakePoint( width - cRadius, cRadius ),
+ cD = NSMakePoint( cRadius, cRadius );
+
+ //start
+ NSBezierPath *bp = [NSBezierPath bezierPath];
+ [bp moveToPoint: a ];
+ [bp lineToPoint: b ];
+ [bp appendBezierPathWithArcWithCenter: cA radius: cRadius startAngle:180 endAngle:90 clockwise: YES];
+ [bp lineToPoint: d ];
+ [bp appendBezierPathWithArcWithCenter: cB radius: cRadius startAngle:90 endAngle:0 clockwise: YES];
+ [bp lineToPoint: f ];
+ [bp appendBezierPathWithArcWithCenter: cC radius: cRadius startAngle:0 endAngle:270 clockwise: YES];
+ [bp lineToPoint: h ];
+ [bp appendBezierPathWithArcWithCenter: cD radius: cRadius startAngle:270 endAngle:180 clockwise: YES];
+ [bp closePath];
+
+ //Transform path to rectangle's origin
+ NSAffineTransform *transform = [NSAffineTransform transform];
+ [transform translateXBy: left yBy: bottom];
+ [bp transformUsingAffineTransform: transform];
+
+ return bp; //it's already been autoreleased
+}
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.