Skip to content

Commit

Permalink
Solved compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
laullon committed Mar 11, 2011
1 parent abbb208 commit f9ccf1f
Show file tree
Hide file tree
Showing 31 changed files with 41 additions and 49 deletions.
2 changes: 1 addition & 1 deletion ApplicationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ - (NSPersistentStoreCoordinator *) persistentStoreCoordinator {
fileManager = [NSFileManager defaultManager];
applicationSupportFolder = [self applicationSupportFolder];
if ( ![fileManager fileExistsAtPath:applicationSupportFolder isDirectory:NULL] ) {
[fileManager createDirectoryAtPath:applicationSupportFolder attributes:nil];
[fileManager createDirectoryAtPath:applicationSupportFolder withIntermediateDirectories:YES attributes:nil error:nil];
}

url = [NSURL fileURLWithPath: [applicationSupportFolder stringByAppendingPathComponent: @"GitTest.xml"]];
Expand Down
2 changes: 1 addition & 1 deletion Commands/PBCommandFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
#import "PBGitRepository.h"

@protocol PBCommandFactory
+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository;
+ (NSArray *) commandsForObject:(id<PBPresentable>) object repository:(PBGitRepository *) repository;
@end
2 changes: 1 addition & 1 deletion Commands/PBCommandWithParameter.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ @implementation PBCommandWithParameter
@synthesize parameterDisplayName;

- initWithCommand:(PBCommand *) aCommand parameterName:(NSString *) param parameterDisplayName:(NSString *) paramDisplayName {
if (self = [super initWithDisplayName:[aCommand displayName] parameters:nil repository:[aCommand repository]]) {
if ((self = [super initWithDisplayName:[aCommand displayName] parameters:nil repository:[aCommand repository]])) {
command = [aCommand retain];
parameterName = [param retain];
parameterDisplayName = [paramDisplayName retain];
Expand Down
2 changes: 1 addition & 1 deletion Commands/PBOpenDocumentCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@implementation PBOpenDocumentCommand

- (id) initWithDocumentAbsolutePath:(NSString *) path {
if (self = [super initWithDisplayName:@"Open" parameters:nil repository:nil]) {
if ((self = [super initWithDisplayName:@"Open" parameters:nil repository:nil])) {
documentURL = [[NSURL alloc] initWithString:path];
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion Commands/PBRemoteCommandFactory.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ + (NSArray *) commandsForSubmodule:(PBGitSubmodule *) submodule inRepository:(PB
return commands;
}

+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository {
+ (NSArray *) commandsForObject:(id<PBPresentable>) object repository:(PBGitRepository *) repository {
if ([object isKindOfClass:[PBGitSubmodule class]]) {
return [PBRemoteCommandFactory commandsForSubmodule:(id)object inRepository:repository];
}
Expand Down
2 changes: 1 addition & 1 deletion Commands/PBRevealWithFinderCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ - (id) initWithDocumentAbsolutePath:(NSString *) path {
return nil;
}

if (self = [super initWithDisplayName:@"Reveal in Finder" parameters:nil repository:nil]) {
if ((self = [super initWithDisplayName:@"Reveal in Finder" parameters:nil repository:nil])) {
documentURL = [[NSURL alloc] initWithString:path];
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion Commands/PBStashCommandFactory.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ + (NSArray *) commandsForRef:(PBGitRef *) ref repository:(PBGitRepository *) rep

@implementation PBStashCommandFactory

+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository {
+ (NSArray *) commandsForObject:(id<PBPresentable>) object repository:(PBGitRepository *) repository {
NSArray *cmds = nil;
if ([object isKindOfClass:[PBGitStash class]]) {
cmds = [PBStashCommandFactory commandsForStash:(id)object repository:repository];
Expand Down
2 changes: 1 addition & 1 deletion Controller/PBArgumentPickerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@implementation PBArgumentPickerController

- initWithCommandWithParameter:(PBCommandWithParameter *) aCommand {
if (self = [super initWithWindowNibName:@"PBArgumentPicker" owner:self]) {
if ((self = [super initWithWindowNibName:@"PBArgumentPicker" owner:self])) {
cmdWithParameter = [aCommand retain];
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion Controller/PBGitResetController.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@implementation PBGitResetController

- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion Controller/PBSubmoduleController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ @implementation PBSubmoduleController
@synthesize submodules;

- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion DBPrefsWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#import <Cocoa/Cocoa.h>


@interface DBPrefsWindowController : NSWindowController {
@interface DBPrefsWindowController : NSWindowController <NSAnimationDelegate,NSToolbarDelegate>{
NSMutableArray *toolbarIdentifiers;
NSMutableDictionary *toolbarViews;
NSMutableDictionary *toolbarItems;
Expand Down
1 change: 0 additions & 1 deletion GLFileView.m
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ - (NSString *) parseBlame:(NSString *)txt

int n;
for(n=1;n<nLines;n++){
line=[lines objectAtIndex:i++];
do{
line=[lines objectAtIndex:i++];
}while([line characterAtIndex:0]!='\t');
Expand Down
8 changes: 6 additions & 2 deletions GitX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,7 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = "Generate PList Prefix";
SDKROOT = "";
};
name = Debug;
};
Expand All @@ -2016,6 +2017,7 @@
GCC_ENABLE_FIX_AND_CONTINUE = NO;
INFOPLIST_PREPROCESS = YES;
PRODUCT_NAME = "Generate PList Prefix";
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
Expand Down Expand Up @@ -2052,6 +2054,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = GitXTesting;
SDKROOT = "";
};
name = Debug;
};
Expand Down Expand Up @@ -2082,6 +2085,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = GitXTesting;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
Expand Down Expand Up @@ -2111,7 +2115,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = SpeedTest;
SDKROOT = macosx10.5;
SDKROOT = "";
};
name = Debug;
};
Expand All @@ -2136,7 +2140,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = SpeedTest;
SDKROOT = iphoneos2.0;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion Model/PBGitStash.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ @implementation PBGitStash
@synthesize stashSourceMessage;

- initWithRawStashLine:(NSString *) stashLineFromStashListOutput {
if (self = [super init]) {
if ((self = [super init])) {
stashRawString = [stashLineFromStashListOutput retain];
NSArray *lineComponents = [stashLineFromStashListOutput componentsSeparatedByString:@":"];
name = [[lineComponents objectAtIndex:0] retain];
Expand Down
4 changes: 2 additions & 2 deletions Model/PBGitSubmodule.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ - (NSMutableArray *) submodules {
- (id) initWithRawSubmoduleStatusString:(NSString *) submoduleStatusString {
NSParameterAssert([submoduleStatusString length] > 0);

if (self = [super init]) {
if ((self = [super init])) {
unichar status = [submoduleStatusString characterAtIndex:0];
submoduleState = [PBGitSubmodule submoduleStateFromCharacter:status];
NSScanner *scanner = [NSScanner scannerWithString:[submoduleStatusString substringFromIndex:1]];
Expand All @@ -47,7 +47,7 @@ - (id) initWithRawSubmoduleStatusString:(NSString *) submoduleStatusString {
shouldContinue = [scanner scanString:@"(" intoString:NULL];
}
if (shouldContinue) {
shouldContinue = [scanner scanUpToString:@")" intoString:&coName];
[scanner scanUpToString:@")" intoString:&coName];
}
self.path = [fullPath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
coName = [coName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
Expand Down
4 changes: 2 additions & 2 deletions PBChangedFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ - (NSString *)indexInfo
{
NSAssert(status == NEW || self.commitBlobSHA, @"File is not new, but doesn't have an index entry!");
if (!self.commitBlobSHA)
return [NSString stringWithFormat:@"0 0000000000000000000000000000000000000000\t%@\0", self.path];
return [NSString stringWithFormat:@"0 0000000000000000000000000000000000000000\t%@", self.path];
else
return [NSString stringWithFormat:@"%@ %@\t%@\0", self.commitBlobMode, self.commitBlobSHA, self.path];
return [NSString stringWithFormat:@"%@ %@\t%@", self.commitBlobMode, self.commitBlobSHA, self.path];
}

+ (NSImage *) iconForStatus:(PBChangedFileStatus) aStatus {
Expand Down
2 changes: 1 addition & 1 deletion PBCommandMenuItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ @implementation PBCommandMenuItem
@synthesize command;

- initWithCommand:(PBCommand *) aCommand {
if (self = [super init]) {
if ((self = [super init])) {
self.command = aCommand;
super.title = [aCommand displayName];
[self setTarget:aCommand];
Expand Down
2 changes: 1 addition & 1 deletion PBGitHistoryController.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

@class PBHistorySearchController;

@interface PBGitHistoryController : PBViewController {
@interface PBGitHistoryController : PBViewController <NSOutlineViewDelegate>{
IBOutlet PBRefController *refController;
IBOutlet NSSearchField *searchField;
IBOutlet NSArrayController* commitController;
Expand Down
2 changes: 1 addition & 1 deletion PBGitMenuItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ @implementation PBGitMenuItem
//---------------------------------------------------------------------------------------------

- initWithSourceObject:(id<PBPresentable>) anObject {
if (self = [super init]) {
if ((self = [super init])) {
super.title = [anObject displayDescription];
sourceObject = [anObject retain];
}
Expand Down
2 changes: 1 addition & 1 deletion PBGitRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ - (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSEr
NSURL* gitDirURL = [PBGitRepository gitDirForURL:[self fileURL]];
if (!gitDirURL) {
if (outError) {
NSDictionary* userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%@ does not appear to be a git repository.", [self fileName]]
NSDictionary* userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%@ does not appear to be a git repository.", [self fileURL]]
forKey:NSLocalizedRecoverySuggestionErrorKey];
*outError = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:userInfo];
}
Expand Down
2 changes: 1 addition & 1 deletion PBGitRevList.mm
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
[self performSelectorOnMainThread:@selector(finishedParsing) withObject:nil waitUntilDone:NO];
}
else {
NSLog(@"[%@ %s] thread has been canceled", [self class], NSStringFromSelector(_cmd));
NSLog(@"[%@ %@] thread has been canceled", [self class], NSStringFromSelector(_cmd));
}

[task terminate];
Expand Down
2 changes: 1 addition & 1 deletion PBGitSidebarController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@class PBGitHistoryController;
@class PBGitCommitController;

@interface PBGitSidebarController : PBViewController {
@interface PBGitSidebarController : PBViewController <NSOutlineViewDelegate>{
IBOutlet NSWindow *window;
IBOutlet NSOutlineView *sourceView;
IBOutlet NSView *sourceListControlsView;
Expand Down
2 changes: 1 addition & 1 deletion PBGitSidebarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ - (void) outlineDoubleClicked {
PBSourceViewItem *item = [self selectedItem];
if ([item isKindOfClass:[PBGitMenuItem class]]) {
PBGitMenuItem *sidebarItem = (PBGitMenuItem *) item;
NSObject *sourceObject = [sidebarItem sourceObject];
id<PBPresentable> sourceObject = [sidebarItem sourceObject];
if ([sourceObject isKindOfClass:[PBGitSubmodule class]]) {
[[repository.submoduleController defaultCommandForSubmodule:(id)sourceObject] invoke];
}
Expand Down
16 changes: 3 additions & 13 deletions PBGitTree.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@ - (BOOL) isLocallyCached
return NO;
}

- (BOOL)hasBinaryHeader:(NSString*)contents
{
if (!contents)
return NO;

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

- (BOOL)hasBinaryAttributes
{
// First ask git check-attr if the file has a binary attribute custom set
Expand Down Expand Up @@ -231,7 +221,7 @@ - (NSString *) diff:(NSString *)format error:(NSError **)anError
}
res=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff", sha, des,[self fullPath], nil]];
if ([res length]==0) {
NSLog(@"--%d",[res length]);
NSLog(@"--%@",[res length]);
if (anError != NULL) {
*anError = [NSError errorWithDomain:@"diff" code:1 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"No Diff",NSLocalizedDescriptionKey,nil]];
}
Expand Down Expand Up @@ -296,7 +286,7 @@ - (void) saveToFolder: (NSString *) dir
NSData* data = [handle readDataToEndOfFile];
[data writeToFile:newName atomically:YES];
} else { // Directory
[[NSFileManager defaultManager] createDirectoryAtPath:newName attributes:nil];
[[NSFileManager defaultManager] createDirectoryAtPath:newName withIntermediateDirectories:YES attributes:nil error:nil];
for (PBGitTree* child in [self children])
[child saveToFolder: newName];
}
Expand Down Expand Up @@ -383,7 +373,7 @@ - (NSString*) fullPath
- (void) finalize
{
if (localFileName)
[[NSFileManager defaultManager] removeFileAtPath:localFileName handler:nil];
[[NSFileManager defaultManager] removeItemAtPath:localFileName error:nil];
[super finalize];
}
@end
2 changes: 1 addition & 1 deletion PBGitWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@class PBViewController, PBGitSidebarController, PBGitCommitController;

@interface PBGitWindowController : NSWindowController {
@interface PBGitWindowController : NSWindowController <NSWindowDelegate>{
__weak PBGitRepository* repository;

PBViewController *contentController;
Expand Down
1 change: 0 additions & 1 deletion PBGitWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ - (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode
}

- (IBAction) changeLayout:(id)sender{
NSLog(@"selectedSegment=%ld (%d)",[sender selectedSegment],[sender isSelectedForSegment:[sender selectedSegment]]);
NSSplitView *sp=nil;
switch ([sender selectedSegment]) {
case 0:
Expand Down
2 changes: 1 addition & 1 deletion PBGitXProtocol.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ - (id)initWithRequest:(NSURLRequest *)request cachedResponse:(NSCachedURLRespons
// note that this leaks!
CFRetain(client);

if (self = [super initWithRequest:request cachedResponse:cachedResponse client:client])
if ((self = [super initWithRequest:request cachedResponse:cachedResponse client:client]))
{
}

Expand Down
2 changes: 1 addition & 1 deletion PBSourceViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ @implementation PBSourceViewCell
# pragma mark context menu delegate methods

- init {
if (self = [super init]) {
if ((self = [super init])) {

}
return self;
Expand Down
2 changes: 1 addition & 1 deletion PBStashController.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ @implementation PBStashController
@synthesize stashes;

- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion PBViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGit
{
NSString *nibName = [[[self class] description] stringByReplacingOccurrencesOfString:@"Controller"
withString:@"View"];
if(self = [self initWithNibName:nibName bundle:nil]) {
if((self = [self initWithNibName:nibName bundle:nil])) {
repository = theRepository;
superController = controller;
}
Expand Down
8 changes: 4 additions & 4 deletions gitx_askpasswd_main.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define WINDOWAUTOSAVENAME @"GitXAskPasswordWindowFrame"


@interface GAPAppDelegate : NSObject
@interface GAPAppDelegate : NSObject <NSApplicationDelegate>
{
NSPanel* mPasswordPanel;
NSSecureTextField* mPasswordField;
Expand All @@ -48,7 +48,7 @@ -(IBAction) doCancelButton: (id)sender;
OSStatus StorePasswordKeychain (const char *url, UInt32 urlLength, void* password,UInt32 passwordLength);


@implementation GAPAppDelegate
@implementation GAPAppDelegate

-(NSPanel*)passwordPanel:(NSString *)prompt remember:(BOOL)remember
{
Expand Down Expand Up @@ -167,7 +167,7 @@ -(IBAction) doOKButton: (id)sender
if ((rememberCheck!=nil) && [rememberCheck state]==NSOnState) {
OSStatus status = StorePasswordKeychain ([url cStringUsingEncoding:NSASCIIStringEncoding],
[url lengthOfBytesUsingEncoding:NSASCIIStringEncoding],
[pas cStringUsingEncoding:NSASCIIStringEncoding],
(void *)[pas cStringUsingEncoding:NSASCIIStringEncoding],
[pas lengthOfBytesUsingEncoding:NSASCIIStringEncoding]); //Call
if (status != noErr) {
[[NSApplication sharedApplication] stopModalWithCode:-1];
Expand Down Expand Up @@ -329,7 +329,7 @@ int main( int argc, const char* argv[] )

void *passwordData = nil;
SecKeychainItemRef itemRef = nil;
UInt32 passwordLength = nil;
UInt32 passwordLength = 0;

OSStatus status = GetPasswordKeychain ([url cStringUsingEncoding:NSASCIIStringEncoding],[url lengthOfBytesUsingEncoding:NSASCIIStringEncoding],&passwordData,&passwordLength,&itemRef);
if (status == noErr) {
Expand Down

0 comments on commit f9ccf1f

Please sign in to comment.