mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
compatibility and portability fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29736 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f6f61cb578
commit
62939c969a
12 changed files with 124 additions and 36 deletions
|
@ -69,7 +69,7 @@
|
|||
* in case the remote server is buggy and requires particular
|
||||
* captialisation of headers (some http software is faulty like that).
|
||||
*/
|
||||
static unsigned int
|
||||
static NSUInteger
|
||||
_id_hash(void *table, NSString* o)
|
||||
{
|
||||
return [[o uppercaseString] hash];
|
||||
|
@ -81,7 +81,7 @@ _id_is_equal(void *table, NSString *o, NSString *p)
|
|||
return ([o caseInsensitiveCompare: p] == NSOrderedSame) ? YES : NO;
|
||||
}
|
||||
|
||||
typedef unsigned int (*NSMT_hash_func_t)(NSMapTable *, const void *);
|
||||
typedef NSUInteger (*NSMT_hash_func_t)(NSMapTable *, const void *);
|
||||
typedef BOOL (*NSMT_is_equal_func_t)(NSMapTable *, const void *, const void *);
|
||||
typedef void (*NSMT_retain_func_t)(NSMapTable *, const void *);
|
||||
typedef void (*NSMT_release_func_t)(NSMapTable *, void *);
|
||||
|
|
|
@ -82,8 +82,10 @@
|
|||
#define IN6ADDRSZ 16
|
||||
#endif
|
||||
|
||||
#ifndef socklen_t
|
||||
#define socklen_t uint32_t
|
||||
#if !defined(HAVE_SOCKLEN_T)
|
||||
# if !defined(socklen_t)
|
||||
# define socklen_t uint32_t
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -259,7 +259,7 @@ NSCopyHashTableWithZone(NSHashTable *table, NSZone *zone)
|
|||
/**
|
||||
* Returns the number of items in the table.
|
||||
*/
|
||||
unsigned int
|
||||
NSUInteger
|
||||
NSCountHashTable(NSHashTable *table)
|
||||
{
|
||||
return [table count];
|
||||
|
@ -275,7 +275,7 @@ NSCountHashTable(NSHashTable *table)
|
|||
NSHashTable *
|
||||
NSCreateHashTable(
|
||||
NSHashTableCallBacks callBacks,
|
||||
unsigned int capacity)
|
||||
NSUInteger capacity)
|
||||
{
|
||||
return NSCreateHashTableWithZone(callBacks, capacity, NSDefaultMallocZone());
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ NSCreateHashTable(
|
|||
NSHashTable *
|
||||
NSCreateHashTableWithZone(
|
||||
NSHashTableCallBacks k,
|
||||
unsigned int capacity,
|
||||
NSUInteger capacity,
|
||||
NSZone *zone)
|
||||
{
|
||||
GSIMapTable table;
|
||||
|
@ -726,7 +726,7 @@ NSStringFromHashTable(NSHashTable *table)
|
|||
|
||||
|
||||
/* These are to increase readabilty locally. */
|
||||
typedef unsigned int (*NSHT_hash_func_t)(NSHashTable *, const void *);
|
||||
typedef NSUInteger (*NSHT_hash_func_t)(NSHashTable *, const void *);
|
||||
typedef BOOL (*NSHT_isEqual_func_t)(NSHashTable *, const void *, const void *);
|
||||
typedef void (*NSHT_retain_func_t)(NSHashTable *, const void *);
|
||||
typedef void (*NSHT_release_func_t)(NSHashTable *, void *);
|
||||
|
@ -855,7 +855,7 @@ const NSHashTableCallBacks NSPointerToStructHashCallBacks =
|
|||
- (NSArray*) allObjects
|
||||
{
|
||||
NSHashEnumerator enumerator;
|
||||
unsigned index;
|
||||
NSUInteger index;
|
||||
NSArray *a;
|
||||
GS_BEGINITEMBUF(objects, nodeCount, id);
|
||||
|
||||
|
|
|
@ -385,7 +385,7 @@ NSCopyMapTableWithZone(NSMapTable *table, NSZone *zone)
|
|||
/**
|
||||
* Returns the number of key/value pairs in the table.
|
||||
*/
|
||||
unsigned int
|
||||
NSUInteger
|
||||
NSCountMapTable(NSMapTable *table)
|
||||
{
|
||||
if (table == nil)
|
||||
|
@ -411,7 +411,7 @@ NSMapTable *
|
|||
NSCreateMapTable(
|
||||
NSMapTableKeyCallBacks keyCallBacks,
|
||||
NSMapTableValueCallBacks valueCallBacks,
|
||||
unsigned int capacity)
|
||||
NSUInteger capacity)
|
||||
{
|
||||
return NSCreateMapTableWithZone(keyCallBacks, valueCallBacks,
|
||||
capacity, NSDefaultMallocZone());
|
||||
|
@ -430,7 +430,7 @@ NSMapTable *
|
|||
NSCreateMapTableWithZone(
|
||||
NSMapTableKeyCallBacks k,
|
||||
NSMapTableValueCallBacks v,
|
||||
unsigned int capacity,
|
||||
NSUInteger capacity,
|
||||
NSZone *zone)
|
||||
{
|
||||
GSIMapTable table;
|
||||
|
@ -1002,7 +1002,7 @@ NSStringFromMapTable(NSMapTable *table)
|
|||
|
||||
|
||||
/* These are to increase readabilty locally. */
|
||||
typedef unsigned int (*NSMT_hash_func_t)(NSMapTable *, const void *);
|
||||
typedef NSUInteger (*NSMT_hash_func_t)(NSMapTable *, const void *);
|
||||
typedef BOOL (*NSMT_is_equal_func_t)(NSMapTable *, const void *, const void *);
|
||||
typedef void (*NSMT_retain_func_t)(NSMapTable *, const void *);
|
||||
typedef void (*NSMT_release_func_t)(NSMapTable *, void *);
|
||||
|
|
|
@ -133,14 +133,16 @@ static Class concreteClass = 0;
|
|||
|
||||
- (NSUInteger) count
|
||||
{
|
||||
return (NSUInteger)[self subclassResponsibility: _cmd];
|
||||
[self subclassResponsibility: _cmd];
|
||||
return (NSUInteger)0;
|
||||
}
|
||||
|
||||
- (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState*)state
|
||||
objects: (id*)stackbuf
|
||||
count: (NSUInteger)len
|
||||
{
|
||||
return (NSUInteger)[self subclassResponsibility: _cmd];
|
||||
[self subclassResponsibility: _cmd];
|
||||
return (NSUInteger)0;
|
||||
}
|
||||
|
||||
- (NSDictionary*) dictionaryRepresentation
|
||||
|
@ -201,7 +203,7 @@ static Class concreteClass = 0;
|
|||
|
||||
- (void) removeAllObjects
|
||||
{
|
||||
unsigned count = [self count];
|
||||
NSUInteger count = [self count];
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
|
|
|
@ -2150,7 +2150,7 @@ static Class tcpPortClass;
|
|||
#endif
|
||||
{
|
||||
struct sockaddr_in sockAddr;
|
||||
size_t size = sizeof(sockAddr);
|
||||
socklen_t size = sizeof(sockAddr);
|
||||
|
||||
desc = accept(listener, (struct sockaddr*)&sockAddr, &size);
|
||||
if (desc == INVALID_SOCKET)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue