Solved compilation warnings

This commit is contained in:
German Laullon
2011-03-10 16:04:45 -08:00
parent abbb2081c4
commit f9ccf1fe8d
31 changed files with 41 additions and 49 deletions
+1 -1
View File
@@ -245,7 +245,7 @@
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"]];
+1 -1
View File
@@ -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
+1 -1
View File
@@ -16,7 +16,7 @@
@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];
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -58,7 +58,7 @@
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];
}
+1 -1
View File
@@ -17,7 +17,7 @@
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;
+1 -1
View File
@@ -22,7 +22,7 @@
@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];
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -15,7 +15,7 @@ static NSString * const kCommandKey = @"command";
@implementation PBGitResetController
- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
+1 -1
View File
@@ -19,7 +19,7 @@
@synthesize submodules;
- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
+1 -1
View File
@@ -42,7 +42,7 @@
#import <Cocoa/Cocoa.h>
@interface DBPrefsWindowController : NSWindowController {
@interface DBPrefsWindowController : NSWindowController <NSAnimationDelegate,NSToolbarDelegate>{
NSMutableArray *toolbarIdentifiers;
NSMutableDictionary *toolbarViews;
NSMutableDictionary *toolbarItems;
-1
View File
@@ -485,7 +485,6 @@
int n;
for(n=1;n<nLines;n++){
line=[lines objectAtIndex:i++];
do{
line=[lines objectAtIndex:i++];
}while([line characterAtIndex:0]!='\t');
+6 -2
View File
@@ -2005,6 +2005,7 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = "Generate PList Prefix";
SDKROOT = "";
};
name = Debug;
};
@@ -2016,6 +2017,7 @@
GCC_ENABLE_FIX_AND_CONTINUE = NO;
INFOPLIST_PREPROCESS = YES;
PRODUCT_NAME = "Generate PList Prefix";
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
@@ -2052,6 +2054,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = GitXTesting;
SDKROOT = "";
};
name = Debug;
};
@@ -2082,6 +2085,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = GitXTesting;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
@@ -2111,7 +2115,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = SpeedTest;
SDKROOT = macosx10.5;
SDKROOT = "";
};
name = Debug;
};
@@ -2136,7 +2140,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = SpeedTest;
SDKROOT = iphoneos2.0;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
+1 -1
View File
@@ -16,7 +16,7 @@
@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];
+2 -2
View File
@@ -32,7 +32,7 @@
- (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]];
@@ -47,7 +47,7 @@
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]];
+2 -2
View File
@@ -26,9 +26,9 @@
{
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 {
+1 -1
View File
@@ -18,7 +18,7 @@
@synthesize command;
- initWithCommand:(PBCommand *) aCommand {
if (self = [super init]) {
if ((self = [super init])) {
self.command = aCommand;
super.title = [aCommand displayName];
[self setTarget:aCommand];
+1 -1
View File
@@ -23,7 +23,7 @@
@class PBHistorySearchController;
@interface PBGitHistoryController : PBViewController {
@interface PBGitHistoryController : PBViewController <NSOutlineViewDelegate>{
IBOutlet PBRefController *refController;
IBOutlet NSSearchField *searchField;
IBOutlet NSArrayController* commitController;
+1 -1
View File
@@ -17,7 +17,7 @@
//---------------------------------------------------------------------------------------------
- initWithSourceObject:(id<PBPresentable>) anObject {
if (self = [super init]) {
if ((self = [super init])) {
super.title = [anObject displayDescription];
sourceObject = [anObject retain];
}
+1 -1
View File
@@ -143,7 +143,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
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];
}
+1 -1
View File
@@ -225,7 +225,7 @@ using namespace std;
[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];
+1 -1
View File
@@ -13,7 +13,7 @@
@class PBGitHistoryController;
@class PBGitCommitController;
@interface PBGitSidebarController : PBViewController {
@interface PBGitSidebarController : PBViewController <NSOutlineViewDelegate>{
IBOutlet NSWindow *window;
IBOutlet NSOutlineView *sourceView;
IBOutlet NSView *sourceListControlsView;
+1 -1
View File
@@ -244,7 +244,7 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged";
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];
}
+3 -13
View File
@@ -113,16 +113,6 @@
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
@@ -231,7 +221,7 @@
}
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]];
}
@@ -296,7 +286,7 @@
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];
}
@@ -383,7 +373,7 @@
- (void) finalize
{
if (localFileName)
[[NSFileManager defaultManager] removeFileAtPath:localFileName handler:nil];
[[NSFileManager defaultManager] removeItemAtPath:localFileName error:nil];
[super finalize];
}
@end
+1 -1
View File
@@ -14,7 +14,7 @@
@class PBViewController, PBGitSidebarController, PBGitCommitController;
@interface PBGitWindowController : NSWindowController {
@interface PBGitWindowController : NSWindowController <NSWindowDelegate>{
__weak PBGitRepository* repository;
PBViewController *contentController;
-1
View File
@@ -216,7 +216,6 @@
}
- (IBAction) changeLayout:(id)sender{
NSLog(@"selectedSegment=%ld (%d)",[sender selectedSegment],[sender isSelectedForSegment:[sender selectedSegment]]);
NSSplitView *sp=nil;
switch ([sender selectedSegment]) {
case 0:
+1 -1
View File
@@ -17,7 +17,7 @@
// note that this leaks!
CFRetain(client);
if (self = [super initWithRequest:request cachedResponse:cachedResponse client:client])
if ((self = [super initWithRequest:request cachedResponse:cachedResponse client:client]))
{
}
+1 -1
View File
@@ -22,7 +22,7 @@
# pragma mark context menu delegate methods
- init {
if (self = [super init]) {
if ((self = [super init])) {
}
return self;
+1 -1
View File
@@ -23,7 +23,7 @@ static NSString * const kCommandName = @"stash";
@synthesize stashes;
- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
+1 -1
View File
@@ -19,7 +19,7 @@
{
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;
}
+4 -4
View File
@@ -30,7 +30,7 @@
#define WINDOWAUTOSAVENAME @"GitXAskPasswordWindowFrame"
@interface GAPAppDelegate : NSObject
@interface GAPAppDelegate : NSObject <NSApplicationDelegate>
{
NSPanel* mPasswordPanel;
NSSecureTextField* mPasswordField;
@@ -48,7 +48,7 @@ NSString* url;
OSStatus StorePasswordKeychain (const char *url, UInt32 urlLength, void* password,UInt32 passwordLength);
@implementation GAPAppDelegate
@implementation GAPAppDelegate
-(NSPanel*)passwordPanel:(NSString *)prompt remember:(BOOL)remember
{
@@ -167,7 +167,7 @@ OSStatus StorePasswordKeychain (const char *url, UInt32 urlLength, void* passw
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];
@@ -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) {