diff --git a/AppKit/Win32.subproj/Win32EventInputSource.m b/AppKit/Win32.subproj/Win32EventInputSource.m index 156b8735..0141e3ec 100755 --- a/AppKit/Win32.subproj/Win32EventInputSource.m +++ b/AppKit/Win32.subproj/Win32EventInputSource.m @@ -40,7 +40,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return NO; } --(unsigned)waitForEventsAndMultipleObjects:(HANDLE *)objects count:(unsigned)count milliseconds:(DWORD)milliseconds { +-(NSUInteger)waitForEventsAndMultipleObjects:(HANDLE *)objects count:(NSUInteger)count milliseconds:(DWORD)milliseconds { if(count==0){ UINT timer=SetTimer(NULL,0,milliseconds,NULL); diff --git a/Cocoa/Cocoa.xcodeproj/project.pbxproj b/Cocoa/Cocoa.xcodeproj/project.pbxproj index 802bd593..cf63d0ce 100644 --- a/Cocoa/Cocoa.xcodeproj/project.pbxproj +++ b/Cocoa/Cocoa.xcodeproj/project.pbxproj @@ -47,28 +47,28 @@ isa = PBXContainerItemProxy; containerPortal = FE7135460B36427F006C9493 /* AppKit.xcodeproj */; proxyType = 2; - remoteGlobalIDString = C8A2E5730F07EA1F0054397C /* AppKit.framework */; + remoteGlobalIDString = C8A2E5730F07EA1F0054397C; remoteInfo = "AppKit-Darwin-i386"; }; C8E0BF960F0E6AF300677729 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = FE3217D10BB41D16004F000A /* ApplicationServices.xcodeproj */; proxyType = 2; - remoteGlobalIDString = C8A2E2900F07E9B70054397C /* ApplicationServices.framework */; + remoteGlobalIDString = C8A2E2900F07E9B70054397C; remoteInfo = "ApplicationServices-Darwin-i386"; }; C8E0BFAF0F0E6B6600677729 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = FE7135460B36427F006C9493 /* AppKit.xcodeproj */; proxyType = 1; - remoteGlobalIDString = C8A2E29F0F07EA1F0054397C /* AppKit-Darwin-i386 */; + remoteGlobalIDString = C8A2E29F0F07EA1F0054397C; remoteInfo = "AppKit-Darwin-i386"; }; C8E0BFB10F0E6B6C00677729 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = FE3217D10BB41D16004F000A /* ApplicationServices.xcodeproj */; proxyType = 1; - remoteGlobalIDString = C8A2E2710F07E9B70054397C /* ApplicationServices-Darwin-i386 */; + remoteGlobalIDString = C8A2E2710F07E9B70054397C; remoteInfo = "ApplicationServices-Darwin-i386"; }; FE01AB240C5D9C3500AEA51A /* PBXContainerItemProxy */ = { diff --git a/Foundation/NSArchiver.h b/Foundation/NSArchiver.h index 7279c1bb..b7349c96 100755 --- a/Foundation/NSArchiver.h +++ b/Foundation/NSArchiver.h @@ -13,10 +13,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @interface NSArchiver : NSCoder { NSMutableData *_data; - unsigned char *_bytes; + uint8_t *_bytes; NSUInteger _position; - unsigned _pass; + NSUInteger _pass; NSHashTable *_conditionals; NSHashTable *_objects; NSHashTable *_classes; diff --git a/Foundation/NSArchiver.m b/Foundation/NSArchiver.m index 540f69b0..72beb308 100755 --- a/Foundation/NSArchiver.m +++ b/Foundation/NSArchiver.m @@ -77,7 +77,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI _position=[_data length]; } --(void)_appendWordOne:(unsigned char)value { +-(void)_appendWordOne:(uint8_t)value { if(_pass==0) return; @@ -85,7 +85,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI _bytes[_position++]=value; } --(void)_appendWordTwo:(unsigned short)value { +-(void)_appendWordTwo:(uint16_t)value { if(_pass==0) return; @@ -94,7 +94,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI _bytes[_position++]=value&0xFF; } --(void)_appendWordFour:(unsigned)value { +-(void)_appendWordFour:(uint32_t)value { if(_pass==0) return; @@ -109,7 +109,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [self _appendWordFour:NSConvertHostFloatToSwapped(value).floatWord]; } --(void)_appendWordEight:(unsigned long long)value { +-(void)_appendWordEight:(uint64_t)value { if(_pass==0) return; @@ -124,7 +124,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI _bytes[_position++]=value&0xFF; } --(void)_appendBytes:(const char *)bytes length:(NSUInteger)length { +-(void)_appendBytes:(const uint8_t *)bytes length:(NSUInteger)length { int i; if(_pass==0) @@ -216,7 +216,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } } --(void)_appendArrayOfObjCType:(const char *)type length:(unsigned)length +-(void)_appendArrayOfObjCType:(const char *)type length:(NSUInteger)length at:(const void *)addr { if(_pass==0) @@ -226,7 +226,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI case 'c': case 'C':{ const unsigned char *values=addr; - int i; + NSInteger i; for(i=0;iextra[0], length); NSInteger i=state->extra[0]; - int j=0; + NSInteger j=0; state->itemsPtr=stackbuf; for(j=0; jcount;i++) if(self->objects) @@ -331,7 +331,7 @@ static inline void removeEntryAtIndex(NSRangeEntries *self,NSUInteger index){ } void NSRangeEntriesDump(NSRangeEntries *self) { - int i; + NSInteger i; NSLog(@"DUMP BEGIN"); for(i=0;icount;i++) @@ -346,8 +346,8 @@ NSLog(@"DUMP END"); void NSRangeEntriesVerify(NSRangeEntries *self,NSUInteger length) { #if 0 - unsigned last=0; - int i; + NSUInteger last=0; + NSInteger i; for(i=0;icount;i++){ NSRange range=self->entries[i].range; diff --git a/Foundation/NSByteOrder.m b/Foundation/NSByteOrder.m index 5679e714..732447b4 100755 --- a/Foundation/NSByteOrder.m +++ b/Foundation/NSByteOrder.m @@ -244,7 +244,7 @@ unsigned long NSSwapLong(unsigned long value){ unsigned long long NSSwapLongLong(unsigned long long valueX){ union { unsigned long long word; - unsigned char bytes[8]; + uint8_t bytes[8]; } value,result; value.word=valueX; diff --git a/Foundation/NSCharacterSet/NSCharacterSet.m b/Foundation/NSCharacterSet/NSCharacterSet.m index fb00f520..e95d79b6 100755 --- a/Foundation/NSCharacterSet/NSCharacterSet.m +++ b/Foundation/NSCharacterSet/NSCharacterSet.m @@ -176,7 +176,7 @@ static NSCharacterSet *sharedSetWithName(Class cls,NSString *name){ } -(NSCharacterSet *)invertedSet { - unsigned char *bitmap=bitmapBytes(self); + uint8_t *bitmap=bitmapBytes(self); NSUInteger i; for(i=0;i Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - Christopher Lloyd #import #import #import @@ -15,8 +13,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI /* I had an implementation in mind long ago but didn't finish it and now forget what it was exactly { - unsigned char _stageOne[256]; - unsigned char _stageTwo[8]; + uint8_t _stageOne[256]; + uint8_t _stageTwo[8]; } -(BOOL)characterIsMember:(unichar)character { @@ -37,8 +35,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @implementation NSCharacterSet_bitmap -initWithData:(NSData *)data { - const unsigned char *bytes=[data bytes]; - unsigned i; + const uint8_t *bytes=[data bytes]; + NSUInteger i; if([data length]!=NSBitmapCharacterSetSize) [NSException raise:@"NSCharacterSetFailedException" diff --git a/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.h b/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.h index 7196a6c5..a94a818b 100755 --- a/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.h +++ b/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.h @@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #import @interface NSMutableCharacterSet_bitmap : NSMutableCharacterSet { - unsigned char _bitmap[NSBitmapCharacterSetSize]; + uint8_t _bitmap[NSBitmapCharacterSetSize]; } -initWithCharacterSet:(NSCharacterSet *)set; diff --git a/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.m b/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.m index 4d10e1de..8afc66b5 100755 --- a/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.m +++ b/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.m @@ -35,7 +35,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } -initWithData:(NSData *)data { - const unsigned char *bytes=[data bytes]; + const uint8_t *bytes=[data bytes]; NSUInteger i; if([data length]!=NSBitmapCharacterSetSize) @@ -91,7 +91,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(void)formUnionWithCharacterSet:(NSCharacterSet *)other { BOOL (*method)()=(void *)[other methodForSelector:@selector(characterIsMember:)]; - unsigned code; + NSUInteger code; for(code=0;code<=0xFFFF;code++) if(method(other,@selector(characterIsMember:),(unichar)code)) @@ -120,7 +120,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(void)formIntersectionWithCharacterSet:(NSCharacterSet *)other { BOOL (*method)()=(void *)[other methodForSelector:@selector(characterIsMember:)]; - unsigned code; + NSUInteger code; for(code=0;code<=0xFFFF;code++) if(!method(other,@selector(characterIsMember:),(unichar)code)) diff --git a/Foundation/NSCharacterSet/bitmapRepresentation.h b/Foundation/NSCharacterSet/bitmapRepresentation.h index ab614e23..1af552af 100755 --- a/Foundation/NSCharacterSet/bitmapRepresentation.h +++ b/Foundation/NSCharacterSet/bitmapRepresentation.h @@ -12,19 +12,19 @@ enum { NSBitmapCharacterSetSize=8192 }; -static inline BOOL bitmapIsSet(unsigned char bitmap[8192],unichar character){ +static inline BOOL bitmapIsSet(uint8_t bitmap[8192],unichar character){ return bitmap[character>>3]&(1<<(character&0x07)); } -static inline void bitmapSet(unsigned char bitmap[8192],unichar character) { +static inline void bitmapSet(uint8_t bitmap[8192],unichar character) { bitmap[character>>3]|=1<<(character&0x07); } -static inline void bitmapClear(unsigned char bitmap[8192],unichar character) { +static inline void bitmapClear(uint8_t bitmap[8192],unichar character) { bitmap[character>>3]&=~(1<<(character&0x07)); } -static inline void bitmapEnable(unsigned char bitmap[8192],unichar character,BOOL yorn) { +static inline void bitmapEnable(uint8_t bitmap[8192],unichar character,BOOL yorn) { if(yorn) bitmap[character>>3]|=1<<(character&0x07); @@ -32,10 +32,10 @@ static inline void bitmapEnable(unsigned char bitmap[8192],unichar character,BOO bitmap[character>>3]&=~(1<<(character&0x07)); } -static inline unsigned char *bitmapBytes(NSCharacterSet *self){ +static inline uint8_t *bitmapBytes(NSCharacterSet *self){ BOOL (*method)()=(void *)[self methodForSelector:@selector(characterIsMember:)]; - unsigned char *bitmap=NSZoneMalloc(NULL,sizeof(unsigned char)*NSBitmapCharacterSetSize); - unsigned code; + uint8_t *bitmap=NSZoneMalloc(NULL,sizeof(uint8_t)*NSBitmapCharacterSetSize); + uint32_t code; for(code=0;code<=0xFFFF;code++) bitmapEnable(bitmap,code,method(self, diff --git a/Foundation/NSConnection/NSPort.h b/Foundation/NSConnection/NSPort.h index a7c1ef68..8fb32b83 100644 --- a/Foundation/NSConnection/NSPort.h +++ b/Foundation/NSConnection/NSPort.h @@ -32,7 +32,7 @@ FOUNDATION_EXPORT NSString *NSPortDidBecomeInvalidNotification; -(BOOL)sendBeforeDate:(NSDate *)beforeDate components:(NSMutableArray *)components from:(NSPort *)fromPort reserved:(NSUInteger)reservedSpace; --(BOOL)sendBeforeDate:(NSDate *)beforeData msgid:(unsigned)msgid components:(NSMutableArray *)components from:(NSPort *)fromPort reserved:(NSUInteger)reservedSpace; +-(BOOL)sendBeforeDate:(NSDate *)beforeData msgid:(NSUInteger)msgid components:(NSMutableArray *)components from:(NSPort *)fromPort reserved:(NSUInteger)reservedSpace; @end diff --git a/Foundation/NSConnection/NSPort.m b/Foundation/NSConnection/NSPort.m index 14149e51..20be5d94 100644 --- a/Foundation/NSConnection/NSPort.m +++ b/Foundation/NSConnection/NSPort.m @@ -70,7 +70,7 @@ NSString *NSPortDidBecomeInvalidNotification=@"NSPortDidBecomeInvalidNotificatio } --(BOOL)sendBeforeDate:(NSDate *)beforeData msgid:(unsigned)msgid components:(NSMutableArray *)components from:(NSPort *)fromPort reserved:(NSUInteger)reservedSpace { +-(BOOL)sendBeforeDate:(NSDate *)beforeData msgid:(NSUInteger)msgid components:(NSMutableArray *)components from:(NSPort *)fromPort reserved:(NSUInteger)reservedSpace { NSInvalidAbstractInvocation(); return NO; } diff --git a/Foundation/NSConnection/NSPortMessage.h b/Foundation/NSConnection/NSPortMessage.h index e7969eeb..7679203d 100644 --- a/Foundation/NSConnection/NSPortMessage.h +++ b/Foundation/NSConnection/NSPortMessage.h @@ -23,7 +23,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(NSPort *)sendPort; -(NSPort *)receivePort; --(void)setMsgid:(unsigned)msgid; +-(void)setMsgid:(uint32_t)msgid; -(BOOL)sendBeforeDate:(NSDate *)date; diff --git a/Foundation/NSConnection/NSPortMessage.m b/Foundation/NSConnection/NSPortMessage.m index 37709877..f2f6208b 100644 --- a/Foundation/NSConnection/NSPortMessage.m +++ b/Foundation/NSConnection/NSPortMessage.m @@ -43,7 +43,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return _receivePort; } --(void)setMsgid:(unsigned)msgid { +-(void)setMsgid:(uint32_t)msgid { _msgid=msgid; } diff --git a/Foundation/NSConnection/NSSocketPort.h b/Foundation/NSConnection/NSSocketPort.h index bc921072..a2400038 100644 --- a/Foundation/NSConnection/NSSocketPort.h +++ b/Foundation/NSConnection/NSSocketPort.h @@ -20,7 +20,7 @@ typedef int NSSocketNativeHandle; -init; -initRemoteWithProtocolFamily:(int)family socketType:(int)type protocol:(int)protocol address:(NSData *)address; --initRemoteWithTCPPort:(unsigned short)port host:(NSString *)hostName; +-initRemoteWithTCPPort:(uint16_t)port host:(NSString *)hostName; -initWithProtocolFamily:(int)family socketType:(int)type protocol:(int)protocol address:(NSData *)address; -initWithProtocolFamily:(int)family socketType:(int)type protocol:(int)protocol socket:(NSSocketNativeHandle)nativeSocket; diff --git a/Foundation/NSConnection/NSSocketPort.m b/Foundation/NSConnection/NSSocketPort.m index 16565743..419144ac 100644 --- a/Foundation/NSConnection/NSSocketPort.m +++ b/Foundation/NSConnection/NSSocketPort.m @@ -22,7 +22,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return nil; } --initRemoteWithTCPPort:(unsigned short)port host:(NSString *)hostName { +-initRemoteWithTCPPort:(uint16_t)port host:(NSString *)hostName { NSUnimplementedMethod(); return nil; } diff --git a/Foundation/NSData/NSData.m b/Foundation/NSData/NSData.m index 71c9e886..739da77f 100755 --- a/Foundation/NSData/NSData.m +++ b/Foundation/NSData/NSData.m @@ -263,7 +263,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI cString[pos++]='<'; for(i=0;i>4]; cString[pos++]=hex[byte&0x0F]; diff --git a/Foundation/NSDate/NSCalendar.h b/Foundation/NSDate/NSCalendar.h index 195d1bf4..ee835b07 100644 --- a/Foundation/NSDate/NSCalendar.h +++ b/Foundation/NSDate/NSCalendar.h @@ -15,8 +15,8 @@ typedef int NSCalendarUnit; @interface NSCalendar : NSObject { NSString *_identifier; - unsigned _firstWeekday; - unsigned _minimumDaysInFirstWeek; + NSUInteger _firstWeekday; + NSUInteger _minimumDaysInFirstWeek; NSTimeZone *_timeZone; NSLocale *_locale; } @@ -26,25 +26,25 @@ typedef int NSCalendarUnit; -initWithCalendarIdentifier:(NSString *)identifier; -(NSString *)calendarIdentifier; --(unsigned)firstWeekday; --(unsigned)minimumDaysInFirstWeek; +-(NSUInteger)firstWeekday; +-(NSUInteger)minimumDaysInFirstWeek; -(NSTimeZone *)timeZone; -(NSLocale *)locale; --(void)setFirstWeekday:(unsigned)weekday; --(void)setMinimumDaysInFirstWeek:(unsigned)days; +-(void)setFirstWeekday:(NSUInteger)weekday; +-(void)setMinimumDaysInFirstWeek:(NSUInteger)days; -(void)setTimeZone:(NSTimeZone *)timeZone; -(void)setLocale:(NSLocale *)locale; -(NSRange)minimumRangeOfUnit:(NSCalendarUnit)unit; -(NSRange)maximumRangeOfUnit:(NSCalendarUnit)unit; -(NSRange)rangeOfUnit:(NSCalendarUnit)unit inUnit:(NSCalendarUnit)inUnit forDate:(NSDate *)date; --(unsigned)ordinalityOfUnit:(NSCalendarUnit)unit inUnit:(NSCalendarUnit)inUnit forDate:(NSDate *)date; +-(NSUInteger)ordinalityOfUnit:(NSCalendarUnit)unit inUnit:(NSCalendarUnit)inUnit forDate:(NSDate *)date; --(NSDateComponents *)components:(unsigned)flags fromDate:(NSDate *)date; --(NSDateComponents *)components:(unsigned)flags fromDate:(NSDate *)fromDate toDate:(NSDate *)toDate options:(unsigned)options; +-(NSDateComponents *)components:(NSUInteger)flags fromDate:(NSDate *)date; +-(NSDateComponents *)components:(NSUInteger)flags fromDate:(NSDate *)fromDate toDate:(NSDate *)toDate options:(NSUInteger)options; --(NSDate *)dateByAddingComponents:(NSDateComponents *)components toDate:(NSDate *)date options:(unsigned)options; +-(NSDate *)dateByAddingComponents:(NSDateComponents *)components toDate:(NSDate *)date options:(NSUInteger)options; -(NSDate *)dateFromComponents:(NSDateComponents *)components; @end diff --git a/Foundation/NSDate/NSCalendar.m b/Foundation/NSDate/NSCalendar.m index 4c0f64ea..70dbc48a 100644 --- a/Foundation/NSDate/NSCalendar.m +++ b/Foundation/NSDate/NSCalendar.m @@ -33,11 +33,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return _identifier; } --(unsigned)firstWeekday { +-(NSUInteger)firstWeekday { return _firstWeekday; } --(unsigned)minimumDaysInFirstWeek { +-(NSUInteger)minimumDaysInFirstWeek { return _minimumDaysInFirstWeek; } @@ -49,11 +49,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return _locale; } --(void)setFirstWeekday:(unsigned)weekday { +-(void)setFirstWeekday:(NSUInteger)weekday { _firstWeekday=weekday; } --(void)setMinimumDaysInFirstWeek:(unsigned)days { +-(void)setMinimumDaysInFirstWeek:(NSUInteger)days { _minimumDaysInFirstWeek=days; } @@ -84,22 +84,22 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return NSMakeRange(0,0); } --(unsigned)ordinalityOfUnit:(NSCalendarUnit)unit inUnit:(NSCalendarUnit)inUnit forDate:(NSDate *)date { +-(NSUInteger)ordinalityOfUnit:(NSCalendarUnit)unit inUnit:(NSCalendarUnit)inUnit forDate:(NSDate *)date { NSUnimplementedMethod(); return 0; } --(NSDateComponents *)components:(unsigned)flags fromDate:(NSDate *)date { +-(NSDateComponents *)components:(NSUInteger)flags fromDate:(NSDate *)date { NSUnimplementedMethod(); return nil; } --(NSDateComponents *)components:(unsigned)flags fromDate:(NSDate *)fromDate toDate:(NSDate *)toDate options:(unsigned)options { +-(NSDateComponents *)components:(NSUInteger)flags fromDate:(NSDate *)fromDate toDate:(NSDate *)toDate options:(NSUInteger)options { NSUnimplementedMethod(); return nil; } --(NSDate *)dateByAddingComponents:(NSDateComponents *)components toDate:(NSDate *)date options:(unsigned)options { +-(NSDate *)dateByAddingComponents:(NSDateComponents *)components toDate:(NSDate *)date options:(NSUInteger)options { NSUnimplementedMethod(); return nil; } diff --git a/Foundation/NSDate/NSDate.m b/Foundation/NSDate/NSDate.m index ff2fbfd0..c3197704 100755 --- a/Foundation/NSDate/NSDate.m +++ b/Foundation/NSDate/NSDate.m @@ -141,7 +141,7 @@ const NSTimeInterval NSTimeIntervalSince1970 = (NSTimeInterval)978307200.0; } -(NSUInteger)hash { - return (int)[self timeIntervalSinceReferenceDate]; + return (NSUInteger)[self timeIntervalSinceReferenceDate]; } -(BOOL)isEqual:other { diff --git a/Foundation/NSDecimal/NSDecimalNumber.h b/Foundation/NSDecimal/NSDecimalNumber.h index 7c3fea2f..4bbcc530 100644 --- a/Foundation/NSDecimal/NSDecimalNumber.h +++ b/Foundation/NSDecimal/NSDecimalNumber.h @@ -21,12 +21,12 @@ FOUNDATION_EXPORT NSString *NSDecimalNumberExactnessException; } -initWithDecimal:(NSDecimal)decimal; --initWithMantissa:(unsigned long long)mantissa exponent:(short)exponent isNegative:(BOOL)flag; +-initWithMantissa:(uint64_t)mantissa exponent:(int16_t)exponent isNegative:(BOOL)flag; -initWithString:(NSString *)string; -initWithString:(NSString *)string locale:(NSDictionary *)locale; +(NSDecimalNumber *)decimalNumberWithDecimal:(NSDecimal)decimal; -+(NSDecimalNumber *)decimalNumberWithMantissa:(unsigned long long)mantissa exponent:(short)exponent isNegative:(BOOL)negative; ++(NSDecimalNumber *)decimalNumberWithMantissa:(uint64_t)mantissa exponent:(int16_t)exponent isNegative:(BOOL)negative; +(NSDecimalNumber *)decimalNumberWithString:(NSString *)string; +(NSDecimalNumber *)decimalNumberWithString:(NSString *)string locale:(NSDictionary *)locale; @@ -56,11 +56,11 @@ FOUNDATION_EXPORT NSString *NSDecimalNumberExactnessException; -(NSDecimalNumber *)decimalNumberByDividingBy:(NSDecimalNumber *)other; -(NSDecimalNumber *)decimalNumberByDividingBy:(NSDecimalNumber *)other withBehavior:(id )behavior; --(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power; --(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power withBehavior:(id )behavior; +-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(int16_t)power; +-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(int16_t)power withBehavior:(id )behavior; --(NSDecimalNumber *)decimalNumberByRaisingToPower:(unsigned)power; --(NSDecimalNumber *)decimalNumberByRaisingToPower:(unsigned)power withBehavior:(id )behavior; +-(NSDecimalNumber *)decimalNumberByRaisingToPower:(NSUInteger)power; +-(NSDecimalNumber *)decimalNumberByRaisingToPower:(NSUInteger)power withBehavior:(id )behavior; -(NSString *)descriptionWithLocale:(NSDictionary *)locale; diff --git a/Foundation/NSDecimal/NSDecimalNumber.m b/Foundation/NSDecimal/NSDecimalNumber.m index 115391ee..16fd998e 100644 --- a/Foundation/NSDecimal/NSDecimalNumber.m +++ b/Foundation/NSDecimal/NSDecimalNumber.m @@ -22,7 +22,7 @@ NSString *NSDecimalNumberExactnessException=@"NSDecimalNumberExactnessException" return nil; } --initWithMantissa:(unsigned long long)mantissa exponent:(short)exponent isNegative:(BOOL)flag { +-initWithMantissa:(uint64_t)mantissa exponent:(int16_t)exponent isNegative:(BOOL)flag { NSUnimplementedMethod(); return nil; } @@ -42,7 +42,7 @@ NSString *NSDecimalNumberExactnessException=@"NSDecimalNumberExactnessException" return nil; } -+(NSDecimalNumber *)decimalNumberWithMantissa:(unsigned long long)mantissa exponent:(short)exponent isNegative:(BOOL)negative { ++(NSDecimalNumber *)decimalNumberWithMantissa:(uint64_t)mantissa exponent:(int16_t)exponent isNegative:(BOOL)negative { NSUnimplementedMethod(); return nil; } @@ -150,12 +150,12 @@ NSString *NSDecimalNumberExactnessException=@"NSDecimalNumberExactnessException" return nil; } --(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power { +-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(int16_t)power { NSUnimplementedMethod(); return nil; } --(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power withBehavior:(id )behavior { +-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(int16_t)power withBehavior:(id )behavior { NSUnimplementedMethod(); return nil; } diff --git a/Foundation/NSDictionary/NSDictionary.m b/Foundation/NSDictionary/NSDictionary.m index e0457868..6f262252 100755 --- a/Foundation/NSDictionary/NSDictionary.m +++ b/Foundation/NSDictionary/NSDictionary.m @@ -259,7 +259,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } else { NSEnumerator *state=[self keyEnumerator]; - NSUInteger count=[self count]; + int count=[self count]; id key; [coder encodeValueOfObjCType:@encode(int) at:&count]; diff --git a/Foundation/NSDictionary/NSDictionary_mapTable.m b/Foundation/NSDictionary/NSDictionary_mapTable.m index bd098d12..abd683fe 100755 --- a/Foundation/NSDictionary/NSDictionary_mapTable.m +++ b/Foundation/NSDictionary/NSDictionary_mapTable.m @@ -27,7 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } -initWithObjects:(id *)objects forKeys:(id *)keys count:(NSUInteger)count { - int i; + NSInteger i; _table=NSCreateMapTableWithZone(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks,count,NULL); diff --git a/Foundation/NSEnumerator.m b/Foundation/NSEnumerator.m index 8096a187..4e8931b2 100755 --- a/Foundation/NSEnumerator.m +++ b/Foundation/NSEnumerator.m @@ -5,8 +5,6 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - Christopher Lloyd #import #import #import @@ -30,7 +28,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)length; { - int i; + NSInteger i; state->itemsPtr=stackbuf; state->mutationsPtr=(unsigned long *)self; diff --git a/Foundation/NSFileManager.h b/Foundation/NSFileManager.h index 3d54ed8b..467a8fc9 100755 --- a/Foundation/NSFileManager.h +++ b/Foundation/NSFileManager.h @@ -107,7 +107,7 @@ FOUNDATION_EXPORT NSString *NSFileSystemFreeSize; -(BOOL)changeFileAttributes:(NSDictionary *)attributes atPath:(NSString *)path; -(const char *)fileSystemRepresentationWithPath:(NSString *)path; --(const unsigned short *)fileSystemRepresentationWithPathW:(NSString *)path; +-(const uint16_t *)fileSystemRepresentationWithPathW:(NSString *)path; @end @@ -131,10 +131,10 @@ FOUNDATION_EXPORT NSString *NSFileSystemFreeSize; @interface NSDictionary(NSFileManager_fileAttributes) -(NSDate *)fileModificationDate; --(unsigned long)filePosixPermissions; +-(NSUInteger)filePosixPermissions; -(NSString *)fileOwnerAccountName; -(NSString *)fileGroupOwnerAccountName; -(NSString *)fileType; --(unsigned long long)fileSize; +-(uint64_t)fileSize; @end diff --git a/Foundation/NSFileManager.m b/Foundation/NSFileManager.m index f32bc957..3a372455 100755 --- a/Foundation/NSFileManager.m +++ b/Foundation/NSFileManager.m @@ -277,7 +277,7 @@ stringByAppendingPathComponent:[files objectAtIndex:x]] paths:paths]; return NULL; } --(const unsigned short *)fileSystemRepresentationWithPathW:(NSString *)path { +-(const uint16_t *)fileSystemRepresentationWithPathW:(NSString *)path { NSInvalidAbstractInvocation(); return NULL; } @@ -291,8 +291,8 @@ stringByAppendingPathComponent:[files objectAtIndex:x]] paths:paths]; return [self objectForKey:NSFileModificationDate]; } --(unsigned long)filePosixPermissions { - return [[self objectForKey:NSFilePosixPermissions] unsignedLongValue]; +-(NSUInteger)filePosixPermissions { + return [[self objectForKey:NSFilePosixPermissions] unsignedIntegerValue]; } -(NSString *)fileOwnerAccountName { @@ -307,7 +307,7 @@ stringByAppendingPathComponent:[files objectAtIndex:x]] paths:paths]; return [self objectForKey:NSFileType]; } --(unsigned long long)fileSize { +-(uint64_t)fileSize { return [[self objectForKey:NSFileSize] unsignedLongLongValue]; } diff --git a/Foundation/NSIndexSet/NSIndexSet.m b/Foundation/NSIndexSet/NSIndexSet.m index 76e586ac..9eb51432 100644 --- a/Foundation/NSIndexSet/NSIndexSet.m +++ b/Foundation/NSIndexSet/NSIndexSet.m @@ -24,7 +24,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } -initWithIndexSet:(NSIndexSet *)other { - int i; + NSInteger i; _length=other->_length; _ranges=NSZoneMalloc([self zone],sizeof(NSRange)*((_length==0)?1:_length)); @@ -63,7 +63,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } -(BOOL)isEqualToIndexSet:(NSIndexSet *)other { - int i; + NSInteger i; if(_length!=other->_length) return NO; @@ -77,7 +77,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(NSUInteger)count { NSUInteger result=0; - int i; + NSInteger i; for(i=0;i<_length;i++) result+=_ranges[i].length; @@ -166,7 +166,7 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges,NSUIn } -(BOOL)containsIndexes:(NSIndexSet *)other { - int i; + NSInteger i; for(i=0;i_length;i++) if(![self containsIndexesInRange:other->_ranges[i]]) @@ -261,7 +261,7 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges,NSUIn -(NSString *)description { NSMutableString *result=[NSMutableString string]; - int i; + NSInteger i; [result appendString:[super description]]; [result appendFormat:@"[number of indexes: %d (in %d ranges), indexes: (",[self count],_length]; diff --git a/Foundation/NSInvocation.h b/Foundation/NSInvocation.h index 3645e45b..5502afb4 100755 --- a/Foundation/NSInvocation.h +++ b/Foundation/NSInvocation.h @@ -14,14 +14,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI NSMethodSignature *_signature; NSUInteger _returnSize; - unsigned char *_returnValue; + uint8_t *_returnValue; NSUInteger _argumentFrameSize; NSUInteger *_argumentSizes; NSUInteger *_argumentOffsets; - unsigned char *_argumentFrame; + uint8_t *_argumentFrame; - unsigned _retainArguments:1; + BOOL _retainArguments; } +(NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)signature; diff --git a/Foundation/NSInvocation.m b/Foundation/NSInvocation.m index 2c959737..e460d5d8 100755 --- a/Foundation/NSInvocation.m +++ b/Foundation/NSInvocation.m @@ -40,7 +40,7 @@ id objc_msg_sendv(id self, SEL selector, unsigned arg_size, void *arg_frame); _argumentOffsets[i]=_argumentFrameSize; NSGetSizeAndAlignment([_signature getArgumentTypeAtIndex:i],&naturalSize,&align); - promotedSize=((naturalSize+sizeof(int)-1)/sizeof(int))*sizeof(int); + promotedSize=((naturalSize+sizeof(long)-1)/sizeof(long))*sizeof(long); _argumentSizes[i]=naturalSize; _argumentFrameSize+=promotedSize; @@ -66,7 +66,7 @@ id objc_msg_sendv(id self, SEL selector, unsigned arg_size, void *arg_frame); -initWithMethodSignature:(NSMethodSignature *)signature arguments:(void *)arguments { unsigned i; - unsigned char *stackFrame=arguments; + uint8_t *stackFrame=arguments; [self initWithMethodSignature:signature]; @@ -77,7 +77,7 @@ id objc_msg_sendv(id self, SEL selector, unsigned arg_size, void *arg_frame); } -(void)dealloc { - if (_retainArguments == YES) { + if (_retainArguments) { NSInteger i, count = [_signature numberOfArguments]; for (i = 0; i < count; ++i) { @@ -209,12 +209,12 @@ static void byteCopy(void *src,void *dst,NSUInteger length){ -(void)getArgument:(void *)pointerToValue atIndex:(NSInteger)index { NSUInteger naturalSize=_argumentSizes[index]; - NSUInteger promotedSize=((naturalSize+sizeof(int)-1)/sizeof(int))*sizeof(int); + NSUInteger promotedSize=((naturalSize+sizeof(long)-1)/sizeof(long))*sizeof(long); if(naturalSize==promotedSize) byteCopy(_argumentFrame+_argumentOffsets[index],pointerToValue,naturalSize); else if(promotedSize==4){ - unsigned char promoted[promotedSize]; + uint8_t promoted[promotedSize]; byteCopy(_argumentFrame+_argumentOffsets[index],promoted,promotedSize); if(naturalSize==1) @@ -232,12 +232,12 @@ static void byteCopy(void *src,void *dst,NSUInteger length){ -(void)setArgument:(void *)pointerToValue atIndex:(NSInteger)index { NSUInteger naturalSize=_argumentSizes[index]; - NSUInteger promotedSize=((naturalSize+sizeof(int)-1)/sizeof(int))*sizeof(int); + NSUInteger promotedSize=((naturalSize+sizeof(long)-1)/sizeof(long))*sizeof(long); if(naturalSize==promotedSize) byteCopy(pointerToValue,_argumentFrame+_argumentOffsets[index],naturalSize); else if(promotedSize==4){ - unsigned char promoted[promotedSize]; + uint8_t promoted[promotedSize]; if(naturalSize==1) *((int *)promoted)=*((char *)pointerToValue); @@ -254,7 +254,7 @@ static void byteCopy(void *src,void *dst,NSUInteger length){ } -(void)retainArguments { - if (_retainArguments == NO) { + if (!_retainArguments) { NSInteger i, count = [_signature numberOfArguments]; _retainArguments=YES; diff --git a/Foundation/NSKeyedArchiving/NSKeyedArchiver.h b/Foundation/NSKeyedArchiving/NSKeyedArchiver.h index b58f65be..492ce6c1 100644 --- a/Foundation/NSKeyedArchiving/NSKeyedArchiver.h +++ b/Foundation/NSKeyedArchiving/NSKeyedArchiver.h @@ -21,7 +21,7 @@ FOUNDATION_EXPORT NSString *NSInvalidArchiveOperationException; id _delegate; NSPropertyListFormat _outputFormat; NSMapTable *_nameToClass; - unsigned _pass; + NSUInteger _pass; NSMapTable *_objectToUid; } diff --git a/Foundation/NSKeyedArchiving/NSKeyedArchiver.m b/Foundation/NSKeyedArchiving/NSKeyedArchiver.m index e894e48e..51379982 100644 --- a/Foundation/NSKeyedArchiving/NSKeyedArchiver.m +++ b/Foundation/NSKeyedArchiving/NSKeyedArchiver.m @@ -134,14 +134,14 @@ static NSMapTable *_globalNameToClass=NULL; [[_plistStack lastObject] setObject:[NSNumber numberWithInt:value] forKey:key]; } --(void)encodeInt32:(int)value forKey:(NSString *)key { +-(void)encodeInt32:(int32_t)value forKey:(NSString *)key { if(_pass==0) return; [[_plistStack lastObject] setObject:[NSNumber numberWithInt:value] forKey:key]; } --(void)encodeInt64:(long long)value forKey:(NSString *)key { +-(void)encodeInt64:(int64_t)value forKey:(NSString *)key { if(_pass==0) return; diff --git a/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.h b/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.h index 85c656f1..5ac52374 100644 --- a/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.h +++ b/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.h @@ -32,8 +32,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(double)decodeDoubleForKey:(NSString *)key; -(float)decodeFloatForKey:(NSString *)key; -(int)decodeIntForKey:(NSString *)key; --(int)decodeInt32ForKey:(NSString *)key; --(int)decodeInt64ForKey:(NSString *)key; +-(int32_t)decodeInt32ForKey:(NSString *)key; +-(int64_t)decodeInt64ForKey:(NSString *)key; -decodeObjectForKey:(NSString *)key; -(void)finishDecoding; diff --git a/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.m b/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.m index 152a2291..7ad2bdf1 100644 --- a/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.m +++ b/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.m @@ -198,7 +198,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return [number intValue]; } --(int)decodeInt32ForKey:(NSString *)key { +-(int32_t)decodeInt32ForKey:(NSString *)key { NSNumber *number=[self _numberForKey:key]; if(number==nil) @@ -207,7 +207,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return [number intValue]; } --(int)decodeInt64ForKey:(NSString *)key { +-(int64_t)decodeInt64ForKey:(NSString *)key { NSNumber *number=[self _numberForKey:key]; if(number==nil) diff --git a/Foundation/NSMethodSignature.m b/Foundation/NSMethodSignature.m index 956795da..e59dbf64 100755 --- a/Foundation/NSMethodSignature.m +++ b/Foundation/NSMethodSignature.m @@ -98,7 +98,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI NSUInteger promotedSize; NSGetSizeAndAlignment([self getArgumentTypeAtIndex:i],&naturalSize,&align); - promotedSize=((naturalSize+sizeof(int)-1)/sizeof(int))*sizeof(int); + promotedSize=((naturalSize+sizeof(long)-1)/sizeof(long))*sizeof(long); result+=promotedSize; } diff --git a/Foundation/NSNetService/NSNetServices.m b/Foundation/NSNetService/NSNetServices.m index 31464f95..f630f6d7 100644 --- a/Foundation/NSNetService/NSNetServices.m +++ b/Foundation/NSNetService/NSNetServices.m @@ -232,7 +232,6 @@ static void QueryCallback(bonjour_DNSServiceRef sdRef,bonjour_DNSServiceFlags fl interface: (uint32_t) interfaceIndex { NSMutableArray *addresses = [_info objectForKey: @"Addresses"]; - const unsigned char *rd = rdata; NSData *data = nil; if( nil == addresses ){ @@ -242,12 +241,12 @@ static void QueryCallback(bonjour_DNSServiceRef sdRef,bonjour_DNSServiceFlags fl switch( rrtype ){ case kDNSServiceType_A: // AF_INET - data=NSSocketAddressDataForNetworkOrderAddressBytesAndPort(rd,4,_port); + data=NSSocketAddressDataForNetworkOrderAddressBytesAndPort(rdata,4,_port); break; case kDNSServiceType_AAAA: // AF_INET6 case kDNSServiceType_A6: // deprecates AAAA - data=NSSocketAddressDataForNetworkOrderAddressBytesAndPort(rd,16,_port); + data=NSSocketAddressDataForNetworkOrderAddressBytesAndPort(rdata,16,_port); break; default: @@ -404,7 +403,7 @@ static void QueryCallback(bonjour_DNSServiceRef sdRef,bonjour_DNSServiceFlags fl [self _didPublish]; } --(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(unsigned)selectEvent { +-(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(NSUInteger)selectEvent { if(selectEvent&NSSelectReadEvent){ @@ -1149,7 +1148,7 @@ static void BrowserCallback(bonjour_DNSServiceRef sdRef,bonjour_DNSServiceFlags } } --(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(unsigned)selectEvent { +-(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(NSUInteger)selectEvent { if(selectEvent&NSSelectReadEvent){ bonjour_DNSServiceErrorType err = bonjour_DNSServiceProcessResult(_netServiceBrowser); diff --git a/Foundation/NSNumberFormatter.m b/Foundation/NSNumberFormatter.m index 469ffb14..4e31c674 100755 --- a/Foundation/NSNumberFormatter.m +++ b/Foundation/NSNumberFormatter.m @@ -652,9 +652,9 @@ Aug 10 14:40:35 formatters[12645] 0.11111: $ unichar *outputBuffer = NSAllocateMemoryPages([format length]+64); BOOL isNegative = [stringValue hasPrefix:@"-"]; BOOL done = NO; - unsigned formatIndex, valueIndex = 0, outputIndex = 0; - unsigned prePoint, postPoint; - int thousandSepCounter; + NSUInteger formatIndex, valueIndex = 0, outputIndex = 0; + NSUInteger prePoint, postPoint; + NSInteger thousandSepCounter; // remove - if (isNegative) @@ -752,7 +752,7 @@ Aug 10 14:40:35 formatters[12645] 0.11111: $ NSString *rightSide = nil, *leftSide = nil; NSMutableString *result = [NSMutableString string]; NSRange r; - unsigned i, indexRight = 0; + NSUInteger i, indexRight = 0; BOOL formatNoDecPoint = ([format rangeOfString:@"."].location == NSNotFound); BOOL havePassedDecPoint = NO; NSInteger lastPlaceholder = 0; @@ -872,7 +872,7 @@ Aug 10 14:40:35 formatters[12645] 0.11111: $ NSMutableCharacterSet *digitsAndSeparators = [[[NSCharacterSet decimalDigitCharacterSet] mutableCopy] autorelease]; NSMutableString *mutableString = [[string mutableCopy] autorelease]; unichar thousandSeparator = [_thousandSeparator characterAtIndex:0]; - unsigned i; + NSUInteger i; [digitsAndSeparators addCharactersInString:_decimalSeparator]; [digitsAndSeparators addCharactersInString:_thousandSeparator]; diff --git a/Foundation/NSObject/NSObject.h b/Foundation/NSObject/NSObject.h index 8059f184..869ec99a 100755 --- a/Foundation/NSObject/NSObject.h +++ b/Foundation/NSObject/NSObject.h @@ -59,8 +59,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI Class isa; } -+(int)version; -+(void)setVersion:(int)version; ++(NSInteger)version; ++(void)setVersion:(NSInteger)version; +(void)load; diff --git a/Foundation/NSObject/NSObject.m b/Foundation/NSObject/NSObject.m index ad012941..1e654556 100755 --- a/Foundation/NSObject/NSObject.m +++ b/Foundation/NSObject/NSObject.m @@ -36,12 +36,12 @@ BOOL NSObjectIsKindOfClass(id object,Class kindOf) { @implementation NSObject -+(int)version { ++(NSInteger)version { return class_getVersion(self); } -+(void)setVersion:(int)version { ++(void)setVersion:(NSInteger)version { class_setVersion(self,version); } diff --git a/Foundation/NSObject/forwarding.m b/Foundation/NSObject/forwarding.m index 4ef65b2b..0efb7da0 100644 --- a/Foundation/NSObject/forwarding.m +++ b/Foundation/NSObject/forwarding.m @@ -1,10 +1,20 @@ #import +#import +#import -#if 0 +#define NSABISizeofRegisterReturn 8 +#define NSABIasm_jmp_objc_msgSend __asm__("jmp _objc_msgSend") +#define NSABIasm_jmp_objc_msgSend_stret __asm__("jmp _objc_msgSend_stret") + +#if 1 @interface NSObject(fastforwarding) -forwardingTargetForSelector:(SEL)selector; @end +@interface NSInvocation(private) ++(NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)signature arguments:(void *)arguments; +@end + id NSObjCGetFastForwardTarget(id object,SEL selector){ id check=nil; @@ -15,36 +25,51 @@ id NSObjCGetFastForwardTarget(id object,SEL selector){ return check; } +void NSObjCForwardInvocation(void *returnValue,id object,SEL selector,va_list arguments){ + NSMethodSignature *signature=[object methodSignatureForSelector:selector]; + + if(signature==nil) + [object doesNotRecognizeSelector:selector]; + else { + NSInvocation *invocation=[NSInvocation invocationWithMethodSignature:signature arguments:arguments]; + + [object forwardInvocation:invocation]; + [invocation getReturnValue:returnValue]; + } +} + void NSObjCForward(id object,SEL selector,...){ - id check=NSObjCGetFastForwardFunction(object,selector); + id check=NSObjCGetFastForwardTarget(object,selector); if(check!=nil){ object=check; - ;// jmp objc_msgSend + NSABIasm_jmp_objc_msgSend; } + uint8_t returnValue[NSABISizeofRegisterReturn]; + va_list arguments; va_start(arguments,selector); - NSObjCForwardInvocation(object,selector,arguments); + NSObjCForwardInvocation(returnValue,object,selector,arguments); va_end(arguments); } -void NSObjCForward_stret(void *value,id object,SEL selector,...){ - id check=NSObjCGetFastForwardFunction(object,selector); +void NSObjCForward_stret(void *returnValue,id object,SEL selector,...){ + id check=NSObjCGetFastForwardTarget(object,selector); if(check!=nil){ object=check; - ;// jmp objc_msgSend_stret + NSABIasm_jmp_objc_msgSend_stret; } va_list arguments; va_start(arguments,selector); - NSObjCForwardInvocation(object,selector,arguments); + NSObjCForwardInvocation(returnValue,object,selector,arguments); va_end(arguments); } diff --git a/Foundation/NSObject/msgSendv-solaris.m b/Foundation/NSObject/msgSendv-solaris.m index dc5eae98..3e1f6405 100755 --- a/Foundation/NSObject/msgSendv-solaris.m +++ b/Foundation/NSObject/msgSendv-solaris.m @@ -8,8 +8,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #import // how lame but this is all I need, sparc passes arguments in registers -id objc_msg_sendv(id self, SEL selector, unsigned arg_size, void *arg_frame) { - unsigned *argWords=arg_frame; +id objc_msg_sendv(id self, SEL selector, uint32_t arg_size, void *arg_frame) { + uint32_t *argWords=arg_frame; IMP method=objc_msg_lookup(self,selector); arg_size/=sizeof(int); diff --git a/Foundation/NSPortNameServer/NSSocketPortNameServer.h b/Foundation/NSPortNameServer/NSSocketPortNameServer.h index 7576437f..2e5b6a11 100644 --- a/Foundation/NSPortNameServer/NSSocketPortNameServer.h +++ b/Foundation/NSPortNameServer/NSSocketPortNameServer.h @@ -14,16 +14,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI +sharedInstance; --(unsigned short)defaultNameServerPortNumber; +-(uint16_t)defaultNameServerPortNumber; --(void)setDefaultNameServerPortNumber:(unsigned short)number; +-(void)setDefaultNameServerPortNumber:(uint16_t)number; --(NSPort *)portForName:(NSString *)name host:(NSString *)host nameServerPortNumber:(unsigned short)number; +-(NSPort *)portForName:(NSString *)name host:(NSString *)host nameServerPortNumber:(uint16_t)number; -(NSPort *)portForName:(NSString *)name host:(NSString *)host; -(NSPort *)portForName:(NSString *)name; -(BOOL)registerPort:(NSPort *)port name:(NSString *)name; --(BOOL)registerPort:(NSPort *)port name:(NSString *)name nameServerPortNumber:(unsigned short)number; +-(BOOL)registerPort:(NSPort *)port name:(NSString *)name nameServerPortNumber:(uint16_t)number; -(BOOL)removePortForName:(NSString *)name; diff --git a/Foundation/NSPortNameServer/NSSocketPortNameServer.m b/Foundation/NSPortNameServer/NSSocketPortNameServer.m index 48a1974f..d9b51b2c 100644 --- a/Foundation/NSPortNameServer/NSSocketPortNameServer.m +++ b/Foundation/NSPortNameServer/NSSocketPortNameServer.m @@ -16,16 +16,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return 0; } --(unsigned short)defaultNameServerPortNumber { +-(uint16_t)defaultNameServerPortNumber { NSUnimplementedMethod(); return 0; } --(void)setDefaultNameServerPortNumber:(unsigned short)number { +-(void)setDefaultNameServerPortNumber:(uint16_t)number { NSUnimplementedMethod(); } --(NSPort *)portForName:(NSString *)name host:(NSString *)host nameServerPortNumber:(unsigned short)number { +-(NSPort *)portForName:(NSString *)name host:(NSString *)host nameServerPortNumber:(uint16_t)number { NSUnimplementedMethod(); return 0; } @@ -45,7 +45,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return 0; } --(BOOL)registerPort:(NSPort *)port name:(NSString *)name nameServerPortNumber:(unsigned short)number { +-(BOOL)registerPort:(NSPort *)port name:(NSString *)name nameServerPortNumber:(uint16_t)number { NSUnimplementedMethod(); return 0; } diff --git a/Foundation/NSPredicate/NSComparisonPredicate.h b/Foundation/NSPredicate/NSComparisonPredicate.h index f86a75d5..04319fef 100644 --- a/Foundation/NSPredicate/NSComparisonPredicate.h +++ b/Foundation/NSPredicate/NSComparisonPredicate.h @@ -41,14 +41,14 @@ enum { NSComparisonPredicateModifier _modifier; NSPredicateOperatorType _type; - unsigned _options; + NSUInteger _options; SEL _customSelector; } --initWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(unsigned)options; +-initWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(NSUInteger)options; -initWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right customSelector:(SEL)selector; -+(NSPredicate *)predicateWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(unsigned)options; ++(NSPredicate *)predicateWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(NSUInteger)options; +(NSPredicate *)predicateWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right customSelector:(SEL)selector; -(NSExpression *)leftExpression; @@ -56,7 +56,7 @@ enum { -(NSPredicateOperatorType)predicateOperatorType; -(NSComparisonPredicateModifier)comparisonPredicateModifier; --(unsigned)options; +-(NSUInteger)options; -(SEL)customSelector; diff --git a/Foundation/NSPredicate/NSComparisonPredicate.m b/Foundation/NSPredicate/NSComparisonPredicate.m index a9e43336..9d8f2c47 100644 --- a/Foundation/NSPredicate/NSComparisonPredicate.m +++ b/Foundation/NSPredicate/NSComparisonPredicate.m @@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @implementation NSComparisonPredicate --initWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(unsigned)options { +-initWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(NSUInteger)options { _left=[left retain]; _right=[right retain]; _modifier=modifier; @@ -56,7 +56,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return [self retain]; } -+(NSPredicate *)predicateWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(unsigned)options { ++(NSPredicate *)predicateWithLeftExpression:(NSExpression *)left rightExpression:(NSExpression *)right modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(NSUInteger)options { return [[[self alloc] initWithLeftExpression:left rightExpression:right modifier:modifier type:type options:options] autorelease]; } @@ -176,7 +176,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return _modifier; } --(unsigned)options { +-(NSUInteger)options { return _options; } @@ -186,7 +186,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(BOOL)_evaluateValue:leftResult withObject:object { id rightResult=[_right expressionValueWithObject:object context:nil]; - unsigned compareOptions=0; + NSUInteger compareOptions=0; BOOL selfIsNil = (leftResult == nil || [leftResult isEqual:[NSNull null]]); BOOL objectIsNil = (rightResult == nil || [rightResult isEqual:[NSNull null]]); diff --git a/Foundation/NSPredicate/NSPredicate.m b/Foundation/NSPredicate/NSPredicate.m index 2543d15d..da5798cb 100644 --- a/Foundation/NSPredicate/NSPredicate.m +++ b/Foundation/NSPredicate/NSPredicate.m @@ -1297,7 +1297,7 @@ static NSPredicate *nextComparisonPredicate(predicateScanner *scanner){ NSExpression *right; NSPredicate *result; NSPredicateOperatorType type; - auto unsigned options; + unsigned options; switch(peekTokenType(scanner)){ diff --git a/Foundation/NSProcessInfo.h b/Foundation/NSProcessInfo.h index 64001e23..9cef33c1 100755 --- a/Foundation/NSProcessInfo.h +++ b/Foundation/NSProcessInfo.h @@ -30,7 +30,7 @@ enum { -(NSUInteger)processorCount; -(NSUInteger)activeProcessorCount; --(unsigned long long)physicalMemory; +-(uint64_t)physicalMemory; -(NSUInteger)operatingSystem; -(NSString *)operatingSystemName; diff --git a/Foundation/NSProcessInfo.m b/Foundation/NSProcessInfo.m index 4b19a2f2..5355a423 100755 --- a/Foundation/NSProcessInfo.m +++ b/Foundation/NSProcessInfo.m @@ -56,7 +56,7 @@ const char * const *NSProcessInfoArgv=NULL; return 0; } --(unsigned long long)physicalMemory { +-(uint64_t)physicalMemory { NSUnimplementedMethod(); return 0; } diff --git a/Foundation/NSPropertyList/NSOldXMLReader.h b/Foundation/NSPropertyList/NSOldXMLReader.h index 5d8a968b..248ae1dc 100755 --- a/Foundation/NSPropertyList/NSOldXMLReader.h +++ b/Foundation/NSPropertyList/NSOldXMLReader.h @@ -15,7 +15,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @interface NSOldXMLReader : NSString { NSData *_data; - const unsigned char *_bytes; + const uint8_t *_bytes; NSUInteger _length; NSRange _range; diff --git a/Foundation/NSPropertyList/NSOldXMLReader.m b/Foundation/NSPropertyList/NSOldXMLReader.m index 276cad4a..99e8a369 100755 --- a/Foundation/NSPropertyList/NSOldXMLReader.m +++ b/Foundation/NSPropertyList/NSOldXMLReader.m @@ -93,7 +93,7 @@ enum { } -(void)getCharacters:(unichar *)buffer { - unsigned i; + NSUInteger i; for(i=0;i<_range.length;i++) buffer[i]=_bytes[_range.location+i]; @@ -189,13 +189,13 @@ enum { return result; } -static inline BOOL codeIsWhitespace(unsigned char code){ +static inline BOOL codeIsWhitespace(uint8_t code){ if(code==0x20 || code==0x0A || code==0x0D || code==0x09) return YES; return NO; } -static inline BOOL codeIsNameStart(unsigned char code){ +static inline BOOL codeIsNameStart(uint8_t code){ if((code>='A' && code<='Z') || (code>='a' && code<='z') || code==':' || code=='_') @@ -204,7 +204,7 @@ static inline BOOL codeIsNameStart(unsigned char code){ return NO; } -static inline BOOL codeIsNameContinue(unsigned char code){ +static inline BOOL codeIsNameContinue(uint8_t code){ if((code>='A' && code<='Z') || (code>='a' && code<='z') || code==':' || code=='_' || @@ -217,7 +217,7 @@ static inline BOOL codeIsNameContinue(unsigned char code){ -(void)unexpectedIn:(NSString *)state { NSUInteger position=NSMaxRange(_range)-1; - unsigned char code=_bytes[position]; + uint8_t code=_bytes[position]; [NSException raise:@"" format:@"Unexpected character %c in %@, position=%d",code,state,position]; } @@ -225,7 +225,7 @@ static inline BOOL codeIsNameContinue(unsigned char code){ -(void)tokenize { while(NSMaxRange(_range)<_length){ - unsigned char code=_bytes[NSMaxRange(_range)]; + uint8_t code=_bytes[NSMaxRange(_range)]; enum { extendLength, advanceLocationToNext, diff --git a/Foundation/NSPropertyList/NSPropertyListReader_binary1.m b/Foundation/NSPropertyList/NSPropertyListReader_binary1.m index 40967f1e..8e2cc1d3 100644 --- a/Foundation/NSPropertyList/NSPropertyListReader_binary1.m +++ b/Foundation/NSPropertyList/NSPropertyListReader_binary1.m @@ -220,7 +220,7 @@ static id ExtractUID(NSPropertyListReader_binary1 *bplist, uint64_t offset) atOffset: offset]]; if( topNibble == 0x2 ) { - unsigned size = 1 << botNibble; + size_t size = 1 << botNibble; uint64_t val = [self _readIntOfSize: size atOffset: offset]; if( size == 4 ) diff --git a/Foundation/NSPropertyList/NSPropertyListReader_vintage.h b/Foundation/NSPropertyList/NSPropertyListReader_vintage.h index 346bae2b..1783b656 100755 --- a/Foundation/NSPropertyList/NSPropertyListReader_vintage.h +++ b/Foundation/NSPropertyList/NSPropertyListReader_vintage.h @@ -14,7 +14,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @interface NSPropertyListReader_vintage : NSObject { NSData *_data; NSUInteger _length; - const unsigned char *_bytes; + const uint8_t *_bytes; NSUInteger _stackCapacity; NSInteger _stackSize; diff --git a/Foundation/NSPropertyList/NSPropertyListReader_vintage.m b/Foundation/NSPropertyList/NSPropertyListReader_vintage.m index 701aa767..f2ec84bf 100755 --- a/Foundation/NSPropertyList/NSPropertyListReader_vintage.m +++ b/Foundation/NSPropertyList/NSPropertyListReader_vintage.m @@ -109,7 +109,7 @@ static inline id topObject(NSPropertyListReader_vintage *self){ return self->_stack[self->_stackSize-1]; } -static inline void appendCharacter(NSPropertyListReader_vintage *self,unsigned char c){ +static inline void appendCharacter(NSPropertyListReader_vintage *self,uint8_t c){ if(self->_bufferSize>=self->_bufferCapacity){ self->_bufferCapacity*=2; self->_buffer=NSZoneRealloc(NULL,self->_buffer,self->_bufferCapacity*sizeof(unichar)); @@ -165,7 +165,7 @@ static inline void appendCharacter(NSPropertyListReader_vintage *self,unsigned c } expect=EXPECT_VAL; for(_index=0;_index<_length;){ - unsigned char code=_bytes[_index++]; + uint8_t code=_bytes[_index++]; switch(state){ diff --git a/Foundation/NSPropertyList/NSPropertyListReader_xml1.m b/Foundation/NSPropertyList/NSPropertyListReader_xml1.m index 649c36f8..7445ffda 100644 --- a/Foundation/NSPropertyList/NSPropertyListReader_xml1.m +++ b/Foundation/NSPropertyList/NSPropertyListReader_xml1.m @@ -88,8 +88,8 @@ NSDate* NSDateFromPlistString(NSString* string) +(NSData *)dataFromBase64String:(NSString *)string { NSUInteger i,length=[string length],resultLength=0; unichar buffer[length]; - unsigned char result[length]; - unsigned char partial=0; + uint8_t result[length]; + uint8_t partial=0; enum { load6High, load2Low, load4Low, load6Low } state=load6High; [string getCharacters:buffer]; diff --git a/Foundation/NSPropertyList/NSPropertyListWriter_vintage.h b/Foundation/NSPropertyList/NSPropertyListWriter_vintage.h index b9ace44d..d03683e0 100755 --- a/Foundation/NSPropertyList/NSPropertyListWriter_vintage.h +++ b/Foundation/NSPropertyList/NSPropertyListWriter_vintage.h @@ -16,7 +16,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -init; --(void)encodePropertyList:object indent:(int)indent; +-(void)encodePropertyList:object indent:(NSInteger)indent; -(NSData *)dataForRootObject:object; diff --git a/Foundation/NSPropertyList/NSPropertyListWriter_vintage.m b/Foundation/NSPropertyList/NSPropertyListWriter_vintage.m index fe44785f..434e8f99 100755 --- a/Foundation/NSPropertyList/NSPropertyListWriter_vintage.m +++ b/Foundation/NSPropertyList/NSPropertyListWriter_vintage.m @@ -36,7 +36,7 @@ YES,YES,YES,YES,YES,YES,YES,YES,YES,YES,YES, NO, NO, NO, NO, NO,// 112 [super dealloc]; } --(void)encodeIndent:(int)indent { +-(void)encodeIndent:(NSInteger)indent { int i; [_data appendBytes:" " length:1]; @@ -117,7 +117,7 @@ YES,YES,YES,YES,YES,YES,YES,YES,YES,YES,YES, NO, NO, NO, NO, NO,// 112 } } --(void)encodeArray:(NSArray *)array indent:(int)indent { +-(void)encodeArray:(NSArray *)array indent:(NSInteger)indent { NSInteger i,count=[array count]; [_data appendBytes:"(\n" length:2]; @@ -133,7 +133,7 @@ YES,YES,YES,YES,YES,YES,YES,YES,YES,YES,YES, NO, NO, NO, NO, NO,// 112 [_data appendBytes:")" length:1]; } --(void)encodeDictionary:(NSDictionary *)dictionary indent:(int)indent { +-(void)encodeDictionary:(NSDictionary *)dictionary indent:(NSInteger)indent { NSArray *allKeys=[[dictionary allKeys] sortedArrayUsingSelector:@selector(compare:)]; NSInteger i,count=[allKeys count]; @@ -153,7 +153,7 @@ YES,YES,YES,YES,YES,YES,YES,YES,YES,YES,YES, NO, NO, NO, NO, NO,// 112 [_data appendBytes:"}" length:1]; } --(void)encodePropertyList:plist escape:(BOOL)escape indent:(int)indent { +-(void)encodePropertyList:plist escape:(BOOL)escape indent:(NSInteger)indent { if([plist isKindOfClass:objc_lookUpClass("NSString")]) [self encodeString:plist escape:escape]; else if([plist isKindOfClass:objc_lookUpClass("NSArray")]) @@ -164,7 +164,7 @@ YES,YES,YES,YES,YES,YES,YES,YES,YES,YES,YES, NO, NO, NO, NO, NO,// 112 [self encodeString:[plist description] escape:escape]; } --(void)encodePropertyList:plist indent:(int)indent { +-(void)encodePropertyList:plist indent:(NSInteger)indent { [self encodePropertyList:plist escape:YES indent:indent]; } diff --git a/Foundation/NSPropertyList/NSPropertyListWriter_xml1.h b/Foundation/NSPropertyList/NSPropertyListWriter_xml1.h index a67996a6..46db19f0 100644 --- a/Foundation/NSPropertyList/NSPropertyListWriter_xml1.h +++ b/Foundation/NSPropertyList/NSPropertyListWriter_xml1.h @@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(id)init; --(void)encodePropertyList:(id)object indent:(int)indent; +-(void)encodePropertyList:(id)object indent:(NSInteger)indent; -(NSData *)dataForRootObject:(id)object; diff --git a/Foundation/NSPropertyList/NSPropertyListWriter_xml1.m b/Foundation/NSPropertyList/NSPropertyListWriter_xml1.m index 8d6a0e4a..13a41807 100644 --- a/Foundation/NSPropertyList/NSPropertyListWriter_xml1.m +++ b/Foundation/NSPropertyList/NSPropertyListWriter_xml1.m @@ -28,7 +28,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [super dealloc]; } --(void)_encodeIndent:(int)indent +-(void)_encodeIndent:(NSInteger)indent { int i; for(i = 0; i < indent; i++) @@ -57,7 +57,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } } --(void)encodeString:(NSString *)string indent:(int)indent +-(void)encodeString:(NSString *)string indent:(NSInteger)indent { [self _encodeIndent:indent]; @@ -66,7 +66,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [_data appendBytes:"\n" length:10]; } --(void)encodeKey:(NSString *)key indent:(int)indent +-(void)encodeKey:(NSString *)key indent:(NSInteger)indent { [self _encodeIndent:indent]; @@ -109,7 +109,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } } -- (void)encodeNumber:(NSNumber *)number indent:(int)indent +- (void)encodeNumber:(NSNumber *)number indent:(NSInteger)indent { [self _encodeIndent:indent]; @@ -135,7 +135,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } } -- (void)encodeArray:(NSArray *)array indent:(int)indent +- (void)encodeArray:(NSArray *)array indent:(NSInteger)indent { NSUInteger i, count = [array count]; @@ -153,7 +153,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [_data appendBytes:"\n" length:9]; } -- (void)encodeDictionary:(NSDictionary *)dictionary indent:(int)indent +- (void)encodeDictionary:(NSDictionary *)dictionary indent:(NSInteger)indent { NSArray *allKeys = [[dictionary allKeys] sortedArrayUsingSelector:@selector(compare:)]; @@ -175,21 +175,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [_data appendBytes:"\n" length:8]; } -- (void)encodeData:(NSData *)data indent:(int)indent +- (void)encodeData:(NSData *)data indent:(NSInteger)indent { static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; NSUInteger y, n; const NSUInteger len = [data length]; - unsigned const char *bytes = [data bytes]; + const uint8_t *bytes = [data bytes]; [self _encodeIndent:indent]; [_data appendBytes:"\n" length:7]; indent++; const NSUInteger numRows = 1 + len / 45; // 60 chars per output row -> 45 input bytes per row - unsigned char srcBuf[48]; - unsigned char dstBuf[64]; + uint8_t srcBuf[48]; + uint8_t dstBuf[64]; n = 0; for (y = 0; y < numRows; y++) { @@ -227,7 +227,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [_data appendBytes:"\n" length:8]; } -- (void)encodePropertyList:(id)plist indent:(int)indent +- (void)encodePropertyList:(id)plist indent:(NSInteger)indent { if ([plist isKindOfClass:objc_lookUpClass("NSString")]) [self encodeString:plist indent:indent]; diff --git a/Foundation/NSRunLoop/NSOrderedPerform.h b/Foundation/NSRunLoop/NSOrderedPerform.h index 40faacd3..9e15d10f 100755 --- a/Foundation/NSRunLoop/NSOrderedPerform.h +++ b/Foundation/NSRunLoop/NSOrderedPerform.h @@ -14,16 +14,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI SEL _selector; id _target; id _argument; - unsigned _order; + NSUInteger _order; NSArray *_modes; } -+(NSOrderedPerform *)orderedPerformWithSelector:(SEL)selector target:target argument:argument order:(unsigned)order modes:(NSArray *)modes; ++(NSOrderedPerform *)orderedPerformWithSelector:(SEL)selector target:target argument:argument order:(NSUInteger)order modes:(NSArray *)modes; -(SEL)selector; -(id)target; -(id)argument; --(unsigned)order; +-(NSUInteger)order; -(BOOL)fireInMode:(NSString *)mode; diff --git a/Foundation/NSRunLoop/NSOrderedPerform.m b/Foundation/NSRunLoop/NSOrderedPerform.m index 5cefd7b3..2c1f5dff 100755 --- a/Foundation/NSRunLoop/NSOrderedPerform.m +++ b/Foundation/NSRunLoop/NSOrderedPerform.m @@ -5,15 +5,13 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - Christopher Lloyd #import #import #import @implementation NSOrderedPerform --initWithSelector:(SEL)selector target:target argument:argument order:(unsigned)order modes:(NSArray *)modes { +-initWithSelector:(SEL)selector target:target argument:argument order:(NSUInteger)order modes:(NSArray *)modes { _selector=selector; _target=[target retain]; _argument=[argument retain]; @@ -29,7 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [super dealloc]; } -+(NSOrderedPerform *)orderedPerformWithSelector:(SEL)selector target:target argument:argument order:(unsigned)order modes:(NSArray *)modes { ++(NSOrderedPerform *)orderedPerformWithSelector:(SEL)selector target:target argument:argument order:(NSUInteger)order modes:(NSArray *)modes { return [[[self alloc] initWithSelector:selector target:target argument:argument order:order modes:modes] autorelease]; } @@ -45,7 +43,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return _argument; } --(unsigned)order { +-(NSUInteger)order { return _order; } diff --git a/Foundation/NSRunLoop/NSRunLoop.h b/Foundation/NSRunLoop/NSRunLoop.h index a76dc371..13b96f97 100755 --- a/Foundation/NSRunLoop/NSRunLoop.h +++ b/Foundation/NSRunLoop/NSRunLoop.h @@ -39,7 +39,7 @@ FOUNDATION_EXPORT NSString *NSRunLoopCommonModes; -(void)addTimer:(NSTimer *)timer forMode:(NSString *)mode; --(void)performSelector:(SEL)selector target:target argument:argument order:(unsigned)order modes:(NSArray *)modes; +-(void)performSelector:(SEL)selector target:target argument:argument order:(NSUInteger)order modes:(NSArray *)modes; -(void)cancelPerformSelector:(SEL)selector target:target argument:argument; diff --git a/Foundation/NSRunLoop/NSRunLoop.m b/Foundation/NSRunLoop/NSRunLoop.m index 6cb346d8..5632a817 100755 --- a/Foundation/NSRunLoop/NSRunLoop.m +++ b/Foundation/NSRunLoop/NSRunLoop.m @@ -191,7 +191,7 @@ NSString *NSRunLoopCommonModes=@"NSRunLoopCommonModes"; [[self stateForMode:mode] addTimer:timer]; } --(void)performSelector:(SEL)selector target:target argument:argument order:(unsigned)order modes:(NSArray *)modes { +-(void)performSelector:(SEL)selector target:target argument:argument order:(NSUInteger)order modes:(NSArray *)modes { NSOrderedPerform *perform=[NSOrderedPerform orderedPerformWithSelector:selector target:target argument:argument order:order modes:modes]; @synchronized(_orderedPerforms) { @@ -199,7 +199,7 @@ NSString *NSRunLoopCommonModes=@"NSRunLoopCommonModes"; while(--count>=0){ NSOrderedPerform *check=[_orderedPerforms objectAtIndex:count]; - unsigned checkOrder=[check order]; + NSUInteger checkOrder=[check order]; if(checkOrder>order) break; diff --git a/Foundation/NSSet/NSSet.m b/Foundation/NSSet/NSSet.m index d77ad203..dbe2d7ff 100755 --- a/Foundation/NSSet/NSSet.m +++ b/Foundation/NSSet/NSSet.m @@ -337,7 +337,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)length; { - int i; + NSInteger i; state->itemsPtr=stackbuf; state->mutationsPtr=(unsigned long*)self; diff --git a/Foundation/NSStream/NSFileHandle.h b/Foundation/NSStream/NSFileHandle.h index 7e33ce99..7a0d04cf 100755 --- a/Foundation/NSStream/NSFileHandle.h +++ b/Foundation/NSStream/NSFileHandle.h @@ -41,9 +41,9 @@ FOUNDATION_EXPORT NSString *NSFileHandleOperationException; -(void)closeFile; -(void)synchronizeFile; --(unsigned long long)offsetInFile; --(void)seekToFileOffset:(unsigned long long)offset; --(unsigned long long)seekToEndOfFile; +-(uint64_t)offsetInFile; +-(void)seekToFileOffset:(uint64_t)offset; +-(uint64_t)seekToEndOfFile; -(NSData *)readDataOfLength:(NSUInteger)length; -(NSData *)readDataToEndOfFile; @@ -51,7 +51,7 @@ FOUNDATION_EXPORT NSString *NSFileHandleOperationException; -(void)writeData:(NSData *)data; --(void)truncateFileAtOffset:(unsigned long long)offset; +-(void)truncateFileAtOffset:(uint64_t)offset; -(void)readInBackgroundAndNotifyForModes:(NSArray *)modes; -(void)readInBackgroundAndNotify; diff --git a/Foundation/NSStream/NSFileHandle.m b/Foundation/NSStream/NSFileHandle.m index a8d18da1..7c64d689 100755 --- a/Foundation/NSStream/NSFileHandle.m +++ b/Foundation/NSStream/NSFileHandle.m @@ -92,16 +92,16 @@ NSString *NSFileHandleOperationException = @"NSFileHandleOperationException"; NSInvalidAbstractInvocation(); } --(unsigned long long)offsetInFile { +-(uint64_t)offsetInFile { NSInvalidAbstractInvocation(); return 0; } --(void)seekToFileOffset:(unsigned long long)offset { +-(void)seekToFileOffset:(uint64_t)offset { NSInvalidAbstractInvocation(); } --(unsigned long long)seekToEndOfFile { +-(uint64_t)seekToEndOfFile { NSInvalidAbstractInvocation(); return 0; } @@ -125,7 +125,7 @@ NSString *NSFileHandleOperationException = @"NSFileHandleOperationException"; NSInvalidAbstractInvocation(); } --(void)truncateFileAtOffset:(unsigned long long)offset { +-(void)truncateFileAtOffset:(uint64_t)offset { NSInvalidAbstractInvocation(); } diff --git a/Foundation/NSStream/NSFileHandle_stream.m b/Foundation/NSStream/NSFileHandle_stream.m index b563b4f9..c197ea23 100644 --- a/Foundation/NSStream/NSFileHandle_stream.m +++ b/Foundation/NSStream/NSFileHandle_stream.m @@ -62,16 +62,16 @@ enum { [NSException raise:NSFileHandleOperationException format:@"-[%@ %s]: Operation not supported",isa,sel_getName(_cmd)]; } --(unsigned long long)offsetInFile { +-(uint64_t)offsetInFile { [NSException raise:NSFileHandleOperationException format:@"-[%@ %s]: Illegal seek",isa,sel_getName(_cmd)]; return 0; } --(void)seekToFileOffset:(unsigned long long)offset { +-(void)seekToFileOffset:(uint64_t)offset { [NSException raise:NSFileHandleOperationException format:@"-[%@ %s]: Illegal seek",isa,sel_getName(_cmd)]; } --(unsigned long long)seekToEndOfFile { +-(uint64_t)seekToEndOfFile { [NSException raise:NSFileHandleOperationException format:@"-[%@ %s]: Illegal seek",isa,sel_getName(_cmd)]; return 0; } @@ -109,7 +109,7 @@ enum { ; } --(void)truncateFileAtOffset:(unsigned long long)offset { +-(void)truncateFileAtOffset:(uint64_t)offset { [self doesNotRecognizeSelector:_cmd]; } diff --git a/Foundation/NSStream/NSInputStream_data.m b/Foundation/NSStream/NSInputStream_data.m index 9c10d59e..777f2506 100644 --- a/Foundation/NSStream/NSInputStream_data.m +++ b/Foundation/NSStream/NSInputStream_data.m @@ -88,7 +88,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI if(_status!=NSStreamStatusOpen) return -1; else { - const unsigned char *bytes=[_data bytes]; + const uint8_t *bytes=[_data bytes]; NSUInteger i,length=[_data length]; for(i=0;i_length=length; self->_capacity=roundCapacityUp(length); diff --git a/Foundation/NSString/NSPathUtilities.h b/Foundation/NSString/NSPathUtilities.h index 3c4a8e21..5db3df08 100755 --- a/Foundation/NSString/NSPathUtilities.h +++ b/Foundation/NSString/NSPathUtilities.h @@ -34,22 +34,22 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(BOOL)isAbsolutePath; -(const char *)fileSystemRepresentation; --(const unsigned short *)fileSystemRepresentationW; +-(const uint16_t *)fileSystemRepresentationW; -(BOOL)getFileSystemRepresentation:(char *)bytes maxLength:(NSUInteger)maxLength; -(NSUInteger)completePathIntoString:(NSString **)string caseSensitive:(BOOL)caseSensitive matchesIntoArray:(NSArray **)array filterTypes:(NSArray *)types; @end -enum { +typedef enum { NSLibraryDirectory, -}; +} NSSearchPathDirectory; -enum { +typedef enum { NSSystemDomainMask -}; +} NSSearchPathDomainMask; -FOUNDATION_EXPORT NSArray *NSSearchPathForDirectoriesInDomains(int d,unsigned mask,BOOL expand); +FOUNDATION_EXPORT NSArray *NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory d,NSSearchPathDomainMask mask,BOOL expand); FOUNDATION_EXPORT NSString *NSHomeDirectory(void); diff --git a/Foundation/NSString/NSPathUtilities.m b/Foundation/NSString/NSPathUtilities.m index 4b6ffd2a..0dad16b7 100755 --- a/Foundation/NSString/NSPathUtilities.m +++ b/Foundation/NSString/NSPathUtilities.m @@ -278,7 +278,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI fileSystemRepresentationWithPath:self]; } --(const unsigned short *)fileSystemRepresentationW { +-(const uint16_t *)fileSystemRepresentationW { return [[NSFileManager defaultManager] fileSystemRepresentationWithPathW:self]; } diff --git a/Foundation/NSString/NSString.h b/Foundation/NSString/NSString.h index a186c0d6..b8acd351 100755 --- a/Foundation/NSString/NSString.h +++ b/Foundation/NSString/NSString.h @@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @class NSArray,NSData,NSDictionary,NSCharacterSet,NSError,NSLocale,NSURL; -typedef unsigned short unichar; +typedef uint16_t unichar; typedef enum { NSUnicodeStringEncoding, diff --git a/Foundation/NSString/NSStringHashing.h b/Foundation/NSString/NSStringHashing.h index b6dca86e..843039d9 100755 --- a/Foundation/NSString/NSStringHashing.h +++ b/Foundation/NSString/NSStringHashing.h @@ -12,8 +12,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // djb2 -static inline unsigned NSStringHashUnicode(const unichar *buffer,NSUInteger length){ - unsigned i,result=5381; +static inline NSUInteger NSStringHashUnicode(const unichar *buffer,NSUInteger length){ + NSUInteger i,result=5381; for(i=0;i #import -static NSUInteger convertUTF16toUTF8(const unichar *utf16,NSUInteger utf16Length,unsigned char *utf8){ +static NSUInteger convertUTF16toUTF8(const unichar *utf16,NSUInteger utf16Length,uint8_t *utf8){ NSUInteger utf8Length=0; NSUInteger i; for(i=0;i_length=length; for(i=0;i_bytes[i]=((unsigned char *)bytes)[i]; + string->_bytes[i]=((uint8_t *)bytes)[i]; string->_bytes[i]='\0'; return string; diff --git a/Foundation/NSString/NSString_nextstep.m b/Foundation/NSString/NSString_nextstep.m index 7c73d512..63bafa9f 100755 --- a/Foundation/NSString/NSString_nextstep.m +++ b/Foundation/NSString/NSString_nextstep.m @@ -91,7 +91,7 @@ char *NSUnicodeToNEXTSTEP(const unichar *characters,NSUInteger length, } NSUInteger NSGetNEXTSTEPStringWithMaxLength(const unichar *characters,NSUInteger length,NSUInteger *location,char *cString,NSUInteger maxLength,BOOL lossy) { - unsigned i,result=0; + NSUInteger i,result=0; for(i=0;i)sender; diff --git a/Foundation/NSURL/NSURLAuthenticationChallenge.m b/Foundation/NSURL/NSURLAuthenticationChallenge.m index 1582608c..8e7d0737 100644 --- a/Foundation/NSURL/NSURLAuthenticationChallenge.m +++ b/Foundation/NSURL/NSURLAuthenticationChallenge.m @@ -44,7 +44,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return _proposedCredential; } --(unsigned)previousFailureCount { +-(NSUInteger)previousFailureCount { return _failureCount; } diff --git a/Foundation/NSURL/NSURLCache.h b/Foundation/NSURL/NSURLCache.h index 01bbf373..f3ee7e25 100644 --- a/Foundation/NSURL/NSURLCache.h +++ b/Foundation/NSURL/NSURLCache.h @@ -10,25 +10,25 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @class NSCachedURLResponse,NSURLRequest; @interface NSURLCache : NSObject { - unsigned _memoryCapacity; - unsigned _diskCapacity; + NSUInteger _memoryCapacity; + NSUInteger _diskCapacity; } +(NSURLCache *)sharedURLCache; +(void)setSharedURLCache:(NSURLCache *)cache; --initWithMemoryCapacity:(unsigned)memoryCapacity diskCapacity:(unsigned)diskCapacity diskPath:(NSString *)diskPath; +-initWithMemoryCapacity:(NSUInteger)memoryCapacity diskCapacity:(NSUInteger)diskCapacity diskPath:(NSString *)diskPath; --(unsigned)memoryCapacity; --(unsigned)diskCapacity; +-(NSUInteger)memoryCapacity; +-(NSUInteger)diskCapacity; --(unsigned)currentDiskUsage; --(unsigned)currentMemoryUsage; +-(NSUInteger)currentDiskUsage; +-(NSUInteger)currentMemoryUsage; -(NSCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request; --(void)setMemoryCapacity:(unsigned)memoryCapacity; --(void)setDiskCapacity:(unsigned)diskCapacity; +-(void)setMemoryCapacity:(NSUInteger)memoryCapacity; +-(void)setDiskCapacity:(NSUInteger)diskCapacity; -(void)storeCachedResponse:(NSCachedURLResponse *)response forRequest:(NSURLRequest *)request; diff --git a/Foundation/NSURL/NSURLCache.m b/Foundation/NSURL/NSURLCache.m index b42864e5..516ad1c0 100644 --- a/Foundation/NSURL/NSURLCache.m +++ b/Foundation/NSURL/NSURLCache.m @@ -19,25 +19,25 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI NSUnimplementedMethod(); } --initWithMemoryCapacity:(unsigned)memoryCapacity diskCapacity:(unsigned)diskCapacity diskPath:(NSString *)diskPath { +-initWithMemoryCapacity:(NSUInteger)memoryCapacity diskCapacity:(NSUInteger)diskCapacity diskPath:(NSString *)diskPath { NSUnimplementedMethod(); return nil; } --(unsigned)memoryCapacity { +-(NSUInteger)memoryCapacity { return _memoryCapacity; } --(unsigned)diskCapacity { +-(NSUInteger)diskCapacity { return _diskCapacity; } --(unsigned)currentDiskUsage { +-(NSUInteger)currentDiskUsage { NSUnimplementedMethod(); return 0; } --(unsigned)currentMemoryUsage { +-(NSUInteger)currentMemoryUsage { NSUnimplementedMethod(); return 0; } @@ -47,11 +47,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return nil; } --(void)setMemoryCapacity:(unsigned)memoryCapacity { +-(void)setMemoryCapacity:(NSUInteger)memoryCapacity { NSUnimplementedMethod(); } --(void)setDiskCapacity:(unsigned)diskCapacity { +-(void)setDiskCapacity:(NSUInteger)diskCapacity { NSUnimplementedMethod(); } diff --git a/Foundation/NSURL/NSURLDownload.h b/Foundation/NSURL/NSURLDownload.h index c1e8ecc7..207f2710 100644 --- a/Foundation/NSURL/NSURLDownload.h +++ b/Foundation/NSURL/NSURLDownload.h @@ -37,7 +37,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(void)download:(NSURLDownload *)download didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)authChallenge; -(void)download:(NSURLDownload *)download didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)authChallenge; -(void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response; --(void)download:(NSURLDownload *)download didReceiveDataOfLength:(unsigned)length; +-(void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)length; -(void)download:(NSURLDownload *)download didFailWithError:(NSError *)error; -(void)downloadDidFinish:(NSURLDownload *)download; diff --git a/Foundation/NSURL/NSURLProtocol_http.h b/Foundation/NSURL/NSURLProtocol_http.h index 4e6de4cd..712c8f21 100644 --- a/Foundation/NSURL/NSURLProtocol_http.h +++ b/Foundation/NSURL/NSURLProtocol_http.h @@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // parsing state NSMutableData *_data; - const unsigned char *_bytes; + const uint8_t *_bytes; NSUInteger _length; int _state; NSRange _range; diff --git a/Foundation/NSURL/NSURLProtocol_http.m b/Foundation/NSURL/NSURLProtocol_http.m index 4f3a282c..a5b6bf41 100644 --- a/Foundation/NSURL/NSURLProtocol_http.m +++ b/Foundation/NSURL/NSURLProtocol_http.m @@ -99,7 +99,7 @@ enum { -(BOOL)advanceIsEndOfReply { while(NSMaxRange(_range)<_length){ - unsigned char code=_bytes[NSMaxRange(_range)]; + uint8_t code=_bytes[NSMaxRange(_range)]; enum { extendLength, advanceLocationToNext, @@ -321,8 +321,8 @@ NSLog(@"transfer completed"); -(void)inputStream:(NSInputStream *)stream handleEvent:(NSStreamEvent)streamEvent { - char buffer[1024]; - NSInteger size=[stream read:(unsigned char*)buffer maxLength:sizeof(buffer)]; + uint8_t buffer[1024]; + NSInteger size=[stream read:buffer maxLength:sizeof(buffer)]; if (size>0) { [self appendData:[NSData dataWithBytes:buffer length:size]]; @@ -353,7 +353,7 @@ NSLog(@"transfer completed"); [httprequest appendString:@"\r\n"]; NSLog(@"request %@ ",httprequest); const char* crequest=[httprequest UTF8String]; - [stream write:(unsigned char*)crequest maxLength:strlen(crequest)]; + [stream write:(uint8_t *)crequest maxLength:strlen(crequest)]; sentrequest=YES; } diff --git a/Foundation/NSURL/NSURLResponse.h b/Foundation/NSURL/NSURLResponse.h index de1f6297..8cdeae0c 100644 --- a/Foundation/NSURL/NSURLResponse.h +++ b/Foundation/NSURL/NSURLResponse.h @@ -12,11 +12,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @interface NSURLResponse : NSObject { NSString *_url; NSString *_mimeType; - int _expecteContentLength; + NSInteger _expectedContentLength; NSString *_encoding; } --initWithURL:(NSURL *)url MIMEType:(NSString *)mimeType expectedContentLength:(int)expectedLength textEncodingName:(NSString *)encoding; +-initWithURL:(NSURL *)url MIMEType:(NSString *)mimeType expectedContentLength:(NSInteger)expectedLength textEncodingName:(NSString *)encoding; -(NSString *)URL; -(NSString *)MIMEType; diff --git a/Foundation/NSURL/NSURLResponse.m b/Foundation/NSURL/NSURLResponse.m index 299926d6..6eeaff7f 100644 --- a/Foundation/NSURL/NSURLResponse.m +++ b/Foundation/NSURL/NSURLResponse.m @@ -11,10 +11,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @implementation NSURLResponse --initWithURL:(NSURL *)url MIMEType:(NSString *)mimeType expectedContentLength:(int)expectedLength textEncodingName:(NSString *)encoding { +-initWithURL:(NSURL *)url MIMEType:(NSString *)mimeType expectedContentLength:(NSInteger)expectedLength textEncodingName:(NSString *)encoding { _url=[url retain]; _mimeType=[mimeType retain]; - _expecteContentLength=expectedLength; + _expectedContentLength=expectedLength; _encoding=[encoding retain]; return self; } @@ -48,7 +48,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } -(long long)expectedContentLength { - return _expecteContentLength; + return _expectedContentLength; } -(NSString *)textEncodingName { diff --git a/Foundation/NSUnarchiver.h b/Foundation/NSUnarchiver.h index f95e78dc..52999dee 100755 --- a/Foundation/NSUnarchiver.h +++ b/Foundation/NSUnarchiver.h @@ -13,11 +13,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @interface NSUnarchiver : NSCoder { NSData *_data; - const unsigned char *_bytes; + const uint8_t *_bytes; NSUInteger _position,_length; NSZone *_objectZone; - unsigned _version; + uint32_t _version; NSMapTable *_objects; NSMapTable *_classes; NSMapTable *_cStrings; @@ -40,7 +40,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(BOOL)isAtEnd; -(NSZone *)objectZone; -(void)setObjectZone:(NSZone *)zone; --(unsigned)systemVersion; -(void)decodeClassName:(NSString *)archiveName asClassName:(NSString *)runtimeName; -(NSString *)classNameDecodedForArchiveClassName:(NSString *)className; diff --git a/Foundation/NSUnarchiver.m b/Foundation/NSUnarchiver.m index d4d033f6..d35bc3e9 100755 --- a/Foundation/NSUnarchiver.m +++ b/Foundation/NSUnarchiver.m @@ -19,19 +19,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI format:@"NSUnarchiver cannot decode type=%s",type]; } --(void)_ensureLength:(unsigned)length { +-(void)_ensureLength:(NSUInteger)length { if(_position+length>_length) [NSException raise:@"NSUnarchiverBadArchiveException" format:@"NSUnarchiver attempt to read beyond length"]; } --(unsigned char)_extractWordOne { +-(uint8_t)_extractWordOne { [self _ensureLength:1]; return _bytes[_position++]; } --(unsigned short)_extractWordTwo { - unsigned short result; +-(uint16_t)_extractWordTwo { + uint16_t result; [self _ensureLength:2]; @@ -100,7 +100,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(NSString *)_extractCStringBytes { NSString *result; - unsigned length=0; + NSUInteger length=0; while((_position+length)<_length && (_bytes[_position+length]!='\0')) length++; @@ -178,7 +178,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return result; } --(void)_extractArrayOfObjCType:(const char *)type length:(unsigned)length +-(void)_extractArrayOfObjCType:(const char *)type length:(NSUInteger)length at:(void *)addr { switch(*type){ @@ -293,7 +293,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI case '[':{ const char *tmp=type; - unsigned length=0; + NSUInteger length=0; tmp++; // skip [ for(;*tmp>='0' && *tmp<='9';tmp++) @@ -459,11 +459,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI _objectZone=zone; } --(unsigned)systemVersion { - NSUnimplementedMethod(); - return 0; -} - -(void)decodeClassName:(NSString *)archiveName asClassName:(NSString *)runtimeName { NSUnimplementedMethod(); } diff --git a/Foundation/NSUndoManager/NSUndoManager.h b/Foundation/NSUndoManager/NSUndoManager.h index fed9f8eb..fa0da478 100755 --- a/Foundation/NSUndoManager/NSUndoManager.h +++ b/Foundation/NSUndoManager/NSUndoManager.h @@ -10,7 +10,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @class NSArray,NSMutableArray,NSInvocation; -FOUNDATION_EXPORT const unsigned NSUndoCloseGroupingRunLoopOrdering; +enum { + NSUndoCloseGroupingRunLoopOrdering=350000, +}; FOUNDATION_EXPORT NSString *NSUndoManagerCheckpointNotification; @@ -30,7 +32,7 @@ FOUNDATION_EXPORT NSString *NSUndoManagerDidRedoChangeNotification; BOOL _groupsByEvent; NSArray *_modes; int _disableCount; - int _levelsOfUndo; + NSInteger _levelsOfUndo; id _currentGroup; int _state; NSString *_actionName; @@ -39,11 +41,11 @@ FOUNDATION_EXPORT NSString *NSUndoManagerDidRedoChangeNotification; } -(NSArray *)runLoopModes; --(unsigned)levelsOfUndo; +-(NSUInteger)levelsOfUndo; -(BOOL)groupsByEvent; -(void)setRunLoopModes:(NSArray *)modes; --(void)setLevelsOfUndo:(unsigned)levels; +-(void)setLevelsOfUndo:(NSUInteger)levels; -(void)setGroupsByEvent:(BOOL)flag; -(BOOL)isUndoRegistrationEnabled; @@ -53,7 +55,7 @@ FOUNDATION_EXPORT NSString *NSUndoManagerDidRedoChangeNotification; -(void)beginUndoGrouping; -(void)endUndoGrouping; --(int)groupingLevel; +-(NSInteger)groupingLevel; -(BOOL)canUndo; -(void)undo; diff --git a/Foundation/NSUndoManager/NSUndoManager.m b/Foundation/NSUndoManager/NSUndoManager.m index 97e77f84..f645e854 100755 --- a/Foundation/NSUndoManager/NSUndoManager.m +++ b/Foundation/NSUndoManager/NSUndoManager.m @@ -5,8 +5,6 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - David Young #import #import #import @@ -23,8 +21,6 @@ enum _NSUndoManagerState { NSUndoManagerRedoing }; -const unsigned NSUndoCloseGroupingRunLoopOrdering=350000; - NSString *NSUndoManagerCheckpointNotification=@"NSUndoManagerCheckpointNotification"; NSString *NSUndoManagerDidOpenUndoGroupNotification=@"NSUndoManagerDidOpenUndoGroupNotification"; NSString *NSUndoManagerWillCloseUndoGroupNotification=@"NSUndoManagerWillCloseUndoGroupNotification"; @@ -82,7 +78,7 @@ NSString *NSUndoManagerDidRedoChangeNotification=@"NSUndoManagerDidRedoChangeNot return _modes; } -- (unsigned)levelsOfUndo +- (NSUInteger)levelsOfUndo { return _levelsOfUndo; } @@ -101,7 +97,7 @@ NSString *NSUndoManagerDidRedoChangeNotification=@"NSUndoManagerDidRedoChangeNot [self _registerPerform]; } -- (void)setLevelsOfUndo:(unsigned)levels +- (void)setLevelsOfUndo:(NSUInteger)levels { _levelsOfUndo = levels; while ([_undoStack count] > _levelsOfUndo) @@ -192,7 +188,7 @@ NSString *NSUndoManagerDidRedoChangeNotification=@"NSUndoManagerDidRedoChangeNot _currentGroup = parentGroup; } -- (int)groupingLevel +- (NSInteger)groupingLevel { NSUndoGroup *temp = _currentGroup; int level = (_currentGroup != nil); diff --git a/Foundation/NSUserDefaults/NSUserDefaults.h b/Foundation/NSUserDefaults/NSUserDefaults.h index 3821e5ab..1f7f8472 100755 --- a/Foundation/NSUserDefaults/NSUserDefaults.h +++ b/Foundation/NSUserDefaults/NSUserDefaults.h @@ -70,12 +70,12 @@ FOUNDATION_EXPORT NSString *NSUserDefaultsDidChangeNotification; -(NSDictionary *)dictionaryForKey:(NSString *)key; -(NSArray *)stringArrayForKey:(NSString *)key; -(BOOL)boolForKey:(NSString *)key; --(int)integerForKey:(NSString *)key; +-(NSInteger)integerForKey:(NSString *)key; -(float)floatForKey:(NSString *)key; -(void)setObject:value forKey:(NSString *)key; -(void)setBool:(BOOL)value forKey:(NSString *)key; --(void)setInteger:(int)value forKey:(NSString *)key; +-(void)setInteger:(NSInteger)value forKey:(NSString *)key; -(void)setFloat:(float)value forKey:(NSString *)key; -(void)removeObjectForKey:(NSString *)key; diff --git a/Foundation/NSUserDefaults/NSUserDefaults.m b/Foundation/NSUserDefaults/NSUserDefaults.m index 9c78db17..c137f5bb 100755 --- a/Foundation/NSUserDefaults/NSUserDefaults.m +++ b/Foundation/NSUserDefaults/NSUserDefaults.m @@ -311,7 +311,7 @@ NSString *NSUserDefaultsDidChangeNotification=@"NSUserDefaultsDidChangeNotificat return [string intValue]; } --(int)integerForKey:(NSString *)defaultName { +-(NSInteger)integerForKey:(NSString *)defaultName { NSNumber *number=[self objectForKey:defaultName]; return [number isKindOfClass:objc_lookUpClass("NSNumber")]?[number intValue]:0; @@ -336,8 +336,8 @@ NSString *NSUserDefaultsDidChangeNotification=@"NSUserDefaultsDidChangeNotificat [self setObject:value?@"YES":@"NO" forKey:defaultName]; } --(void)setInteger:(int)value forKey:(NSString *)defaultName { - [self setObject:[NSNumber numberWithInt:value] forKey:defaultName]; +-(void)setInteger:(NSInteger)value forKey:(NSString *)defaultName { + [self setObject:[NSNumber numberWithInteger:value] forKey:defaultName]; } -(void)setFloat:(float)value forKey:(NSString *)defaultName { diff --git a/Foundation/objc/ObjCArray.h b/Foundation/objc/ObjCArray.h index 6af48445..4b82daa9 100755 --- a/Foundation/objc/ObjCArray.h +++ b/Foundation/objc/ObjCArray.h @@ -9,19 +9,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #import typedef struct { - void **data; - unsigned size; - unsigned count; + void **data; + unsigned long size; + unsigned long count; } OBJCArray; OBJCArray *OBJCArrayNew(void); void OBJCArrayDealloc(OBJCArray *array); OBJC_EXPORT void OBJCArrayAdd(OBJCArray *vector, void *item); -OBJC_EXPORT unsigned OBJCArrayCount(OBJCArray *array); -OBJC_EXPORT void *OBJCArrayItemAtIndex(OBJCArray *vector, unsigned index); +OBJC_EXPORT unsigned long OBJCArrayCount(OBJCArray *array); +OBJC_EXPORT void *OBJCArrayItemAtIndex(OBJCArray *vector, unsigned long index); -OBJC_EXPORT void OBJCArrayRemoveItemAtIndex(OBJCArray *vector, unsigned index); +OBJC_EXPORT void OBJCArrayRemoveItemAtIndex(OBJCArray *vector, unsigned long index); -OBJC_EXPORT void *OBJCArrayEnumerate(OBJCArray *vector, unsigned *enumerator); +OBJC_EXPORT void *OBJCArrayEnumerate(OBJCArray *vector, unsigned long *enumerator); diff --git a/Foundation/objc/ObjCArray.m b/Foundation/objc/ObjCArray.m index 7056e50e..9271b568 100755 --- a/Foundation/objc/ObjCArray.m +++ b/Foundation/objc/ObjCArray.m @@ -5,8 +5,6 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - David Young , Christopher Lloyd #import #import #import @@ -39,18 +37,18 @@ void OBJCArrayAdd(OBJCArray *array, void *item) { array->data[array->count++] = item; } -unsigned OBJCArrayCount(OBJCArray *array) { +unsigned long OBJCArrayCount(OBJCArray *array) { return array->count; } -void *OBJCArrayItemAtIndex(OBJCArray *array, unsigned index) { +void *OBJCArrayItemAtIndex(OBJCArray *array, unsigned long index) { if (index > array->count) OBJCRaiseException("OBJCArrayIndexBeyondBounds","OBJCArrayItemAtIndex index (%d) beyond bounds (%d)",index,array->count); return array->data[index]; } -void OBJCArrayRemoveItemAtIndex(OBJCArray *array, unsigned index) { +void OBJCArrayRemoveItemAtIndex(OBJCArray *array, unsigned long index) { if (index > array->count) OBJCRaiseException("OBJCArrayIndexBeyondBounds","OBJCArrayItemAtIndex index (%d) beyond bounds (%d)",index,array->count); @@ -61,7 +59,7 @@ void OBJCArrayRemoveItemAtIndex(OBJCArray *array, unsigned index) { array->count--; } -void *OBJCArrayEnumerate(OBJCArray *array, unsigned *enumerator) { +void *OBJCArrayEnumerate(OBJCArray *array, unsigned long *enumerator) { if (*enumerator < array->count) return array->data[(*enumerator)++]; diff --git a/Foundation/objc/ObjCDynamicModule.m b/Foundation/objc/ObjCDynamicModule.m index e9751f8d..8d306557 100755 --- a/Foundation/objc/ObjCDynamicModule.m +++ b/Foundation/objc/ObjCDynamicModule.m @@ -5,8 +5,6 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - David Young , Christopher Lloyd #import #import #import diff --git a/Foundation/objc/ObjCHashTable.h b/Foundation/objc/ObjCHashTable.h index 7f0e5498..ca91694f 100755 --- a/Foundation/objc/ObjCHashTable.h +++ b/Foundation/objc/ObjCHashTable.h @@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #import typedef struct { - unsigned count; - unsigned nBuckets; + unsigned long count; + unsigned long nBuckets; struct OBJCHashBucket **buckets; } OBJCHashTable; @@ -24,7 +24,7 @@ typedef struct OBJCHashBucket { typedef struct { OBJCHashTable *table; - int i; + long i; struct OBJCHashBucket *j; } OBJCHashEnumerator; diff --git a/Foundation/objc/ObjCHashTable.m b/Foundation/objc/ObjCHashTable.m index dcd3a9fe..829f4420 100755 --- a/Foundation/objc/ObjCHashTable.m +++ b/Foundation/objc/ObjCHashTable.m @@ -5,8 +5,6 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - David Young , Christopher Lloyd #import #import diff --git a/Foundation/objc/ObjCModule.m b/Foundation/objc/ObjCModule.m index 9876128e..35f6fa5e 100755 --- a/Foundation/objc/ObjCModule.m +++ b/Foundation/objc/ObjCModule.m @@ -51,7 +51,7 @@ static OBJCObjectFile *OBJCObjectFileWithPath(const char *path) { OBJCObjectFile *OBJCUniqueObjectFileWithPath(const char *path) { OBJCObjectFile *result; OBJCArray *array=OBJCObjectFileImageArray(); - unsigned arrayIndex=0; + unsigned long arrayIndex=0; while((result=OBJCArrayEnumerate(array,&arrayIndex))!=NULL){ if (strcmp(result->path, path) == 0) @@ -263,7 +263,7 @@ static void OBJCSymbolTableRegisterCategories(OBJCSymbolTable *symbolTable){ static void OBJCSymbolTableRegisterStringsIfNeeded(OBJCSymbolTable *symbolTable){ static OBJCArray *unlinkedObjects=NULL; - unsigned offset=symbolTable->classCount+symbolTable->categoryCount; + unsigned long offset=symbolTable->classCount+symbolTable->categoryCount; OBJCStaticInstanceList **listOfLists=symbolTable->definitions[offset]; if(unlinkedObjects!=NULL){ @@ -342,7 +342,7 @@ void OBJCLinkQueuedModulesToObjectFileWithPath(const char *path){ OBJCObjectFile *objectFile=OBJCUniqueObjectFileWithPath(path); OBJCArray *queue=OBJCModuleQueueWithReset(YES); OBJCModule *module; - unsigned state=0; + unsigned long state=0; while((module=OBJCArrayEnumerate(queue,&state))!=NULL) OBJCArrayAdd(objectFile->moduleArray,module); @@ -357,7 +357,7 @@ OBJCObjectFile *OBJCObjectFileFromClass(Class class) { while(--count>=0){ OBJCObjectFile *objectFile=OBJCArrayItemAtIndex(array,count); OBJCModule *module; - unsigned moduleIndex = 0; + unsigned long moduleIndex = 0; while((module=OBJCArrayEnumerate(objectFile->moduleArray,&moduleIndex))!=NULL) { unsigned classIndex; @@ -393,7 +393,7 @@ const char *OBJCModulePathForProcess(){ const char **objc_copyImageNames(unsigned *countp) { OBJCArray *array=OBJCObjectFileImageArray(); - unsigned arrayIndex=0,count=OBJCArrayCount(array); + unsigned long arrayIndex=0,count=OBJCArrayCount(array); const char **result=malloc(count*sizeof(char *)); OBJCObjectFile *objectFile; diff --git a/Foundation/objc/objc_cache.h b/Foundation/objc/objc_cache.h index 6758e14d..bc2b5156 100644 --- a/Foundation/objc/objc_cache.h +++ b/Foundation/objc/objc_cache.h @@ -2,7 +2,7 @@ // the cache entry size must be a power of 2 typedef struct { - long offsetToNextEntry; + intptr_t offsetToNextEntry; struct objc_method *method; } OBJCMethodCacheEntry; diff --git a/Foundation/objc/objc_class.m b/Foundation/objc/objc_class.m index 3aa379a9..e2228f16 100755 --- a/Foundation/objc/objc_class.m +++ b/Foundation/objc/objc_class.m @@ -199,7 +199,7 @@ Class class_getSuperclass(Class class) { int class_getVersion(Class class) { struct objc_class *cls=class; - return (int)(cls->version); // FIXME: ? API is int, object format is long. am I missing something? + return (int)(cls->version); // FIXME: NSObject uses NSInteger (long), object format uses log, API is int. wtf. am I missing something? } Method class_getClassMethod(Class class, SEL selector) @@ -274,7 +274,7 @@ const char *class_getIvarLayout(Class cls) { } static inline void OBJCInitializeCacheEntryOffset(OBJCMethodCacheEntry *entry){ - entry->offsetToNextEntry=-((long)entry); + entry->offsetToNextEntry=-((intptr_t)entry); } // FIXME, better allocator @@ -288,7 +288,7 @@ static OBJCMethodCacheEntry *allocateCacheEntry(){ static inline void OBJCCacheMethodInClass(Class class,struct objc_method *method) { SEL uniqueId=method->method_name; - unsigned long index=(unsigned long)uniqueId&OBJCMethodCacheMask; + uintptr_t index=(uintptr_t)uniqueId&OBJCMethodCacheMask; OBJCMethodCacheEntry *check=((void *)class->cache->table)+index; if(check->method->method_name==NULL) @@ -301,7 +301,7 @@ static inline void OBJCCacheMethodInClass(Class class,struct objc_method *method BOOL success=NO; while(!success) { - long offset=0; + intptr_t offset=0; while(offset=check->offsetToNextEntry, ((void *)check)+offset!=NULL) check=((void *)check)+offset; diff --git a/Foundation/objc/objc_debugHelpers.m b/Foundation/objc/objc_debugHelpers.m index 85bc6fad..a80ae076 100644 --- a/Foundation/objc/objc_debugHelpers.m +++ b/Foundation/objc/objc_debugHelpers.m @@ -138,7 +138,7 @@ BOOL _objc_checkObject(volatile id object) saneName[255]='\0'; char* cur; for(cur=saneName; *cur!='\0'; cur++) { - if(((unsigned char)*cur<=32 || (unsigned char)*cur>128)) + if(((uint8_t)*cur<=32 || (uint8_t)*cur>128)) { return NO; } diff --git a/Foundation/objc/objc_msg_lookup.m b/Foundation/objc/objc_msg_lookup.m index b0da06e5..c9f12b87 100644 --- a/Foundation/objc/objc_msg_lookup.m +++ b/Foundation/objc/objc_msg_lookup.m @@ -21,7 +21,7 @@ IMP objc_msg_lookup(id object,SEL selector) { return nil_message; else { OBJCMethodCache *cache=object->isa->cache; - unsigned long index=(unsigned long)selector&OBJCMethodCacheMask; + uintptr_t index=(uintptr_t)selector&OBJCMethodCacheMask; OBJCMethodCacheEntry *checkEntry=((void *)cache->table)+index; do{ @@ -38,7 +38,7 @@ IMP objc_msg_lookup(id object,SEL selector) { } IMP objc_msg_lookup_super(struct objc_super *super,SEL selector) { - unsigned long index=(unsigned long)selector&OBJCMethodCacheMask; + uintptr_t index=(uintptr_t)selector&OBJCMethodCacheMask; OBJCMethodCacheEntry *checkEntry=((void *)super->super_class->cache->table)+index; do{ diff --git a/Foundation/objc/objc_object.m b/Foundation/objc/objc_object.m index 2504b060..294ca189 100644 --- a/Foundation/objc/objc_object.m +++ b/Foundation/objc/objc_object.m @@ -47,8 +47,8 @@ Class object_setClass(id object,Class cls) { } static void ivarCopy(void *vdst,unsigned offset,void *vsrc,size_t length){ - unsigned char *dst=vdst; - unsigned char *src=vsrc; + uint8_t *dst=vdst; + uint8_t *src=vsrc; size_t i; for(i=0;ifdset,activeWrite->fdset,activeExcept->fdset,&timeval))<0) { diff --git a/Foundation/platform_posix/NSSocket_bsd.m b/Foundation/platform_posix/NSSocket_bsd.m index 88c99865..c5b4a4f8 100644 --- a/Foundation/platform_posix/NSSocket_bsd.m +++ b/Foundation/platform_posix/NSSocket_bsd.m @@ -33,7 +33,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @implementation NSSocket_bsd static inline void byteZero(void *vsrc,size_t size){ - unsigned char *src=vsrc; + uint8_t *src=vsrc; size_t i; for(i=0;i>32; SetFilePointer(_handle,offset&0xFFFFFFFF,&highWord,FILE_BEGIN); @@ -123,8 +123,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // Win32Assert("SetFilePointer"); } --(unsigned long long)seekToEndOfFile { - unsigned long long result=0; +-(uint64_t)seekToEndOfFile { + uint64_t result=0; LONG highWord=0; DWORD lowWord=SetFilePointer(_handle,0,&highWord,FILE_END); @@ -138,7 +138,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return result; } --(NSData *)readDataOfLength:(unsigned)length { +-(NSData *)readDataOfLength:(NSUInteger)length { NSMutableData *result=[NSMutableData dataWithLength:length]; DWORD readLength; @@ -236,7 +236,7 @@ while(GetLastError()!=ERROR_BROKEN_PIPE && Win32Assert("WriteFile"); } --(void)truncateFileAtOffset:(unsigned long long)offset { +-(void)truncateFileAtOffset:(uint64_t)offset { LONG highWord=offset>>32; SetFilePointer(_handle,offset&0xFFFFFFFF,&highWord,FILE_BEGIN); diff --git a/Foundation/platform_win32/NSFileManager_win32.m b/Foundation/platform_win32/NSFileManager_win32.m index 59f58e11..0302829b 100755 --- a/Foundation/platform_win32/NSFileManager_win32.m +++ b/Foundation/platform_win32/NSFileManager_win32.m @@ -120,7 +120,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } else { NSArray *contents=[self directoryContentsAtPath:path]; - int i,count=[contents count]; + NSInteger i,count=[contents count]; for(i=0;i @interface NSInputSource(Win32EventInputSource) --(unsigned)waitForEventsAndMultipleObjects:(HANDLE *)objects count:(unsigned)count milliseconds:(DWORD)milliseconds; +-(NSUInteger)waitForEventsAndMultipleObjects:(HANDLE *)objects count:(NSUInteger)count milliseconds:(DWORD)milliseconds; @end @implementation NSHandleMonitorSet_win32 @@ -33,7 +33,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [super dealloc]; } --(unsigned)count { +-(NSUInteger)count { return [_inputSources count]; } @@ -116,7 +116,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return nil; if(waitResult>=WAIT_OBJECT_0 && (waitResult=WAIT_ABANDONED_0 && waitResult<(WAIT_ABANDONED_0+objectCount)){ - unsigned index=waitResult-WAIT_ABANDONED_0; + DWORD index=waitResult-WAIT_ABANDONED_0; NSHandleMonitor_win32 *result=[self monitorWithHandle:objectList[index]]; [result setCurrentActivity:Win32HandleAbandoned]; diff --git a/Foundation/platform_win32/NSHandleMonitor_win32.h b/Foundation/platform_win32/NSHandleMonitor_win32.h index 91909a94..4be18a2b 100755 --- a/Foundation/platform_win32/NSHandleMonitor_win32.h +++ b/Foundation/platform_win32/NSHandleMonitor_win32.h @@ -16,7 +16,7 @@ enum { @interface NSHandleMonitor_win32 : NSInputSource { void *_handle; id _delegate; - unsigned _currentActivity; + NSUInteger _currentActivity; } +(NSHandleMonitor_win32 *)handleMonitorWithHandle:(void *)handle; @@ -27,7 +27,7 @@ enum { -(void)setDelegate:delegate; --(void)setCurrentActivity:(unsigned)activity; +-(void)setCurrentActivity:(NSUInteger)activity; -(void)notifyDelegateOfCurrentActivity; diff --git a/Foundation/platform_win32/NSHandleMonitor_win32.m b/Foundation/platform_win32/NSHandleMonitor_win32.m index 023156ad..05dfee1a 100755 --- a/Foundation/platform_win32/NSHandleMonitor_win32.m +++ b/Foundation/platform_win32/NSHandleMonitor_win32.m @@ -1,12 +1,10 @@ -/* Copyright (c) 2006-2007 Christopher J. W. Lloyd +/* Copyright (c) 2006-2007 Christopher J. W. Lloyd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - Christopher Lloyd #import #import #import @@ -32,7 +30,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI _delegate=delegate; } --(void)setCurrentActivity:(unsigned)activity { +-(void)setCurrentActivity:(NSUInteger)activity { _currentActivity=activity; } diff --git a/Foundation/platform_win32/NSMemoryFunctions_win32.m b/Foundation/platform_win32/NSMemoryFunctions_win32.m index 026859ad..616ab648 100755 --- a/Foundation/platform_win32/NSMemoryFunctions_win32.m +++ b/Foundation/platform_win32/NSMemoryFunctions_win32.m @@ -33,9 +33,9 @@ void NSDeallocateMemoryPages(void *pointer,NSUInteger byteCount) { } void NSCopyMemoryPages(const void *src,void *dst,NSUInteger byteCount) { - const unsigned char *srcb=src; - unsigned char *dstb=dst; - int i; + const uint8_t *srcb=src; + uint8_t *dstb=dst; + NSUInteger i; for(i=0;i #import #import #import @@ -21,7 +19,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @implementation NSPersistantDomain_win32 -(HKEY)rootHandle { - int i,count=[_path count]; + NSInteger i,count=[_path count]; HKEY previous=HKEY_CURRENT_USER; HKEY current=NULL; DWORD disposition; diff --git a/Foundation/platform_win32/NSPlatform_win32.m b/Foundation/platform_win32/NSPlatform_win32.m index 304ab8e5..fd1bc966 100755 --- a/Foundation/platform_win32/NSPlatform_win32.m +++ b/Foundation/platform_win32/NSPlatform_win32.m @@ -174,7 +174,7 @@ NSString *NSPlatformLoadableObjectFilePrefix=@""; -(NSDictionary *)environment { id *objects,*keys; - unsigned count; + NSUInteger count; char *envString=GetEnvironmentStrings(); char **env; @@ -331,7 +331,7 @@ void NSPlatformSleepThreadForTimeInterval(NSTimeInterval interval) { void NSPlatformLogString(NSString *string) { NSData *data=[NSPropertyListWriter_vintage nullTerminatedASCIIDataWithString:string]; const char *cString=[data bytes]; - unsigned length=[data length]-1; // skip 0 + NSUInteger length=[data length]-1; // skip 0 DWORD ignore; HANDLE handle; diff --git a/Foundation/platform_win32/NSReadInBackground_win32.h b/Foundation/platform_win32/NSReadInBackground_win32.h index dfed2863..28e4625b 100755 --- a/Foundation/platform_win32/NSReadInBackground_win32.h +++ b/Foundation/platform_win32/NSReadInBackground_win32.h @@ -14,8 +14,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @interface NSReadInBackground_win32 : NSObject { NSFileHandle *_fileHandle; HANDLE _readHandle; - unsigned _bufferCapacity; - unsigned _bufferSize; + NSUInteger _bufferCapacity; + NSUInteger _bufferSize; void *_buffer; NSArray *_modes; diff --git a/Foundation/platform_win32/NSReadInBackground_win32.m b/Foundation/platform_win32/NSReadInBackground_win32.m index 408a892f..ff7f045a 100755 --- a/Foundation/platform_win32/NSReadInBackground_win32.m +++ b/Foundation/platform_win32/NSReadInBackground_win32.m @@ -5,8 +5,6 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - Christopher Lloyd #import #import #import @@ -31,7 +29,7 @@ static DWORD WINAPI readInBackground(LPVOID arg){ } -initWithFileHandle:(NSFileHandle *)fileHandle modes:(NSArray *)modes { - int i,count=[modes count]; + NSInteger i,count=[modes count]; DWORD threadID; _fileHandle=fileHandle; @@ -73,7 +71,7 @@ static DWORD WINAPI readInBackground(LPVOID arg){ } -(void)_removeFromModes { - int i,count=[_modes count]; + NSInteger i,count=[_modes count]; for(i=0;ilock); if(pingElseThread){ - unsigned char one[1]={ 42 }; + uint8_t one[1]={ 42 }; [_async->pingWrite write:one maxLength:1]; } diff --git a/Foundation/platform_win32/NSSocket_windows.m b/Foundation/platform_win32/NSSocket_windows.m index 120dde5a..2e5e248d 100644 --- a/Foundation/platform_win32/NSSocket_windows.m +++ b/Foundation/platform_win32/NSSocket_windows.m @@ -24,9 +24,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI @implementation NSSocket_windows -static inline void byteZero(void *vsrc,int size){ - unsigned char *src=vsrc; - int i; +static inline void byteZero(void *vsrc,size_t size){ + uint8_t *src=vsrc; + size_t i; for(i=0;i Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -// Original - Christopher Lloyd #import #import NSString *NSStringFromNullTerminatedUnicode(const unichar *characters) { - unsigned length=0; + NSUInteger length=0; while(characters[length]!=0x0000) length++; @@ -20,7 +18,7 @@ NSString *NSStringFromNullTerminatedUnicode(const unichar *characters) { } const unichar *NSNullTerminatedUnicodeFromString(NSString *string) { - unsigned length=[string length]; + NSUInteger length=[string length]; unichar buffer[length+1]; [string getCharacters:buffer]; @@ -30,9 +28,9 @@ const unichar *NSNullTerminatedUnicodeFromString(NSString *string) { } NSData *NSTaskArgumentDataFromString(NSString *string) { - unsigned i,length=[string length],resultLength=0; + NSUInteger i,length=[string length],resultLength=0; unichar buffer[length]; - unsigned char result[1+length*2+1]; + uint8_t result[1+length*2+1]; [string getCharacters:buffer]; @@ -54,7 +52,7 @@ NSData *NSTaskArgumentDataFromString(NSString *string) { } NSData *NSTaskArgumentDataFromStringW(NSString *string) { - unsigned i,length=[string length],resultLength=0; + NSUInteger i,length=[string length],resultLength=0; unichar buffer[length]; unichar result[1+length*2+1]; diff --git a/Foundation/platform_win32/NSTask_win32.m b/Foundation/platform_win32/NSTask_win32.m index df1392c8..63d6a222 100755 --- a/Foundation/platform_win32/NSTask_win32.m +++ b/Foundation/platform_win32/NSTask_win32.m @@ -91,7 +91,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(NSData *)_argumentsData { NSMutableData *data=[NSMutableData data]; - int i,count=[_arguments count]; + NSInteger i,count=[_arguments count]; [data appendData:NSTaskArgumentDataFromString(_launchPath)]; [data appendBytes:" " length:1]; diff --git a/Foundation/xml/NSXMLDTD.h b/Foundation/xml/NSXMLDTD.h index 5abc48d3..7991906b 100644 --- a/Foundation/xml/NSXMLDTD.h +++ b/Foundation/xml/NSXMLDTD.h @@ -18,8 +18,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI +(NSXMLDTDNode *)predefinedEntityDeclarationForName:(NSString *)name; --initWithData:(NSData *)data options:(unsigned)options error:(NSError **)error; --initWithContentsOfURL:(NSURL *)url options:(unsigned)options error:(NSError **)error; +-initWithData:(NSData *)data options:(NSUInteger)options error:(NSError **)error; +-initWithContentsOfURL:(NSURL *)url options:(NSUInteger)options error:(NSError **)error; -(NSString *)publicID; -(NSString *)systemID; diff --git a/Foundation/xml/NSXMLDTD.m b/Foundation/xml/NSXMLDTD.m index 63364846..2ed5a842 100644 --- a/Foundation/xml/NSXMLDTD.m +++ b/Foundation/xml/NSXMLDTD.m @@ -17,12 +17,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return nil; } --initWithData:(NSData *)data options:(unsigned)options error:(NSError **)error { +-initWithData:(NSData *)data options:(NSUInteger)options error:(NSError **)error { NSUnimplementedMethod(); return nil; } --initWithContentsOfURL:(NSURL *)url options:(unsigned)options error:(NSError **)error { +-initWithContentsOfURL:(NSURL *)url options:(NSUInteger)options error:(NSError **)error { NSUnimplementedMethod(); return nil; } diff --git a/Foundation/xml/NSXMLElement.h b/Foundation/xml/NSXMLElement.h index ae685512..94c08ff8 100644 --- a/Foundation/xml/NSXMLElement.h +++ b/Foundation/xml/NSXMLElement.h @@ -35,10 +35,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(void)setNamespaces:(NSArray *)namespaces; -(void)addChild:(NSXMLNode *)child; --(void)insertChild:(NSXMLNode *)child atIndex:(unsigned)index; --(void)insertChildren:(NSArray *)children atIndex:(unsigned)index; --(void)removeChildAtIndex:(unsigned)index; --(void)replaceChildAtIndex:(unsigned)index withNode:(NSXMLNode *)node; +-(void)insertChild:(NSXMLNode *)child atIndex:(NSUInteger)index; +-(void)insertChildren:(NSArray *)children atIndex:(NSUInteger)index; +-(void)removeChildAtIndex:(NSUInteger)index; +-(void)replaceChildAtIndex:(NSUInteger)index withNode:(NSXMLNode *)node; -(void)addAttribute:(NSXMLNode *)attribute; -(void)removeAttributeForName:(NSString *)name; diff --git a/Foundation/xml/NSXMLElement.m b/Foundation/xml/NSXMLElement.m index 01d701aa..25da54bb 100644 --- a/Foundation/xml/NSXMLElement.m +++ b/Foundation/xml/NSXMLElement.m @@ -86,22 +86,22 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI [_children addObject:node]; } --(void)insertChild:(NSXMLNode *)child atIndex:(unsigned)index { +-(void)insertChild:(NSXMLNode *)child atIndex:(NSUInteger)index { [_children insertObject:child atIndex:index]; } --(void)insertChildren:(NSArray *)children atIndex:(unsigned)index { +-(void)insertChildren:(NSArray *)children atIndex:(NSUInteger)index { NSInteger i,count=[children count]; for(i=0;i { NSXMLNode *_parent; - unsigned _index; + NSUInteger _index; NSXMLNodeKind _kind; - unsigned _options; + NSUInteger _options; NSString *_name; id _value; } @@ -77,11 +77,11 @@ enum { +(NSString *)localNameForName:(NSString *)name; -initWithKind:(NSXMLNodeKind)kind; --initWithKind:(NSXMLNodeKind)kind options:(unsigned)options; +-initWithKind:(NSXMLNodeKind)kind options:(NSUInteger)options; --(unsigned)index; +-(NSUInteger)index; -(NSXMLNodeKind)kind; --(unsigned)level; +-(NSUInteger)level; -(NSString *)localName; -(NSString *)name; -(NSXMLNode *)nextNode; @@ -95,9 +95,9 @@ enum { -(NSXMLNode *)previousSibling; -(NSXMLDocument *)rootDocument; --(unsigned)childCount; +-(NSUInteger)childCount; -(NSArray *)children; --(NSXMLNode *)childAtIndex:(unsigned)index; +-(NSXMLNode *)childAtIndex:(NSUInteger)index; -(void)setName:(NSString *)name; -(void)setObjectValue:object; @@ -109,7 +109,7 @@ enum { -(NSArray *)objectsForXQuery:(NSString *)xquery constants:(NSDictionary *)constants error:(NSError **)error; -(NSArray *)objectsForXQuery:(NSString *)xquery error:(NSError **)error; -(NSString *)XMLString; --(NSString *)XMLStringWithOptions:(unsigned)options; +-(NSString *)XMLStringWithOptions:(NSUInteger)options; -(NSString *)XPath; -(NSString *)canonicalXMLStringPreservingComments:(BOOL)comments; diff --git a/Foundation/xml/NSXMLNode.m b/Foundation/xml/NSXMLNode.m index c51b65f7..1550bb88 100644 --- a/Foundation/xml/NSXMLNode.m +++ b/Foundation/xml/NSXMLNode.m @@ -113,7 +113,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return self; } --initWithKind:(NSXMLNodeKind)kind options:(unsigned)options { +-initWithKind:(NSXMLNodeKind)kind options:(NSUInteger)options { _parent=nil; _index=0; _kind=kind; @@ -139,7 +139,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return copy; } --(unsigned)index { +-(NSUInteger)index { return _index; } @@ -147,7 +147,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return _kind; } --(unsigned)level { +-(NSUInteger)level { NSUnimplementedMethod(); return 0; } @@ -208,7 +208,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return nil; } --(unsigned)childCount { +-(NSUInteger)childCount { return 0; } @@ -216,7 +216,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return nil; } --(NSXMLNode *)childAtIndex:(unsigned)index { +-(NSXMLNode *)childAtIndex:(NSUInteger)index { return nil; } @@ -267,7 +267,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return nil; } --(NSString *)XMLStringWithOptions:(unsigned)options { +-(NSString *)XMLStringWithOptions:(NSUInteger)options { NSUnimplementedMethod(); return nil; } diff --git a/Foundation/xml/NSXMLParser.h b/Foundation/xml/NSXMLParser.h index 95c14ef3..0d8b5d1a 100644 --- a/Foundation/xml/NSXMLParser.h +++ b/Foundation/xml/NSXMLParser.h @@ -19,8 +19,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI NSError *_parserError; NSString *_systemID; NSString *_publicID; - int _columnNumber; - int _lineNumber; + NSInteger _columnNumber; + NSInteger _lineNumber; } -initWithData:(NSData *)data; @@ -42,7 +42,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI -(NSString *)systemID; -(NSString *)publicID; --(int)columnNumber; --(int)lineNumber; +-(NSInteger)columnNumber; +-(NSInteger)lineNumber; @end diff --git a/Foundation/xml/NSXMLParser.m b/Foundation/xml/NSXMLParser.m index 46036543..715a7e9a 100644 --- a/Foundation/xml/NSXMLParser.m +++ b/Foundation/xml/NSXMLParser.m @@ -81,11 +81,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return _publicID; } --(int)columnNumber { +-(NSInteger)columnNumber { return _columnNumber; } --(int)lineNumber { +-(NSInteger)lineNumber { return _lineNumber; } diff --git a/testing/SWRender/DemosTemplate.m b/testing/SWRender/DemosTemplate.m index e2bf8dbd..fe8cd0cf 100644 --- a/testing/SWRender/DemosTemplate.m +++ b/testing/SWRender/DemosTemplate.m @@ -305,6 +305,12 @@ static void addSliceToPath(CGMutablePathRef path,float innerRadius,float outerRa CGMutablePathRef path=CGPathCreateMutable(); +#if 0 + CGPathMoveToPoint(path,NULL,-width,0); + CGPathAddLineToPoint(path,NULL,width,0); + CGPathMoveToPoint(path,NULL,0,-height); + CGPathAddLineToPoint(path,NULL,0,height); +#else for(i=0;i<400;i+=4){ CGPathMoveToPoint(path,NULL,i,0); @@ -316,10 +322,13 @@ static void addSliceToPath(CGMutablePathRef path,float innerRadius,float outerRa CGPathAddLineToPoint(path,NULL,width,i); } +#endif + CGContextSaveGState(_context); CGContextClearRect(_context,CGRectMake(0,0,400,400)); CGContextConcatCTM(_context,xform); [self establishContextState]; + CGContextBeginPath(_context); CGContextAddPath(_context,path); diff --git a/testing/SWRender/English.lproj/MainMenu.nib/info.nib b/testing/SWRender/English.lproj/MainMenu.nib/info.nib index 0d0a28b0..5ac025bf 100644 --- a/testing/SWRender/English.lproj/MainMenu.nib/info.nib +++ b/testing/SWRender/English.lproj/MainMenu.nib/info.nib @@ -11,7 +11,7 @@ IBOpenObjects 29 - 735 + 694 IBSystem Version 9G55 diff --git a/testing/SWRender/English.lproj/MainMenu.nib/keyedobjects.nib b/testing/SWRender/English.lproj/MainMenu.nib/keyedobjects.nib index dae9e4d5..36d4c2c2 100644 Binary files a/testing/SWRender/English.lproj/MainMenu.nib/keyedobjects.nib and b/testing/SWRender/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/testing/SWRender/SWRender.xcodeproj/project.pbxproj b/testing/SWRender/SWRender.xcodeproj/project.pbxproj index 3db22f19..5dffb8c3 100644 --- a/testing/SWRender/SWRender.xcodeproj/project.pbxproj +++ b/testing/SWRender/SWRender.xcodeproj/project.pbxproj @@ -646,7 +646,7 @@ GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO; - GCC_MODEL_PPC64 = NO; + GCC_MODEL_PPC64 = YES; GCC_MODEL_TUNING = ""; GCC_OPTIMIZATION_LEVEL = 3; GCC_STRICT_ALIASING = YES;