mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Applied patch #6677
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27080 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4e37cbbca4
commit
c4a2f62ad0
35 changed files with 142 additions and 88 deletions
40
ChangeLog
40
ChangeLog
|
@ -1,4 +1,42 @@
|
|||
2008-10-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
2008-11-07 Roland Schwingel <roland.schwingel@onevision.de>
|
||||
|
||||
* Source/GSSocketStream.m:
|
||||
* Source/NSPropertyList.m:
|
||||
* Source/NSDistributedNotificationCenter.m:
|
||||
* Source/NSSocketPort.m:
|
||||
* Source/NSRunLoop.m:
|
||||
* Source/GSFFCallInvocation.m:
|
||||
* Source/NSArray.m:
|
||||
* Source/inet_ntop.c:
|
||||
* Source/NSDebug.m:
|
||||
* Source/NSPredicate.m:
|
||||
* Source/GSHTTPURLHandle.m:
|
||||
* Source/GSFFIInvocation.m:
|
||||
* Source/NSMessagePort.m:
|
||||
* Source/win32/GSFileHandle.m:
|
||||
* Source/win32/NSUserDefaults.m:
|
||||
* Source/win32/NSMessagePort.m:
|
||||
* Source/win32/GSRunLoopCtxt.m:
|
||||
* Source/win32/NSMessagePortNameServer.m:
|
||||
* Source/NSKeyValueMutableArray.m:
|
||||
* Source/NSURL.m:
|
||||
* Source/mframe.m:
|
||||
* Source/NSObject.m:
|
||||
* Source/NSString.m:
|
||||
* Source/NSDecimalNumber.m:
|
||||
* Source/cifframe.m:
|
||||
* Source/Additions/GSXML.m:
|
||||
* Source/GSString.m:
|
||||
* Source/NSConnection.m:
|
||||
* Source/NSProxy.m:
|
||||
* Source/GSFormat.m:
|
||||
* Source/NSSet.m:
|
||||
* Source/NSTask.m:
|
||||
* Source/NSCharacterSet.m:
|
||||
* Source/NSNumberFormatter.m:
|
||||
Cosmetic changes plus a couple of fixes for 64bit mswindows.
|
||||
|
||||
2008-11-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSProcessInfo.m: Remove useless sysctl command.
|
||||
* Source/NSMessagePort.m: Ensure port is not deallocated while
|
||||
|
|
|
@ -2413,7 +2413,7 @@ loadEntityFunction(void *ctx,
|
|||
entityId = (eid != 0) ? (id)UTF8Str(eid) : nil;
|
||||
location = UTF8Str(url);
|
||||
components = [location pathComponents];
|
||||
local = [NSMutableString string];
|
||||
local = (NSMutableString *) [NSMutableString string];
|
||||
|
||||
/*
|
||||
* Build a local filename by replacing path separator characters with
|
||||
|
|
|
@ -182,7 +182,8 @@ static const char *gs_subtypes(const char *type, int *result)
|
|||
|
||||
/* return the index'th subtype
|
||||
*/
|
||||
static const char *gs_subtype(const char *type, int index)
|
||||
static __attribute__((unused))
|
||||
const char *gs_subtype(const char *type, int index)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
|
|
|
@ -204,7 +204,8 @@ static IMP gs_objc_msg_forward2 (id receiver, SEL sel)
|
|||
return (IMP)cclosure;
|
||||
}
|
||||
|
||||
static IMP gs_objc_msg_forward (SEL sel)
|
||||
static __attribute__ ((__unused__))
|
||||
IMP gs_objc_msg_forward (SEL sel)
|
||||
{
|
||||
return gs_objc_msg_forward2 (nil, sel);
|
||||
}
|
||||
|
|
|
@ -1671,7 +1671,7 @@ NSDictionary *locale)
|
|||
{
|
||||
/* If the pointer is not NULL, write it as a %#x spec. */
|
||||
base = 16;
|
||||
number.word = (unsigned long int) ptr;
|
||||
number.word = (size_t) ptr;
|
||||
is_negative = 0;
|
||||
alt = 1;
|
||||
group = 0;
|
||||
|
|
|
@ -1397,8 +1397,11 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
}
|
||||
if (sock == nil)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
extern int __declspec(dllimport) errno;
|
||||
#else
|
||||
extern int errno;
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Tell superclass that the load failed - let it do housekeeping.
|
||||
*/
|
||||
|
|
|
@ -52,6 +52,11 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
extern const char *inet_ntop(int, const void *, char *, size_t);
|
||||
extern int inet_pton(int , const char *, void *);
|
||||
#endif
|
||||
|
||||
unsigned
|
||||
GSPrivateSockaddrLength(struct sockaddr *addr)
|
||||
{
|
||||
|
@ -1264,7 +1269,7 @@ setNonBlocking(SOCKET fd)
|
|||
case AF_INET:
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
unsigned size = sizeof(sin);
|
||||
socklen_t size = sizeof(sin);
|
||||
|
||||
if ([key isEqualToString: GSStreamLocalAddressKey])
|
||||
{
|
||||
|
@ -1304,7 +1309,7 @@ setNonBlocking(SOCKET fd)
|
|||
case AF_INET6:
|
||||
{
|
||||
struct sockaddr_in6 sin;
|
||||
unsigned size = sizeof(sin);
|
||||
socklen_t size = sizeof(sin);
|
||||
|
||||
if ([key isEqualToString: GSStreamLocalAddressKey])
|
||||
{
|
||||
|
@ -1445,7 +1450,7 @@ setNonBlocking(SOCKET fd)
|
|||
case AF_LOCAL:
|
||||
{
|
||||
struct sockaddr_un peer;
|
||||
const char *c_addr;
|
||||
const char *c_addr;
|
||||
|
||||
c_addr = [address fileSystemRepresentation];
|
||||
memset(&peer, '\0', sizeof(peer));
|
||||
|
@ -1737,7 +1742,7 @@ setNonBlocking(SOCKET fd)
|
|||
else
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
readLen = recv([self _sock], buffer, len, 0);
|
||||
readLen = recv([self _sock], (char*) buffer, (socklen_t) len, 0);
|
||||
#else
|
||||
readLen = read([self _sock], buffer, len);
|
||||
#endif
|
||||
|
@ -1826,7 +1831,7 @@ setNonBlocking(SOCKET fd)
|
|||
[self _unschedule];
|
||||
if (error == 0)
|
||||
{
|
||||
unsigned len = sizeof(error);
|
||||
socklen_t len = sizeof(error);
|
||||
|
||||
getReturn = getsockopt(_sock, SOL_SOCKET, SO_ERROR,
|
||||
(char*)&error, &len);
|
||||
|
@ -1983,9 +1988,9 @@ setNonBlocking(SOCKET fd)
|
|||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
writeLen = send([self _sock], buffer, len, 0);
|
||||
writeLen = send([self _sock], (char*) buffer, (socklen_t) len, 0);
|
||||
#else
|
||||
writeLen = write([self _sock], buffer, len);
|
||||
writeLen = write([self _sock], buffer, (socklen_t) len);
|
||||
#endif
|
||||
|
||||
if (socketError(writeLen))
|
||||
|
@ -2231,7 +2236,7 @@ setNonBlocking(SOCKET fd)
|
|||
[self _unschedule];
|
||||
if (error == 0)
|
||||
{
|
||||
unsigned len = sizeof(error);
|
||||
socklen_t len = sizeof(error);
|
||||
|
||||
getReturn = getsockopt(_sock, SOL_SOCKET, SO_ERROR,
|
||||
(char*)&error, &len);
|
||||
|
|
|
@ -876,7 +876,7 @@ fixBOM(unsigned char **bytes, unsigned *length, BOOL *shouldFree,
|
|||
* peculiar to its memory management (shrinking, growing, and converting).
|
||||
*/
|
||||
|
||||
static inline char*
|
||||
static inline const char*
|
||||
UTF8String_c(GSStr self)
|
||||
{
|
||||
unsigned char *r;
|
||||
|
@ -922,10 +922,10 @@ UTF8String_c(GSStr self)
|
|||
NSZoneFree(NSDefaultMallocZone(), u);
|
||||
}
|
||||
|
||||
return (char*)r;
|
||||
return (const char*)r;
|
||||
}
|
||||
|
||||
static inline char*
|
||||
static inline const char*
|
||||
UTF8String_u(GSStr self)
|
||||
{
|
||||
unsigned c = self->_count;
|
||||
|
@ -945,7 +945,7 @@ UTF8String_u(GSStr self)
|
|||
[NSException raise: NSCharacterConversionException
|
||||
format: @"Can't get UTF8 from Unicode string."];
|
||||
}
|
||||
return (char*)r;
|
||||
return (const char*)r;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1184,7 +1184,7 @@ compare_u(GSStr self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
return strCompUsNs((id)self, aString, mask, aRange);
|
||||
}
|
||||
|
||||
static inline char*
|
||||
static inline const char*
|
||||
cString_c(GSStr self, NSStringEncoding enc)
|
||||
{
|
||||
unsigned char *r;
|
||||
|
@ -1245,10 +1245,10 @@ cString_c(GSStr self, NSStringEncoding enc)
|
|||
NSZoneFree(NSDefaultMallocZone(), u);
|
||||
}
|
||||
|
||||
return (char*)r;
|
||||
return (const char*)r;
|
||||
}
|
||||
|
||||
static inline char*
|
||||
static inline const char*
|
||||
cString_u(GSStr self, NSStringEncoding enc)
|
||||
{
|
||||
unsigned c = self->_count;
|
||||
|
@ -1273,7 +1273,7 @@ cString_u(GSStr self, NSStringEncoding enc)
|
|||
[NSDataClass dataWithBytesNoCopy: tmp
|
||||
length: (c + 1)*2
|
||||
freeWhenDone: YES];
|
||||
return (char*)tmp;
|
||||
return (const char*)tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1286,7 +1286,7 @@ cString_u(GSStr self, NSStringEncoding enc)
|
|||
[NSException raise: NSCharacterConversionException
|
||||
format: @"Can't get cString from Unicode string."];
|
||||
}
|
||||
return (char*)r;
|
||||
return (const char*)r;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1357,7 +1357,7 @@ compare(id elem1, id elem2, void* context)
|
|||
|
||||
- (id) valueForKeyPath: (NSString*)path
|
||||
{
|
||||
id result;
|
||||
id result = nil;
|
||||
|
||||
if ([path hasPrefix: @"@"])
|
||||
{
|
||||
|
|
|
@ -1250,6 +1250,7 @@ static Class concreteMutableClass = nil;
|
|||
NSRange r;
|
||||
BOOL findingLocation = YES;
|
||||
|
||||
r.location = 0;
|
||||
indexes = [NSMutableIndexSet new];
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
|
|
|
@ -2754,7 +2754,7 @@ static void callEncoder (DOContext *ctxt)
|
|||
*/
|
||||
- (NSPortCoder*) _getReplyRmc: (int)sn
|
||||
{
|
||||
NSPortCoder *rmc;
|
||||
NSPortCoder *rmc = nil;
|
||||
GSIMapNode node = 0;
|
||||
NSDate *timeout_date = nil;
|
||||
NSTimeInterval last_interval = 0.0001;
|
||||
|
|
|
@ -877,8 +877,10 @@ case a: env->addr = __builtin_return_address(a + 1); break;
|
|||
|
||||
#if defined(__MINGW32__)
|
||||
#include <setjmp.h>
|
||||
#ifndef SIGBUS
|
||||
#define SIGBUS SIGILL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
jmp_buf buf;
|
||||
|
|
|
@ -250,8 +250,8 @@ static NSDecimalNumber *one;
|
|||
*/
|
||||
- (id) initWithBytes: (const void*)value objCType: (const char*)type
|
||||
{
|
||||
unsigned long long val;
|
||||
long long llval;
|
||||
unsigned long long val = 0ll;
|
||||
long long llval = 0ll;
|
||||
NSDecimal decimal;
|
||||
BOOL negative, llvalSet;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
object: (NSString*)object
|
||||
userInfo: (NSData*)info
|
||||
selector: (NSString*)aSelector
|
||||
to: (unsigned long)observer;
|
||||
to: (size_t)observer;
|
||||
@end
|
||||
|
||||
/**
|
||||
|
@ -337,7 +337,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
NS_DURING
|
||||
{
|
||||
[self _connect];
|
||||
[(id<GDNCProtocol>)_remote addObserver: (unsigned long)anObserver
|
||||
[(id<GDNCProtocol>)_remote addObserver: (size_t)anObserver
|
||||
selector: NSStringFromSelector(aSelector)
|
||||
name: notificationName
|
||||
object: anObject
|
||||
|
@ -463,7 +463,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
NS_DURING
|
||||
{
|
||||
[self _connect];
|
||||
[(id<GDNCProtocol>)_remote removeObserver: (unsigned long)anObserver
|
||||
[(id<GDNCProtocol>)_remote removeObserver: (size_t)anObserver
|
||||
name: notificationName
|
||||
object: anObject
|
||||
for: (id<GDNCClient>)self];
|
||||
|
@ -517,7 +517,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
* in the source where the '@protocol()' directive is used.
|
||||
*/
|
||||
@interface NSDistributedNotificationCenterDummy : NSObject <GDNCProtocol>
|
||||
- (void) addObserver: (unsigned long)anObserver
|
||||
- (void) addObserver: (size_t)anObserver
|
||||
selector: (NSString*)aSelector
|
||||
name: (NSString*)notificationname
|
||||
object: (NSString*)anObject
|
||||
|
@ -529,7 +529,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
deliverImmediately: (BOOL)deliverImmediately
|
||||
for: (id<GDNCClient>)client;
|
||||
- (void) registerClient: (id<GDNCClient>)client;
|
||||
- (void) removeObserver: (unsigned long)anObserver
|
||||
- (void) removeObserver: (size_t)anObserver
|
||||
name: (NSString*)notificationname
|
||||
object: (NSString*)anObject
|
||||
for: (id<GDNCClient>)client;
|
||||
|
@ -539,7 +539,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
@end
|
||||
|
||||
@implementation NSDistributedNotificationCenterDummy
|
||||
- (void) addObserver: (unsigned long)anObserver
|
||||
- (void) addObserver: (size_t)anObserver
|
||||
selector: (NSString*)aSelector
|
||||
name: (NSString*)notificationname
|
||||
object: (NSString*)anObject
|
||||
|
@ -557,7 +557,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
- (void) registerClient: (id<GDNCClient>)client
|
||||
{
|
||||
}
|
||||
- (void) removeObserver: (unsigned long)anObserver
|
||||
- (void) removeObserver: (size_t)anObserver
|
||||
name: (NSString*)notificationname
|
||||
object: (NSString*)anObject
|
||||
for: (id<GDNCClient>)client
|
||||
|
@ -802,7 +802,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
object: (NSString*)object
|
||||
userInfo: (NSData*)info
|
||||
selector: (NSString*)aSelector
|
||||
to: (unsigned long)observer
|
||||
to: (size_t)observer
|
||||
{
|
||||
id userInfo;
|
||||
NSNotification *notification;
|
||||
|
|
|
@ -221,7 +221,7 @@
|
|||
|
||||
- (void) removeObjectAtIndex: (unsigned)index
|
||||
{
|
||||
NSIndexSet *indexes;
|
||||
NSIndexSet *indexes = nil;
|
||||
|
||||
if (!otherChangeInProgress)
|
||||
{
|
||||
|
@ -242,7 +242,7 @@
|
|||
|
||||
- (void) insertObject: (id)anObject atIndex: (unsigned)index
|
||||
{
|
||||
NSIndexSet *indexes;
|
||||
NSIndexSet *indexes = nil;
|
||||
|
||||
if (!otherChangeInProgress)
|
||||
{
|
||||
|
@ -264,7 +264,7 @@
|
|||
|
||||
- (void) replaceObjectAtIndex: (unsigned)index withObject: (id)anObject
|
||||
{
|
||||
NSIndexSet *indexes;
|
||||
NSIndexSet *indexes = nil;
|
||||
BOOL triggerNotifications = !otherChangeInProgress;
|
||||
|
||||
if (triggerNotifications)
|
||||
|
@ -332,7 +332,7 @@
|
|||
|
||||
- (void) removeObjectAtIndex: (unsigned)index
|
||||
{
|
||||
NSIndexSet *indexes;
|
||||
NSIndexSet *indexes = nil;
|
||||
NSMutableArray *temp;
|
||||
|
||||
if (!otherChangeInProgress)
|
||||
|
@ -359,7 +359,7 @@
|
|||
|
||||
- (void) insertObject: (id)anObject atIndex: (unsigned)index
|
||||
{
|
||||
NSIndexSet *indexes;
|
||||
NSIndexSet *indexes = nil;
|
||||
NSMutableArray *temp;
|
||||
|
||||
if (!otherChangeInProgress)
|
||||
|
@ -386,7 +386,7 @@
|
|||
|
||||
- (void) replaceObjectAtIndex: (unsigned)index withObject: (id)anObject
|
||||
{
|
||||
NSIndexSet *indexes;
|
||||
NSIndexSet *indexes = nil;
|
||||
NSMutableArray *temp;
|
||||
|
||||
if (!otherChangeInProgress)
|
||||
|
@ -432,7 +432,7 @@
|
|||
char cKey[size + 2];
|
||||
char *cKeyPtr = &cKey[0];
|
||||
const char *type = 0;
|
||||
BOOL found;
|
||||
BOOL found = NO;
|
||||
int offset;
|
||||
|
||||
cKey[0] = '_';
|
||||
|
|
|
@ -1452,7 +1452,7 @@ typedef struct {
|
|||
me = NSEnumerateMapTable(handles);
|
||||
while (NSNextMapEnumeratorPair(&me, &dummy, (void**)&handle))
|
||||
{
|
||||
if ([handle recvPort] == recvPort)
|
||||
if ((NSPort*) [handle recvPort] == recvPort)
|
||||
{
|
||||
RETAIN(handle);
|
||||
NSEndMapTableEnumeration(&me);
|
||||
|
|
|
@ -517,7 +517,7 @@
|
|||
NSString *prefix;
|
||||
NSString *suffix;
|
||||
NSString *wholeString;
|
||||
NSString *fracPad;
|
||||
NSString *fracPad = nil;
|
||||
NSString *fracPartString;
|
||||
NSMutableString *intPartString;
|
||||
NSMutableString *formattedNumber;
|
||||
|
|
|
@ -28,9 +28,10 @@
|
|||
/* On some versions of mingw we need to work around bad function declarations
|
||||
* by defining them away and doing the declarations ourself later.
|
||||
*/
|
||||
#ifndef _WIN64
|
||||
#define InterlockedIncrement BadInterlockedIncrement
|
||||
#define InterlockedDecrement BadInterlockedDecrement
|
||||
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "GNUstepBase/preface.h"
|
||||
|
@ -211,11 +212,12 @@ static void GSLogZombie(id o, SEL sel)
|
|||
#if defined(REFCNT_LOCAL)
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
|
||||
#ifndef _WIN64
|
||||
#undef InterlockedIncrement
|
||||
#undef InterlockedDecrement
|
||||
LONG WINAPI InterlockedIncrement(LONG volatile *);
|
||||
LONG WINAPI InterlockedDecrement(LONG volatile *);
|
||||
#endif
|
||||
|
||||
/* Set up atomic read, increment and decrement for mswindows
|
||||
*/
|
||||
|
|
|
@ -1589,7 +1589,7 @@
|
|||
|
||||
- (NSPredicate *) parse
|
||||
{
|
||||
NSPredicate *r;
|
||||
NSPredicate *r = nil;
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
|
|
|
@ -1730,7 +1730,7 @@ PString(NSString *obj, NSMutableData *output)
|
|||
static void
|
||||
XString(NSString* obj, NSMutableData *output)
|
||||
{
|
||||
static char *hexdigits = "0123456789ABCDEF";
|
||||
static const char *hexdigits = "0123456789ABCDEF";
|
||||
unsigned end;
|
||||
|
||||
end = [obj length];
|
||||
|
|
|
@ -275,7 +275,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"<%s %lx>",
|
||||
GSClassNameFromObject(self), (unsigned long)self];
|
||||
GSClassNameFromObject(self), (size_t)self];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -862,7 +862,7 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
|||
NSTimeInterval now;
|
||||
NSDate *earliest = nil;
|
||||
BOOL recheck = YES;
|
||||
NSTimeInterval ei;
|
||||
NSTimeInterval ei = 0;
|
||||
NSTimer *t;
|
||||
NSTimeInterval ti;
|
||||
unsigned i;
|
||||
|
@ -1089,7 +1089,7 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
|||
beforeDate: (NSDate*)limit_date
|
||||
{
|
||||
GSRunLoopCtxt *context;
|
||||
NSTimeInterval ti;
|
||||
NSTimeInterval ti = 0;
|
||||
int timeout_ms;
|
||||
NSString *savedMode = _currentMode;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
|
|
|
@ -445,7 +445,7 @@ static Class NSMutableSet_concrete_class;
|
|||
id e = [self objectEnumerator];
|
||||
unsigned i;
|
||||
unsigned c = [self count];
|
||||
NSArray *result;
|
||||
NSArray *result = nil;
|
||||
GS_BEGINIDBUF(k, c);
|
||||
|
||||
for (i = 0; i < c; i++)
|
||||
|
@ -630,7 +630,7 @@ static Class NSMutableSet_concrete_class;
|
|||
|
||||
- (id) valueForKeyPath: (NSString*)path
|
||||
{
|
||||
id result;
|
||||
id result = (id) nil;
|
||||
|
||||
if ([path hasPrefix: @"@"])
|
||||
{
|
||||
|
|
|
@ -698,7 +698,7 @@ static Class runLoopClass;
|
|||
#if defined(__MINGW32__)
|
||||
- (int) eventHandle
|
||||
{
|
||||
return (int)event;
|
||||
return (int) (size_t) event;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1102,7 +1102,7 @@ static Class runLoopClass;
|
|||
if (state == GS_H_TRYCON) /* Connection attempt. */
|
||||
{
|
||||
int res = 0;
|
||||
unsigned len = sizeof(res);
|
||||
socklen_t len = sizeof(res);
|
||||
|
||||
if (getsockopt(desc, SOL_SOCKET, SO_ERROR, (char*)&res, &len) != 0)
|
||||
{
|
||||
|
@ -1541,7 +1541,7 @@ static Class tcpPortClass;
|
|||
forceAddress: (NSString*)addr
|
||||
listener: (BOOL)shouldListen
|
||||
{
|
||||
unsigned i;
|
||||
socklen_t slen;
|
||||
NSSocketPort *port = nil;
|
||||
NSHost *thisHost = [NSHost localHost];
|
||||
NSMapTable *thePorts;
|
||||
|
@ -1629,7 +1629,7 @@ static Class tcpPortClass;
|
|||
/*
|
||||
* Need size of buffer for getsockbyname() later.
|
||||
*/
|
||||
i = sizeof(sockaddr);
|
||||
slen = sizeof(sockaddr);
|
||||
|
||||
if (addrOk == NO)
|
||||
{
|
||||
|
@ -1672,7 +1672,7 @@ static Class tcpPortClass;
|
|||
(void) close(desc);
|
||||
DESTROY(port);
|
||||
}
|
||||
else if (getsockname(desc, (struct sockaddr*)&sockaddr, &i)
|
||||
else if (getsockname(desc, (struct sockaddr*)&sockaddr, &slen)
|
||||
== SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %@", [NSError _last]);
|
||||
|
@ -1935,7 +1935,7 @@ static Class tcpPortClass;
|
|||
me = NSEnumerateMapTable(handles);
|
||||
while (NSNextMapEnumeratorPair(&me, &dummy, (void**)&handle))
|
||||
{
|
||||
if ([handle recvPort] == recvPort)
|
||||
if ((NSPort*) [handle recvPort] == recvPort)
|
||||
{
|
||||
RETAIN(handle);
|
||||
NSEndMapTableEnumeration(&me);
|
||||
|
@ -2158,7 +2158,7 @@ static Class tcpPortClass;
|
|||
#endif
|
||||
{
|
||||
struct sockaddr_in sockAddr;
|
||||
unsigned size = sizeof(sockAddr);
|
||||
size_t size = sizeof(sockAddr);
|
||||
|
||||
desc = accept(listener, (struct sockaddr*)&sockAddr, &size);
|
||||
if (desc == INVALID_SOCKET)
|
||||
|
|
|
@ -4610,7 +4610,7 @@ static NSFileManager *fm = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
self = [self initWithBytesNoCopy: ""
|
||||
self = [self initWithBytesNoCopy: (char *)""
|
||||
length: 0
|
||||
encoding: NSASCIIStringEncoding
|
||||
freeWhenDone: NO];
|
||||
|
|
|
@ -1004,7 +1004,7 @@ static DWORD WINAPI _threadFunction(LPVOID t)
|
|||
NSConcreteWindowsTask *task;
|
||||
|
||||
[tasksLock lock];
|
||||
task = (NSConcreteWindowsTask*)NSMapGet(activeTasks, (void*)taskId);
|
||||
task = (NSConcreteWindowsTask*)NSMapGet(activeTasks, (void*)(intptr_t) taskId);
|
||||
[tasksLock unlock];
|
||||
if (task == nil)
|
||||
{
|
||||
|
@ -1216,7 +1216,7 @@ quotedFromString(NSString *aString)
|
|||
ASSIGN(_launchPath, lpath); // Actual path used.
|
||||
|
||||
[tasksLock lock];
|
||||
NSMapInsert(activeTasks, (void*)_taskId, (void*)self);
|
||||
NSMapInsert(activeTasks, (void*)(intptr_t) _taskId, (void*)self);
|
||||
[tasksLock unlock];
|
||||
/*
|
||||
* Create thread to watch for termination of process.
|
||||
|
|
|
@ -978,7 +978,7 @@ static unsigned urlAlign;
|
|||
{
|
||||
buf->user = 0;
|
||||
buf->password = 0;
|
||||
buf->host = "localhost";
|
||||
buf->host = (char*) "localhost";
|
||||
buf->port = 0;
|
||||
buf->isGeneric = YES;
|
||||
}
|
||||
|
|
|
@ -708,7 +708,7 @@ cifframe_do_call (DOContext *ctxt,
|
|||
/* The selector for the message we're sending to the TARGET. */
|
||||
SEL selector;
|
||||
/* The OBJECT's Method(_t) pointer for the SELECTOR. */
|
||||
GSMethod meth;
|
||||
GSMethod meth = 0;
|
||||
/* The OBJECT's implementation of the SELECTOR. */
|
||||
IMP method_implementation;
|
||||
/* Type qualifier flags; see <objc/objc-api.h>. */
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
*/
|
||||
|
||||
static const char *inet_ntop4(const u_char *src, char *dst, size_t size);
|
||||
static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
|
||||
static __attribute__((unused)) const char *inet_ntop6(const u_char *src, char *dst, size_t size);
|
||||
|
||||
/* char *
|
||||
* inet_ntop(af, src, dst, size)
|
||||
|
@ -114,7 +114,8 @@ inet_ntop4(src, dst, size)
|
|||
* author:
|
||||
* Paul Vixie, 1996.
|
||||
*/
|
||||
static const char *
|
||||
static __attribute__((unused))
|
||||
const char *
|
||||
inet_ntop6(src, dst, size)
|
||||
const u_char *src;
|
||||
char *dst;
|
||||
|
|
|
@ -820,7 +820,7 @@ mframe_do_call (DOContext *ctxt,
|
|||
/* The selector for the message we're sending to the TARGET. */
|
||||
SEL selector;
|
||||
/* The OBJECT's Method(_t) pointer for the SELECTOR. */
|
||||
GSMethod meth;
|
||||
GSMethod meth = 0;
|
||||
/* The OBJECT's implementation of the SELECTOR. */
|
||||
IMP method_implementation;
|
||||
/* The number bytes for holding arguments passed on the stack. */
|
||||
|
@ -909,7 +909,7 @@ mframe_do_call (DOContext *ctxt,
|
|||
@"Will search for arbitrary signature.",
|
||||
object,
|
||||
GSNameFromClass(GSObjCIsClass(object)
|
||||
? object : GSObjCClass(object)),
|
||||
? object : (id) GSObjCClass(object)),
|
||||
GSNameFromSelector(selector));
|
||||
type = GSTypesFromSelector(selector);
|
||||
}
|
||||
|
|
|
@ -888,7 +888,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
#endif
|
||||
SOCKET net;
|
||||
struct sockaddr_in sin;
|
||||
unsigned int size = sizeof(sin);
|
||||
int size = sizeof(sin);
|
||||
|
||||
if (getAddr(a, s, p, &sin) == NO)
|
||||
{
|
||||
|
@ -1924,7 +1924,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
struct sockaddr_in buf;
|
||||
SOCKET desc;
|
||||
unsigned int blen = sizeof(buf);
|
||||
int blen = sizeof(buf);
|
||||
|
||||
desc = accept((SOCKET)_get_osfhandle(descriptor),
|
||||
(struct sockaddr*)&buf, &blen);
|
||||
|
@ -1941,7 +1941,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{ // Accept attempt completed.
|
||||
GSFileHandle *h;
|
||||
struct sockaddr_in sin;
|
||||
unsigned int size = sizeof(sin);
|
||||
int size = sizeof(sin);
|
||||
int status;
|
||||
|
||||
/*
|
||||
|
@ -2045,7 +2045,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{ // Connection attempt completed.
|
||||
int result;
|
||||
int rval;
|
||||
unsigned len = sizeof(result);
|
||||
int len = sizeof(result);
|
||||
|
||||
rval = getsockopt((SOCKET)_get_osfhandle(descriptor), SOL_SOCKET,
|
||||
SO_ERROR, (char*)&result, &len);
|
||||
|
@ -2293,7 +2293,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *str = nil;
|
||||
struct sockaddr_in sin;
|
||||
unsigned size = sizeof(sin);
|
||||
int size = sizeof(sin);
|
||||
|
||||
if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == SOCKET_ERROR)
|
||||
{
|
||||
|
@ -2310,7 +2310,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *str = nil;
|
||||
struct sockaddr_in sin;
|
||||
unsigned size = sizeof(sin);
|
||||
int size = sizeof(sin);
|
||||
|
||||
if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == SOCKET_ERROR)
|
||||
{
|
||||
|
|
|
@ -331,7 +331,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
switch (info->type)
|
||||
{
|
||||
case ET_HANDLE:
|
||||
handle = (HANDLE)(int)info->data;
|
||||
handle = (HANDLE)(size_t)info->data;
|
||||
NSMapInsert(handleMap, (void*)handle, info);
|
||||
num_handles++;
|
||||
break;
|
||||
|
@ -355,13 +355,13 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
while (port_handle_count--)
|
||||
{
|
||||
NSMapInsert(handleMap,
|
||||
(void*)port_handle_array[port_handle_count], info);
|
||||
(void*)(size_t) port_handle_array[port_handle_count], info);
|
||||
num_handles++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ET_WINMSG:
|
||||
handle = (HANDLE)(int)info->data;
|
||||
handle = (HANDLE)(size_t)info->data;
|
||||
NSMapInsert(winMsgMap, (void*)handle, info);
|
||||
num_winMsgs++;
|
||||
break;
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
extern int errno;
|
||||
extern __declspec(dllimport) int errno;
|
||||
|
||||
#define UNISTR(X) \
|
||||
((const unichar*)[(X) cStringUsingEncoding: NSUnicodeStringEncoding])
|
||||
|
@ -596,8 +596,8 @@ static Class messagePortClass = 0;
|
|||
GSPortItemHeader *pih;
|
||||
unsigned off = 0;
|
||||
unsigned len;
|
||||
unsigned rId;
|
||||
unsigned nItems;
|
||||
unsigned rId = 0;
|
||||
unsigned nItems = 0;
|
||||
NSMessagePort *rPort = nil;
|
||||
NSMutableArray *rItems = nil;
|
||||
|
||||
|
@ -971,7 +971,7 @@ again:
|
|||
from: (NSPort*)receivingPort
|
||||
reserved: (unsigned)length
|
||||
{
|
||||
NSMutableData *h;
|
||||
NSMutableData *h = nil;
|
||||
NSMutableData *first;
|
||||
BOOL sent = NO;
|
||||
unsigned c;
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#define UNISTR(X) \
|
||||
((const unichar*)[(X) cStringUsingEncoding: NSUnicodeStringEncoding])
|
||||
|
||||
extern int errno;
|
||||
extern __declspec(dllimport) int errno;
|
||||
|
||||
static NSRecursiveLock *serverLock = nil;
|
||||
static NSMessagePortNameServer *defaultServer = nil;
|
||||
|
@ -112,7 +112,7 @@ static void clean_up_names(void)
|
|||
HKEY_CURRENT_USER,
|
||||
UNISTR(registry),
|
||||
0,
|
||||
L"",
|
||||
(LPWSTR) L"",
|
||||
REG_OPTION_VOLATILE,
|
||||
STANDARD_RIGHTS_WRITE|STANDARD_RIGHTS_READ|KEY_SET_VALUE
|
||||
|KEY_QUERY_VALUE|KEY_NOTIFY,
|
||||
|
@ -227,7 +227,7 @@ OutputDebugStringW(L"");
|
|||
return nil;
|
||||
}
|
||||
|
||||
mailslotName = [NSString stringWithUTF8String: ptr];
|
||||
mailslotName = [NSString stringWithUTF8String: (const char *) ptr];
|
||||
if (ptr != buf)
|
||||
{
|
||||
objc_free(ptr);
|
||||
|
@ -338,7 +338,7 @@ OutputDebugStringW(L"");
|
|||
}
|
||||
|
||||
n = [[self class] _translate: name];
|
||||
str = [[(NSMessagePort*)port name] UTF8String];
|
||||
str = (const unsigned char *) [[(NSMessagePort*)port name] UTF8String];
|
||||
|
||||
rc = RegSetValueExW(
|
||||
key,
|
||||
|
@ -346,7 +346,7 @@ OutputDebugStringW(L"");
|
|||
0,
|
||||
REG_BINARY,
|
||||
str,
|
||||
strlen(str)+1);
|
||||
strlen((const char*) str)+1);
|
||||
NSDebugLLog(@"NSMessagePortNameServer", @"Set port '%s' for %@", str, n);
|
||||
if (rc == ERROR_SUCCESS)
|
||||
{
|
||||
|
|
|
@ -553,7 +553,7 @@ struct NSUserDefaultsWin32_DomainInfo
|
|||
rc = RegCreateKeyExW(HKEY_CURRENT_USER,
|
||||
UNISTR(dPath),
|
||||
0,
|
||||
L"",
|
||||
(LPWSTR) L"",
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
STANDARD_RIGHTS_WRITE|STANDARD_RIGHTS_READ|KEY_SET_VALUE
|
||||
|KEY_QUERY_VALUE,
|
||||
|
|
Loading…
Reference in a new issue