mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Changes for 64bit clean printf format strings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36810 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8082fb58c1
commit
022d588467
32 changed files with 223 additions and 168 deletions
|
@ -274,7 +274,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
|
|||
+ (id) stringWithCString: (const char*)byteString
|
||||
length: (NSUInteger)length;
|
||||
+ (id) stringWithCString: (const char*)byteString;
|
||||
+ (id) stringWithFormat: (NSString*)format,...;
|
||||
+ (id) stringWithFormat: (NSString*)format,... NS_FORMAT_FUNCTION(1,2);
|
||||
+ (id) stringWithContentsOfFile:(NSString *)path;
|
||||
|
||||
// Initializing Newly Allocated Strings
|
||||
|
@ -344,9 +344,9 @@ typedef NSUInteger NSStringEncodingConversionOptions;
|
|||
length: (NSUInteger)length;
|
||||
- (id) initWithCString: (const char*)byteString;
|
||||
- (id) initWithString: (NSString*)string;
|
||||
- (id) initWithFormat: (NSString*)format, ...;
|
||||
- (id) initWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
|
||||
- (id) initWithFormat: (NSString*)format
|
||||
arguments: (va_list)argList;
|
||||
arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0);
|
||||
- (id) initWithData: (NSData*)data
|
||||
encoding: (NSStringEncoding)encoding;
|
||||
- (id) initWithContentsOfFile: (NSString*)path;
|
||||
|
@ -361,7 +361,8 @@ typedef NSUInteger NSStringEncodingConversionOptions;
|
|||
range: (NSRange)aRange;
|
||||
|
||||
// Combining Strings
|
||||
- (NSString*) stringByAppendingFormat: (NSString*)format,...;
|
||||
- (NSString*) stringByAppendingFormat: (NSString*)format,...
|
||||
NS_FORMAT_FUNCTION(1,2);
|
||||
- (NSString*) stringByAppendingString: (NSString*)aString;
|
||||
|
||||
// Dividing Strings into Substrings
|
||||
|
@ -742,16 +743,17 @@ typedef NSUInteger NSStringEncodingConversionOptions;
|
|||
*/
|
||||
- (NSArray*) stringsByAppendingPaths: (NSArray*)paths;
|
||||
|
||||
+ (NSString*) localizedStringWithFormat: (NSString*)format, ...;
|
||||
+ (NSString*) localizedStringWithFormat: (NSString*)format, ...
|
||||
NS_FORMAT_FUNCTION(1,2);
|
||||
|
||||
+ (id) stringWithString: (NSString*)aString;
|
||||
+ (id) stringWithContentsOfURL: (NSURL*)url;
|
||||
+ (id) stringWithUTF8String: (const char*)bytes;
|
||||
- (id) initWithFormat: (NSString*)format
|
||||
locale: (NSDictionary*)locale, ...;
|
||||
locale: (NSDictionary*)locale, ... NS_FORMAT_FUNCTION(1,3);
|
||||
- (id) initWithFormat: (NSString*)format
|
||||
locale: (NSDictionary*)locale
|
||||
arguments: (va_list)argList;
|
||||
arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0);
|
||||
- (id) initWithUTF8String: (const char *)bytes;
|
||||
- (id) initWithContentsOfURL: (NSURL*)url;
|
||||
- (NSString*) substringWithRange: (NSRange)aRange;
|
||||
|
@ -831,7 +833,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
|
|||
+ (id) stringWithCString: (const char*)byteString
|
||||
length: (NSUInteger)length;
|
||||
+ (id) stringWithCString: (const char*)byteString;
|
||||
+ (id) stringWithFormat: (NSString*)format,...;
|
||||
+ (id) stringWithFormat: (NSString*)format,... NS_FORMAT_FUNCTION(1,2);
|
||||
+ (id) stringWithContentsOfFile: (NSString*)path;
|
||||
+ (NSMutableString*) stringWithCapacity: (NSUInteger)capacity;
|
||||
|
||||
|
@ -839,7 +841,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
|
|||
- (id) initWithCapacity: (NSUInteger)capacity;
|
||||
|
||||
// Modify A String
|
||||
- (void) appendFormat: (NSString*)format, ...;
|
||||
- (void) appendFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
|
||||
- (void) appendString: (NSString*)aString;
|
||||
- (void) deleteCharactersInRange: (NSRange)range;
|
||||
- (void) insertString: (NSString*)aString atIndex: (NSUInteger)loc;
|
||||
|
|
|
@ -46,7 +46,7 @@ extern "C" {
|
|||
* to build an explicit <code>va_list</code> structure.
|
||||
*/
|
||||
+ (id) stringWithFormat: (NSString*)format
|
||||
arguments: (va_list)argList;
|
||||
arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0);
|
||||
|
||||
/**
|
||||
* Returns a string formed by removing the prefix string from the
|
||||
|
|
|
@ -1302,7 +1302,8 @@ wordData(NSString *word)
|
|||
{
|
||||
NSMutableString *desc;
|
||||
|
||||
desc = [NSMutableString stringWithFormat: @"GSMimeParser <%0x> -\n", self];
|
||||
desc = [NSMutableString stringWithFormat: @"GSMimeParser <0x%"PRIxPTR"> -\n",
|
||||
(NSUInteger)self];
|
||||
[desc appendString: [document description]];
|
||||
return desc;
|
||||
}
|
||||
|
@ -1535,7 +1536,8 @@ wordData(NSString *word)
|
|||
return NO; /* Want no more data */
|
||||
}
|
||||
|
||||
NSDebugMLLog(@"GSMime", @"Parse %u bytes - '%*.*s'", l, l, l, [d bytes]);
|
||||
NSDebugMLLog(@"GSMime", @"Parse %u bytes - '%*.*s'",
|
||||
(unsigned)l, (unsigned)l, (unsigned)l, [d bytes]);
|
||||
|
||||
r = [self _endOfHeaders: d];
|
||||
if (r.location == NSNotFound)
|
||||
|
@ -1625,8 +1627,7 @@ wordData(NSString *word)
|
|||
* This is an intermediary response ... so we have
|
||||
* to restart the parsing operation!
|
||||
*/
|
||||
NSDebugMLLog(@"GSMime",
|
||||
@"Parsed http continuation", "");
|
||||
NSDebugMLLog(@"GSMime", @"%@", @"Parsed http continuation");
|
||||
flags.inBody = 0;
|
||||
if ([d length] == 0)
|
||||
{
|
||||
|
@ -2424,7 +2425,8 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
|
|||
NSDebugMLLog(@"GSMime", @"Parse body expects %u bytes", expect);
|
||||
}
|
||||
|
||||
NSDebugMLLog(@"GSMime", @"Parse %u bytes - '%*.*s'", l, l, l, [d bytes]);
|
||||
NSDebugMLLog(@"GSMime", @"Parse %u bytes - '%*.*s'",
|
||||
(unsigned)l, (unsigned)l, (unsigned)l, [d bytes]);
|
||||
// NSDebugMLLog(@"GSMime", @"Boundary - '%*.*s'", [boundary length], [boundary length], [boundary bytes]);
|
||||
|
||||
if ([context atEnd] == YES)
|
||||
|
@ -2434,7 +2436,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
|
|||
if ([d length] > 0)
|
||||
{
|
||||
NSLog(@"Additional data (%*.*s) ignored after parse complete",
|
||||
(int)[d length], (int)[d length], [d bytes]);
|
||||
(unsigned)[d length], (unsigned)[d length], [d bytes]);
|
||||
}
|
||||
needsMore = NO; /* Nothing more to do */
|
||||
}
|
||||
|
@ -2480,7 +2482,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
|
|||
flags.inBody = 0;
|
||||
flags.complete = 1;
|
||||
|
||||
NSDebugMLLog(@"GSMime", @"Parse body complete", "");
|
||||
NSDebugMLLog(@"GSMime", @"%@", @"Parse body complete");
|
||||
/*
|
||||
* If no content type is supplied, we assume text ... unless
|
||||
* we have something that's known to be a file.
|
||||
|
@ -3430,7 +3432,8 @@ static NSCharacterSet *tokenSet = nil;
|
|||
{
|
||||
NSMutableString *desc;
|
||||
|
||||
desc = [NSMutableString stringWithFormat: @"GSMimeHeader <%0x> -\n", self];
|
||||
desc = [NSMutableString stringWithFormat: @"GSMimeHeader <0x%"PRIxPTR"> -\n",
|
||||
(NSUInteger)self];
|
||||
[desc appendFormat: @" name: %@\n", [self name]];
|
||||
[desc appendFormat: @" value: %@\n", [self value]];
|
||||
[desc appendFormat: @" params: %@\n", [self parameters]];
|
||||
|
@ -3836,7 +3839,8 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
if (ok == NO)
|
||||
{
|
||||
NSDebugMLLog(@"GSMime",
|
||||
@"Value for '%@' too long for folding at %u in header", n, fold);
|
||||
@"Value for '%@' too long for folding at %"PRIuPTR" in header",
|
||||
n, fold);
|
||||
}
|
||||
|
||||
while ((k = [e nextObject]) != nil)
|
||||
|
@ -3854,7 +3858,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
if (ok == NO)
|
||||
{
|
||||
NSDebugMLLog(@"GSMime",
|
||||
@"Parameter name '%@' in '%@' too long for folding at %u",
|
||||
@"Parameter name '%@' in '%@' too long for folding at %"PRIuPTR,
|
||||
k, n, fold);
|
||||
}
|
||||
offset = appendBytes(md, offset, fold, "=", 1);
|
||||
|
@ -3862,7 +3866,8 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
if (ok == NO)
|
||||
{
|
||||
NSDebugMLLog(@"GSMime",
|
||||
@"Parameter value for '%@' in '%@' too long for folding at %u",
|
||||
@"Parameter value for '%@' in '%@' "
|
||||
@"too long for folding at %"PRIuPTR,
|
||||
k, n, fold);
|
||||
}
|
||||
}
|
||||
|
@ -5449,7 +5454,9 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
NSMutableString *desc;
|
||||
NSDictionary *locale;
|
||||
|
||||
desc = [NSMutableString stringWithFormat: @"GSMimeDocument <%0x> -\n", self];
|
||||
desc = [NSMutableString
|
||||
stringWithFormat: @"GSMimeDocument <0x%"PRIxPTR"> -\n",
|
||||
(NSUInteger)self];
|
||||
locale = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
|
||||
[desc appendString: [headers descriptionWithLocale: locale]];
|
||||
[desc appendFormat: @"\nDocument content -\n%@", content];
|
||||
|
|
|
@ -3306,7 +3306,8 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
colNumber: (NSInteger)colNumber
|
||||
lineNumber: (NSInteger)lineNumber
|
||||
{
|
||||
e = [NSString stringWithFormat: @"at line: %d column: %d ... %@",
|
||||
e = [NSString stringWithFormat:
|
||||
@"at line: %"PRIdPTR" column: %"PRIdPTR" ... %@",
|
||||
lineNumber, colNumber, e];
|
||||
[self warning: e];
|
||||
}
|
||||
|
@ -3318,7 +3319,8 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
colNumber: (NSInteger)colNumber
|
||||
lineNumber: (NSInteger)lineNumber
|
||||
{
|
||||
e = [NSString stringWithFormat: @"at line: %d column: %d ... %@",
|
||||
e = [NSString stringWithFormat:
|
||||
@"at line: %"PRIdPTR" column: %"PRIdPTR" ... %@",
|
||||
lineNumber, colNumber, e];
|
||||
[self error: e];
|
||||
}
|
||||
|
@ -3330,7 +3332,8 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
colNumber: (NSInteger)colNumber
|
||||
lineNumber: (NSInteger)lineNumber
|
||||
{
|
||||
e = [NSString stringWithFormat: @"at line: %d column: %d ... %@",
|
||||
e = [NSString stringWithFormat:
|
||||
@"at line: %"PRIdPTR" column: %"PRIdPTR" ... %@",
|
||||
lineNumber, colNumber, e];
|
||||
[self fatalError: e];
|
||||
}
|
||||
|
@ -3791,7 +3794,8 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
}
|
||||
- (NSString *) description
|
||||
{
|
||||
return [NSString_class stringWithFormat: @"NodeSet (count %u)", [self count]];
|
||||
return [NSString_class stringWithFormat:
|
||||
@"NodeSet (count %"PRIuPTR")", [self count]];
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ static Class GSInlineArrayClass;
|
|||
self, @"Array", nil, nil];
|
||||
|
||||
reason = [NSString stringWithFormat:
|
||||
@"Index %d is out of range %d (in '%@')",
|
||||
@"Index %"PRIuPTR" is out of range %d (in '%@')",
|
||||
index, _count, NSStringFromSelector(sel)];
|
||||
|
||||
exception = [NSException exceptionWithName: NSRangeException
|
||||
|
|
|
@ -409,7 +409,7 @@ debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
if ((id)NSMapGet(wProperties, (void*)@"Content-Length") == nil)
|
||||
{
|
||||
NSMapInsert(wProperties, (void*)@"Content-Length",
|
||||
(void*)[NSString stringWithFormat: @"%d", [wData length]]);
|
||||
(void*)[NSString stringWithFormat: @"%"PRIuPTR, [wData length]]);
|
||||
}
|
||||
|
||||
if ([wData length] > 0)
|
||||
|
|
|
@ -65,12 +65,20 @@ typedef enum
|
|||
*/
|
||||
NSString* GSNetServiceDotTerminatedNSStringFromString(const char* string);
|
||||
|
||||
@class GSAvahiRunLoopContext, NSTimer, NSLock, NSRecursiveLock, NSMutableDictionary, NSMapTable;
|
||||
@class GSAvahiRunLoopContext;
|
||||
@class NSTimer;
|
||||
@class NSRecursiveLock;
|
||||
@class NSMutableDictionary;
|
||||
@class NSMapTable;
|
||||
|
||||
/**
|
||||
* NSNetService using the avahi-client API.
|
||||
*/
|
||||
#ifdef __clang__ /* FIXME ... this is not clang specific! */
|
||||
@interface GSAvahiNetService : NSNetService <NSNetServiceDelegate>
|
||||
#else
|
||||
@interface GSAvahiNetService : NSNetService
|
||||
#endif
|
||||
{
|
||||
// GSAvahiClient behaviour ivars:
|
||||
// From superclass: id _delegate;
|
||||
|
@ -79,7 +87,7 @@ NSString* GSNetServiceDotTerminatedNSStringFromString(const char* string);
|
|||
NSRecursiveLock *_lock;
|
||||
// Ivars for this class:
|
||||
NSMutableDictionary *_info;
|
||||
NSLock *_infoLock;
|
||||
NSRecursiveLock *_infoLock;
|
||||
NSUInteger _infoSeq;
|
||||
GSNetServiceState _serviceState;
|
||||
int _ifIndex;
|
||||
|
@ -112,7 +120,12 @@ NSString* GSNetServiceDotTerminatedNSStringFromString(const char* string);
|
|||
/**
|
||||
* NSNetServiceBrowser using the avahi-client API.
|
||||
*/
|
||||
#ifdef __clang__ /* FIXME ... this is not clang specific! */
|
||||
@interface GSAvahiNetServiceBrowser
|
||||
: NSNetServiceBrowser <NSNetServiceBrowserDelegate>
|
||||
#else
|
||||
@interface GSAvahiNetServiceBrowser: NSNetServiceBrowser
|
||||
#endif
|
||||
{
|
||||
// GSAvahiClient behaviour ivars:
|
||||
// from superclass: id _delegate;
|
||||
|
|
|
@ -596,7 +596,7 @@ static NSArray *keys = nil;
|
|||
- (void) stream: (NSStream*)stream handleEvent: (NSStreamEvent)event
|
||||
{
|
||||
NSDebugMLLog(@"NSStream",
|
||||
@"GSTLSHandler got %d on %p", event, stream);
|
||||
@"GSTLSHandler got %"PRIdPTR" on %p", event, stream);
|
||||
|
||||
if (handshake == YES)
|
||||
{
|
||||
|
@ -862,7 +862,7 @@ static NSString * const GSSOCKSAckConn = @"GSSOCKSAckConn";
|
|||
address = [[NSString alloc] initWithUTF8String:
|
||||
(char*)inet_ntoa(addr->sin_addr)];
|
||||
port = [[NSString alloc] initWithFormat: @"%d",
|
||||
(NSInteger)GSSwapBigI16ToHost(addr->sin_port)];
|
||||
(int)GSSwapBigI16ToHost(addr->sin_port)];
|
||||
|
||||
/* Now reconfigure the streams so they will actually connect
|
||||
* to the socks proxy server.
|
||||
|
|
|
@ -498,8 +498,7 @@ static NSMutableDictionary *certificateListCache = nil;
|
|||
unsigned int bits;
|
||||
int i;
|
||||
|
||||
[str appendString: @"\n"];
|
||||
[str appendFormat: _(@"- Certificate info:\n")];
|
||||
[str appendFormat: @"\n%@", _(@"- Certificate info:\n")];
|
||||
|
||||
expiret = gnutls_x509_crt_get_expiration_time(cert);
|
||||
activet = gnutls_x509_crt_get_activation_time(cert);
|
||||
|
|
|
@ -97,7 +97,7 @@ NSString *const NSAssertionHandlerKey = @"NSAssertionHandler";
|
|||
va_start(ap, format);
|
||||
message =
|
||||
[NSString
|
||||
stringWithFormat: @"%@:%d Assertion failed in %@. %@",
|
||||
stringWithFormat: @"%@:%"PRIdPTR" Assertion failed in %@. %@",
|
||||
fileName, line, functionName, format];
|
||||
NSLogv(message, ap);
|
||||
|
||||
|
@ -124,8 +124,8 @@ NSString *const NSAssertionHandlerKey = @"NSAssertionHandler";
|
|||
|
||||
va_start(ap, format);
|
||||
message =
|
||||
[NSString
|
||||
stringWithFormat: @"%@:%d Assertion failed in %@(%@), method %@. %@",
|
||||
[NSString stringWithFormat:
|
||||
@"%@:%"PRIdPTR" Assertion failed in %@(%@), method %@. %@",
|
||||
fileName, line, NSStringFromClass([object class]),
|
||||
class_isMetaClass([object class]) ? @"class" : @"instance",
|
||||
NSStringFromSelector(aSelector), format];
|
||||
|
|
|
@ -917,8 +917,7 @@ static inline int getDigits(const char *from, char *to, int limit, BOOL *error)
|
|||
error = YES;
|
||||
NSDebugMLog(
|
||||
@"Expected literal '%%' but got end of string parsing"
|
||||
@"'%@' using '%@'", source[sourceIdx],
|
||||
description, fmt);
|
||||
@"'%@' using '%@'", description, fmt);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1530,24 +1529,24 @@ static inline int getDigits(const char *from, char *to, int limit, BOOL *error)
|
|||
|
||||
if (month < 1 || month > 12)
|
||||
{
|
||||
NSWarnMLog(@"invalid month given - %u", month);
|
||||
NSWarnMLog(@"invalid month given - %"PRIuPTR, month);
|
||||
}
|
||||
c = lastDayOfGregorianMonth(month, year);
|
||||
if (day < 1 || day > c)
|
||||
{
|
||||
NSWarnMLog(@"invalid day given - %u", day);
|
||||
NSWarnMLog(@"invalid day given - %"PRIuPTR, day);
|
||||
}
|
||||
if (hour > 23)
|
||||
{
|
||||
NSWarnMLog(@"invalid hour given - %u", hour);
|
||||
NSWarnMLog(@"invalid hour given - %"PRIuPTR, hour);
|
||||
}
|
||||
if (minute > 59)
|
||||
{
|
||||
NSWarnMLog(@"invalid minute given - %u", minute);
|
||||
NSWarnMLog(@"invalid minute given - %"PRIuPTR, minute);
|
||||
}
|
||||
if (second > 59)
|
||||
{
|
||||
NSWarnMLog(@"invalid second given - %u", second);
|
||||
NSWarnMLog(@"invalid second given - %"PRIuPTR, second);
|
||||
}
|
||||
|
||||
// Calculate date as GMT
|
||||
|
|
|
@ -100,7 +100,7 @@ _NS_owned_void_p_release(void *table, void *p)
|
|||
NSString *
|
||||
_NS_owned_void_p_describe(void *table, void *p)
|
||||
{
|
||||
return [NSString stringWithFormat: @"%#x", p];
|
||||
return [NSString stringWithFormat: @"%#"PRIxPTR, (NSUInteger)p];
|
||||
}
|
||||
|
||||
/** For non-retained Objective-C objects **/
|
||||
|
@ -199,7 +199,7 @@ _NS_non_owned_void_p_release(void *table, void *p)
|
|||
NSString *
|
||||
_NS_non_owned_void_p_describe(void *table, void *p)
|
||||
{
|
||||
return [NSString stringWithFormat: @"%0x", p];
|
||||
return [NSString stringWithFormat: @"%0"PRIxPTR, (NSUInteger)p];
|
||||
}
|
||||
|
||||
/** For pointers to structures and `int *' **/
|
||||
|
@ -232,5 +232,5 @@ NSString *
|
|||
_NS_int_p_describe(void *table, int *p)
|
||||
{
|
||||
/* Is this useful? */
|
||||
return [NSString stringWithFormat: @"%d(%#x)", *p, p];
|
||||
return [NSString stringWithFormat: @"%d(%#"PRIxPTR")", *p, (NSUInteger)p];
|
||||
}
|
||||
|
|
|
@ -2039,8 +2039,8 @@ static NSLock *cached_proxies_gate = nil;
|
|||
}
|
||||
|
||||
[self _sendOutRmc: op type: METHOD_REQUEST];
|
||||
NSDebugMLLog(@"NSConnection", @"Sent message %s RMC %d to 0x%x",
|
||||
sel_getName([inv selector]), seq, (uintptr_t)self);
|
||||
NSDebugMLLog(@"NSConnection", @"Sent message %s RMC %d to 0x%"PRIxPTR,
|
||||
sel_getName([inv selector]), seq, (NSUInteger)self);
|
||||
|
||||
if (needsResponse == NO)
|
||||
{
|
||||
|
@ -3230,7 +3230,8 @@ static NSLock *cached_proxies_gate = nil;
|
|||
}
|
||||
NS_ENDHANDLER
|
||||
|
||||
NSDebugMLLog(@"NSConnection", @"Consuming reply RMC %d on %x", sn, self);
|
||||
NSDebugMLLog(@"NSConnection", @"Consuming reply RMC %d on %"PRIxPTR,
|
||||
sn, (NSUInteger)self);
|
||||
return rmc;
|
||||
}
|
||||
|
||||
|
|
|
@ -2877,7 +2877,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (*cursor >= length)
|
||||
{
|
||||
[NSException raise: NSRangeException
|
||||
format: @"Range: (%u, 1) Size: %d", *cursor, length];
|
||||
format: @"Range: (%u, 1) Size: %"PRIuPTR, *cursor, length];
|
||||
}
|
||||
*tag = *((unsigned char*)bytes + (*cursor)++);
|
||||
if (*tag & _GSC_MAYX)
|
||||
|
@ -2893,7 +2893,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (*cursor >= length)
|
||||
{
|
||||
[NSException raise: NSRangeException
|
||||
format: @"Range: (%u, 1) Size: %d",
|
||||
format: @"Range: (%u, 1) Size: %"PRIuPTR,
|
||||
*cursor, length];
|
||||
}
|
||||
*ref = (unsigned int)*((unsigned char*)bytes + (*cursor)++);
|
||||
|
@ -2906,7 +2906,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (*cursor >= length-1)
|
||||
{
|
||||
[NSException raise: NSRangeException
|
||||
format: @"Range: (%u, 1) Size: %d",
|
||||
format: @"Range: (%u, 1) Size: %"PRIuPTR,
|
||||
*cursor, length];
|
||||
}
|
||||
#if NEED_WORD_ALIGNMENT
|
||||
|
@ -2926,7 +2926,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (*cursor >= length-3)
|
||||
{
|
||||
[NSException raise: NSRangeException
|
||||
format: @"Range: (%u, 1) Size: %d",
|
||||
format: @"Range: (%u, 1) Size: %"PRIuPTR,
|
||||
*cursor, length];
|
||||
}
|
||||
#if NEED_WORD_ALIGNMENT
|
||||
|
@ -3091,7 +3091,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
bytes = mmap(0, length, PROT_READ, MAP_SHARED, fd, 0);
|
||||
if (bytes == MAP_FAILED)
|
||||
{
|
||||
NSWarnMLog(@"mapping failed for %s - %@", path, [NSError _last]);
|
||||
NSWarnMLog(@"mapping failed for %@ - %@", path, [NSError _last]);
|
||||
close(fd);
|
||||
DESTROY(self);
|
||||
self = [dataMalloc allocWithZone: NSDefaultMallocZone()];
|
||||
|
@ -3761,7 +3761,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (tmp == 0)
|
||||
{
|
||||
[NSException raise: NSMallocException
|
||||
format: @"Unable to set data capacity to '%d'", size];
|
||||
format: @"Unable to set data capacity to '%"PRIuPTR"'", size];
|
||||
}
|
||||
if (bytes)
|
||||
{
|
||||
|
@ -3955,8 +3955,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (newid == -1) /* Created memory? */
|
||||
{
|
||||
[NSException raise: NSMallocException
|
||||
format: @"Unable to create shared memory segment (size:%u) - %@.",
|
||||
size, [NSError _last]];
|
||||
format: @"Unable to create shared memory segment"
|
||||
@" (size:%"PRIuPTR") - %@.", size, [NSError _last]];
|
||||
}
|
||||
tmp = shmat(newid, 0, 0);
|
||||
if ((intptr_t)tmp == -1) /* Attached memory? */
|
||||
|
|
|
@ -418,7 +418,7 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFileOwnerAccountID to '%u' - %@",
|
||||
@"Unable to change NSFileOwnerAccountID to '%"PRIuPTR"' - %@",
|
||||
num, [NSError _last]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFileGroupOwnerAccountID to '%u' - %@",
|
||||
@"Unable to change NSFileGroupOwnerAccountID to '%"PRIuPTR"' - %@",
|
||||
num, [NSError _last]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ static NSStringEncoding defaultEncoding;
|
|||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFilePosixPermissions to '%o' - %@",
|
||||
num, [NSError _last]];
|
||||
(unsigned)num, [NSError _last]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,14 +136,14 @@ static NSIndexPath *dummy = nil;
|
|||
NSMutableString *m = [[super description] mutableCopy];
|
||||
NSUInteger i;
|
||||
|
||||
[m appendFormat: @"%u indexes [", _length];
|
||||
[m appendFormat: @"%"PRIuPTR" indexes [", _length];
|
||||
for (i = 0; i < _length; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
[m appendString: @", "];
|
||||
}
|
||||
[m appendFormat: @"%u", _indexes[i]];
|
||||
[m appendFormat: @"%"PRIuPTR, _indexes[i]];
|
||||
}
|
||||
[m appendString: @"]"];
|
||||
return AUTORELEASE(m);
|
||||
|
|
|
@ -288,7 +288,7 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
|
|||
[super description]];
|
||||
}
|
||||
m = [NSMutableString stringWithFormat:
|
||||
@"%@[number of indexes: %u (in %u ranges), indexes:",
|
||||
@"%@[number of indexes: %"PRIuPTR" (in %"PRIuPTR" ranges), indexes:",
|
||||
[super description], [self count], c];
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
|
@ -296,11 +296,12 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
|
|||
|
||||
if (r.length > 1)
|
||||
{
|
||||
[m appendFormat: @" (%u-%u)", r.location, NSMaxRange(r) - 1];
|
||||
[m appendFormat: @" (%"PRIuPTR"-%"PRIuPTR")",
|
||||
r.location, NSMaxRange(r) - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
[m appendFormat: @" %u", r.location];
|
||||
[m appendFormat: @" %"PRIuPTR, r.location];
|
||||
}
|
||||
}
|
||||
[m appendString: @"]"];
|
||||
|
|
|
@ -265,7 +265,7 @@ parseError(ParserState *state)
|
|||
*/
|
||||
NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:
|
||||
_(@"JSON Parse error"), NSLocalizedDescriptionKey,
|
||||
_(([NSString stringWithFormat: @"Unexpected character %c at index %d",
|
||||
_(([NSString stringWithFormat: @"Unexpected character %c at index %"PRIdPTR,
|
||||
(char)currentChar(state), state->sourceIndex])),
|
||||
NSLocalizedFailureReasonErrorKey,
|
||||
nil];
|
||||
|
|
|
@ -345,8 +345,8 @@ NSLogv(NSString* format, va_list args)
|
|||
{
|
||||
if (GSPrivateDefaultsFlag(GSLogThread) == YES)
|
||||
{
|
||||
prefix = [NSString stringWithFormat: @"[thread:%x] ",
|
||||
GSCurrentThread()];
|
||||
prefix = [NSString stringWithFormat: @"[thread:%"PRIxPTR"] ",
|
||||
(NSUInteger)GSCurrentThread()];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -359,11 +359,11 @@ NSLogv(NSString* format, va_list args)
|
|||
if (GSPrivateDefaultsFlag(GSLogThread) == YES)
|
||||
{
|
||||
prefix = [NSString
|
||||
stringWithFormat: @"%@ %@[%d,%x] ",
|
||||
stringWithFormat: @"%@ %@[%d,%"PRIxPTR"x] ",
|
||||
[[NSCalendarDate calendarDate]
|
||||
descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F"],
|
||||
[[NSProcessInfo processInfo] processName],
|
||||
pid, GSCurrentThread()];
|
||||
pid, (NSUInteger)GSCurrentThread()];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -351,7 +351,8 @@ static Class runLoopClass;
|
|||
const unsigned char *name;
|
||||
|
||||
M_LOCK(myLock);
|
||||
NSDebugMLLog(@"NSMessagePort", @"Connecting on 0x%x before %@", self, when);
|
||||
NSDebugMLLog(@"NSMessagePort",
|
||||
@"Connecting on 0x%"PRIxPTR" before %@", (NSUInteger)self, when);
|
||||
if (state != GS_H_UNCON)
|
||||
{
|
||||
BOOL result;
|
||||
|
@ -500,7 +501,8 @@ static Class runLoopClass;
|
|||
type: ET_WDESC
|
||||
forMode: nil
|
||||
all: YES];
|
||||
NSDebugMLLog(@"NSMessagePort", @"invalidated 0x%x", self);
|
||||
NSDebugMLLog(@"NSMessagePort",
|
||||
@"invalidated 0x%"PRIxPTR, (NSUInteger)self);
|
||||
[[self recvPort] removeHandle: self];
|
||||
[[self sendPort] removeHandle: self];
|
||||
}
|
||||
|
@ -527,8 +529,8 @@ static Class runLoopClass;
|
|||
forMode: (NSString*)mode
|
||||
{
|
||||
NSDebugMLLog(@"NSMessagePort_details",
|
||||
@"received %s event on 0x%x",
|
||||
type != ET_WDESC ? "read" : "write", self);
|
||||
@"received %s event on 0x%"PRIxPTR,
|
||||
type != ET_WDESC ? "read" : "write", (NSUInteger)self);
|
||||
/*
|
||||
* If we have been invalidated (desc < 0) then we should ignore this
|
||||
* event and remove ourself from the runloop.
|
||||
|
@ -587,7 +589,8 @@ static Class runLoopClass;
|
|||
{
|
||||
if (res == 0)
|
||||
{
|
||||
NSDebugMLLog(@"NSMessagePort", @"read eof on 0x%x", self);
|
||||
NSDebugMLLog(@"NSMessagePort",
|
||||
@"read eof on 0x%"PRIxPTR, (NSUInteger)self);
|
||||
M_UNLOCK(myLock);
|
||||
[self invalidate];
|
||||
return;
|
||||
|
@ -603,7 +606,7 @@ static Class runLoopClass;
|
|||
res = 0; /* Interrupted - continue */
|
||||
}
|
||||
NSDebugMLLog(@"NSMessagePort_details",
|
||||
@"read %d bytes on 0x%x", res, self);
|
||||
@"read %d bytes on 0x%"PRIxPTR, res, (NSUInteger)self);
|
||||
rLength += res;
|
||||
|
||||
while (valid == YES && rLength >= rWant)
|
||||
|
@ -861,7 +864,7 @@ static Class runLoopClass;
|
|||
rId = 0;
|
||||
DESTROY(rItems);
|
||||
NSDebugMLLog(@"NSMessagePort_details",
|
||||
@"got message %@ on 0x%x", pm, self);
|
||||
@"got message %@ on 0x%"PRIxPTR, pm, (NSUInteger)self);
|
||||
IF_NO_GC([rp retain];)
|
||||
M_UNLOCK(myLock);
|
||||
NS_DURING
|
||||
|
@ -909,7 +912,7 @@ static Class runLoopClass;
|
|||
if (len == (int)[d length])
|
||||
{
|
||||
NSDebugMLLog(@"NSMessagePort_details",
|
||||
@"wrote %d bytes on 0x%x", len, self);
|
||||
@"wrote %d bytes on 0x%"PRIxPTR, len, (NSUInteger)self);
|
||||
state = GS_H_CONNECTED;
|
||||
}
|
||||
else
|
||||
|
@ -938,7 +941,7 @@ static Class runLoopClass;
|
|||
}
|
||||
else
|
||||
{
|
||||
// NSLog(@"No messages to write on 0x%x.", self);
|
||||
// NSLog(@"No messages to write on 0x%"PRIxPTR".", (NSUInteger)self);
|
||||
M_UNLOCK(myLock);
|
||||
return;
|
||||
}
|
||||
|
@ -959,7 +962,7 @@ static Class runLoopClass;
|
|||
else
|
||||
{
|
||||
NSDebugMLLog(@"NSMessagePort_details",
|
||||
@"wrote %d bytes on 0x%x", res, self);
|
||||
@"wrote %d bytes on 0x%"PRIxPTR, res, (NSUInteger)self);
|
||||
wLength += res;
|
||||
if (wLength == l)
|
||||
{
|
||||
|
@ -984,7 +987,8 @@ static Class runLoopClass;
|
|||
* message completed - remove from list.
|
||||
*/
|
||||
NSDebugMLLog(@"NSMessagePort_details",
|
||||
@"completed 0x%x on 0x%x", components, self);
|
||||
@"completed 0x%"PRIxPTR" on 0x%"PRIxPTR,
|
||||
(NSUInteger)components, (NSUInteger)self);
|
||||
wData = nil;
|
||||
wItem = 0;
|
||||
[wMsgs removeObjectAtIndex: 0];
|
||||
|
@ -1004,8 +1008,8 @@ static Class runLoopClass;
|
|||
|
||||
NSAssert([components count] > 0, NSInternalInconsistencyException);
|
||||
NSDebugMLLog(@"NSMessagePort_details",
|
||||
@"Sending message 0x%x %@ on 0x%x(%d) before %@",
|
||||
components, components, self, desc, when);
|
||||
@"Sending message 0x%"PRIxPTR" %@ on 0x%"PRIxPTR"(%d) before %@",
|
||||
(NSUInteger)components, components, (NSUInteger)self, desc, when);
|
||||
M_LOCK(myLock);
|
||||
[wMsgs addObject: components];
|
||||
|
||||
|
@ -1046,7 +1050,8 @@ static Class runLoopClass;
|
|||
}
|
||||
M_UNLOCK(myLock);
|
||||
NSDebugMLLog(@"NSMessagePort_details",
|
||||
@"Message send 0x%x on 0x%x status %d", components, self, sent);
|
||||
@"Message send 0x%"PRIxPTR" on 0x%"PRIxPTR" status %d",
|
||||
(NSUInteger)components, (NSUInteger)self, sent);
|
||||
RELEASE(self);
|
||||
return sent;
|
||||
}
|
||||
|
@ -1408,7 +1413,8 @@ typedef struct {
|
|||
|
||||
- (void) finalize
|
||||
{
|
||||
NSDebugMLLog(@"NSMessagePort", @"NSMessagePort 0x%x finalized", self);
|
||||
NSDebugMLLog(@"NSMessagePort",
|
||||
@"NSMessagePort 0x%"PRIxPTR" finalized", (NSUInteger)self);
|
||||
[self invalidate];
|
||||
if (_internal != 0)
|
||||
{
|
||||
|
@ -1575,12 +1581,13 @@ typedef struct {
|
|||
if (d == nil)
|
||||
{
|
||||
NSDebugMLLog(@"NSMessagePort",
|
||||
@"No delegate to handle incoming message", 0);
|
||||
@"%@", @"No delegate to handle incoming message");
|
||||
return;
|
||||
}
|
||||
if ([d respondsToSelector: @selector(handlePortMessage:)] == NO)
|
||||
{
|
||||
NSDebugMLLog(@"NSMessagePort", @"delegate doesn't handle messages", 0);
|
||||
NSDebugMLLog(@"NSMessagePort",
|
||||
@"%@", @"delegate doesn't handle messages");
|
||||
return;
|
||||
}
|
||||
[d handlePortMessage: m];
|
||||
|
|
|
@ -217,10 +217,11 @@ static Class concreteBrowserClass;
|
|||
* It uses [self class] to obtain the concrete subclass that implements
|
||||
* +dictionaryFromTXTRecordData:.
|
||||
*/
|
||||
NSDictionary *dict = [[self class] dictionaryFromTXTRecordData: [self TXTRecordData]];
|
||||
NSDictionary *dict;
|
||||
NSMutableArray *array = nil;
|
||||
NSString *retVal = nil;
|
||||
|
||||
dict = [[self class] dictionaryFromTXTRecordData: [self TXTRecordData]];
|
||||
if (dict == nil)
|
||||
{
|
||||
return nil;
|
||||
|
@ -229,12 +230,16 @@ static Class concreteBrowserClass;
|
|||
FOR_IN(NSString*, key, dict)
|
||||
{
|
||||
NSData *value = [dict objectForKey: key];
|
||||
|
||||
if ([value length] > 0)
|
||||
{
|
||||
NSString *valueString = [[NSString alloc] initWithBytes: [value bytes]
|
||||
length: [value length]
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[array addObject: [NSString stringWithFormat: @"%@=%@", key, valueString]];
|
||||
NSString *valueString;
|
||||
|
||||
valueString = [[NSString alloc] initWithBytes: [value bytes]
|
||||
length: [value length]
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[array addObject:
|
||||
[NSString stringWithFormat: @"%@=%@", key, valueString]];
|
||||
DESTROY(valueString);
|
||||
}
|
||||
else if ([key length] > 0)
|
||||
|
@ -258,18 +263,24 @@ static Class concreteBrowserClass;
|
|||
|
||||
if (array != nil)
|
||||
{
|
||||
NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity: [array count]];
|
||||
NSMutableDictionary *dictionary;
|
||||
|
||||
dictionary
|
||||
= [[NSMutableDictionary alloc] initWithCapacity: [array count]];
|
||||
FOR_IN(NSString*, item, array)
|
||||
{
|
||||
NSArray *parts = [item componentsSeparatedByString:@"="];
|
||||
NSData *value = [[parts objectAtIndex: 1] dataUsingEncoding: NSUTF8StringEncoding];
|
||||
NSArray *parts;
|
||||
NSData *value;
|
||||
|
||||
parts = [item componentsSeparatedByString: @"="];
|
||||
value = [[parts objectAtIndex: 1]
|
||||
dataUsingEncoding: NSUTF8StringEncoding];
|
||||
[dictionary setObject: value
|
||||
forKey: [parts objectAtIndex: 0]];
|
||||
}
|
||||
END_FOR_IN(array)
|
||||
[self setTXTRecordData:
|
||||
[[self class] dataFromTXTRecordDictionary: dictionary]];
|
||||
[self setTXTRecordData:
|
||||
[[self class] dataFromTXTRecordDictionary: dictionary]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -351,34 +362,34 @@ static Class concreteBrowserClass;
|
|||
* Define extensions for the Avahi API subclass.
|
||||
*/
|
||||
#if GS_USE_AVAHI==1
|
||||
- (void)startMonitoringForRecordType: (NSString*)recordType
|
||||
- (void) startMonitoringForRecordType: (NSString*)recordType
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (void)stopMonitoringForRecordType: (NSString*)recordType
|
||||
- (void) stopMonitoringForRecordType: (NSString*)recordType
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (BOOL)addServiceRecord
|
||||
- (BOOL) addServiceRecord
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (BOOL)addRecordData: (NSData*)data
|
||||
- (BOOL) addRecordData: (NSData*)data
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (id)recordDataForRecordType: (NSString*)type
|
||||
- (id) recordDataForRecordType: (NSString*)type
|
||||
{
|
||||
return [self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (NSString*)fullServiceName
|
||||
- (NSString*) fullServiceName
|
||||
{
|
||||
return [self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
@ -386,7 +397,7 @@ static Class concreteBrowserClass;
|
|||
@end
|
||||
|
||||
@implementation NSNetServiceBrowser
|
||||
+ (void)initialize
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == [NSNetServiceBrowser class])
|
||||
{
|
||||
|
@ -407,6 +418,7 @@ static Class concreteBrowserClass;
|
|||
}
|
||||
return [super allocWithZone: zone];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
return [super init];
|
||||
|
@ -465,7 +477,7 @@ static Class concreteBrowserClass;
|
|||
_delegate = delegate;
|
||||
}
|
||||
|
||||
- (void)netServiceBrowserWillSearch: (NSNetServiceBrowser*)aBrowser
|
||||
- (void) netServiceBrowserWillSearch: (NSNetServiceBrowser*)aBrowser
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector(netServiceBrowserWillSearch:)])
|
||||
{
|
||||
|
@ -473,41 +485,45 @@ static Class concreteBrowserClass;
|
|||
}
|
||||
}
|
||||
|
||||
- (void)netServiceBrowserDidStopSearch: (NSNetServiceBrowser*)aBrowser
|
||||
- (void) netServiceBrowserDidStopSearch: (NSNetServiceBrowser*)aBrowser
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector(netServiceBrowserDidStopSearch:)])
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(netServiceBrowserDidStopSearch:)])
|
||||
{
|
||||
[_delegate netServiceBrowserDidStopSearch: aBrowser];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didNotSearch: (NSDictionary*)errorDict
|
||||
- (void) netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didNotSearch: (NSDictionary*)errorDict
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector(netServiceBrowser:didNotSearch:)])
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(netServiceBrowser:didNotSearch:)])
|
||||
{
|
||||
[_delegate netServiceBrowser: aBrowser
|
||||
didNotSearch: errorDict];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didFindDomain: (NSString*)theDomain
|
||||
moreComing: (BOOL)moreComing
|
||||
- (void) netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didFindDomain: (NSString*)theDomain
|
||||
moreComing: (BOOL)moreComing
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector(netServiceBrowser:didFindDomain:moreComing:)])
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(netServiceBrowser:didFindDomain:moreComing:)])
|
||||
{
|
||||
[_delegate netServiceBrowser: aBrowser
|
||||
didFindDomain: theDomain
|
||||
moreComing: moreComing];
|
||||
[_delegate netServiceBrowser: aBrowser
|
||||
didFindDomain: theDomain
|
||||
moreComing: moreComing];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didRemoveDomain: (NSString*)theDomain
|
||||
moreComing: (BOOL)moreComing
|
||||
- (void) netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didRemoveDomain: (NSString*)theDomain
|
||||
moreComing: (BOOL)moreComing
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector(netServiceBrowser:didRemoveDomain:moreComing:)])
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(netServiceBrowser:didRemoveDomain:moreComing:)])
|
||||
{
|
||||
[_delegate netServiceBrowser: aBrowser
|
||||
didRemoveDomain: theDomain
|
||||
|
@ -515,11 +531,12 @@ static Class concreteBrowserClass;
|
|||
}
|
||||
}
|
||||
|
||||
- (void)netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didFindService: (NSNetService*)theService
|
||||
moreComing: (BOOL)moreComing
|
||||
- (void) netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didFindService: (NSNetService*)theService
|
||||
moreComing: (BOOL)moreComing
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector(netServiceBrowser:didFindService:moreComing:)])
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(netServiceBrowser:didFindService:moreComing:)])
|
||||
{
|
||||
[_delegate netServiceBrowser: aBrowser
|
||||
didFindService: theService
|
||||
|
@ -527,11 +544,12 @@ static Class concreteBrowserClass;
|
|||
}
|
||||
}
|
||||
|
||||
- (void)netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didRemoveService: (NSNetService*)theService
|
||||
moreComing: (BOOL)moreComing
|
||||
- (void) netServiceBrowser: (NSNetServiceBrowser*)aBrowser
|
||||
didRemoveService: (NSNetService*)theService
|
||||
moreComing: (BOOL)moreComing
|
||||
{
|
||||
if ([_delegate respondsToSelector: @selector(netServiceBrowser:didRemoveService:moreComing:)])
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(netServiceBrowser:didRemoveService:moreComing:)])
|
||||
{
|
||||
[_delegate netServiceBrowser: aBrowser
|
||||
didRemoveService: theService
|
||||
|
|
|
@ -365,11 +365,7 @@ static BOOL useSmallFloat;
|
|||
@implementation NSSmallInt
|
||||
#undef VALUE
|
||||
#define VALUE (((intptr_t)self) >> OBJC_SMALL_OBJECT_SHIFT)
|
||||
#if OBJC_SMALL_OBJECT_SHIFT == 1
|
||||
#define FORMAT @"%d"
|
||||
#else
|
||||
#define FORMAT @"%lld"
|
||||
#endif
|
||||
#define FORMAT @"%"PRIdPTR
|
||||
#include "NSNumberMethods.h"
|
||||
|
||||
+ (void) load
|
||||
|
|
|
@ -235,7 +235,7 @@ static Class concreteClass = Nil;
|
|||
self, @"Array", nil, nil];
|
||||
|
||||
reason = [NSString stringWithFormat:
|
||||
@"Index %d is out of range %d (in '%@')",
|
||||
@"Index %"PRIuPTR" is out of range %"PRIuPTR" (in '%@')",
|
||||
index, _count, NSStringFromSelector(sel)];
|
||||
|
||||
exception = [NSException exceptionWithName: NSRangeException
|
||||
|
|
|
@ -45,9 +45,9 @@
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat:
|
||||
@"NSPortMessage 0x%x (Id %u)\n Send: %@\n Recv: %@\n Components -\n%@",
|
||||
self, _msgid, _send, _recv, _components];
|
||||
return [NSString stringWithFormat: @"NSPortMessage 0x%"PRIxPTR
|
||||
@" (Id %u)\n Send: %@\n Recv: %@\n Components -\n%@",
|
||||
(NSUInteger)self, _msgid, _send, _recv, _components];
|
||||
}
|
||||
|
||||
/* PortMessages MUST be initialised with ports and data. */
|
||||
|
|
|
@ -88,7 +88,8 @@ NSString *
|
|||
NSStringFromRange(NSRange range)
|
||||
{
|
||||
setupCache();
|
||||
return [NSStringClass stringWithFormat: @"{location=%d, length=%d}",
|
||||
return [NSStringClass
|
||||
stringWithFormat: @"{location=%"PRIuPTR", length=%"PRIuPTR"}",
|
||||
range.location, range.length];
|
||||
}
|
||||
|
||||
|
|
|
@ -465,7 +465,8 @@ static Class runLoopClass;
|
|||
NSRunLoop *l;
|
||||
|
||||
M_LOCK(myLock);
|
||||
NSDebugMLLog(@"GSTcpHandle", @"Connecting on 0x%x before %@", self, when);
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"Connecting on 0x%"PRIxPTR" before %@", (NSUInteger)self, when);
|
||||
if (state != GS_H_UNCON)
|
||||
{
|
||||
BOOL result;
|
||||
|
@ -680,7 +681,7 @@ static Class runLoopClass;
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"Handle (%d) to %s:%d",
|
||||
return [NSString stringWithFormat: @"Handle (%d) to %@",
|
||||
desc, GSPrivateSockaddrName(&sockAddr)];
|
||||
}
|
||||
|
||||
|
@ -733,7 +734,8 @@ static Class runLoopClass;
|
|||
forMode: nil
|
||||
all: YES];
|
||||
#endif
|
||||
NSDebugMLLog(@"GSTcpHandle", @"invalidated 0x%x", self);
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"invalidated 0x%"PRIxPTR, (NSUInteger)self);
|
||||
[[self recvPort] removeHandle: self];
|
||||
[[self sendPort] removeHandle: self];
|
||||
#if defined(__MINGW__)
|
||||
|
@ -799,7 +801,8 @@ static Class runLoopClass;
|
|||
{
|
||||
if (res == 0)
|
||||
{
|
||||
NSDebugMLLog(@"GSTcpHandle", @"read eof on 0x%x", self);
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"read eof on 0x%"PRIxPTR, (NSUInteger)self);
|
||||
[self invalidate];
|
||||
return;
|
||||
}
|
||||
|
@ -817,7 +820,8 @@ static Class runLoopClass;
|
|||
}
|
||||
res = 0; /* Interrupted - continue */
|
||||
}
|
||||
NSDebugMLLog(@"GSTcpHandle", @"read %d bytes on 0x%x", res, self);
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"read %d bytes on 0x%"PRIxPTR, res, (NSUInteger)self);
|
||||
rLength += res;
|
||||
|
||||
while (valid == YES && rLength >= rWant)
|
||||
|
@ -1068,7 +1072,7 @@ static Class runLoopClass;
|
|||
rId = 0;
|
||||
DESTROY(rItems);
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"got message %@ on 0x%x", pm, self);
|
||||
@"got message %@ on 0x%"PRIxPTR, pm, (NSUInteger)self);
|
||||
IF_NO_GC(RETAIN(rp);)
|
||||
M_UNLOCK(myLock);
|
||||
NS_DURING
|
||||
|
@ -1117,7 +1121,7 @@ static Class runLoopClass;
|
|||
{
|
||||
ASSIGN(defaultAddress, GSPrivateSockaddrHost(&sockAddr));
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"wrote %d bytes on 0x%x", len, self);
|
||||
@"wrote %d bytes on 0x%"PRIxPTR, len, (NSUInteger)self);
|
||||
state = GS_H_CONNECTED;
|
||||
}
|
||||
else
|
||||
|
@ -1146,7 +1150,7 @@ static Class runLoopClass;
|
|||
}
|
||||
else
|
||||
{
|
||||
// NSLog(@"No messages to write on 0x%x.", self);
|
||||
// NSLog(@"No messages to write on 0x%"PRIxPTR".", (NSUInteger)self);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1176,7 +1180,7 @@ static Class runLoopClass;
|
|||
else
|
||||
{
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"wrote %d bytes on 0x%x", res, self);
|
||||
@"wrote %d bytes on 0x%"PRIxPTR, res, (NSUInteger)self);
|
||||
wLength += res;
|
||||
if (wLength == l)
|
||||
{
|
||||
|
@ -1201,7 +1205,8 @@ static Class runLoopClass;
|
|||
* message completed - remove from list.
|
||||
*/
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"completed 0x%x on 0x%x", components, self);
|
||||
@"completed 0x%"PRIxPTR" on 0x%"PRIxPTR,
|
||||
(NSUInteger)components, (NSUInteger)self);
|
||||
wData = nil;
|
||||
wItem = 0;
|
||||
[wMsgs removeObjectAtIndex: 0];
|
||||
|
@ -1346,8 +1351,8 @@ static Class runLoopClass;
|
|||
|
||||
NSAssert([components count] > 0, NSInternalInconsistencyException);
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"Sending message 0x%x %@ on 0x%x(%d) before %@",
|
||||
components, components, self, desc, when);
|
||||
@"Sending message 0x%"PRIxPTR" %@ on 0x%"PRIxPTR"(%d) before %@",
|
||||
(NSUInteger)components, components, (NSUInteger)self, desc, when);
|
||||
M_LOCK(myLock);
|
||||
[wMsgs addObject: components];
|
||||
|
||||
|
@ -1440,7 +1445,8 @@ static Class runLoopClass;
|
|||
}
|
||||
M_UNLOCK(myLock);
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"Message send 0x%x on 0x%x status %d", components, self, sent);
|
||||
@"Message send 0x%"PRIxPTR" on 0x%"PRIxPTR" status %d",
|
||||
(NSUInteger)components, (NSUInteger)self, sent);
|
||||
RELEASE(self);
|
||||
return sent;
|
||||
}
|
||||
|
@ -1796,7 +1802,8 @@ static Class tcpPortClass;
|
|||
|
||||
- (void) finalize
|
||||
{
|
||||
NSDebugMLLog(@"NSPort", @"NSSocketPort 0x%x finalized", self);
|
||||
NSDebugMLLog(@"NSPort",
|
||||
@"NSSocketPort 0x%"PRIxPTR" finalized", (NSUInteger)self);
|
||||
[self invalidate];
|
||||
if (handles != 0)
|
||||
{
|
||||
|
@ -2011,12 +2018,12 @@ static Class tcpPortClass;
|
|||
|
||||
if (d == nil)
|
||||
{
|
||||
NSDebugMLLog(@"NSPort", @"No delegate to handle incoming message", 0);
|
||||
NSDebugMLLog(@"NSPort", @"%@", @"No delegate to handle incoming message");
|
||||
return;
|
||||
}
|
||||
if ([d respondsToSelector: @selector(handlePortMessage:)] == NO)
|
||||
{
|
||||
NSDebugMLLog(@"NSPort", @"delegate doesn't handle messages", 0);
|
||||
NSDebugMLLog(@"NSPort", @"%@", @"delegate doesn't handle messages");
|
||||
return;
|
||||
}
|
||||
[d handlePortMessage: m];
|
||||
|
@ -2132,8 +2139,8 @@ static Class tcpPortClass;
|
|||
#endif
|
||||
GSTcpHandle *handle;
|
||||
|
||||
NSDebugMLLog(@"NSPort", @"received %s event %p on 0x%x",
|
||||
type == ET_RPORT ? "read" : "write", extra, self);
|
||||
NSDebugMLLog(@"NSPort", @"received %s event %p on 0x%"PRIxPTR,
|
||||
type == ET_RPORT ? "read" : "write", extra, (NSUInteger)self);
|
||||
|
||||
#if defined(__MINGW__)
|
||||
if (event == eventListener)
|
||||
|
|
|
@ -663,7 +663,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
}
|
||||
|
||||
- (NSString *) _normalizedICUStringOfType: (const char*)normalization
|
||||
mode: (UNormalizationMode)mode
|
||||
mode: (UNormalization2Mode)mode
|
||||
{
|
||||
UErrorCode err;
|
||||
const UNormalizer2 *normalizer;
|
||||
|
|
|
@ -761,8 +761,8 @@ static NSMapTable *absolutes = 0;
|
|||
* Should never happen now we round to the minute
|
||||
* for MacOS-X compatibnility.
|
||||
*/
|
||||
name = [[NSString alloc] initWithFormat: @"NSAbsoluteTimeZone:%d",
|
||||
anOffset];
|
||||
name = [[NSString alloc]
|
||||
initWithFormat: @"NSAbsoluteTimeZone:%"PRIdPTR, anOffset];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2355,7 +2355,7 @@ localZoneString, [zone name], sign, s/3600, (s/60)%60);
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@(%@, %s%d)", [self name],
|
||||
return [NSString stringWithFormat: @"%@(%@, %s%"PRIdPTR")", [self name],
|
||||
[self timeZoneAbbreviation],
|
||||
([self isDaylightSavingTimeZone]? "IS_DST, ": ""),
|
||||
[self timeZoneSecondsFromGMT]];
|
||||
|
|
|
@ -342,7 +342,7 @@ typedef struct {
|
|||
+ (NSString *) localizedStringForStatusCode: (NSInteger)statusCode
|
||||
{
|
||||
// FIXME ... put real responses in here
|
||||
return [NSString stringWithFormat: @"%d", statusCode];
|
||||
return [NSString stringWithFormat: @"%"PRIdPTR, statusCode];
|
||||
}
|
||||
|
||||
- (NSDictionary *) allHeaderFields
|
||||
|
|
|
@ -1370,7 +1370,7 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
|||
{
|
||||
if (len < 8)
|
||||
{
|
||||
unsigned int val;
|
||||
uint32_t val;
|
||||
char buf[8];
|
||||
|
||||
memcpy(buf, ep + 1, len - 1);
|
||||
|
@ -1379,12 +1379,12 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
|||
if (sscanf(buf, "x%x;", &val))
|
||||
{
|
||||
// &#xhh; hex value
|
||||
return [[NSString alloc] initWithFormat: @"%C", val];
|
||||
return [[NSString alloc] initWithFormat: @"%C", (unichar)val];
|
||||
}
|
||||
else if (sscanf(buf, "%d;", &val))
|
||||
{
|
||||
// &ddd; decimal value
|
||||
return [[NSString alloc] initWithFormat: @"%C", val];
|
||||
return [[NSString alloc] initWithFormat: @"%C", (unichar)val];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -393,7 +393,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
[port getFds: port_fd_array count: &port_fd_count];
|
||||
}
|
||||
NSDebugMLLog(@"NSRunLoop",
|
||||
@"listening to %d port handles\n", port_fd_count);
|
||||
@"listening to %"PRIdPTR" port handles\n", port_fd_count);
|
||||
while (port_fd_count--)
|
||||
{
|
||||
fd = port_fd_array[port_fd_count];
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
if (createSec)
|
||||
{
|
||||
secHeading = [NSString stringWithFormat:
|
||||
@"<section id=\"_main\">\n<heading></heading>\n", toolName];
|
||||
@"<section id=\"_main\">\n<heading>%@</heading>\n", toolName];
|
||||
//The %@ tool
|
||||
[m replaceCharactersInRange: r withString: secHeading];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue