From 4e97f9028e6e76d3a3680a50d93227dc1459a865 Mon Sep 17 00:00:00 2001 From: ericwa Date: Tue, 6 Mar 2012 03:05:23 +0000 Subject: [PATCH] * Source/NSUserDefaults.m: * Source/NSConnection.m: * Source/NSCharacterSet.m: * Tools/make_strings/StringsFile.m: * Tools/pl.m: Fix instances where NSNotFound is stored in or compared to an unsigned or int variable. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34884 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 ++++++++ Source/NSCharacterSet.m | 38 ++++++++++++++++---------------- Source/NSConnection.m | 2 +- Source/NSUserDefaults.m | 2 +- Tools/make_strings/StringsFile.m | 2 +- Tools/pl.m | 4 ++-- 6 files changed, 33 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 579390b07..a736236cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-03-05 Eric Wasylishen + + * Source/NSUserDefaults.m: + * Source/NSConnection.m: + * Source/NSCharacterSet.m: + * Tools/make_strings/StringsFile.m: + * Tools/pl.m: Fix instances where NSNotFound is stored in or + compared to an unsigned or int variable. + 2012-03-05 Eric Wasylishen * Source/NSString.m: Factor out code for opening an ICU collator diff --git a/Source/NSCharacterSet.m b/Source/NSCharacterSet.m index 5e1c5c992..1db1253f8 100644 --- a/Source/NSCharacterSet.m +++ b/Source/NSCharacterSet.m @@ -332,10 +332,10 @@ length = [aString length]; if (length > 0) { - unsigned i; - unichar (*get)(id, SEL, unsigned); + NSUInteger i; + unichar (*get)(id, SEL, NSUInteger); - get = (unichar (*)(id, SEL, unsigned)) + get = (unichar (*)(id, SEL, NSUInteger)) [aString methodForSelector: @selector(characterAtIndex:)]; for (i = 0; i < length; i++) { @@ -502,10 +502,10 @@ length = [aString length]; if (length > 0) { - unsigned i; - unichar (*get)(id, SEL, unsigned); + NSUInteger i; + unichar (*get)(id, SEL, NSUInteger); - get = (unichar (*)(id, SEL, unsigned)) + get = (unichar (*)(id, SEL, NSUInteger)) [aString methodForSelector: @selector(characterAtIndex:)]; for (i = 0; i < length; i++) @@ -1227,7 +1227,7 @@ static Class concreteMutableClass = nil; { NSMutableBitmapCharSet *tmp; NSData *result; - unsigned index = 0; + NSUInteger index = 0; tmp = [NSMutableBitmapCharSet new]; while ((index = [indexes indexGreaterThanOrEqualToIndex: index]) @@ -1276,7 +1276,7 @@ static Class concreteMutableClass = nil; - (BOOL) hasMemberInPlane: (uint8_t)aPlane { - unsigned found; + NSUInteger found; found = [indexes indexGreaterThanOrEqualToIndex: 0x10000 * aPlane]; if (found != NSNotFound && found < 0x10000 * (aPlane + 1)) @@ -1417,10 +1417,10 @@ static Class concreteMutableClass = nil; length = [aString length]; if (length > 0) { - unsigned i; - unichar (*get)(id, SEL, unsigned); + NSUInteger i; + unichar (*get)(id, SEL, NSUInteger); - get = (unichar (*)(id, SEL, unsigned)) + get = (unichar (*)(id, SEL, NSUInteger)) [aString methodForSelector: @selector(characterAtIndex:)]; for (i = 0; i < length; i++) { @@ -1450,9 +1450,9 @@ static Class concreteMutableClass = nil; - (void) formIntersectionWithCharacterSet: (NSCharacterSet *)otherSet { NSIndexSet *otherIndexes; - unsigned index = 0; - unsigned i0; - unsigned i1; + NSUInteger index = 0; + NSUInteger i0; + NSUInteger i1; if ([otherSet isKindOfClass: [_GSIndexCharSet class]] == YES) { @@ -1521,7 +1521,7 @@ static Class concreteMutableClass = nil; - (void) formUnionWithCharacterSet: (NSCharacterSet*)otherSet { NSIndexSet *otherIndexes; - unsigned index; + NSUInteger index; if ([otherSet isKindOfClass: [_GSIndexCharSet class]] == YES) { @@ -1553,7 +1553,7 @@ static Class concreteMutableClass = nil; - (void) invert { NSMutableIndexSet *tmp; - unsigned index; + NSUInteger index; tmp = [NSMutableIndexSet new]; @@ -1614,10 +1614,10 @@ static Class concreteMutableClass = nil; length = [aString length]; if (length > 0) { - unsigned i; - unichar (*get)(id, SEL, unsigned); + NSUInteger i; + unichar (*get)(id, SEL, NSUInteger); - get = (unichar (*)(id, SEL, unsigned)) + get = (unichar (*)(id, SEL, NSUInteger)) [aString methodForSelector: @selector(characterAtIndex:)]; for (i = 0; i < length; i++) diff --git a/Source/NSConnection.m b/Source/NSConnection.m index ec890582a..5075351e5 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -1583,7 +1583,7 @@ static NSLock *cached_proxies_gate = nil; GS_M_LOCK(IrefGate); if (IrunLoops != nil) { - unsigned pos = [IrunLoops indexOfObjectIdenticalTo: loop]; + NSUInteger pos = [IrunLoops indexOfObjectIdenticalTo: loop]; if (pos != NSNotFound) { diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index 991c6fda2..570809494 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -1214,7 +1214,7 @@ newLanguages(NSArray *oldNames) - (void) addSuiteNamed: (NSString*)aName { - unsigned index; + NSUInteger index; if (aName == nil) { diff --git a/Tools/make_strings/StringsFile.m b/Tools/make_strings/StringsFile.m index 473439d93..730c5a1d1 100644 --- a/Tools/make_strings/StringsFile.m +++ b/Tools/make_strings/StringsFile.m @@ -127,7 +127,7 @@ static NSString *parse_string(NSString **ptr) NSMutableArray *update_list=[[NSMutableArray alloc] init]; NSArray *lines; NSString *l; - int i,c,pos; + NSInteger i,c,pos; NSMutableDictionary *dummy_entries=[[NSMutableDictionary alloc] init]; NSMutableString *user_comment=[[NSMutableString alloc] init]; diff --git a/Tools/pl.m b/Tools/pl.m index 50070fb2c..e1b322c52 100644 --- a/Tools/pl.m +++ b/Tools/pl.m @@ -39,7 +39,7 @@ void create_output(id propertyList) NSFileHandle *fileHandle = nil; NSProcessInfo *processInfo = [NSProcessInfo processInfo]; NSArray *arguments = [processInfo arguments]; - int outputIndex = 0; + NSInteger outputIndex = 0; // insert your code here outputIndex = [arguments indexOfObject: @"-output"]; @@ -94,7 +94,7 @@ NSData *read_input() NSFileHandle *fileHandle = nil; NSProcessInfo *processInfo = [NSProcessInfo processInfo]; NSArray *arguments = [processInfo arguments]; - int inputIndex = 0; + NSInteger inputIndex = 0; // insert your code here inputIndex = [arguments indexOfObject: @"-input"];