mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-23 04:00:00 +00:00
More NS(U)Integer cleanup, more stdint conversion
This commit is contained in:
parent
2f54846d44
commit
548ca541b0
@ -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);
|
||||
|
||||
|
@ -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 */ = {
|
||||
|
@ -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;
|
||||
|
@ -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;i<length;i++)
|
||||
[self _appendWordOne:values[i]];
|
||||
@ -236,7 +236,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
case 's':
|
||||
case 'S':{
|
||||
const unsigned short *values=addr;
|
||||
int i;
|
||||
NSInteger i;
|
||||
|
||||
for(i=0;i<length;i++)
|
||||
[self _appendWordTwo:values[i]];
|
||||
|
@ -164,7 +164,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
[keyed encodeArray:self forKey:@"NS.objects"];
|
||||
}
|
||||
else {
|
||||
NSUInteger i,count=[self count];
|
||||
int i,count=[self count];
|
||||
|
||||
[coder encodeValueOfObjCType:@encode(int) at:&count];
|
||||
for(i=0;i<count;i++)
|
||||
@ -512,7 +512,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
{
|
||||
NSInteger numObjects=MIN([self count] - state->extra[0], length);
|
||||
NSInteger i=state->extra[0];
|
||||
int j=0;
|
||||
NSInteger j=0;
|
||||
state->itemsPtr=stackbuf;
|
||||
|
||||
for(j=0; j<numObjects; j++, i++)
|
||||
|
@ -38,7 +38,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
-(void)exchangeobjectAtIndex:(NSUInteger)index withobjectAtIndex:(NSUInteger)other;
|
||||
|
||||
-(void)sortUsingSelector:(SEL)selector;
|
||||
-(void)sortUsingFunction:(int (*)(id, id, void *))compare context:(void *)context;
|
||||
-(void)sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context;
|
||||
|
||||
-(void)sortUsingDescriptors:(NSArray *)descriptors;
|
||||
-(void)filterUsingPredicate:(NSPredicate *)predicate;
|
||||
|
@ -382,7 +382,7 @@ static int selectorCompare(id object1,id object2,void *userData){
|
||||
// http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/merge/mergiter.htm ...
|
||||
|
||||
// ... using a comparison function
|
||||
-(void)sortUsingFunction:(int (*)(id, id, void *))compare context:(void *)context
|
||||
-(void)sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context
|
||||
{
|
||||
NSInteger h, i, j, k, l, m, n = [self count];
|
||||
id A, *B = malloc((n/2 + 1) * sizeof(id));
|
||||
|
@ -251,7 +251,7 @@ static inline NSUInteger indexOfObject(NSMutableArray_concrete *self,id object){
|
||||
}
|
||||
|
||||
// iterative mergesort based on http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/merge/mergiter.htm
|
||||
-(void)sortUsingFunction:(int (*)(id, id, void *))compare context:(void *)context {
|
||||
-(void)sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context {
|
||||
NSInteger h, i, j, k, l, m, n = _count;
|
||||
id A, *B = malloc((n/2 + 1) * sizeof(id));
|
||||
|
||||
|
@ -49,7 +49,7 @@ struct NSRangeEntries {
|
||||
}
|
||||
|
||||
void NSResetRangeEntries(NSRangeEntries *self) {
|
||||
int i;
|
||||
NSInteger i;
|
||||
|
||||
for(i=0;i<self->count;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;i<self->count;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;i<self->count;i++){
|
||||
NSRange range=self->entries[i].range;
|
||||
|
@ -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;
|
||||
|
@ -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<NSBitmapCharacterSetSize;i++)
|
||||
|
@ -11,7 +11,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
|
||||
@interface NSCharacterSet_bitmap : NSCharacterSet {
|
||||
unsigned char _bitmap[NSBitmapCharacterSetSize];
|
||||
uint8_t _bitmap[NSBitmapCharacterSetSize];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -1,12 +1,10 @@
|
||||
/* Copyright (c) 2006-2007 Christopher J. W. Lloyd
|
||||
/* Copyright (c) 2006-2009 Christopher J. W. Lloyd <cjwl@objc.net>
|
||||
|
||||
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 <cjwl@objc.net>
|
||||
#import <Foundation/NSCharacterSet_bitmap.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSRaise.h>
|
||||
@ -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"
|
||||
|
@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <Foundation/bitmapRepresentation.h>
|
||||
|
||||
@interface NSMutableCharacterSet_bitmap : NSMutableCharacterSet {
|
||||
unsigned char _bitmap[NSBitmapCharacterSetSize];
|
||||
uint8_t _bitmap[NSBitmapCharacterSetSize];
|
||||
}
|
||||
|
||||
-initWithCharacterSet:(NSCharacterSet *)set;
|
||||
|
@ -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))
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
cString[pos++]='<';
|
||||
for(i=0;i<length;){
|
||||
unsigned char byte=bytes[i];
|
||||
uint8_t byte=bytes[i];
|
||||
|
||||
cString[pos++]=hex[byte>>4];
|
||||
cString[pos++]=hex[byte&0x0F];
|
||||
|
@ -15,8 +15,8 @@ typedef int NSCalendarUnit;
|
||||
|
||||
@interface NSCalendar : NSObject <NSCopying> {
|
||||
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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ const NSTimeInterval NSTimeIntervalSince1970 = (NSTimeInterval)978307200.0;
|
||||
}
|
||||
|
||||
-(NSUInteger)hash {
|
||||
return (int)[self timeIntervalSinceReferenceDate];
|
||||
return (NSUInteger)[self timeIntervalSinceReferenceDate];
|
||||
}
|
||||
|
||||
-(BOOL)isEqual:other {
|
||||
|
@ -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 <NSDecimalNumberBehaviors>)behavior;
|
||||
|
||||
-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power;
|
||||
-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power withBehavior:(id <NSDecimalNumberBehaviors>)behavior;
|
||||
-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(int16_t)power;
|
||||
-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(int16_t)power withBehavior:(id <NSDecimalNumberBehaviors>)behavior;
|
||||
|
||||
-(NSDecimalNumber *)decimalNumberByRaisingToPower:(unsigned)power;
|
||||
-(NSDecimalNumber *)decimalNumberByRaisingToPower:(unsigned)power withBehavior:(id <NSDecimalNumberBehaviors>)behavior;
|
||||
-(NSDecimalNumber *)decimalNumberByRaisingToPower:(NSUInteger)power;
|
||||
-(NSDecimalNumber *)decimalNumberByRaisingToPower:(NSUInteger)power withBehavior:(id <NSDecimalNumberBehaviors>)behavior;
|
||||
|
||||
-(NSString *)descriptionWithLocale:(NSDictionary *)locale;
|
||||
|
||||
|
@ -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 <NSDecimalNumberBehaviors>)behavior {
|
||||
-(NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(int16_t)power withBehavior:(id <NSDecimalNumberBehaviors>)behavior {
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
|
@ -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 <cjwl@objc.net>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSRaise.h>
|
||||
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
@ -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<other->_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];
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -21,7 +21,7 @@ FOUNDATION_EXPORT NSString *NSInvalidArchiveOperationException;
|
||||
id _delegate;
|
||||
NSPropertyListFormat _outputFormat;
|
||||
NSMapTable *_nameToClass;
|
||||
unsigned _pass;
|
||||
NSUInteger _pass;
|
||||
NSMapTable *_objectToUid;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,20 @@
|
||||
#import <objc/runtime.h>
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSInvocation.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
// 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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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]]);
|
||||
|
@ -1297,7 +1297,7 @@ static NSPredicate *nextComparisonPredicate(predicateScanner *scanner){
|
||||
NSExpression *right;
|
||||
NSPredicate *result;
|
||||
NSPredicateOperatorType type;
|
||||
auto unsigned options;
|
||||
unsigned options;
|
||||
|
||||
switch(peekTokenType(scanner)){
|
||||
|
||||
|
@ -30,7 +30,7 @@ enum {
|
||||
|
||||
-(NSUInteger)processorCount;
|
||||
-(NSUInteger)activeProcessorCount;
|
||||
-(unsigned long long)physicalMemory;
|
||||
-(uint64_t)physicalMemory;
|
||||
|
||||
-(NSUInteger)operatingSystem;
|
||||
-(NSString *)operatingSystemName;
|
||||
|
@ -56,7 +56,7 @@ const char * const *NSProcessInfoArgv=NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
-(unsigned long long)physicalMemory {
|
||||
-(uint64_t)physicalMemory {
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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 )
|
||||
|
@ -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;
|
||||
|
@ -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){
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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:"</string>\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:"</array>\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:"</dict>\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:"<data>\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:"</data>\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];
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 <cjwl@objc.net>
|
||||
#import <Foundation/NSOrderedPerform.h>
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
@ -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<maxLength && _position<length;i++,_position++)
|
||||
|
@ -115,7 +115,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return result;
|
||||
}
|
||||
|
||||
-(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(unsigned)selectEvent {
|
||||
-(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(NSUInteger)selectEvent {
|
||||
NSStreamEvent event;
|
||||
|
||||
switch(_status){
|
||||
|
@ -10,15 +10,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@interface NSOutputStream : NSStream
|
||||
|
||||
-initToBuffer:(unsigned char *)buffer capacity:(NSUInteger)capacity;
|
||||
-initToBuffer:(uint8_t *)buffer capacity:(NSUInteger)capacity;
|
||||
-initToFileAtPath:(NSString *)path append:(BOOL)append;
|
||||
-initToMemory;
|
||||
|
||||
+outputStreamToBuffer:(unsigned char *)buffer capacity:(NSUInteger)capacity;
|
||||
+outputStreamToBuffer:(uint8_t *)buffer capacity:(NSUInteger)capacity;
|
||||
+outputStreamToFileAtPath:(NSString *)path append:(BOOL)append;
|
||||
+outputStreamToMemory;
|
||||
|
||||
-(BOOL)hasSpaceAvailable;
|
||||
-(NSInteger)write:(const unsigned char *)buffer maxLength:(NSUInteger)length;
|
||||
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length;
|
||||
|
||||
@end
|
||||
|
@ -13,7 +13,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@implementation NSOutputStream
|
||||
|
||||
-initToBuffer:(unsigned char *)buffer capacity:(NSUInteger)capacity {
|
||||
-initToBuffer:(uint8_t *)buffer capacity:(NSUInteger)capacity {
|
||||
[self dealloc];
|
||||
return [[NSOutputStream_buffer alloc] initToBuffer:buffer capacity:capacity];
|
||||
}
|
||||
@ -28,7 +28,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return [[NSOutputStream_data alloc] initToMemory];
|
||||
}
|
||||
|
||||
+outputStreamToBuffer:(unsigned char *)buffer capacity:(NSUInteger)capacity {
|
||||
+outputStreamToBuffer:(uint8_t *)buffer capacity:(NSUInteger)capacity {
|
||||
return [[[self alloc] initToBuffer:buffer capacity:capacity] autorelease];
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(NSInteger)write:(const unsigned char *)buffer maxLength:(NSUInteger)length {
|
||||
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length {
|
||||
NSInvalidAbstractInvocation();
|
||||
return 0;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
id _delegate;
|
||||
NSError *_error;
|
||||
NSStreamStatus _status;
|
||||
unsigned char *_buffer;
|
||||
uint8_t *_buffer;
|
||||
NSUInteger _capacity;
|
||||
NSUInteger _position;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@implementation NSOutputStream_buffer
|
||||
|
||||
-initToBuffer:(unsigned char *)buffer capacity:(NSUInteger)capacity {
|
||||
-initToBuffer:(uint8_t *)buffer capacity:(NSUInteger)capacity {
|
||||
_delegate=self;
|
||||
_error=nil;
|
||||
_status=NSStreamStatusNotOpen;
|
||||
@ -59,7 +59,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return (_position<_capacity)?YES:NO;
|
||||
}
|
||||
|
||||
-(NSInteger)write:(const unsigned char *)buffer maxLength:(NSUInteger)maxLength {
|
||||
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)maxLength {
|
||||
if(_status!=NSStreamStatusOpen)
|
||||
return -1;
|
||||
else {
|
||||
|
@ -68,7 +68,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return (_status==NSStreamStatusOpen)?YES:NO;
|
||||
}
|
||||
|
||||
-(NSInteger)write:(const unsigned char *)buffer maxLength:(NSUInteger)maxLength {
|
||||
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)maxLength {
|
||||
if(_status!=NSStreamStatusOpen)
|
||||
return -1;
|
||||
|
||||
|
@ -72,7 +72,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return (_status==NSStreamStatusOpen)?YES:NO;
|
||||
}
|
||||
|
||||
-(NSInteger)write:(const unsigned char *)buffer maxLength:(NSUInteger)maxLength {
|
||||
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)maxLength {
|
||||
if(_status!=NSStreamStatusOpen)
|
||||
return -1;
|
||||
|
||||
|
@ -92,14 +92,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(NSInteger)write:(const unsigned char *)buffer maxLength:(NSUInteger)length {
|
||||
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length {
|
||||
if(_status!=NSStreamStatusOpen && _status!=NSStreamStatusOpening)
|
||||
return -1;
|
||||
|
||||
return [_socket write:buffer maxLength:length];
|
||||
}
|
||||
|
||||
-(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(unsigned)selectEvent {
|
||||
-(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(NSUInteger)selectEvent {
|
||||
NSStreamEvent event;
|
||||
|
||||
switch(_status){
|
||||
|
@ -19,7 +19,7 @@ enum {
|
||||
@interface NSSelectInputSource : NSInputSource {
|
||||
NSSocket *_socket;
|
||||
id _delegate;
|
||||
unsigned _eventMask;
|
||||
NSUInteger _eventMask;
|
||||
BOOL _isValid;
|
||||
}
|
||||
|
||||
@ -32,13 +32,13 @@ enum {
|
||||
|
||||
-(void)setDelegate:object;
|
||||
|
||||
-(unsigned)selectEventMask;
|
||||
-(void)setSelectEventMask:(unsigned)mask;
|
||||
-(NSUInteger)selectEventMask;
|
||||
-(void)setSelectEventMask:(NSUInteger)mask;
|
||||
|
||||
-(BOOL)processImmediateEvents:(unsigned)selectEvent;
|
||||
-(BOOL)processImmediateEvents:(NSUInteger)selectEvent;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject(NSSelectInputSourceDelegate)
|
||||
-(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(unsigned)selectEvent;
|
||||
-(void)selectInputSource:(NSSelectInputSource *)inputSource selectEvent:(NSUInteger)selectEvent;
|
||||
@end
|
||||
|
@ -50,15 +50,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
_delegate=object;
|
||||
}
|
||||
|
||||
-(unsigned)selectEventMask {
|
||||
-(NSUInteger)selectEventMask {
|
||||
return _eventMask;
|
||||
}
|
||||
|
||||
-(void)setSelectEventMask:(unsigned)eventMask {
|
||||
-(void)setSelectEventMask:(NSUInteger)eventMask {
|
||||
_eventMask=eventMask;
|
||||
}
|
||||
|
||||
-(BOOL)processImmediateEvents:(unsigned)selectEvent {
|
||||
-(BOOL)processImmediateEvents:(NSUInteger)selectEvent {
|
||||
if((selectEvent&=_eventMask)==0)
|
||||
return NO;
|
||||
|
||||
|
@ -83,7 +83,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
while((check=[state nextObject])!=nil){
|
||||
NSSocket *socket=[check socket];
|
||||
unsigned mask=[check selectEventMask];
|
||||
NSUInteger mask=[check selectEventMask];
|
||||
|
||||
if(mask&NSSelectReadEvent)
|
||||
[result addObjectForRead:socket];
|
||||
|
@ -26,11 +26,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
-(BOOL)hasBytesAvailable;
|
||||
|
||||
-(NSInteger)read:(unsigned char *)buffer maxLength:(NSUInteger)length;
|
||||
-(NSInteger)write:(const unsigned char *)buffer maxLength:(NSUInteger)length;
|
||||
-(NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)length;
|
||||
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length;
|
||||
|
||||
-(NSSocket *)acceptWithError:(NSError **)errorp;
|
||||
|
||||
@end
|
||||
|
||||
NSData *NSSocketAddressDataForNetworkOrderAddressBytesAndPort(const void *address,unsigned length,int port);
|
||||
NSData *NSSocketAddressDataForNetworkOrderAddressBytesAndPort(const void *address,NSUInteger length,int port);
|
||||
|
@ -46,12 +46,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(NSInteger)read:(unsigned char *)buffer maxLength:(NSUInteger)length {
|
||||
-(NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)length {
|
||||
NSInvalidAbstractInvocation();
|
||||
return -1;
|
||||
}
|
||||
|
||||
-(NSInteger)write:(const unsigned char *)buffer maxLength:(NSUInteger)length {
|
||||
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length {
|
||||
NSInvalidAbstractInvocation();
|
||||
return -1;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
}
|
||||
|
||||
-(void)getCharacters:(unichar *)buffer {
|
||||
int i;
|
||||
NSInteger i;
|
||||
|
||||
for(i=0;i<_length;i++)
|
||||
buffer[i]=_unicode[i];
|
||||
@ -103,7 +103,7 @@ NSString *NSMutableString_unicodePtrInitWithCString(NSMutableString_unicodePtr *
|
||||
|
||||
NSString *NSMutableString_unicodePtrInit(NSMutableString_unicodePtr *self,
|
||||
const unichar *unicode,NSUInteger length,NSZone *zone){
|
||||
int i;
|
||||
NSInteger i;
|
||||
|
||||
self->_length=length;
|
||||
self->_capacity=roundCapacityUp(length);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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];
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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<length;i++)
|
||||
result=((result<<5)+result)+buffer[i]; // hash*33+c
|
||||
@ -21,20 +21,20 @@ static inline unsigned NSStringHashUnicode(const unichar *buffer,NSUInteger leng
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline unsigned NSStringHashASCII(const char *buffer,unsigned length){
|
||||
unsigned i,result=5381;
|
||||
static inline NSUInteger NSStringHashASCII(const char *buffer,NSUInteger length){
|
||||
NSUInteger i,result=5381;
|
||||
|
||||
for(i=0;i<length;i++)
|
||||
result=((result<<5)+result)+(unsigned)(buffer[i]); // hash*33+c
|
||||
result=((result<<5)+result)+(NSUInteger)(buffer[i]); // hash*33+c
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline unsigned NSStringHashZeroTerminatedASCII(const char *buffer){
|
||||
unsigned i,result=5381;
|
||||
static inline NSUInteger NSStringHashZeroTerminatedASCII(const char *buffer){
|
||||
NSUInteger i,result=5381;
|
||||
|
||||
for(i=0;buffer[i]!='\0';i++)
|
||||
result=((result<<5)+result)+(unsigned)(buffer[i]); // hash*33+c
|
||||
result=((result<<5)+result)+(NSUInteger)(buffer[i]); // hash*33+c
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -9,13 +9,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <Foundation/NSStringSymbol.h>
|
||||
#import <Foundation/NSRaise.h>
|
||||
|
||||
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<utf16Length;i++){
|
||||
unsigned code32=utf16[i];
|
||||
unsigned char tmp[4];
|
||||
uint32_t code32=utf16[i];
|
||||
uint8_t tmp[4];
|
||||
int tmpLength=0;
|
||||
|
||||
if(code32<0x80)
|
||||
|
@ -14,7 +14,7 @@ unichar *NSISOLatin1ToUnicode(const char *cString,NSUInteger length,
|
||||
int i;
|
||||
|
||||
for(i=0;i<length;i++)
|
||||
characters[i]=((unsigned char *)cString)[i];
|
||||
characters[i]=((uint8_t *)cString)[i];
|
||||
|
||||
*resultLength=i;
|
||||
return characters;
|
||||
@ -54,7 +54,7 @@ NSString *NSString_isoLatin1NewWithBytes(NSZone *zone,
|
||||
|
||||
string->_length=length;
|
||||
for(i=0;i<length;i++)
|
||||
string->_bytes[i]=((unsigned char *)bytes)[i];
|
||||
string->_bytes[i]=((uint8_t *)bytes)[i];
|
||||
string->_bytes[i]='\0';
|
||||
|
||||
return string;
|
||||
|
@ -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<length && result<maxLength;i++){
|
||||
unichar code=characters[i];
|
||||
|
@ -40,7 +40,7 @@ NSString *NSString_unicodeNew(NSZone *zone,
|
||||
}
|
||||
|
||||
-(void)getCharacters:(unichar *)buffer {
|
||||
int i;
|
||||
NSInteger i;
|
||||
|
||||
for(i=0;i<_length;i++)
|
||||
buffer[i]=_unicode[i];
|
||||
|
@ -734,7 +734,7 @@ void NSUnicodeToCapitalized(unichar *characters,NSUInteger length) {
|
||||
}
|
||||
|
||||
unichar *NSUnicodeFromData(NSData *data,NSUInteger *resultLengthp) {
|
||||
const unsigned char *bytes=[data bytes];
|
||||
const uint8_t *bytes=[data bytes];
|
||||
NSUInteger i,length=[data length],resultLength,resultIndex=0;
|
||||
BOOL swap=NO;
|
||||
unichar *result;
|
||||
@ -780,7 +780,7 @@ unichar *NSUnicodeFromData(NSData *data,NSUInteger *resultLengthp) {
|
||||
}
|
||||
|
||||
unichar *NSUnicodeFromDataUTF16BigEndian(NSData *data,NSUInteger *resultLengthp) {
|
||||
const unsigned char *bytes=[data bytes];
|
||||
const uint8_t *bytes=[data bytes];
|
||||
NSUInteger i,length=[data length],resultLength,resultIndex=0;
|
||||
unichar *result;
|
||||
|
||||
|
@ -26,7 +26,7 @@ static inline unsigned short PickWord(unsigned short w){
|
||||
|
||||
// this routine is applicable for conversion of utf32 to utf8
|
||||
// as well as of utf16 to utf8 in the BMP range U+0000 through U+FFFF
|
||||
static int UnicodeToUTF8(unsigned utf32, unsigned char *utf8)
|
||||
static int UnicodeToUTF8(unsigned utf32, uint8_t *utf8)
|
||||
{
|
||||
if (utf32 < 0x80)
|
||||
{
|
||||
|
@ -13,9 +13,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
}
|
||||
|
||||
+(NSString *)localizedStringForStatusCode:(int)statusCode;
|
||||
+(NSString *)localizedStringForStatusCode:(NSInteger)statusCode;
|
||||
|
||||
-(NSDictionary *)allHeaderFields;
|
||||
-(int)statusCode;
|
||||
-(NSInteger)statusCode;
|
||||
|
||||
@end
|
||||
|
@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@implementation NSHTTPURLResponse
|
||||
|
||||
+(NSString *)localizedStringForStatusCode:(int)statusCode {
|
||||
+(NSString *)localizedStringForStatusCode:(NSInteger)statusCode {
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
}
|
||||
@ -20,7 +20,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(int)statusCode {
|
||||
-(NSInteger)statusCode {
|
||||
NSUnimplementedMethod();
|
||||
return 0;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
-(NSURLProtectionSpace *)protectionSpace;
|
||||
-(NSURLCredential *)proposedCredential;
|
||||
-(unsigned)previousFailureCount;
|
||||
-(NSUInteger)previousFailureCount;
|
||||
-(NSURLResponse *)failureResponse;
|
||||
-(NSError *)error;
|
||||
-(id<NSURLAuthenticationChallengeSender>)sender;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user