From e89f88456bf927241220d53e64a24d54c3571b67 Mon Sep 17 00:00:00 2001 From: Sebastian Reitenbach Date: Sat, 9 Feb 2013 14:29:44 +0000 Subject: [PATCH] * Framework/PCFileCreator.m * Framework/PCMakefileFactory.m * Framework/PCProjectBuilder.m * Framework/PCProjectLauncher.m * Framework/PCProjectManager.m * Framework/PCProject.m * Modules/Projects/Application/PCAppProject.m * Modules/Projects/Tool/PCToolProject.m shutup clang compiler warning about redunant literal string usage git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@36097 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 12 +++++++ Framework/PCFileCreator.m | 36 +++++++++------------ Framework/PCMakefileFactory.m | 8 ++--- Framework/PCProject.m | 8 ++--- Framework/PCProjectBuilder.m | 24 +++++++------- Framework/PCProjectLauncher.m | 4 +-- Framework/PCProjectManager.m | 6 ++-- Modules/Projects/Application/PCAppProject.m | 2 +- Modules/Projects/Tool/PCToolProject.m | 2 +- 9 files changed, 54 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa73b21..fddd4c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2013-02-09 Sebastian Reitenbach + * Framework/PCFileCreator.m + * Framework/PCMakefileFactory.m + * Framework/PCProjectBuilder.m + * Framework/PCProjectLauncher.m + * Framework/PCProjectManager.m + * Framework/PCProject.m + * Modules/Projects/Application/PCAppProject.m + * Modules/Projects/Tool/PCToolProject.m + shutup clang compiler warning about redunant literal + string usage + 2012-11-22 German Arias * Modules/Projects/Library/PCLibProject.m: Don't add the prefix "lib" diff --git a/Framework/PCFileCreator.m b/Framework/PCFileCreator.m index b5de330..841ba51 100644 --- a/Framework/PCFileCreator.m +++ b/Framework/PCFileCreator.m @@ -55,10 +55,9 @@ static NSDictionary *dict = nil; // Setting up the dictionary needed for registration! // Objective C Class - descr = [NSString stringWithString: - @"Generic Objective-C class.\n\n" - @"This is a plain subclass of NSObject which includes" - @" only Foundation.h."]; + descr = @"Generic Objective-C class.\n\n" + @"This is a plain subclass of NSObject which includes" + @" only Foundation.h."; template = [bundle pathForResource:@"class" ofType:@"template"]; classDict = [NSDictionary dictionaryWithObjectsAndKeys: PCClasses, @"ProjectKey", @@ -67,10 +66,9 @@ static NSDictionary *dict = nil; nil]; // Objective C Header - descr = [NSString stringWithString: - @"Generic Objective-C header.\n\n" - @"This is a plain interface subclassing NSObject." - @" The file includes Foundation.h"]; + descr = @"Generic Objective-C header.\n\n" + @"This is a plain interface subclassing NSObject." + @" The file includes Foundation.h"; template = [bundle pathForResource:@"header" ofType:@"template"]; headerDict =[NSDictionary dictionaryWithObjectsAndKeys: PCHeaders,@"ProjectKey", @@ -79,9 +77,8 @@ static NSDictionary *dict = nil; nil]; // C File - descr = [NSString stringWithString: - @"Generic ANSI-C implementation file.\n\n" - @"This file contains no Objective-C dependency in any form."]; + descr = @"Generic ANSI-C implementation file.\n\n" + @"This file contains no Objective-C dependency in any form."; template = [bundle pathForResource:@"cfile" ofType:@"template"]; ccDict = [NSDictionary dictionaryWithObjectsAndKeys: PCOtherSources,@"ProjectKey", @@ -90,9 +87,8 @@ static NSDictionary *dict = nil; nil]; // C Header - descr = [NSString stringWithString: - @"Generic ANSI-C header.\n\n" - @"This file contains no Objective-C dependency in any form."]; + descr = @"Generic ANSI-C header.\n\n" + @"This file contains no Objective-C dependency in any form."; template = [bundle pathForResource:@"cheader" ofType:@"template"]; chDict = [NSDictionary dictionaryWithObjectsAndKeys: PCHeaders,@"ProjectKey", @@ -101,10 +97,9 @@ static NSDictionary *dict = nil; nil]; // Objective C Protocol - descr = [NSString stringWithString: - @"Generic Objective-C protocol.\n\n" - @"This is common Objective-C protocol, comparable" - @" i.e. to a Java interface."]; + descr = @"Generic Objective-C protocol.\n\n" + @"This is common Objective-C protocol, comparable" + @" i.e. to a Java interface."; template = [bundle pathForResource:@"protocol" ofType:@"template"]; protocolDict = [NSDictionary dictionaryWithObjectsAndKeys: PCHeaders,@"ProjectKey", @@ -113,9 +108,8 @@ static NSDictionary *dict = nil; nil]; // GSMarkup - descr = [NSString stringWithString: - @"Generic GSMarkup File.\n\n" - @"This is the interface description of GNUstep Renaissance."]; + descr = @"Generic GSMarkup File.\n\n" + @"This is the interface description of GNUstep Renaissance."; template = [bundle pathForResource:@"gsmarkup" ofType:@"template"]; gsmarkupDict =[NSDictionary dictionaryWithObjectsAndKeys: PCGSMarkupFiles,@"ProjectKey", diff --git a/Framework/PCMakefileFactory.m b/Framework/PCMakefileFactory.m index 1633fdb..1b33f9a 100644 --- a/Framework/PCMakefileFactory.m +++ b/Framework/PCMakefileFactory.m @@ -429,7 +429,7 @@ static PCMakefileFactory *_factory = nil; int count = [array count]; NSString *string = nil; NSString *item = nil; - NSString *eol = [NSString stringWithString: @"\\\n"]; + NSString *eol = @"\\\n"; if (array == nil || count <= 0) { @@ -449,7 +449,7 @@ static PCMakefileFactory *_factory = nil; [self appendString:string]; if (i == (count-2)) { - eol = [NSString stringWithString: @"\n"]; + eol = @"\n"; } } } @@ -471,7 +471,7 @@ static PCMakefileFactory *_factory = nil; NSString *langs = [languages componentsJoinedByString: @" "]; NSString *string = nil; NSString *item = nil; - NSString *eol = [NSString stringWithString: @"\\\n"]; + NSString *eol = @"\\\n"; int i = 0; int count = [resources count]; @@ -494,7 +494,7 @@ static PCMakefileFactory *_factory = nil; { if (i == (count-1)) { - eol = [NSString stringWithString: @"\n"]; + eol = @"\n"; } item = [resources objectAtIndex:i]; string = [NSString stringWithFormat: @"%@ %@", item, eol]; diff --git a/Framework/PCProject.m b/Framework/PCProject.m index 70636c9..64e20b9 100644 --- a/Framework/PCProject.m +++ b/Framework/PCProject.m @@ -388,12 +388,12 @@ NSString forKey:@"ProjectWindow"]; if ([projectWindow isToolbarVisible] == YES) { - [windows setObject:[NSString stringWithString:@"YES"] + [windows setObject:@"YES" forKey:@"ShowToolbar"]; } else { - [windows setObject:[NSString stringWithString:@"NO"] + [windows setObject:@"NO" forKey:@"ShowToolbar"]; } @@ -1047,11 +1047,11 @@ NSString { if ([type isEqualToString:@"m"] || [type isEqualToString:@"c"]) { - return [NSString stringWithString:@"h"]; + return @"h"; } else if ([type isEqualToString:@"h"]) { - return [NSString stringWithString:@"m"]; + return @"m"; } return nil; diff --git a/Framework/PCProjectBuilder.m b/Framework/PCProjectBuilder.m index dbd5dc8..c1be619 100644 --- a/Framework/PCProjectBuilder.m +++ b/Framework/PCProjectBuilder.m @@ -383,7 +383,7 @@ nextEL = ELNone; lastIndentString = @""; - buildStatus = [NSString stringWithString:@"Building..."]; + buildStatus = @"Building..."; [buildStatusTarget setString:@"Build"]; [cleanButton setEnabled:NO]; _isBuilding = YES; @@ -413,7 +413,7 @@ [buildArgs addObject:@"clean"]; [buildArgs addObjectsFromArray:[self buildArguments]]; - buildStatus = [NSString stringWithString:@"Cleaning..."]; + buildStatus = @"Cleaning..."; [buildStatusTarget setString:@"Clean"]; [buildButton setEnabled:NO]; _isCleaning = YES; @@ -574,7 +574,7 @@ stdErrorPipe = [[NSPipe alloc] init]; stdErrorHandle = [stdErrorPipe fileHandleForReading]; - [errorsCountField setStringValue:[NSString stringWithString:@""]]; + [errorsCountField setStringValue:@""]; errorsCount = 0; warningsCount = 0; @@ -732,8 +732,8 @@ - (void)updateErrorsCountField { NSString *string; - NSString *errorsString = [NSString stringWithString:@""]; - NSString *warningsString = [NSString stringWithString:@""]; + NSString *errorsString = @""; + NSString *warningsString = @""; if (errorsCount > 0) { @@ -744,7 +744,7 @@ } else { - errorsString = [NSString stringWithString:@"1 error"]; + errorsString = @"1 error"; } } @@ -757,7 +757,7 @@ } else { - warningsString = [NSString stringWithString:@"1 warning"]; + warningsString = @"1 warning"; } } @@ -1077,11 +1077,11 @@ - (NSArray *)parseErrorLine:(NSString *)string { NSArray *components = [string componentsSeparatedByString:@":"]; - NSString *file = [NSString stringWithString:@""]; - NSString *includedFile = [NSString stringWithString:@""]; - NSString *position = [NSString stringWithString:@"{x=0; y=0}"]; - NSString *type = [NSString stringWithString:@""]; - NSString *message = [NSString stringWithString:@""]; + NSString *file = @""; + NSString *includedFile = @""; + NSString *position = @"{x=0; y=0}"; + NSString *type = @""; + NSString *message = @""; NSMutableArray *items = [NSMutableArray arrayWithCapacity:1]; NSMutableDictionary *errorItem; NSString *indentString = @"\t"; diff --git a/Framework/PCProjectLauncher.m b/Framework/PCProjectLauncher.m index 959ebab..dc8367b 100644 --- a/Framework/PCProjectLauncher.m +++ b/Framework/PCProjectLauncher.m @@ -121,7 +121,7 @@ enum { NSMakeSize([stdOut frame].size.width, 1e7)]; // Font - string = [NSString stringWithString:@"=== Launcher ready ==="]; + string = @"=== Launcher ready ==="; attributedString = [[NSAttributedString alloc] initWithString:string attributes:textAttributes]; @@ -260,7 +260,7 @@ enum { gdbPath = [[[project projectManager] prefController] stringForKey:Debugger]; if (gdbPath == nil) { - gdbPath = [NSString stringWithString:@"/usr/bin/gdb"]; + gdbPath = @"/usr/bin/gdb"; } if ([fm isExecutableFileAtPath:gdbPath] == NO) diff --git a/Framework/PCProjectManager.m b/Framework/PCProjectManager.m index 7408b85..2dba378 100644 --- a/Framework/PCProjectManager.m +++ b/Framework/PCProjectManager.m @@ -451,7 +451,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; if ([projectClassName isEqualToString:@"PCGormProj"] || [projectClassName isEqualToString:@"PCAppProj"]) { - projectTypeName = [NSString stringWithString:@"Application"]; + projectTypeName = @"Application"; projectClassName = [projectTypes objectForKey:projectTypeName]; } @@ -948,12 +948,12 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; project = [activeProject superProject]; [self setActiveProject:project]; } - removeString = [NSString stringWithString:@"Remove subprojects..."]; + removeString = @"Remove subprojects..."; directory = [project dirForCategoryKey:categoryKey]; } else { - removeString = [NSString stringWithString:@"Remove files..."]; + removeString = @"Remove files..."; project = activeProject; } diff --git a/Modules/Projects/Application/PCAppProject.m b/Modules/Projects/Application/PCAppProject.m index 130ce77..3db4241 100644 --- a/Modules/Projects/Application/PCAppProject.m +++ b/Modules/Projects/Application/PCAppProject.m @@ -83,7 +83,7 @@ { PCFileManager *pcfm = [PCFileManager defaultManager]; NSMutableArray *otherRes = nil; - NSString *oldFile = [NSString stringWithString:@"Info-gnustep.plist"]; + NSString *oldFile = @"Info-gnustep.plist"; NSString *oldFilePath = nil; NSString *infoFile = nil; NSString *infoFilePath = nil; diff --git a/Modules/Projects/Tool/PCToolProject.m b/Modules/Projects/Tool/PCToolProject.m index afc4c32..26c62c2 100644 --- a/Modules/Projects/Tool/PCToolProject.m +++ b/Modules/Projects/Tool/PCToolProject.m @@ -83,7 +83,7 @@ { PCFileManager *pcfm = [PCFileManager defaultManager]; NSMutableArray *otherRes = nil; - NSString *oldFile = [NSString stringWithString:@"Info-gnustep.plist"]; + NSString *oldFile = @"Info-gnustep.plist"; NSString *oldFilePath = nil; NSString *infoFile = nil; NSString *infoFilePath = nil;