mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Tidied for gcc-3.4
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15476 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
77fbafc557
commit
d64578fc3e
50 changed files with 2888 additions and 1775 deletions
54
ChangeLog
54
ChangeLog
|
@ -1,3 +1,57 @@
|
||||||
|
2003-01-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* base.make.in:
|
||||||
|
* configure:
|
||||||
|
* configure.ac:
|
||||||
|
* Headers/gnustep/base/GSIArray.h:
|
||||||
|
* Headers/gnustep/base/GSIMap.h:
|
||||||
|
* Headers/gnustep/base/NSGeometry.h:
|
||||||
|
* Headers/gnustep/base/NSInvocation.h:
|
||||||
|
* Source/GSArray.m:
|
||||||
|
* Source/GSAttributedString.m:
|
||||||
|
* Source/GSCompatibility.m:
|
||||||
|
* Source/GSCountedSet.m:
|
||||||
|
* Source/GSDictionary.m:
|
||||||
|
* Source/GSFFCallInvocation.m:
|
||||||
|
* Source/GSFTPURLHandle.m:
|
||||||
|
* Source/GSFileHandle.m:
|
||||||
|
* Source/GSFormat.m:
|
||||||
|
* Source/GSString.m:
|
||||||
|
* Source/GSTcpPort.m:
|
||||||
|
* Source/GSTemplateValue.m:
|
||||||
|
* Source/NSArray.m:
|
||||||
|
* Source/NSAutoreleasePool.m:
|
||||||
|
* Source/NSBundle.m:
|
||||||
|
* Source/NSCalendarDate.m:
|
||||||
|
* Source/NSConcreteNumber.m:
|
||||||
|
* Source/NSCountedSet.m:
|
||||||
|
* Source/NSData.m:
|
||||||
|
* Source/NSDebug.m:
|
||||||
|
* Source/NSInvocation.m:
|
||||||
|
* Source/NSLog.m:
|
||||||
|
* Source/NSMethodSignature.m:
|
||||||
|
* Source/NSNotificationCenter.m:
|
||||||
|
* Source/NSObject.m:
|
||||||
|
* Source/NSPortCoder.m:
|
||||||
|
* Source/NSRunLoop.m:
|
||||||
|
* Source/NSScanner.m:
|
||||||
|
* Source/NSSerializer.m:
|
||||||
|
* Source/NSString.m:
|
||||||
|
* Source/NSTimeZone.m:
|
||||||
|
* Source/NSUnarchiver.m:
|
||||||
|
* Source/mframe.m:
|
||||||
|
* Source/Additions/GSMime.m:
|
||||||
|
* Source/Additions/GSXML.m:
|
||||||
|
* Tools/AGSOutput.m:
|
||||||
|
* Tools/AGSParser.m:
|
||||||
|
* Tools/defaults.m:
|
||||||
|
* Tools/gdomap.c:
|
||||||
|
* Tools/pl2link.m:
|
||||||
|
* Tools/sfparse.m:
|
||||||
|
* Tools/make_strings/StringsFile.m:
|
||||||
|
Tweaks for warning free compilation with gcc-3.4 ... many comparisons
|
||||||
|
os signed and un signed values avoided etc.
|
||||||
|
|
||||||
2003-01-03 Richard Frith-Macdonald <rfm@gnu.org>
|
2003-01-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Tools/AGSHtml.m: Don't try to make a type reference to the
|
* Tools/AGSHtml.m: Don't try to make a type reference to the
|
||||||
|
|
|
@ -156,8 +156,8 @@ GSIArrayCount(GSIArray array)
|
||||||
static INLINE void
|
static INLINE void
|
||||||
GSIArrayGrow(GSIArray array)
|
GSIArrayGrow(GSIArray array)
|
||||||
{
|
{
|
||||||
unsigned next;
|
unsigned int next;
|
||||||
unsigned size;
|
unsigned int size;
|
||||||
GSIArrayItem *tmp;
|
GSIArrayItem *tmp;
|
||||||
|
|
||||||
next = array->cap + array->old;
|
next = array->cap + array->old;
|
||||||
|
@ -177,7 +177,7 @@ GSIArrayGrow(GSIArray array)
|
||||||
static INLINE void
|
static INLINE void
|
||||||
GSIArrayGrowTo(GSIArray array, unsigned next)
|
GSIArrayGrowTo(GSIArray array, unsigned next)
|
||||||
{
|
{
|
||||||
unsigned size;
|
unsigned int size;
|
||||||
GSIArrayItem *tmp;
|
GSIArrayItem *tmp;
|
||||||
|
|
||||||
if (next < array->count)
|
if (next < array->count)
|
||||||
|
@ -201,7 +201,7 @@ GSIArrayGrowTo(GSIArray array, unsigned next)
|
||||||
static INLINE void
|
static INLINE void
|
||||||
GSIArrayInsertItem(GSIArray array, GSIArrayItem item, unsigned index)
|
GSIArrayInsertItem(GSIArray array, GSIArrayItem item, unsigned index)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned int i;
|
||||||
|
|
||||||
GSI_ARRAY_RETAIN(array, item);
|
GSI_ARRAY_RETAIN(array, item);
|
||||||
GSI_ARRAY_CHECK;
|
GSI_ARRAY_CHECK;
|
||||||
|
@ -220,7 +220,7 @@ GSIArrayInsertItem(GSIArray array, GSIArrayItem item, unsigned index)
|
||||||
static INLINE void
|
static INLINE void
|
||||||
GSIArrayInsertItemNoRetain(GSIArray array, GSIArrayItem item, unsigned index)
|
GSIArrayInsertItemNoRetain(GSIArray array, GSIArrayItem item, unsigned index)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned int i;
|
||||||
|
|
||||||
GSI_ARRAY_CHECK;
|
GSI_ARRAY_CHECK;
|
||||||
if (array->count == array->cap)
|
if (array->count == array->cap)
|
||||||
|
@ -271,9 +271,9 @@ static INLINE unsigned
|
||||||
GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item,
|
GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item,
|
||||||
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
|
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
|
||||||
{
|
{
|
||||||
unsigned upper = array->count;
|
unsigned int upper = array->count;
|
||||||
unsigned lower = 0;
|
unsigned int lower = 0;
|
||||||
unsigned index;
|
unsigned int index;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Binary search for an item equal to the one to be inserted.
|
* Binary search for an item equal to the one to be inserted.
|
||||||
|
@ -316,7 +316,7 @@ static INLINE void
|
||||||
GSIArrayCheckSort(GSIArray array,
|
GSIArrayCheckSort(GSIArray array,
|
||||||
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
|
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 1; i < array->count; i++)
|
for (i = 1; i < array->count; i++)
|
||||||
{
|
{
|
||||||
|
@ -332,7 +332,7 @@ static INLINE void
|
||||||
GSIArrayInsertSorted(GSIArray array, GSIArrayItem item,
|
GSIArrayInsertSorted(GSIArray array, GSIArrayItem item,
|
||||||
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
|
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
|
||||||
{
|
{
|
||||||
unsigned index;
|
unsigned int index;
|
||||||
|
|
||||||
index = GSIArrayInsertionPosition(array, item, sorter);
|
index = GSIArrayInsertionPosition(array, item, sorter);
|
||||||
GSIArrayInsertItem(array, item, index);
|
GSIArrayInsertItem(array, item, index);
|
||||||
|
@ -345,7 +345,7 @@ static INLINE void
|
||||||
GSIArrayInsertSortedNoRetain(GSIArray array, GSIArrayItem item,
|
GSIArrayInsertSortedNoRetain(GSIArray array, GSIArrayItem item,
|
||||||
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
|
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
|
||||||
{
|
{
|
||||||
unsigned index;
|
unsigned int index;
|
||||||
|
|
||||||
index = GSIArrayInsertionPosition(array, item, sorter);
|
index = GSIArrayInsertionPosition(array, item, sorter);
|
||||||
GSIArrayInsertItemNoRetain(array, item, index);
|
GSIArrayInsertItemNoRetain(array, item, index);
|
||||||
|
@ -480,7 +480,7 @@ GSIArrayEmpty(GSIArray array)
|
||||||
static INLINE GSIArray
|
static INLINE GSIArray
|
||||||
GSIArrayInitWithZoneAndCapacity(GSIArray array, NSZone *zone, size_t capacity)
|
GSIArrayInitWithZoneAndCapacity(GSIArray array, NSZone *zone, size_t capacity)
|
||||||
{
|
{
|
||||||
unsigned size;
|
unsigned int size;
|
||||||
|
|
||||||
array->zone = zone;
|
array->zone = zone;
|
||||||
array->count = 0;
|
array->count = 0;
|
||||||
|
@ -496,7 +496,7 @@ GSIArrayInitWithZoneAndCapacity(GSIArray array, NSZone *zone, size_t capacity)
|
||||||
static INLINE GSIArray
|
static INLINE GSIArray
|
||||||
GSIArrayCopyWithZone(GSIArray array, NSZone *zone)
|
GSIArrayCopyWithZone(GSIArray array, NSZone *zone)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
GSIArray new;
|
GSIArray new;
|
||||||
new = NSZoneMalloc(zone, sizeof(GSIArray_t));
|
new = NSZoneMalloc(zone, sizeof(GSIArray_t));
|
||||||
GSIArrayInitWithZoneAndCapacity(new, zone, array->count);
|
GSIArrayInitWithZoneAndCapacity(new, zone, array->count);
|
||||||
|
|
|
@ -752,7 +752,7 @@ GSIMapCleanMap(GSIMapTable map)
|
||||||
if (map->nodeCount > 0)
|
if (map->nodeCount > 0)
|
||||||
{
|
{
|
||||||
GSIMapBucket bucket = map->buckets;
|
GSIMapBucket bucket = map->buckets;
|
||||||
int i;
|
unsigned int i;
|
||||||
GSIMapNode startNode = 0;
|
GSIMapNode startNode = 0;
|
||||||
GSIMapNode prevNode = 0;
|
GSIMapNode prevNode = 0;
|
||||||
GSIMapNode node;
|
GSIMapNode node;
|
||||||
|
@ -792,7 +792,7 @@ GSIMapCleanMap(GSIMapTable map)
|
||||||
static INLINE void
|
static INLINE void
|
||||||
GSIMapEmptyMap(GSIMapTable map)
|
GSIMapEmptyMap(GSIMapTable map)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
#ifdef GSI_MAP_NOCLEAN
|
#ifdef GSI_MAP_NOCLEAN
|
||||||
if (GSI_MAP_NOCLEAN)
|
if (GSI_MAP_NOCLEAN)
|
||||||
|
|
|
@ -80,9 +80,9 @@ enum _NSRectEdge
|
||||||
NSMaxYEdge
|
NSMaxYEdge
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NSPoint NSZeroPoint; /* A zero point. */
|
static const NSPoint NSZeroPoint __attribute__((unused)); /* Zero point. */
|
||||||
static const NSRect NSZeroRect; /* A zero origin rectangle. */
|
static const NSRect NSZeroRect __attribute__((unused)); /* Zero rectangle. */
|
||||||
static const NSSize NSZeroSize; /* A zero size rectangle. */
|
static const NSSize NSZeroSize __attribute__((unused)); /* Zero size. */
|
||||||
|
|
||||||
/**** Function Prototypes ****************************************************/
|
/**** Function Prototypes ****************************************************/
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
void *_retval;
|
void *_retval;
|
||||||
id _target;
|
id _target;
|
||||||
SEL _selector;
|
SEL _selector;
|
||||||
int _numArgs;
|
unsigned int _numArgs;
|
||||||
#ifndef STRICT_MACOS_X
|
#ifndef STRICT_MACOS_X
|
||||||
NSArgumentInfo *_info;
|
NSArgumentInfo *_info;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -832,8 +832,8 @@ wordData(NSString *word)
|
||||||
src++;
|
src++;
|
||||||
if (ctxt->state != ChunkSize)
|
if (ctxt->state != ChunkSize)
|
||||||
{
|
{
|
||||||
int val = 0;
|
unsigned int val = 0;
|
||||||
int index;
|
unsigned int index;
|
||||||
|
|
||||||
for (index = 0; index < ctxt->pos; index++)
|
for (index = 0; index < ctxt->pos; index++)
|
||||||
{
|
{
|
||||||
|
@ -2752,7 +2752,7 @@ static NSCharacterSet *tokenSet = nil;
|
||||||
NSData *d = [[self name] dataUsingEncoding: NSASCIIStringEncoding];
|
NSData *d = [[self name] dataUsingEncoding: NSASCIIStringEncoding];
|
||||||
unsigned l = [d length];
|
unsigned l = [d length];
|
||||||
char buf[l];
|
char buf[l];
|
||||||
int i = 0;
|
unsigned int i = 0;
|
||||||
BOOL conv = YES;
|
BOOL conv = YES;
|
||||||
|
|
||||||
#define LIM 120
|
#define LIM 120
|
||||||
|
|
|
@ -3100,7 +3100,8 @@ fatalErrorFunction(void *ctx, const char *msg, ...)
|
||||||
xmlNode *node;
|
xmlNode *node;
|
||||||
GSXMLNode *n;
|
GSXMLNode *n;
|
||||||
|
|
||||||
node = xmlXPathNodeSetItem (((xmlXPathObject*)_lib)->nodesetval, index);
|
node = xmlXPathNodeSetItem (((xmlXPathObject*)_lib)->nodesetval,
|
||||||
|
(int)index);
|
||||||
n = [GSXMLNode alloc];
|
n = [GSXMLNode alloc];
|
||||||
|
|
||||||
return [n _initFrom: node parent: self];
|
return [n _initFrom: node parent: self];
|
||||||
|
|
|
@ -631,14 +631,15 @@ static SEL eqSel;
|
||||||
/* Shell sort algorithm taken from SortingInAction - a NeXT example */
|
/* Shell sort algorithm taken from SortingInAction - a NeXT example */
|
||||||
#define STRIDE_FACTOR 3 // good value for stride factor is not well-understood
|
#define STRIDE_FACTOR 3 // good value for stride factor is not well-understood
|
||||||
// 3 is a fairly good choice (Sedgewick)
|
// 3 is a fairly good choice (Sedgewick)
|
||||||
unsigned c,d, stride;
|
unsigned int c;
|
||||||
|
unsigned int d;
|
||||||
|
unsigned int stride = 1;
|
||||||
BOOL found;
|
BOOL found;
|
||||||
int count = _count;
|
unsigned int count = _count;
|
||||||
#ifdef GSWARN
|
#ifdef GSWARN
|
||||||
BOOL badComparison = NO;
|
BOOL badComparison = NO;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
stride = 1;
|
|
||||||
while (stride <= count)
|
while (stride <= count)
|
||||||
{
|
{
|
||||||
stride = stride * STRIDE_FACTOR + 1;
|
stride = stride * STRIDE_FACTOR + 1;
|
||||||
|
|
|
@ -807,7 +807,7 @@ SANITY();
|
||||||
info = OBJECTAT(arrayIndex);
|
info = OBJECTAT(arrayIndex);
|
||||||
if (info->loc < NSMaxRange(range))
|
if (info->loc < NSMaxRange(range))
|
||||||
{
|
{
|
||||||
int next = arrayIndex + 1;
|
unsigned int next = arrayIndex + 1;
|
||||||
|
|
||||||
while (next < arraySize)
|
while (next < arraySize)
|
||||||
{
|
{
|
||||||
|
|
|
@ -798,7 +798,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
||||||
unsigned c,d, stride;
|
unsigned c,d, stride;
|
||||||
BOOL found;
|
BOOL found;
|
||||||
NSComparisonResult (*comp)(id, SEL, id) = 0;
|
NSComparisonResult (*comp)(id, SEL, id) = 0;
|
||||||
int count = numKeys;
|
unsigned int count = numKeys;
|
||||||
#ifdef GSWARN
|
#ifdef GSWARN
|
||||||
BOOL badComparison = NO;
|
BOOL badComparison = NO;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -206,7 +206,7 @@
|
||||||
|
|
||||||
- (id) initWithObjects: (id*)objs count: (unsigned)c
|
- (id) initWithObjects: (id*)objs count: (unsigned)c
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
self = [self initWithCapacity: c];
|
self = [self initWithCapacity: c];
|
||||||
if (self == nil)
|
if (self == nil)
|
||||||
|
@ -273,7 +273,7 @@
|
||||||
|
|
||||||
while (node != 0)
|
while (node != 0)
|
||||||
{
|
{
|
||||||
if (node->value.uint <= level)
|
if (node->value.uint <= (unsigned int)level)
|
||||||
{
|
{
|
||||||
GSIMapRemoveNodeFromMap(&map, bucket, node);
|
GSIMapRemoveNodeFromMap(&map, bucket, node);
|
||||||
GSIMapFreeNode(&map, node);
|
GSIMapFreeNode(&map, node);
|
||||||
|
|
|
@ -143,7 +143,7 @@ static SEL objSel;
|
||||||
/* Designated initialiser */
|
/* Designated initialiser */
|
||||||
- (id) initWithObjects: (id*)objs forKeys: (id*)keys count: (unsigned)c
|
- (id) initWithObjects: (id*)objs forKeys: (id*)keys count: (unsigned)c
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), c);
|
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), c);
|
||||||
for (i = 0; i < c; i++)
|
for (i = 0; i < c; i++)
|
||||||
|
|
|
@ -488,7 +488,7 @@ static IMP gs_objc_msg_forward (SEL sel)
|
||||||
void
|
void
|
||||||
GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
|
GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
av_alist alist;
|
av_alist alist;
|
||||||
NSInvocation_t *inv = (NSInvocation_t*)_inv;
|
NSInvocation_t *inv = (NSInvocation_t*)_inv;
|
||||||
void *retval = inv->_retval;
|
void *retval = inv->_retval;
|
||||||
|
@ -919,7 +919,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
|
||||||
to send over the wire */
|
to send over the wire */
|
||||||
- (BOOL) encodeWithDistantCoder: (NSCoder*)coder passPointers: (BOOL)passp
|
- (BOOL) encodeWithDistantCoder: (NSCoder*)coder passPointers: (BOOL)passp
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
BOOL out_parameters = NO;
|
BOOL out_parameters = NO;
|
||||||
const char *type = [_sig methodType];
|
const char *type = [_sig methodType];
|
||||||
|
|
||||||
|
|
|
@ -263,8 +263,8 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
|
||||||
unsigned char *ptr;
|
unsigned char *ptr;
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
unsigned int s = 0;
|
unsigned int s = 0;
|
||||||
unsigned int old;
|
int old;
|
||||||
unsigned int len;
|
int len;
|
||||||
int i; // May be negative.
|
int i; // May be negative.
|
||||||
|
|
||||||
if (d != nil)
|
if (d != nil)
|
||||||
|
@ -272,7 +272,7 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
|
||||||
// NSLog(@"Read - '%@'", d);
|
// NSLog(@"Read - '%@'", d);
|
||||||
[ibuf appendData: d];
|
[ibuf appendData: d];
|
||||||
}
|
}
|
||||||
old = len = [ibuf length];
|
old = len = (int)[ibuf length];
|
||||||
ptr = [ibuf mutableBytes];
|
ptr = [ibuf mutableBytes];
|
||||||
|
|
||||||
for (i = pos; i < len; i++)
|
for (i = pos; i < len; i++)
|
||||||
|
@ -355,7 +355,7 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
|
||||||
break; // Need more data
|
break; // Need more data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (c == '\r' && i < len - 1 && ptr[i+1] == '\n')
|
else if (c == '\r' && (int)i < len - 1 && ptr[i+1] == '\n')
|
||||||
{
|
{
|
||||||
line = [[NSData alloc] initWithBytes: &ptr[s] length: i-s+2];
|
line = [[NSData alloc] initWithBytes: &ptr[s] length: i-s+2];
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -1796,7 +1796,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
|
|
||||||
if (modes && [modes count])
|
if (modes && [modes count])
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < [modes count]; i++)
|
for (i = 0; i < [modes count]; i++)
|
||||||
{
|
{
|
||||||
|
@ -1836,7 +1836,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
|
|
||||||
if (modes && [modes count])
|
if (modes && [modes count])
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < [modes count]; i++)
|
for (i = 0; i < [modes count]; i++)
|
||||||
{
|
{
|
||||||
|
@ -1867,7 +1867,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
[self setNonBlocking: YES];
|
[self setNonBlocking: YES];
|
||||||
if (modes && [modes count])
|
if (modes && [modes count])
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < [modes count]; i++)
|
for (i = 0; i < [modes count]; i++)
|
||||||
{
|
{
|
||||||
|
@ -1904,7 +1904,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
[self setNonBlocking: YES];
|
[self setNonBlocking: YES];
|
||||||
if (modes && [modes count])
|
if (modes && [modes count])
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < [modes count]; i++)
|
for (i = 0; i < [modes count]; i++)
|
||||||
{
|
{
|
||||||
|
@ -1990,8 +1990,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
*/
|
*/
|
||||||
if (readMax > 0)
|
if (readMax > 0)
|
||||||
{
|
{
|
||||||
length = readMax - [item length];
|
length = (unsigned int)readMax - [item length];
|
||||||
if (length > sizeof(buf))
|
if (length > (int)sizeof(buf))
|
||||||
{
|
{
|
||||||
length = sizeof(buf);
|
length = sizeof(buf);
|
||||||
}
|
}
|
||||||
|
@ -2021,7 +2021,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[item appendBytes: buf length: received];
|
[item appendBytes: buf length: received];
|
||||||
if (readMax < 0 || (readMax > 0 && [item length] == readMax))
|
if (readMax < 0 || (readMax > 0 && (int)[item length] == readMax))
|
||||||
{
|
{
|
||||||
// Read a single chunk of data
|
// Read a single chunk of data
|
||||||
[self postReadNotification];
|
[self postReadNotification];
|
||||||
|
|
|
@ -745,12 +745,12 @@ parse_one_spec (const unichar *format, size_t posn, struct printf_spec *spec,
|
||||||
{ \
|
{ \
|
||||||
unsigned i; \
|
unsigned i; \
|
||||||
\
|
\
|
||||||
if (s->len+(Len) >= s->size) { \
|
if (s->len+((unsigned)(Len)) >= s->size) { \
|
||||||
s->size += s->size/2 > (Len)? s->size/2: (Len); \
|
s->size += s->size/2 > ((unsigned)(Len))? s->size/2: (unsigned)(Len); \
|
||||||
s->buf = NSZoneRealloc(s->z, s->buf, s->size*sizeof(s->buf[0])); \
|
s->buf = NSZoneRealloc(s->z, s->buf, s->size*sizeof(s->buf[0])); \
|
||||||
} \
|
} \
|
||||||
for (i=0; i < (Len); i++) s->buf[s->len++] = (String)[i]; \
|
for (i=0; i < ((unsigned)(Len)); i++) s->buf[s->len++] = (String)[i]; \
|
||||||
done += (Len); \
|
done += (unsigned)(Len); \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
|
@ -1127,10 +1127,12 @@ NSDictionary *locale)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Maybe the buffer is too small. */
|
/* Maybe the buffer is too small. */
|
||||||
if (MAX (prec, width) + 32 > sizeof (work_buffer) / sizeof (unichar))
|
if ((unsigned)(MAX (prec, width) + 32)
|
||||||
workend = ((unichar *) alloca ((MAX (prec, width) + 32)
|
> sizeof (work_buffer) / sizeof (unichar))
|
||||||
* sizeof (unichar))
|
{
|
||||||
+ (MAX (prec, width) + 32));
|
workend = ((unichar *) alloca ((MAX (prec, width) + 32)
|
||||||
|
* sizeof (unichar)) + (MAX (prec, width) + 32));
|
||||||
|
}
|
||||||
|
|
||||||
/* Process format specifiers. */
|
/* Process format specifiers. */
|
||||||
while (1)
|
while (1)
|
||||||
|
@ -1735,7 +1737,7 @@ NSDictionary *locale)
|
||||||
unsigned slen = strlen(str);
|
unsigned slen = strlen(str);
|
||||||
NSStringEncoding enc = GetDefEncoding();
|
NSStringEncoding enc = GetDefEncoding();
|
||||||
|
|
||||||
len = prec != -1 ? prec : slen;
|
len = prec != -1 ? (unsigned)prec : slen;
|
||||||
if (len > slen)
|
if (len > slen)
|
||||||
len = slen;
|
len = slen;
|
||||||
|
|
||||||
|
@ -1819,7 +1821,7 @@ NSDictionary *locale)
|
||||||
NSRange r;
|
NSRange r;
|
||||||
|
|
||||||
len = [dsc length];
|
len = [dsc length];
|
||||||
if (prec >= 0 && prec < len) len = prec;
|
if (prec >= 0 && prec < (int)len) len = prec;
|
||||||
|
|
||||||
/* Allocate dynamically an array which definitely is long
|
/* Allocate dynamically an array which definitely is long
|
||||||
enough for the wide character version. */
|
enough for the wide character version. */
|
||||||
|
|
|
@ -1048,7 +1048,7 @@ fillHole(ivars self, unsigned index, unsigned size)
|
||||||
self->_count -= size;
|
self->_count -= size;
|
||||||
#ifndef STABLE_MEMCPY
|
#ifndef STABLE_MEMCPY
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (self->_flags.wide == 1)
|
if (self->_flags.wide == 1)
|
||||||
{
|
{
|
||||||
|
@ -1399,7 +1399,7 @@ lossyCString_u(ivars self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
makeHole(ivars self, int index, int size)
|
makeHole(ivars self, unsigned int index, unsigned int size)
|
||||||
{
|
{
|
||||||
unsigned want;
|
unsigned want;
|
||||||
|
|
||||||
|
@ -1474,21 +1474,23 @@ makeHole(ivars self, int index, int size)
|
||||||
#ifndef STABLE_MEMCPY
|
#ifndef STABLE_MEMCPY
|
||||||
if (self->_flags.wide == 1)
|
if (self->_flags.wide == 1)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = self->_count; i >= index; i--)
|
for (i = self->_count; i > index; i--)
|
||||||
{
|
{
|
||||||
self->_contents.u[i+size] = self->_contents.u[i];
|
self->_contents.u[i+size] = self->_contents.u[i];
|
||||||
}
|
}
|
||||||
|
self->_contents.u[index+size] = self->_contents.u[index];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = self->_count; i >= index; i--)
|
for (i = self->_count; i > index; i--)
|
||||||
{
|
{
|
||||||
self->_contents.c[i+size] = self->_contents.c[i];
|
self->_contents.c[i+size] = self->_contents.c[i];
|
||||||
}
|
}
|
||||||
|
self->_contents.c[index+size] = self->_contents.c[index];
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (self->_flags.wide == 1)
|
if (self->_flags.wide == 1)
|
||||||
|
@ -2439,8 +2441,8 @@ transmute(ivars self, NSString *aString)
|
||||||
// private method for Unicode level 3 implementation
|
// private method for Unicode level 3 implementation
|
||||||
- (int) _baseLength
|
- (int) _baseLength
|
||||||
{
|
{
|
||||||
int count = 0;
|
unsigned int count = 0;
|
||||||
int blen = 0;
|
unsigned int blen = 0;
|
||||||
|
|
||||||
while (count < _count)
|
while (count < _count)
|
||||||
if (!uni_isnonsp(_contents.u[count++]))
|
if (!uni_isnonsp(_contents.u[count++]))
|
||||||
|
@ -3033,7 +3035,7 @@ transmute(ivars self, NSString *aString)
|
||||||
}
|
}
|
||||||
else if (offset > 0)
|
else if (offset > 0)
|
||||||
{
|
{
|
||||||
makeHole((ivars)self, NSMaxRange(aRange), offset);
|
makeHole((ivars)self, NSMaxRange(aRange), (unsigned int)offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
|
@ -3107,7 +3109,7 @@ transmute(ivars self, NSString *aString)
|
||||||
|
|
||||||
- (void) setString: (NSString*)aString
|
- (void) setString: (NSString*)aString
|
||||||
{
|
{
|
||||||
int len = (aString == nil) ? 0 : [aString length];
|
unsigned int len = (aString == nil) ? 0 : [aString length];
|
||||||
ivars other;
|
ivars other;
|
||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
|
@ -3118,7 +3120,7 @@ transmute(ivars self, NSString *aString)
|
||||||
other = transmute((ivars)self, aString);
|
other = transmute((ivars)self, aString);
|
||||||
if (_count < len)
|
if (_count < len)
|
||||||
{
|
{
|
||||||
makeHole((ivars)self, _count, len - _count);
|
makeHole((ivars)self, _count, (unsigned int)(len - _count));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3228,8 +3230,8 @@ transmute(ivars self, NSString *aString)
|
||||||
{
|
{
|
||||||
if (_flags.wide == 1)
|
if (_flags.wide == 1)
|
||||||
{
|
{
|
||||||
int count = 0;
|
unsigned int count = 0;
|
||||||
int blen = 0;
|
unsigned int blen = 0;
|
||||||
|
|
||||||
while (count < _count)
|
while (count < _count)
|
||||||
if (!uni_isnonsp(_contents.u[count++]))
|
if (!uni_isnonsp(_contents.u[count++]))
|
||||||
|
|
|
@ -202,7 +202,7 @@ typedef enum {
|
||||||
gsu32 rId; /* Id of incoming message. */
|
gsu32 rId; /* Id of incoming message. */
|
||||||
unsigned nItems; /* Number of items to be read. */
|
unsigned nItems; /* Number of items to be read. */
|
||||||
GSHandleState state; /* State of the handle. */
|
GSHandleState state; /* State of the handle. */
|
||||||
int addrNum; /* Address number within host. */
|
unsigned int addrNum; /* Address number within host. */
|
||||||
@public
|
@public
|
||||||
NSRecursiveLock *myLock; /* Lock for this handle. */
|
NSRecursiveLock *myLock; /* Lock for this handle. */
|
||||||
BOOL caller; /* Did we connect to other end? */
|
BOOL caller; /* Did we connect to other end? */
|
||||||
|
@ -1087,7 +1087,7 @@ static Class runLoopClass;
|
||||||
#else
|
#else
|
||||||
len = write(desc, [d bytes], [d length]);
|
len = write(desc, [d bytes], [d length]);
|
||||||
#endif
|
#endif
|
||||||
if (len == [d length])
|
if (len == (int)[d length])
|
||||||
{
|
{
|
||||||
RELEASE(defaultAddress);
|
RELEASE(defaultAddress);
|
||||||
defaultAddress = RETAIN([NSString stringWithCString:
|
defaultAddress = RETAIN([NSString stringWithCString:
|
||||||
|
@ -1680,7 +1680,8 @@ static Class tcpPortClass;
|
||||||
/*
|
/*
|
||||||
* Make sure there is enough room in the provided array.
|
* Make sure there is enough room in the provided array.
|
||||||
*/
|
*/
|
||||||
NSAssert(*count > NSCountMapTable(handles), NSInternalInconsistencyException);
|
NSAssert(*count > (int)NSCountMapTable(handles),
|
||||||
|
NSInternalInconsistencyException);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Put in our listening socket.
|
* Put in our listening socket.
|
||||||
|
|
|
@ -185,7 +185,7 @@
|
||||||
unsigned char c[sizeof(double)];
|
unsigned char c[sizeof(double)];
|
||||||
} val;
|
} val;
|
||||||
unsigned hash = 0;
|
unsigned hash = 0;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
val.d = data.x + data.y;
|
val.d = data.x + data.y;
|
||||||
for (i = 0; i < sizeof(double); i++)
|
for (i = 0; i < sizeof(double); i++)
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
unsigned char c[sizeof(double)];
|
unsigned char c[sizeof(double)];
|
||||||
} val;
|
} val;
|
||||||
unsigned hash = 0;
|
unsigned hash = 0;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
val.d = data.origin.x + data.origin.y + data.size.width + data.size.height;
|
val.d = data.origin.x + data.origin.y + data.size.width + data.size.height;
|
||||||
for (i = 0; i < sizeof(double); i++)
|
for (i = 0; i < sizeof(double); i++)
|
||||||
|
@ -213,7 +213,7 @@
|
||||||
unsigned char c[sizeof(double)];
|
unsigned char c[sizeof(double)];
|
||||||
} val;
|
} val;
|
||||||
unsigned hash = 0;
|
unsigned hash = 0;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
val.d = data.width + data.height;
|
val.d = data.width + data.height;
|
||||||
for (i = 0; i < sizeof(double); i++)
|
for (i = 0; i < sizeof(double); i++)
|
||||||
|
|
|
@ -1618,14 +1618,15 @@ static int compare(id elem1, id elem2, void* context)
|
||||||
/* Shell sort algorithm taken from SortingInAction - a NeXT example */
|
/* Shell sort algorithm taken from SortingInAction - a NeXT example */
|
||||||
#define STRIDE_FACTOR 3 // good value for stride factor is not well-understood
|
#define STRIDE_FACTOR 3 // good value for stride factor is not well-understood
|
||||||
// 3 is a fairly good choice (Sedgewick)
|
// 3 is a fairly good choice (Sedgewick)
|
||||||
unsigned c,d, stride;
|
unsigned int c;
|
||||||
|
unsigned int d;
|
||||||
|
unsigned int stride = 1;
|
||||||
BOOL found;
|
BOOL found;
|
||||||
int count = [self count];
|
unsigned int count = [self count];
|
||||||
#ifdef GSWARN
|
#ifdef GSWARN
|
||||||
BOOL badComparison = NO;
|
BOOL badComparison = NO;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
stride = 1;
|
|
||||||
while (stride <= count)
|
while (stride <= count)
|
||||||
{
|
{
|
||||||
stride = stride * STRIDE_FACTOR + 1;
|
stride = stride * STRIDE_FACTOR + 1;
|
||||||
|
|
|
@ -248,7 +248,7 @@ static IMP initImp;
|
||||||
{
|
{
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
struct autorelease_array_list *released = _released_head;
|
struct autorelease_array_list *released = _released_head;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
while (released && released->count)
|
while (released && released->count)
|
||||||
{
|
{
|
||||||
|
@ -412,7 +412,7 @@ static IMP initImp;
|
||||||
releasing. */
|
releasing. */
|
||||||
{
|
{
|
||||||
struct autorelease_array_list *released = _released_head;
|
struct autorelease_array_list *released = _released_head;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
while (released)
|
while (released)
|
||||||
{
|
{
|
||||||
|
|
|
@ -282,10 +282,10 @@ _bundle_name_first_match(NSString* directory, NSString* name)
|
||||||
*/
|
*/
|
||||||
+ (void) _addFrameworkFromClass: (Class)frameworkClass
|
+ (void) _addFrameworkFromClass: (Class)frameworkClass
|
||||||
{
|
{
|
||||||
NSBundle *bundle = nil;
|
NSBundle *bundle = nil;
|
||||||
NSString **fmClasses;
|
NSString **fmClasses;
|
||||||
NSString *bundlePath = nil;
|
NSString *bundlePath = nil;
|
||||||
int len;
|
unsigned int len;
|
||||||
|
|
||||||
if (frameworkClass == Nil)
|
if (frameworkClass == Nil)
|
||||||
{
|
{
|
||||||
|
@ -295,7 +295,7 @@ _bundle_name_first_match(NSString* directory, NSString* name)
|
||||||
len = strlen (frameworkClass->name);
|
len = strlen (frameworkClass->name);
|
||||||
|
|
||||||
if (len > 12 * sizeof(char)
|
if (len > 12 * sizeof(char)
|
||||||
&& !strncmp("NSFramework_", frameworkClass->name, 12))
|
&& !strncmp("NSFramework_", frameworkClass->name, 12))
|
||||||
{
|
{
|
||||||
/* The name of the framework. */
|
/* The name of the framework. */
|
||||||
NSString *name = [NSString stringWithCString: &frameworkClass->name[12]];
|
NSString *name = [NSString stringWithCString: &frameworkClass->name[12]];
|
||||||
|
@ -627,12 +627,13 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||||
|
|
||||||
while ((class = objc_next_class(&state)))
|
while ((class = objc_next_class(&state)))
|
||||||
{
|
{
|
||||||
int len = strlen (class->name);
|
unsigned int len = strlen (class->name);
|
||||||
|
|
||||||
if (len > 12 * sizeof(char)
|
if (len > 12 * sizeof(char)
|
||||||
&& !strncmp("NSFramework_", class->name, 12))
|
&& !strncmp("NSFramework_", class->name, 12))
|
||||||
classes[numClasses++] = class;
|
{
|
||||||
|
classes[numClasses++] = class;
|
||||||
|
}
|
||||||
if (numClasses == numBufClasses)
|
if (numClasses == numBufClasses)
|
||||||
{
|
{
|
||||||
Class *ptr;
|
Class *ptr;
|
||||||
|
|
|
@ -143,7 +143,7 @@ abbrev(NSTimeZone *tz, NSDate *d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline unsigned int
|
||||||
lastDayOfGregorianMonth(int month, int year)
|
lastDayOfGregorianMonth(int month, int year)
|
||||||
{
|
{
|
||||||
switch (month)
|
switch (month)
|
||||||
|
@ -485,9 +485,9 @@ static inline int getDigits(const char *from, char *to, int limit)
|
||||||
unsigned formatIdx = 0;
|
unsigned formatIdx = 0;
|
||||||
unsigned sourceIdx = 0;
|
unsigned sourceIdx = 0;
|
||||||
char tmpStr[20];
|
char tmpStr[20];
|
||||||
int tmpIdx;
|
unsigned int tmpIdx;
|
||||||
unsigned had = 0;
|
unsigned had = 0;
|
||||||
int pos;
|
unsigned int pos;
|
||||||
BOOL hadPercent = NO;
|
BOOL hadPercent = NO;
|
||||||
NSString *dForm;
|
NSString *dForm;
|
||||||
NSString *tForm;
|
NSString *tForm;
|
||||||
|
@ -574,21 +574,21 @@ static inline int getDigits(const char *from, char *to, int limit)
|
||||||
if (sub != nil)
|
if (sub != nil)
|
||||||
{
|
{
|
||||||
unsigned sLen = [sub length];
|
unsigned sLen = [sub length];
|
||||||
unsigned i;
|
int i;
|
||||||
|
|
||||||
if (sLen > 2)
|
if (sLen > 2)
|
||||||
{
|
{
|
||||||
[fd setLength:
|
[fd setLength:
|
||||||
(formatLen + sLen - 2) * sizeof(unichar)];
|
(formatLen + sLen - 2) * sizeof(unichar)];
|
||||||
format = (unichar*)[fd mutableBytes];
|
format = (unichar*)[fd mutableBytes];
|
||||||
for (i = formatLen-1; i > pos; i--)
|
for (i = formatLen-1; i > (int)pos; i--)
|
||||||
{
|
{
|
||||||
format[i+sLen-2] = format[i];
|
format[i+sLen-2] = format[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i = pos+1; i < formatLen; i++)
|
for (i = pos+1; i < (int)formatLen; i++)
|
||||||
{
|
{
|
||||||
format[i+sLen-2] = format[i];
|
format[i+sLen-2] = format[i];
|
||||||
}
|
}
|
||||||
|
@ -1141,7 +1141,7 @@ static inline int getDigits(const char *from, char *to, int limit)
|
||||||
second: (unsigned int)second
|
second: (unsigned int)second
|
||||||
timeZone: (NSTimeZone *)aTimeZone
|
timeZone: (NSTimeZone *)aTimeZone
|
||||||
{
|
{
|
||||||
int c;
|
unsigned int c;
|
||||||
NSTimeInterval s;
|
NSTimeInterval s;
|
||||||
NSTimeInterval oldOffset;
|
NSTimeInterval oldOffset;
|
||||||
NSTimeInterval newOffset;
|
NSTimeInterval newOffset;
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include <Foundation/NSCoder.h>
|
#include <Foundation/NSCoder.h>
|
||||||
|
|
||||||
/* This file should be run through a preprocessor with the macro TYPE_ORDER
|
/* This file should be run through a preprocessor with the macro TYPE_ORDER
|
||||||
defined to a number from 0 to 12 cooresponding to each number type */
|
defined to a number from 0 to 12 corresponding to each number type */
|
||||||
#if TYPE_ORDER == 0
|
#if TYPE_ORDER == 0
|
||||||
# define NumberTemplate NSBoolNumber
|
# define NumberTemplate NSBoolNumber
|
||||||
# define TYPE_TYPE BOOL
|
# define TYPE_TYPE BOOL
|
||||||
|
|
|
@ -250,7 +250,7 @@ static Class NSCountedSet_concrete_class;
|
||||||
{
|
{
|
||||||
unsigned c = (*cImp)(self, @selector(countForObject:), obj);
|
unsigned c = (*cImp)(self, @selector(countForObject:), obj);
|
||||||
|
|
||||||
if (c <= level)
|
if (c <= (unsigned int)level)
|
||||||
{
|
{
|
||||||
while (c-- > 0)
|
while (c-- > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -138,7 +138,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
||||||
DWORD high;
|
DWORD high;
|
||||||
DWORD got;
|
DWORD got;
|
||||||
#else
|
#else
|
||||||
unsigned fileLength;
|
long fileLength;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GS_WITH_GC == 1
|
#if GS_WITH_GC == 1
|
||||||
|
@ -294,7 +294,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
||||||
}
|
}
|
||||||
|
|
||||||
c = fread(tmp, 1, fileLength, theFile);
|
c = fread(tmp, 1, fileLength, theFile);
|
||||||
if (c != fileLength)
|
if (c != (int)fileLength)
|
||||||
{
|
{
|
||||||
NSWarnFLog(@"read of file (%s) contents failed - %s",
|
NSWarnFLog(@"read of file (%s) contents failed - %s",
|
||||||
thePath, GSLastErrorStr(errno));
|
thePath, GSLastErrorStr(errno));
|
||||||
|
@ -800,7 +800,7 @@ failure:
|
||||||
*/
|
*/
|
||||||
- (BOOL) isEqualToData: (NSData*)other
|
- (BOOL) isEqualToData: (NSData*)other
|
||||||
{
|
{
|
||||||
int len;
|
unsigned int len;
|
||||||
if (other == self)
|
if (other == self)
|
||||||
{
|
{
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -947,7 +947,7 @@ failure:
|
||||||
* in the fwrite() call. */
|
* in the fwrite() call. */
|
||||||
c = fwrite([self bytes], sizeof(char), [self length], theFile);
|
c = fwrite([self bytes], sizeof(char), [self length], theFile);
|
||||||
|
|
||||||
if (c < [self length]) /* We failed to write everything for
|
if (c < (int)[self length]) /* We failed to write everything for
|
||||||
* some reason. */
|
* some reason. */
|
||||||
{
|
{
|
||||||
NSWarnMLog(@"Fwrite (%s) failed - %s", thePath, GSLastErrorStr(errno));
|
NSWarnMLog(@"Fwrite (%s) failed - %s", thePath, GSLastErrorStr(errno));
|
||||||
|
|
|
@ -37,19 +37,19 @@
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Class class;
|
Class class;
|
||||||
/* The following are used for statistical info */
|
/* The following are used for statistical info */
|
||||||
int count;
|
unsigned int count;
|
||||||
int lastc;
|
unsigned int lastc;
|
||||||
int total;
|
unsigned int total;
|
||||||
int peak;
|
unsigned int peak;
|
||||||
/* The following are used to record actual objects */
|
/* The following are used to record actual objects */
|
||||||
BOOL is_recording;
|
BOOL is_recording;
|
||||||
id *recorded_objects;
|
id *recorded_objects;
|
||||||
int num_recorded_objects;
|
unsigned int num_recorded_objects;
|
||||||
int stack_size;
|
unsigned int stack_size;
|
||||||
} table_entry;
|
} table_entry;
|
||||||
|
|
||||||
static int num_classes = 0;
|
static unsigned int num_classes = 0;
|
||||||
static int table_size = 0;
|
static unsigned int table_size = 0;
|
||||||
|
|
||||||
static table_entry* the_table = 0;
|
static table_entry* the_table = 0;
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ GSDebugAllocationActive(BOOL active)
|
||||||
void
|
void
|
||||||
GSDebugAllocationActiveRecordingObjects(Class c)
|
GSDebugAllocationActiveRecordingObjects(Class c)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned int i;
|
||||||
|
|
||||||
GSDebugAllocationActive(YES);
|
GSDebugAllocationActive(YES);
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ GSDebugAllocationAdd(Class c, id o)
|
||||||
{
|
{
|
||||||
if (debug_allocation)
|
if (debug_allocation)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < num_classes; i++)
|
for (i = 0; i < num_classes; i++)
|
||||||
{
|
{
|
||||||
|
@ -245,7 +245,7 @@ GSDebugAllocationAdd(Class c, id o)
|
||||||
[uniqueLock lock];
|
[uniqueLock lock];
|
||||||
if (num_classes >= table_size)
|
if (num_classes >= table_size)
|
||||||
{
|
{
|
||||||
int more = table_size + 128;
|
unsigned int more = table_size + 128;
|
||||||
table_entry *tmp;
|
table_entry *tmp;
|
||||||
|
|
||||||
tmp = NSZoneMalloc(NSDefaultMallocZone(), more * sizeof(table_entry));
|
tmp = NSZoneMalloc(NSDefaultMallocZone(), more * sizeof(table_entry));
|
||||||
|
@ -305,7 +305,7 @@ GSDebugAllocationAdd(Class c, id o)
|
||||||
int
|
int
|
||||||
GSDebugAllocationCount(Class c)
|
GSDebugAllocationCount(Class c)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < num_classes; i++)
|
for (i = 0; i < num_classes; i++)
|
||||||
{
|
{
|
||||||
|
@ -337,7 +337,7 @@ GSDebugAllocationCount(Class c)
|
||||||
int
|
int
|
||||||
GSDebugAllocationTotal(Class c)
|
GSDebugAllocationTotal(Class c)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < num_classes; i++)
|
for (i = 0; i < num_classes; i++)
|
||||||
{
|
{
|
||||||
|
@ -364,7 +364,7 @@ GSDebugAllocationTotal(Class c)
|
||||||
int
|
int
|
||||||
GSDebugAllocationPeak(Class c)
|
GSDebugAllocationPeak(Class c)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < num_classes; i++)
|
for (i = 0; i < num_classes; i++)
|
||||||
{
|
{
|
||||||
|
@ -390,7 +390,7 @@ GSDebugAllocationClassList()
|
||||||
{
|
{
|
||||||
Class *ans;
|
Class *ans;
|
||||||
size_t siz;
|
size_t siz;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (uniqueLock != nil)
|
if (uniqueLock != nil)
|
||||||
[uniqueLock lock];
|
[uniqueLock lock];
|
||||||
|
@ -439,9 +439,9 @@ GSDebugAllocationList(BOOL changeFlag)
|
||||||
static const char*
|
static const char*
|
||||||
_GSDebugAllocationList(BOOL difference)
|
_GSDebugAllocationList(BOOL difference)
|
||||||
{
|
{
|
||||||
int pos = 0;
|
unsigned int pos = 0;
|
||||||
int i;
|
unsigned int i;
|
||||||
static int siz = 0;
|
static unsigned int siz = 0;
|
||||||
static char *buf = 0;
|
static char *buf = 0;
|
||||||
|
|
||||||
for (i = 0; i < num_classes; i++)
|
for (i = 0; i < num_classes; i++)
|
||||||
|
@ -536,9 +536,9 @@ GSDebugAllocationListAll()
|
||||||
static const char*
|
static const char*
|
||||||
_GSDebugAllocationListAll(void)
|
_GSDebugAllocationListAll(void)
|
||||||
{
|
{
|
||||||
int pos = 0;
|
unsigned int pos = 0;
|
||||||
int i;
|
unsigned int i;
|
||||||
static int siz = 0;
|
static unsigned int siz = 0;
|
||||||
static char *buf = 0;
|
static char *buf = 0;
|
||||||
|
|
||||||
for (i = 0; i < num_classes; i++)
|
for (i = 0; i < num_classes; i++)
|
||||||
|
@ -592,7 +592,7 @@ GSDebugAllocationRemove(Class c, id o)
|
||||||
{
|
{
|
||||||
if (debug_allocation)
|
if (debug_allocation)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < num_classes; i++)
|
for (i = 0; i < num_classes; i++)
|
||||||
{
|
{
|
||||||
|
@ -653,7 +653,7 @@ NSArray *
|
||||||
GSDebugAllocationListRecordedObjects(Class c)
|
GSDebugAllocationListRecordedObjects(Class c)
|
||||||
{
|
{
|
||||||
NSArray *answer;
|
NSArray *answer;
|
||||||
unsigned i, k;
|
unsigned int i, k;
|
||||||
id *tmp;
|
id *tmp;
|
||||||
|
|
||||||
if (debug_allocation == NO)
|
if (debug_allocation == NO)
|
||||||
|
|
|
@ -146,7 +146,7 @@ _arg_addr(NSInvocation *inv, int index)
|
||||||
_argsRetained = NO;
|
_argsRetained = NO;
|
||||||
if (_cframe && _sig)
|
if (_cframe && _sig)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 3; i <= _numArgs; i++)
|
for (i = 3; i <= _numArgs; i++)
|
||||||
{
|
{
|
||||||
|
@ -368,7 +368,7 @@ _arg_addr(NSInvocation *inv, int index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
_argsRetained = YES;
|
_argsRetained = YES;
|
||||||
IF_NO_GC(RETAIN(_target));
|
IF_NO_GC(RETAIN(_target));
|
||||||
|
@ -518,7 +518,7 @@ _arg_addr(NSInvocation *inv, int index)
|
||||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
const char *types = [_sig methodType];
|
const char *types = [_sig methodType];
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
[aCoder encodeValueOfObjCType: @encode(char*)
|
[aCoder encodeValueOfObjCType: @encode(char*)
|
||||||
at: &types];
|
at: &types];
|
||||||
|
@ -567,7 +567,7 @@ _arg_addr(NSInvocation *inv, int index)
|
||||||
NSMethodSignature *newSig;
|
NSMethodSignature *newSig;
|
||||||
const char *types;
|
const char *types;
|
||||||
void *datum;
|
void *datum;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
[aCoder decodeValueOfObjCType: @encode(char*) at: &types];
|
[aCoder decodeValueOfObjCType: @encode(char*) at: &types];
|
||||||
newSig = [NSMethodSignature signatureWithObjCTypes: types];
|
newSig = [NSMethodSignature signatureWithObjCTypes: types];
|
||||||
|
@ -666,7 +666,7 @@ _arg_addr(NSInvocation *inv, int index)
|
||||||
}
|
}
|
||||||
if (self)
|
if (self)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
[self setTarget: anObject];
|
[self setTarget: anObject];
|
||||||
[self setSelector: aSelector];
|
[self setSelector: aSelector];
|
||||||
|
@ -793,7 +793,7 @@ _arg_addr(NSInvocation *inv, int index)
|
||||||
*/
|
*/
|
||||||
if (frame)
|
if (frame)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
mframe_get_arg(frame, &_info[1], &_target);
|
mframe_get_arg(frame, &_info[1], &_target);
|
||||||
for (i = 1; i <= _numArgs; i++)
|
for (i = 1; i <= _numArgs; i++)
|
||||||
|
|
|
@ -110,7 +110,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
||||||
#ifdef HAVE_SYSLOG
|
#ifdef HAVE_SYSLOG
|
||||||
|
|
||||||
if (GSUserDefaultsFlag(GSLogSyslog) == YES
|
if (GSUserDefaultsFlag(GSLogSyslog) == YES
|
||||||
|| write(_NSLogDescriptor, buf, len) != len)
|
|| write(_NSLogDescriptor, buf, len) != (int)len)
|
||||||
{
|
{
|
||||||
int mask;
|
int mask;
|
||||||
/* We NULL-terminate the string in order to feed it to
|
/* We NULL-terminate the string in order to feed it to
|
||||||
|
|
|
@ -169,7 +169,7 @@
|
||||||
if (_info == 0)
|
if (_info == 0)
|
||||||
{
|
{
|
||||||
const char *types = _methodTypes;
|
const char *types = _methodTypes;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
_info = NSZoneMalloc(NSDefaultMallocZone(),
|
_info = NSZoneMalloc(NSDefaultMallocZone(),
|
||||||
sizeof(NSArgumentInfo)*(_numArgs+1));
|
sizeof(NSArgumentInfo)*(_numArgs+1));
|
||||||
|
|
|
@ -247,8 +247,8 @@ typedef struct NCTbl {
|
||||||
Observation **chunks;
|
Observation **chunks;
|
||||||
unsigned numChunks;
|
unsigned numChunks;
|
||||||
GSIMapTable cache[CACHESIZE];
|
GSIMapTable cache[CACHESIZE];
|
||||||
short chunkIndex;
|
unsigned short chunkIndex;
|
||||||
short cacheIndex;
|
unsigned short cacheIndex;
|
||||||
} NCTable;
|
} NCTable;
|
||||||
|
|
||||||
#define TABLE ((NCTable*)_table)
|
#define TABLE ((NCTable*)_table)
|
||||||
|
|
|
@ -1148,16 +1148,16 @@ static BOOL double_release_check_enabled = NO;
|
||||||
for (proto_list = ((struct objc_class*)self)->protocols;
|
for (proto_list = ((struct objc_class*)self)->protocols;
|
||||||
proto_list; proto_list = proto_list->next)
|
proto_list; proto_list = proto_list->next)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < proto_list->count; i++)
|
for (i = 0; i < proto_list->count; i++)
|
||||||
{
|
{
|
||||||
/* xxx We should add conformsToProtocol to Protocol class. */
|
/* xxx We should add conformsToProtocol to Protocol class. */
|
||||||
if ([proto_list->list[i] conformsTo: aProtocol])
|
if ([proto_list->list[i] conformsTo: aProtocol])
|
||||||
{
|
{
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([self superclass])
|
if ([self superclass])
|
||||||
|
|
|
@ -380,7 +380,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
||||||
count: (unsigned)expected
|
count: (unsigned)expected
|
||||||
at: (void*)buf
|
at: (void*)buf
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
int size = objc_sizeof_type(type);
|
int size = objc_sizeof_type(type);
|
||||||
unsigned char info;
|
unsigned char info;
|
||||||
|
|
|
@ -357,25 +357,6 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
||||||
#define WatcherMapValueCallBacks NSOwnedPointerMapValueCallBacks
|
#define WatcherMapValueCallBacks NSOwnedPointerMapValueCallBacks
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
|
||||||
aRetain(NSMapTable* t, const void* a)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
aRelease(NSMapTable* t, const void* a)
|
|
||||||
{
|
|
||||||
GSIArrayEmpty((GSIArray)a);
|
|
||||||
NSZoneFree(((GSIArray)a)->zone, (void*)a);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
|
||||||
{
|
|
||||||
aRetain,
|
|
||||||
aRelease,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -400,8 +381,8 @@ static const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
||||||
int fairStart; // For trying to ensure fair handling.
|
int fairStart; // For trying to ensure fair handling.
|
||||||
BOOL completed; // To mark operation as completed.
|
BOOL completed; // To mark operation as completed.
|
||||||
#ifdef HAVE_POLL
|
#ifdef HAVE_POLL
|
||||||
int pollfds_capacity;
|
unsigned int pollfds_capacity;
|
||||||
int pollfds_count;
|
unsigned int pollfds_count;
|
||||||
struct pollfd *pollfds;
|
struct pollfd *pollfds;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -577,7 +558,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
||||||
int fdEnd = 0; /* Number of descriptors being monitored. */
|
int fdEnd = 0; /* Number of descriptors being monitored. */
|
||||||
int fdIndex;
|
int fdIndex;
|
||||||
int fdFinish;
|
int fdFinish;
|
||||||
unsigned i;
|
unsigned int i;
|
||||||
|
|
||||||
i = GSIArrayCount(watchers);
|
i = GSIArrayCount(watchers);
|
||||||
|
|
||||||
|
@ -689,21 +670,25 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
||||||
milliseconds = 0;
|
milliseconds = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0) {
|
#if 0
|
||||||
int i;
|
{
|
||||||
|
unsigned int i;
|
||||||
fprintf(stderr, "poll %d %d:", milliseconds, pollfds_count);
|
fprintf(stderr, "poll %d %d:", milliseconds, pollfds_count);
|
||||||
for (i = 0; i < pollfds_count; i++)
|
for (i = 0; i < pollfds_count; i++)
|
||||||
fprintf(stderr, " %d,%x", pollfds[i].fd, pollfds[i].events);
|
fprintf(stderr, " %d,%x", pollfds[i].fd, pollfds[i].events);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
poll_return = poll (pollfds, pollfds_count, milliseconds);
|
poll_return = poll (pollfds, pollfds_count, milliseconds);
|
||||||
if (0) {
|
#if 0
|
||||||
int i;
|
{
|
||||||
|
unsigned int i;
|
||||||
fprintf(stderr, "ret %d %d:", poll_return, pollfds_count);
|
fprintf(stderr, "ret %d %d:", poll_return, pollfds_count);
|
||||||
for (i = 0; i < pollfds_count; i++)
|
for (i = 0; i < pollfds_count; i++)
|
||||||
fprintf(stderr, " %d,%x", pollfds[i].fd, pollfds[i].revents);
|
fprintf(stderr, " %d,%x", pollfds[i].fd, pollfds[i].revents);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
NSDebugMLLog(@"NSRunLoop", @"poll returned %d\n", poll_return);
|
NSDebugMLLog(@"NSRunLoop", @"poll returned %d\n", poll_return);
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ typedef struct {
|
||||||
* Internal version used by scanRadixUnsignedInt: and scanHexInt: .
|
* Internal version used by scanRadixUnsignedInt: and scanHexInt: .
|
||||||
*/
|
*/
|
||||||
- (BOOL) scanUnsignedInt_: (unsigned int *)value
|
- (BOOL) scanUnsignedInt_: (unsigned int *)value
|
||||||
radix: (int)radix
|
radix: (unsigned int)radix
|
||||||
gotDigits: (BOOL)gotDigits
|
gotDigits: (BOOL)gotDigits
|
||||||
{
|
{
|
||||||
unsigned int num = 0;
|
unsigned int num = 0;
|
||||||
|
@ -429,7 +429,7 @@ typedef struct {
|
||||||
*/
|
*/
|
||||||
- (BOOL) scanRadixUnsignedInt: (unsigned int *)value
|
- (BOOL) scanRadixUnsignedInt: (unsigned int *)value
|
||||||
{
|
{
|
||||||
int radix;
|
unsigned int radix;
|
||||||
BOOL gotDigits = NO;
|
BOOL gotDigits = NO;
|
||||||
unsigned int saveScanLocation = _scanLocation;
|
unsigned int saveScanLocation = _scanLocation;
|
||||||
|
|
||||||
|
|
|
@ -608,10 +608,10 @@ deserializeFromInfo(_NSDeserializerInfo* info)
|
||||||
case ST_MDICT:
|
case ST_MDICT:
|
||||||
size = (*info->deiImp)(info->data, deiSel, info->cursor);
|
size = (*info->deiImp)(info->data, deiSel, info->cursor);
|
||||||
{
|
{
|
||||||
id keys[size];
|
id keys[size];
|
||||||
id objects[size];
|
id objects[size];
|
||||||
id d;
|
id d;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -588,8 +588,8 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
BOOL isAscii = YES;
|
BOOL isAscii = YES;
|
||||||
|
|
||||||
if (chars == 0)
|
if (chars == 0)
|
||||||
{
|
{
|
||||||
|
@ -1562,9 +1562,9 @@ handle_printf_atsign (FILE *stream,
|
||||||
options: (unsigned int)mask
|
options: (unsigned int)mask
|
||||||
range: (NSRange)aRange
|
range: (NSRange)aRange
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
int start;
|
unsigned int start;
|
||||||
int stop;
|
unsigned int stop;
|
||||||
int step;
|
int step;
|
||||||
NSRange range;
|
NSRange range;
|
||||||
unichar (*cImp)(id, SEL, unsigned int);
|
unichar (*cImp)(id, SEL, unsigned int);
|
||||||
|
@ -3511,7 +3511,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
int count = 0;
|
unsigned int count = 0;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
||||||
|
@ -4955,9 +4955,9 @@ static id parsePlItem(pldata* pld)
|
||||||
if (pld->pos < pld->end && pld->ptr[pld->pos] == '*')
|
if (pld->pos < pld->end && pld->ptr[pld->pos] == '*')
|
||||||
{
|
{
|
||||||
const unichar *ptr;
|
const unichar *ptr;
|
||||||
unsigned min;
|
unsigned min;
|
||||||
unsigned len = 0;
|
unsigned len = 0;
|
||||||
int i;
|
unsigned i;
|
||||||
|
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
min = pld->pos;
|
min = pld->pos;
|
||||||
|
|
|
@ -1514,7 +1514,7 @@ chop(NSTimeInterval since, GSTimeZone *zone)
|
||||||
gss32 *trans = zone->trans;
|
gss32 *trans = zone->trans;
|
||||||
unsigned hi = zone->n_trans;
|
unsigned hi = zone->n_trans;
|
||||||
unsigned lo = 0;
|
unsigned lo = 0;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (hi == 0 || trans[0] > when)
|
if (hi == 0 || trans[0] > when)
|
||||||
{
|
{
|
||||||
|
@ -1556,7 +1556,7 @@ chop(NSTimeInterval since, GSTimeZone *zone)
|
||||||
* was later than our date, we step back to find the last
|
* was later than our date, we step back to find the last
|
||||||
* transition before our date.
|
* transition before our date.
|
||||||
*/
|
*/
|
||||||
if (i == zone->n_trans || trans[i] > when)
|
if (i > 0 && (i == zone->n_trans || trans[i] > when))
|
||||||
{
|
{
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|
|
@ -455,9 +455,9 @@ static Class NSDataMallocClass;
|
||||||
count: (unsigned)expected
|
count: (unsigned)expected
|
||||||
at: (void*)buf
|
at: (void*)buf
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
int size = objc_sizeof_type(type);
|
unsigned int size = (unsigned int)objc_sizeof_type(type);
|
||||||
unsigned char info;
|
unsigned char info;
|
||||||
unsigned count;
|
unsigned count;
|
||||||
|
|
||||||
|
|
|
@ -358,9 +358,9 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info)
|
||||||
|
|
||||||
case _C_STRUCT_B:
|
case _C_STRUCT_B:
|
||||||
{
|
{
|
||||||
int acc_size = 0;
|
unsigned int acc_size = 0;
|
||||||
int def_align = objc_alignof_type(typePtr-1);
|
unsigned int def_align = objc_alignof_type(typePtr-1);
|
||||||
int acc_align = def_align;
|
unsigned int acc_align = def_align;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skip "<name>=" stuff.
|
* Skip "<name>=" stuff.
|
||||||
|
@ -407,8 +407,8 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info)
|
||||||
|
|
||||||
case _C_UNION_B:
|
case _C_UNION_B:
|
||||||
{
|
{
|
||||||
int max_size = 0;
|
unsigned int max_size = 0;
|
||||||
int max_align = 0;
|
unsigned int max_align = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skip "<name>=" stuff.
|
* Skip "<name>=" stuff.
|
||||||
|
@ -1317,7 +1317,7 @@ mframe_build_return (arglist_t argframe,
|
||||||
/* A pointer to the memory that will hold the return value. */
|
/* A pointer to the memory that will hold the return value. */
|
||||||
retval_t retframe = NULL;
|
retval_t retframe = NULL;
|
||||||
/* The size, in bytes, of memory pointed to by RETFRAME. */
|
/* The size, in bytes, of memory pointed to by RETFRAME. */
|
||||||
int retsize;
|
unsigned int retsize;
|
||||||
/* Which argument number are we processing now? */
|
/* Which argument number are we processing now? */
|
||||||
int argnum;
|
int argnum;
|
||||||
/* Type qualifier flags; see <objc/objc-api.h>. */
|
/* Type qualifier flags; see <objc/objc-api.h>. */
|
||||||
|
@ -1377,7 +1377,7 @@ mframe_build_return (arglist_t argframe,
|
||||||
/* We are returning a pointer to something. */
|
/* We are returning a pointer to something. */
|
||||||
/* Increment TYPE so we can see what it is a pointer to. */
|
/* Increment TYPE so we can see what it is a pointer to. */
|
||||||
tmptype++;
|
tmptype++;
|
||||||
retLength = objc_sizeof_type(tmptype);
|
retLength = (unsigned int)objc_sizeof_type(tmptype);
|
||||||
/* Allocate memory to hold the value we're pointing to. */
|
/* Allocate memory to hold the value we're pointing to. */
|
||||||
*(void**)retframe =
|
*(void**)retframe =
|
||||||
NSZoneMalloc(NSDefaultMallocZone(), retLength);
|
NSZoneMalloc(NSDefaultMallocZone(), retLength);
|
||||||
|
|
|
@ -1453,7 +1453,7 @@ static BOOL snuggleStart(NSString *t)
|
||||||
a = [self split: str];
|
a = [self split: str];
|
||||||
for (i = 0; i < [a count]; i++)
|
for (i = 0; i < [a count]; i++)
|
||||||
{
|
{
|
||||||
int j;
|
unsigned int j;
|
||||||
|
|
||||||
str = [a objectAtIndex: i];
|
str = [a objectAtIndex: i];
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@
|
||||||
{
|
{
|
||||||
NSNumber *num = [lines objectAtIndex: where];
|
NSNumber *num = [lines objectAtIndex: where];
|
||||||
|
|
||||||
if ([num intValue] <= pos)
|
if ([num intValue] <= (int)pos)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ main(int argc, char** argv, char **env)
|
||||||
NSString *value;
|
NSString *value;
|
||||||
NSString *user = nil;
|
NSString *user = nil;
|
||||||
BOOL found = NO;
|
BOOL found = NO;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||||
|
|
|
@ -378,7 +378,7 @@ typedef struct {
|
||||||
int s;
|
int s;
|
||||||
#endif /* __MINGW__ */
|
#endif /* __MINGW__ */
|
||||||
struct sockaddr_in addr; /* Address of process making request. */
|
struct sockaddr_in addr; /* Address of process making request. */
|
||||||
int pos; /* Position reading data. */
|
unsigned int pos; /* Position reading data. */
|
||||||
union {
|
union {
|
||||||
gdo_req r;
|
gdo_req r;
|
||||||
unsigned char b[GDO_REQ_SIZE];
|
unsigned char b[GDO_REQ_SIZE];
|
||||||
|
@ -410,7 +410,7 @@ delRInfo(SOCKET s)
|
||||||
delRInfo(int s)
|
delRInfo(int s)
|
||||||
#endif /* __MINGW__ */
|
#endif /* __MINGW__ */
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < _rInfoCount; i++)
|
for (i = 0; i < _rInfoCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -441,7 +441,7 @@ getRInfo(SOCKET s, int make)
|
||||||
getRInfo(int s, int make)
|
getRInfo(int s, int make)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < _rInfoCount; i++)
|
for (i = 0; i < _rInfoCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -483,7 +483,7 @@ delWInfo(SOCKET s)
|
||||||
delWInfo(int s)
|
delWInfo(int s)
|
||||||
#endif /* __MINGW__ */
|
#endif /* __MINGW__ */
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < _wInfoCount; i++)
|
for (i = 0; i < _wInfoCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -514,7 +514,7 @@ getWInfo(SOCKET s, int make)
|
||||||
getWInfo(int s, int make)
|
getWInfo(int s, int make)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < _wInfoCount; i++)
|
for (i = 0; i < _wInfoCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -838,7 +838,7 @@ static void
|
||||||
prb_add(struct in_addr *p)
|
prb_add(struct in_addr *p)
|
||||||
{
|
{
|
||||||
prb_type *n = 0;
|
prb_type *n = 0;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (is_local_host(*p) != 0)
|
if (is_local_host(*p) != 0)
|
||||||
{
|
{
|
||||||
|
@ -911,13 +911,13 @@ prb_add(struct in_addr *p)
|
||||||
static void
|
static void
|
||||||
prb_del(struct in_addr *p)
|
prb_del(struct in_addr *p)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < prb_used; i++)
|
for (i = 0; i < prb_used; i++)
|
||||||
{
|
{
|
||||||
if (memcmp(&prb[i]->sin, p, IASIZE) == 0)
|
if (memcmp(&prb[i]->sin, p, IASIZE) == 0)
|
||||||
{
|
{
|
||||||
int j;
|
unsigned int j;
|
||||||
|
|
||||||
free(prb[i]);
|
free(prb[i]);
|
||||||
for (j = i + 1; j < prb_used; j++)
|
for (j = i + 1; j < prb_used; j++)
|
||||||
|
@ -1005,7 +1005,7 @@ static void
|
||||||
dump_stats()
|
dump_stats()
|
||||||
{
|
{
|
||||||
int tcp_pending = 0;
|
int tcp_pending = 0;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < _wInfoCount; i++)
|
for (i = 0; i < _wInfoCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -1046,7 +1046,7 @@ dump_tables()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < prb_used; i++)
|
for (i = 0; i < prb_used; i++)
|
||||||
{
|
{
|
||||||
|
@ -1540,12 +1540,12 @@ load_iface(const char* from)
|
||||||
bcok[interfaces] = 0;
|
bcok[interfaces] = 0;
|
||||||
bcst[interfaces].s_addr = inet_addr("0.0.0.0");
|
bcst[interfaces].s_addr = inet_addr("0.0.0.0");
|
||||||
}
|
}
|
||||||
if (addr[interfaces].s_addr == -1)
|
if (addr[interfaces].s_addr == (unsigned long)-1)
|
||||||
{
|
{
|
||||||
sprintf(ebuf, "'%s' is not as valid address", buf);
|
sprintf(ebuf, "'%s' is not as valid address", buf);
|
||||||
gdomap_log(LOG_ERR);
|
gdomap_log(LOG_ERR);
|
||||||
}
|
}
|
||||||
else if (mask[interfaces].s_addr == -1)
|
else if (mask[interfaces].s_addr == (unsigned long)-1)
|
||||||
{
|
{
|
||||||
sprintf(ebuf, "'%s' is not as valid netmask", ptr);
|
sprintf(ebuf, "'%s' is not as valid netmask", ptr);
|
||||||
gdomap_log(LOG_ERR);
|
gdomap_log(LOG_ERR);
|
||||||
|
@ -2008,7 +2008,7 @@ init_probe()
|
||||||
if ((p->addr.s_addr & mask[iface].s_addr) ==
|
if ((p->addr.s_addr & mask[iface].s_addr) ==
|
||||||
(addr[iface].s_addr & mask[iface].s_addr))
|
(addr[iface].s_addr & mask[iface].s_addr))
|
||||||
{
|
{
|
||||||
int len = elen;
|
unsigned int len = elen;
|
||||||
|
|
||||||
p->direct = 1;
|
p->direct = 1;
|
||||||
/* Kick off probe. */
|
/* Kick off probe. */
|
||||||
|
@ -2044,7 +2044,7 @@ init_probe()
|
||||||
for (j = low + 1; j < high; j++)
|
for (j = low + 1; j < high; j++)
|
||||||
{
|
{
|
||||||
struct in_addr a;
|
struct in_addr a;
|
||||||
int len = elen;
|
unsigned int len = elen;
|
||||||
|
|
||||||
a.s_addr = htonl(net + j);
|
a.s_addr = htonl(net + j);
|
||||||
if (is_local_host(a))
|
if (is_local_host(a))
|
||||||
|
@ -2098,7 +2098,7 @@ init_probe()
|
||||||
{
|
{
|
||||||
if (p->direct == 0)
|
if (p->direct == 0)
|
||||||
{
|
{
|
||||||
int len = elen;
|
unsigned int len = elen;
|
||||||
|
|
||||||
if (is_local_host(p->addr))
|
if (is_local_host(p->addr))
|
||||||
{
|
{
|
||||||
|
@ -2865,8 +2865,8 @@ handle_request(int desc)
|
||||||
}
|
}
|
||||||
else if (type == GDO_SERVERS)
|
else if (type == GDO_SERVERS)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
int j;
|
unsigned int j;
|
||||||
|
|
||||||
free(wi->buf);
|
free(wi->buf);
|
||||||
wi->buf = (char*)malloc(sizeof(unsigned long)
|
wi->buf = (char*)malloc(sizeof(unsigned long)
|
||||||
|
@ -2984,7 +2984,7 @@ handle_request(int desc)
|
||||||
struct in_addr laddr;
|
struct in_addr laddr;
|
||||||
struct in_addr raddr;
|
struct in_addr raddr;
|
||||||
struct in_addr *other;
|
struct in_addr *other;
|
||||||
int elen;
|
unsigned int elen;
|
||||||
void *rbuf = ri->buf.r.name;
|
void *rbuf = ri->buf.r.name;
|
||||||
void *wbuf;
|
void *wbuf;
|
||||||
int i;
|
int i;
|
||||||
|
@ -4351,7 +4351,7 @@ printf(
|
||||||
prb = (plentry*)malloc(sizeof(plentry));
|
prb = (plentry*)malloc(sizeof(plentry));
|
||||||
memset((char*)prb, '\0', sizeof(plentry));
|
memset((char*)prb, '\0', sizeof(plentry));
|
||||||
prb->addr.s_addr = inet_addr(buf);
|
prb->addr.s_addr = inet_addr(buf);
|
||||||
if (prb->addr.s_addr == -1)
|
if (prb->addr.s_addr == (unsigned long)-1)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "'%s' is not as valid address\n", buf);
|
fprintf(stderr, "'%s' is not as valid address\n", buf);
|
||||||
free(prb);
|
free(prb);
|
||||||
|
|
|
@ -310,7 +310,7 @@ static NSString *parse_string(NSString **ptr)
|
||||||
|
|
||||||
-(BOOL) writeToFile: (NSString *)filename
|
-(BOOL) writeToFile: (NSString *)filename
|
||||||
{
|
{
|
||||||
int i,c;
|
unsigned i,c;
|
||||||
BOOL result;
|
BOOL result;
|
||||||
NSMutableString *str=[[NSMutableString alloc] initWithCapacity: 32*1024];
|
NSMutableString *str=[[NSMutableString alloc] initWithCapacity: 32*1024];
|
||||||
StringsEntry *se;
|
StringsEntry *se;
|
||||||
|
|
|
@ -124,28 +124,28 @@ main(int argc, char** argv, char **env)
|
||||||
|
|
||||||
list = [plist objectForKey: @"NSTypes"];
|
list = [plist objectForKey: @"NSTypes"];
|
||||||
if (list != nil)
|
if (list != nil)
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
[fileContents appendString: @"MimeType="];
|
|
||||||
for (i = 0; i < [list count]; i++)
|
|
||||||
{
|
{
|
||||||
NSArray *types;
|
unsigned int i;
|
||||||
int j;
|
|
||||||
|
|
||||||
plist = [list objectAtIndex: i];
|
[fileContents appendString: @"MimeType="];
|
||||||
types = [plist objectForKey: @"NSMIMETypes"];
|
for (i = 0; i < [list count]; i++)
|
||||||
if (types != nil)
|
{
|
||||||
{
|
NSArray *types;
|
||||||
for (j = 0; j < [types count]; j++)
|
unsigned int j;
|
||||||
{
|
|
||||||
entry = [types objectAtIndex: j];
|
plist = [list objectAtIndex: i];
|
||||||
[fileContents appendFormat: @"%@;", entry];
|
types = [plist objectForKey: @"NSMIMETypes"];
|
||||||
}
|
if (types != nil)
|
||||||
|
{
|
||||||
|
for (j = 0; j < [types count]; j++)
|
||||||
|
{
|
||||||
|
entry = [types objectAtIndex: j];
|
||||||
|
[fileContents appendFormat: @"%@;", entry];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
[fileContents appendString: @"\n"];
|
||||||
}
|
}
|
||||||
[fileContents appendString: @"\n"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ([[fileContents dataUsingEncoding: NSUTF8StringEncoding]
|
if ([[fileContents dataUsingEncoding: NSUTF8StringEncoding]
|
||||||
writeToFile: destName atomically: YES] == NO)
|
writeToFile: destName atomically: YES] == NO)
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
int
|
int
|
||||||
convert_unicode(NSArray *args)
|
convert_unicode(NSArray *args)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 2; i < [args count]; i++)
|
for (i = 2; i < [args count]; i++)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ convert_unicode(NSArray *args)
|
||||||
int
|
int
|
||||||
convert_utf8(NSArray *args)
|
convert_utf8(NSArray *args)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 2; i < [args count]; i++)
|
for (i = 2; i < [args count]; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ ifeq ($(FOUNDATION_LIB),gnu)
|
||||||
#
|
#
|
||||||
# FIXME - macro names
|
# FIXME - macro names
|
||||||
#
|
#
|
||||||
CONFIG_SYSTEM_INCL += @NX_CONST_STRING_CPPFLAGS@
|
AUXILIARY_OBJCFLAGS += @NX_CONST_STRING_OBJCFLAGS@
|
||||||
ifeq ($(shared),no)
|
ifeq ($(shared),no)
|
||||||
CONFIG_SYSTEM_LIBS += @LIBS@
|
CONFIG_SYSTEM_LIBS += @LIBS@
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -442,16 +442,16 @@ AC_CACHE_VAL(objc_compiler_supports_constant_string_class,
|
||||||
objc_compiler_supports_constant_string_class=no)
|
objc_compiler_supports_constant_string_class=no)
|
||||||
)
|
)
|
||||||
if test $objc_compiler_supports_constant_string_class = yes; then
|
if test $objc_compiler_supports_constant_string_class = yes; then
|
||||||
NX_CONST_STRING_CPPFLAGS="-fconstant-string-class=NSConstantString"
|
NX_CONST_STRING_OBJCFLAGS="-fconstant-string-class=NSConstantString"
|
||||||
NX_CONST_STRING_CLASS=NSConstantString
|
NX_CONST_STRING_CLASS=NSConstantString
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
else
|
else
|
||||||
NX_CONST_STRING_CPPFLAGS=""
|
NX_CONST_STRING_OBJCFLAGS=""
|
||||||
NX_CONST_STRING_CLASS=NXConstantString
|
NX_CONST_STRING_CLASS=NXConstantString
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(NX_CONST_STRING_CPPFLAGS)
|
AC_SUBST(NX_CONST_STRING_OBJCFLAGS)
|
||||||
AC_SUBST(NX_CONST_STRING_CLASS)
|
AC_SUBST(NX_CONST_STRING_CLASS)
|
||||||
|
|
||||||
CPPFLAGS="$saved_CPPFLAGS"
|
CPPFLAGS="$saved_CPPFLAGS"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue