From c9fb0577bd1362294d16f0af3be3dead957275fd Mon Sep 17 00:00:00 2001 From: ericwa Date: Thu, 16 Sep 2010 02:55:24 +0000 Subject: [PATCH] Fix more unsigned int / int cases that should be NS[U]Integer git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31355 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 14 ++++++++++++++ Source/GSAttributedString.m | 8 ++++---- Source/GSSocketStream.m | 2 +- Source/NSAttributedString.m | 2 +- Source/NSKeyValueMutableArray.m | 22 +++++++++++----------- Source/NSKeyValueMutableSet.m | 4 ++-- Source/NSKeyedUnarchiver.m | 4 ++-- Source/NSPortCoder.m | 4 ++-- Source/NSSocketPort.m | 6 +++--- Source/NSUnarchiver.m | 2 +- Source/NSXMLParser.m | 30 +++++++++++++++--------------- 11 files changed, 56 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69a4d8a99..1d65a2876 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2010-09-15 Eric Wasylishen + + * Source/GSSocketStream.m: + * Source/NSPortCoder.m: + * Source/NSSocketPort.m: + * Source/NSAttributedString.m: + * Source/NSKeyValueMutableSet.m: + * Source/NSKeyedUnarchiver.m: + * Source/NSUnarchiver.m: + * Source/GSAttributedString.m: + * Source/NSKeyValueMutableArray.m: + * Source/NSXMLParser.m: Fix more unsigned int / ints that should + be NSUInteger/NSInteger + 2010-09-15 Eric Wasylishen * Source/objc-load.m: Don't compile the dynamic_handles code with libobjc2. diff --git a/Source/GSAttributedString.m b/Source/GSAttributedString.m index 8cf859167..1c183cbf0 100644 --- a/Source/GSAttributedString.m +++ b/Source/GSAttributedString.m @@ -71,7 +71,7 @@ static NSDictionary *blank; - (id) initWithString: (NSString*)aString attributes: (NSDictionary*)attributes; - (NSString*) string; -- (NSDictionary*) attributesAtIndex: (unsigned)index +- (NSDictionary*) attributesAtIndex: (NSUInteger)index effectiveRange: (NSRange*)aRange; @end @@ -86,7 +86,7 @@ static NSDictionary *blank; - (id) initWithString: (NSString*)aString attributes: (NSDictionary*)attributes; - (NSString*) string; -- (NSDictionary*) attributesAtIndex: (unsigned)index +- (NSDictionary*) attributesAtIndex: (NSUInteger)index effectiveRange: (NSRange*)aRange; - (void) setAttributes: (NSDictionary*) attributes range: (NSRange)range; @@ -496,7 +496,7 @@ _attributesAtIndexEffectiveRange( return AUTORELEASE([_textChars copyWithZone: NSDefaultMallocZone()]); } -- (NSDictionary*) attributesAtIndex: (unsigned)index +- (NSDictionary*) attributesAtIndex: (NSUInteger)index effectiveRange: (NSRange*)aRange { return _attributesAtIndexEffectiveRange( @@ -603,7 +603,7 @@ SANITY(); return _textProxy; } -- (NSDictionary*) attributesAtIndex: (unsigned)index +- (NSDictionary*) attributesAtIndex: (NSUInteger)index effectiveRange: (NSRange*)aRange { unsigned dummy; diff --git a/Source/GSSocketStream.m b/Source/GSSocketStream.m index a999fd176..5716b3ae8 100644 --- a/Source/GSSocketStream.m +++ b/Source/GSSocketStream.m @@ -1837,7 +1837,7 @@ setNonBlocking(SOCKET fd) return readLen; } -- (BOOL) getBuffer: (uint8_t **)buffer length: (unsigned int *)len +- (BOOL) getBuffer: (uint8_t **)buffer length: (NSUInteger *)len { return NO; } diff --git a/Source/NSAttributedString.m b/Source/NSAttributedString.m index efb7cd3e9..fa499fd21 100644 --- a/Source/NSAttributedString.m +++ b/Source/NSAttributedString.m @@ -1182,7 +1182,7 @@ appendUIntData(NSMutableData *d, NSUInteger i) return [[_owner string] smallestEncoding]; } -- (NSInteger) _baseLength +- (int) _baseLength { return [[_owner string] _baseLength]; } diff --git a/Source/NSKeyValueMutableArray.m b/Source/NSKeyValueMutableArray.m index 2a3bfdd5c..1da7e7a4e 100644 --- a/Source/NSKeyValueMutableArray.m +++ b/Source/NSKeyValueMutableArray.m @@ -130,7 +130,7 @@ return self; } -- (unsigned) count +- (NSUInteger) count { if (array == nil) { @@ -139,7 +139,7 @@ return [array count]; } -- (id) objectAtIndex: (unsigned)index +- (id) objectAtIndex: (NSUInteger)index { if (array == nil) { @@ -220,7 +220,7 @@ [super dealloc]; } -- (void) removeObjectAtIndex: (unsigned)index +- (void) removeObjectAtIndex: (NSUInteger)index { NSIndexSet *indexes = nil; @@ -241,7 +241,7 @@ } } -- (void) insertObject: (id)anObject atIndex: (unsigned)index +- (void) insertObject: (id)anObject atIndex: (NSUInteger)index { NSIndexSet *indexes = nil; @@ -263,7 +263,7 @@ } } -- (void) replaceObjectAtIndex: (unsigned)index withObject: (id)anObject +- (void) replaceObjectAtIndex: (NSUInteger)index withObject: (id)anObject { NSIndexSet *indexes = nil; BOOL triggerNotifications = !otherChangeInProgress; @@ -331,7 +331,7 @@ return self; } -- (void) removeObjectAtIndex: (unsigned)index +- (void) removeObjectAtIndex: (NSUInteger)index { NSIndexSet *indexes = nil; NSMutableArray *temp; @@ -358,7 +358,7 @@ } } -- (void) insertObject: (id)anObject atIndex: (unsigned)index +- (void) insertObject: (id)anObject atIndex: (NSUInteger)index { NSIndexSet *indexes = nil; NSMutableArray *temp; @@ -385,7 +385,7 @@ } } -- (void) replaceObjectAtIndex: (unsigned)index withObject: (id)anObject +- (void) replaceObjectAtIndex: (NSUInteger)index withObject: (id)anObject { NSIndexSet *indexes = nil; NSMutableArray *temp; @@ -469,7 +469,7 @@ forKey: key]; } -- (void) removeObjectAtIndex: (unsigned)index +- (void) removeObjectAtIndex: (NSUInteger)index { NSIndexSet *indexes = [NSIndexSet indexSetWithIndex: index]; @@ -482,7 +482,7 @@ forKey: key]; } -- (void) insertObject: (id)anObject atIndex: (unsigned)index +- (void) insertObject: (id)anObject atIndex: (NSUInteger)index { NSIndexSet *indexes = [NSIndexSet indexSetWithIndex: index]; @@ -508,7 +508,7 @@ forKey: key]; } -- (void) replaceObjectAtIndex: (unsigned)index withObject: (id)anObject +- (void) replaceObjectAtIndex: (NSUInteger)index withObject: (id)anObject { NSIndexSet *indexes = [NSIndexSet indexSetWithIndex: index]; diff --git a/Source/NSKeyValueMutableSet.m b/Source/NSKeyValueMutableSet.m index e5bec5ade..c7647e7ac 100644 --- a/Source/NSKeyValueMutableSet.m +++ b/Source/NSKeyValueMutableSet.m @@ -132,7 +132,7 @@ return self; } -- (unsigned) count +- (NSUInteger) count { if (set == nil) { @@ -583,7 +583,7 @@ return self; } -- (unsigned) count +- (NSUInteger) count { return [set count]; } diff --git a/Source/NSKeyedUnarchiver.m b/Source/NSKeyedUnarchiver.m index ff1057b07..e5db84098 100644 --- a/Source/NSKeyedUnarchiver.m +++ b/Source/NSKeyedUnarchiver.m @@ -377,7 +377,7 @@ static NSMapTable *globalClassMap = 0; } - (void) decodeArrayOfObjCType: (const char*)type - count: (unsigned)expected + count: (NSUInteger)expected at: (void*)buf { id o = [self decodeObject]; @@ -505,7 +505,7 @@ static NSMapTable *globalClassMap = 0; return (int)i; } -- (int) decodeIntegerForKey: (NSString*)aKey +- (NSInteger) decodeIntegerForKey: (NSString*)aKey { int64_t i = [self decodeInt64ForKey: aKey]; diff --git a/Source/NSPortCoder.m b/Source/NSPortCoder.m index b7a5ada9b..ffa900cac 100644 --- a/Source/NSPortCoder.m +++ b/Source/NSPortCoder.m @@ -425,7 +425,7 @@ static IMP _xRefImp; /* Serialize a crossref. */ } - (void) decodeArrayOfObjCType: (const char*)type - count: (unsigned)expected + count: (NSUInteger)expected at: (void*)buf { unsigned int i; @@ -1089,7 +1089,7 @@ static IMP _xRefImp; /* Serialize a crossref. */ } - (void) encodeArrayOfObjCType: (const char*)type - count: (unsigned)count + count: (NSUInteger)count at: (const void*)buf { unsigned i; diff --git a/Source/NSSocketPort.m b/Source/NSSocketPort.m index 9a516cbcd..0669c2dde 100644 --- a/Source/NSSocketPort.m +++ b/Source/NSSocketPort.m @@ -2286,16 +2286,16 @@ static Class tcpPortClass; * the start can be written directly without having to copy data to another * buffer etc. */ -- (unsigned int) reservedSpaceLength +- (NSUInteger) reservedSpaceLength { return sizeof(GSPortItemHeader) + sizeof(GSPortMsgHeader); } - (BOOL) sendBeforeDate: (NSDate*)when - msgid: (int)msgId + msgid: (NSInteger)msgId components: (NSMutableArray*)components from: (NSPort*)receivingPort - reserved: (unsigned)length + reserved: (NSUInteger)length { BOOL sent = NO; GSTcpHandle *h; diff --git a/Source/NSUnarchiver.m b/Source/NSUnarchiver.m index a9151d9c7..1cf9bfa54 100644 --- a/Source/NSUnarchiver.m +++ b/Source/NSUnarchiver.m @@ -521,7 +521,7 @@ static Class NSDataMallocClass; } - (void) decodeArrayOfObjCType: (const char*)type - count: (unsigned)expected + count: (NSUInteger)expected at: (void*)buf { unsigned int i; diff --git a/Source/NSXMLParser.m b/Source/NSXMLParser.m index 133ebec16..f52ccacfd 100644 --- a/Source/NSXMLParser.m +++ b/Source/NSXMLParser.m @@ -291,7 +291,7 @@ static NSNull *null = nil; * An entity definition has been parsed. */ - (void) entityDecl: (NSString*)name - type: (int)type + type: (NSInteger)type public: (NSString*)publicId system: (NSString*)systemId content: (NSString*)content @@ -300,8 +300,8 @@ static NSNull *null = nil; - (void) attributeDecl: (NSString*)nameElement name: (NSString*)name - type: (int)type - typeDefValue: (int)defType + type: (NSInteger)type + typeDefValue: (NSInteger)defType defaultValue: (NSString*)value { [_delegate parser: _owner @@ -312,7 +312,7 @@ static NSNull *null = nil; } - (void) elementDecl: (NSString*)name - type: (int)type + type: (NSInteger)type { [_delegate parser: _owner foundElementDeclarationWithName: name @@ -373,30 +373,30 @@ static NSNull *null = nil; [self error: e]; } - (void) warning: (NSString*)e - colNumber: (int)colNumber - lineNumber: (int)lineNumber + colNumber: (NSInteger)colNumber + lineNumber: (NSInteger)lineNumber { e = [NSString stringWithFormat: @"at line: %d column: %d ... %@", - lineNumber, colNumber, e]; + (int)lineNumber, (int)colNumber, e]; [self warning: e]; } - (void) error: (NSString*)e - colNumber: (int)colNumber - lineNumber: (int)lineNumber + colNumber: (NSInteger)colNumber + lineNumber: (NSInteger)lineNumber { e = [NSString stringWithFormat: @"at line: %d column: %d ... %@", - lineNumber, colNumber, e]; + (int)lineNumber, (int)colNumber, e]; [self error: e]; } - (void) fatalError: (NSString*)e - colNumber: (int)colNumber - lineNumber: (int)lineNumber + colNumber: (NSInteger)colNumber + lineNumber: (NSInteger)lineNumber { e = [NSString stringWithFormat: @"at line: %d column: %d ... %@", - lineNumber, colNumber, e]; + (int)lineNumber, (int)colNumber, e]; [self fatalError: e]; } -- (int) hasInternalSubset +- (NSInteger) hasInternalSubset { return 0; } @@ -406,7 +406,7 @@ static NSNull *null = nil; { return NO; } -- (int) hasExternalSubset +- (NSInteger) hasExternalSubset { return 0; }