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:
Richard Frith-Macdonald 2003-01-03 20:14:47 +00:00
parent 89c0d389fd
commit 9e7fe6bf12
50 changed files with 2888 additions and 1775 deletions

View file

@ -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>
* Tools/AGSHtml.m: Don't try to make a type reference to the

View file

@ -156,8 +156,8 @@ GSIArrayCount(GSIArray array)
static INLINE void
GSIArrayGrow(GSIArray array)
{
unsigned next;
unsigned size;
unsigned int next;
unsigned int size;
GSIArrayItem *tmp;
next = array->cap + array->old;
@ -177,7 +177,7 @@ GSIArrayGrow(GSIArray array)
static INLINE void
GSIArrayGrowTo(GSIArray array, unsigned next)
{
unsigned size;
unsigned int size;
GSIArrayItem *tmp;
if (next < array->count)
@ -201,7 +201,7 @@ GSIArrayGrowTo(GSIArray array, unsigned next)
static INLINE void
GSIArrayInsertItem(GSIArray array, GSIArrayItem item, unsigned index)
{
unsigned i;
unsigned int i;
GSI_ARRAY_RETAIN(array, item);
GSI_ARRAY_CHECK;
@ -220,7 +220,7 @@ GSIArrayInsertItem(GSIArray array, GSIArrayItem item, unsigned index)
static INLINE void
GSIArrayInsertItemNoRetain(GSIArray array, GSIArrayItem item, unsigned index)
{
unsigned i;
unsigned int i;
GSI_ARRAY_CHECK;
if (array->count == array->cap)
@ -271,9 +271,9 @@ static INLINE unsigned
GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned upper = array->count;
unsigned lower = 0;
unsigned index;
unsigned int upper = array->count;
unsigned int lower = 0;
unsigned int index;
/*
* Binary search for an item equal to the one to be inserted.
@ -316,7 +316,7 @@ static INLINE void
GSIArrayCheckSort(GSIArray array,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned i;
unsigned int i;
for (i = 1; i < array->count; i++)
{
@ -332,7 +332,7 @@ static INLINE void
GSIArrayInsertSorted(GSIArray array, GSIArrayItem item,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned index;
unsigned int index;
index = GSIArrayInsertionPosition(array, item, sorter);
GSIArrayInsertItem(array, item, index);
@ -345,7 +345,7 @@ static INLINE void
GSIArrayInsertSortedNoRetain(GSIArray array, GSIArrayItem item,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned index;
unsigned int index;
index = GSIArrayInsertionPosition(array, item, sorter);
GSIArrayInsertItemNoRetain(array, item, index);
@ -480,7 +480,7 @@ GSIArrayEmpty(GSIArray array)
static INLINE GSIArray
GSIArrayInitWithZoneAndCapacity(GSIArray array, NSZone *zone, size_t capacity)
{
unsigned size;
unsigned int size;
array->zone = zone;
array->count = 0;
@ -496,7 +496,7 @@ GSIArrayInitWithZoneAndCapacity(GSIArray array, NSZone *zone, size_t capacity)
static INLINE GSIArray
GSIArrayCopyWithZone(GSIArray array, NSZone *zone)
{
int i;
unsigned int i;
GSIArray new;
new = NSZoneMalloc(zone, sizeof(GSIArray_t));
GSIArrayInitWithZoneAndCapacity(new, zone, array->count);

View file

@ -752,7 +752,7 @@ GSIMapCleanMap(GSIMapTable map)
if (map->nodeCount > 0)
{
GSIMapBucket bucket = map->buckets;
int i;
unsigned int i;
GSIMapNode startNode = 0;
GSIMapNode prevNode = 0;
GSIMapNode node;
@ -792,7 +792,7 @@ GSIMapCleanMap(GSIMapTable map)
static INLINE void
GSIMapEmptyMap(GSIMapTable map)
{
int i;
unsigned int i;
#ifdef GSI_MAP_NOCLEAN
if (GSI_MAP_NOCLEAN)

View file

@ -80,9 +80,9 @@ enum _NSRectEdge
NSMaxYEdge
};
static const NSPoint NSZeroPoint; /* A zero point. */
static const NSRect NSZeroRect; /* A zero origin rectangle. */
static const NSSize NSZeroSize; /* A zero size rectangle. */
static const NSPoint NSZeroPoint __attribute__((unused)); /* Zero point. */
static const NSRect NSZeroRect __attribute__((unused)); /* Zero rectangle. */
static const NSSize NSZeroSize __attribute__((unused)); /* Zero size. */
/**** Function Prototypes ****************************************************/

View file

@ -35,7 +35,7 @@
void *_retval;
id _target;
SEL _selector;
int _numArgs;
unsigned int _numArgs;
#ifndef STRICT_MACOS_X
NSArgumentInfo *_info;
#else

View file

@ -832,8 +832,8 @@ wordData(NSString *word)
src++;
if (ctxt->state != ChunkSize)
{
int val = 0;
int index;
unsigned int val = 0;
unsigned int index;
for (index = 0; index < ctxt->pos; index++)
{
@ -2752,7 +2752,7 @@ static NSCharacterSet *tokenSet = nil;
NSData *d = [[self name] dataUsingEncoding: NSASCIIStringEncoding];
unsigned l = [d length];
char buf[l];
int i = 0;
unsigned int i = 0;
BOOL conv = YES;
#define LIM 120

View file

@ -3100,7 +3100,8 @@ fatalErrorFunction(void *ctx, const char *msg, ...)
xmlNode *node;
GSXMLNode *n;
node = xmlXPathNodeSetItem (((xmlXPathObject*)_lib)->nodesetval, index);
node = xmlXPathNodeSetItem (((xmlXPathObject*)_lib)->nodesetval,
(int)index);
n = [GSXMLNode alloc];
return [n _initFrom: node parent: self];

View file

@ -631,14 +631,15 @@ static SEL eqSel;
/* Shell sort algorithm taken from SortingInAction - a NeXT example */
#define STRIDE_FACTOR 3 // good value for stride factor is not well-understood
// 3 is a fairly good choice (Sedgewick)
unsigned c,d, stride;
unsigned int c;
unsigned int d;
unsigned int stride = 1;
BOOL found;
int count = _count;
unsigned int count = _count;
#ifdef GSWARN
BOOL badComparison = NO;
#endif
stride = 1;
while (stride <= count)
{
stride = stride * STRIDE_FACTOR + 1;

View file

@ -807,7 +807,7 @@ SANITY();
info = OBJECTAT(arrayIndex);
if (info->loc < NSMaxRange(range))
{
int next = arrayIndex + 1;
unsigned int next = arrayIndex + 1;
while (next < arraySize)
{

View file

@ -798,7 +798,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
unsigned c,d, stride;
BOOL found;
NSComparisonResult (*comp)(id, SEL, id) = 0;
int count = numKeys;
unsigned int count = numKeys;
#ifdef GSWARN
BOOL badComparison = NO;
#endif

View file

@ -206,7 +206,7 @@
- (id) initWithObjects: (id*)objs count: (unsigned)c
{
int i;
unsigned int i;
self = [self initWithCapacity: c];
if (self == nil)
@ -273,7 +273,7 @@
while (node != 0)
{
if (node->value.uint <= level)
if (node->value.uint <= (unsigned int)level)
{
GSIMapRemoveNodeFromMap(&map, bucket, node);
GSIMapFreeNode(&map, node);

View file

@ -143,7 +143,7 @@ static SEL objSel;
/* Designated initialiser */
- (id) initWithObjects: (id*)objs forKeys: (id*)keys count: (unsigned)c
{
int i;
unsigned int i;
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), c);
for (i = 0; i < c; i++)

View file

@ -488,7 +488,7 @@ static IMP gs_objc_msg_forward (SEL sel)
void
GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
{
int i;
unsigned int i;
av_alist alist;
NSInvocation_t *inv = (NSInvocation_t*)_inv;
void *retval = inv->_retval;
@ -919,7 +919,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
to send over the wire */
- (BOOL) encodeWithDistantCoder: (NSCoder*)coder passPointers: (BOOL)passp
{
int i;
unsigned int i;
BOOL out_parameters = NO;
const char *type = [_sig methodType];

View file

@ -263,8 +263,8 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
unsigned char *ptr;
unsigned char c;
unsigned int s = 0;
unsigned int old;
unsigned int len;
int old;
int len;
int i; // May be negative.
if (d != nil)
@ -272,7 +272,7 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
// NSLog(@"Read - '%@'", d);
[ibuf appendData: d];
}
old = len = [ibuf length];
old = len = (int)[ibuf length];
ptr = [ibuf mutableBytes];
for (i = pos; i < len; i++)
@ -355,7 +355,7 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
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];
i++;

View file

@ -1796,7 +1796,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
if (modes && [modes count])
{
int i;
unsigned int i;
for (i = 0; i < [modes count]; i++)
{
@ -1836,7 +1836,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
if (modes && [modes count])
{
int i;
unsigned int i;
for (i = 0; i < [modes count]; i++)
{
@ -1867,7 +1867,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
[self setNonBlocking: YES];
if (modes && [modes count])
{
int i;
unsigned int i;
for (i = 0; i < [modes count]; i++)
{
@ -1904,7 +1904,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
[self setNonBlocking: YES];
if (modes && [modes count])
{
int i;
unsigned int i;
for (i = 0; i < [modes count]; i++)
{
@ -1990,8 +1990,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
*/
if (readMax > 0)
{
length = readMax - [item length];
if (length > sizeof(buf))
length = (unsigned int)readMax - [item length];
if (length > (int)sizeof(buf))
{
length = sizeof(buf);
}
@ -2021,7 +2021,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
else
{
[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
[self postReadNotification];

View file

@ -745,12 +745,12 @@ parse_one_spec (const unichar *format, size_t posn, struct printf_spec *spec,
{ \
unsigned i; \
\
if (s->len+(Len) >= s->size) { \
s->size += s->size/2 > (Len)? s->size/2: (Len); \
if (s->len+((unsigned)(Len)) >= s->size) { \
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])); \
} \
for (i=0; i < (Len); i++) s->buf[s->len++] = (String)[i]; \
done += (Len); \
for (i=0; i < ((unsigned)(Len)); i++) s->buf[s->len++] = (String)[i]; \
done += (unsigned)(Len); \
} \
while (0)
@ -1127,10 +1127,12 @@ NSDictionary *locale)
}
/* Maybe the buffer is too small. */
if (MAX (prec, width) + 32 > sizeof (work_buffer) / sizeof (unichar))
workend = ((unichar *) alloca ((MAX (prec, width) + 32)
* sizeof (unichar))
+ (MAX (prec, width) + 32));
if ((unsigned)(MAX (prec, width) + 32)
> sizeof (work_buffer) / sizeof (unichar))
{
workend = ((unichar *) alloca ((MAX (prec, width) + 32)
* sizeof (unichar)) + (MAX (prec, width) + 32));
}
/* Process format specifiers. */
while (1)
@ -1735,7 +1737,7 @@ NSDictionary *locale)
unsigned slen = strlen(str);
NSStringEncoding enc = GetDefEncoding();
len = prec != -1 ? prec : slen;
len = prec != -1 ? (unsigned)prec : slen;
if (len > slen)
len = slen;
@ -1819,7 +1821,7 @@ NSDictionary *locale)
NSRange r;
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
enough for the wide character version. */

View file

@ -1048,7 +1048,7 @@ fillHole(ivars self, unsigned index, unsigned size)
self->_count -= size;
#ifndef STABLE_MEMCPY
{
int i;
unsigned int i;
if (self->_flags.wide == 1)
{
@ -1399,7 +1399,7 @@ lossyCString_u(ivars self)
}
static inline void
makeHole(ivars self, int index, int size)
makeHole(ivars self, unsigned int index, unsigned int size)
{
unsigned want;
@ -1474,21 +1474,23 @@ makeHole(ivars self, int index, int size)
#ifndef STABLE_MEMCPY
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[index+size] = self->_contents.u[index];
}
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[index+size] = self->_contents.c[index];
}
#else
if (self->_flags.wide == 1)
@ -2439,8 +2441,8 @@ transmute(ivars self, NSString *aString)
// private method for Unicode level 3 implementation
- (int) _baseLength
{
int count = 0;
int blen = 0;
unsigned int count = 0;
unsigned int blen = 0;
while (count < _count)
if (!uni_isnonsp(_contents.u[count++]))
@ -3033,7 +3035,7 @@ transmute(ivars self, NSString *aString)
}
else if (offset > 0)
{
makeHole((ivars)self, NSMaxRange(aRange), offset);
makeHole((ivars)self, NSMaxRange(aRange), (unsigned int)offset);
}
if (length > 0)
@ -3107,7 +3109,7 @@ transmute(ivars self, NSString *aString)
- (void) setString: (NSString*)aString
{
int len = (aString == nil) ? 0 : [aString length];
unsigned int len = (aString == nil) ? 0 : [aString length];
ivars other;
if (len == 0)
@ -3118,7 +3120,7 @@ transmute(ivars self, NSString *aString)
other = transmute((ivars)self, aString);
if (_count < len)
{
makeHole((ivars)self, _count, len - _count);
makeHole((ivars)self, _count, (unsigned int)(len - _count));
}
else
{
@ -3228,8 +3230,8 @@ transmute(ivars self, NSString *aString)
{
if (_flags.wide == 1)
{
int count = 0;
int blen = 0;
unsigned int count = 0;
unsigned int blen = 0;
while (count < _count)
if (!uni_isnonsp(_contents.u[count++]))

View file

@ -202,7 +202,7 @@ typedef enum {
gsu32 rId; /* Id of incoming message. */
unsigned nItems; /* Number of items to be read. */
GSHandleState state; /* State of the handle. */
int addrNum; /* Address number within host. */
unsigned int addrNum; /* Address number within host. */
@public
NSRecursiveLock *myLock; /* Lock for this handle. */
BOOL caller; /* Did we connect to other end? */
@ -1087,7 +1087,7 @@ static Class runLoopClass;
#else
len = write(desc, [d bytes], [d length]);
#endif
if (len == [d length])
if (len == (int)[d length])
{
RELEASE(defaultAddress);
defaultAddress = RETAIN([NSString stringWithCString:
@ -1680,7 +1680,8 @@ static Class tcpPortClass;
/*
* 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.

View file

@ -185,7 +185,7 @@
unsigned char c[sizeof(double)];
} val;
unsigned hash = 0;
int i;
unsigned int i;
val.d = data.x + data.y;
for (i = 0; i < sizeof(double); i++)
@ -201,7 +201,7 @@
unsigned char c[sizeof(double)];
} val;
unsigned hash = 0;
int i;
unsigned int i;
val.d = data.origin.x + data.origin.y + data.size.width + data.size.height;
for (i = 0; i < sizeof(double); i++)
@ -213,7 +213,7 @@
unsigned char c[sizeof(double)];
} val;
unsigned hash = 0;
int i;
unsigned int i;
val.d = data.width + data.height;
for (i = 0; i < sizeof(double); i++)

View file

@ -1618,14 +1618,15 @@ static int compare(id elem1, id elem2, void* context)
/* Shell sort algorithm taken from SortingInAction - a NeXT example */
#define STRIDE_FACTOR 3 // good value for stride factor is not well-understood
// 3 is a fairly good choice (Sedgewick)
unsigned c,d, stride;
unsigned int c;
unsigned int d;
unsigned int stride = 1;
BOOL found;
int count = [self count];
unsigned int count = [self count];
#ifdef GSWARN
BOOL badComparison = NO;
#endif
stride = 1;
while (stride <= count)
{
stride = stride * STRIDE_FACTOR + 1;

View file

@ -248,7 +248,7 @@ static IMP initImp;
{
unsigned count = 0;
struct autorelease_array_list *released = _released_head;
int i;
unsigned int i;
while (released && released->count)
{
@ -412,7 +412,7 @@ static IMP initImp;
releasing. */
{
struct autorelease_array_list *released = _released_head;
int i;
unsigned int i;
while (released)
{

View file

@ -282,10 +282,10 @@ _bundle_name_first_match(NSString* directory, NSString* name)
*/
+ (void) _addFrameworkFromClass: (Class)frameworkClass
{
NSBundle *bundle = nil;
NSBundle *bundle = nil;
NSString **fmClasses;
NSString *bundlePath = nil;
int len;
NSString *bundlePath = nil;
unsigned int len;
if (frameworkClass == Nil)
{
@ -295,7 +295,7 @@ _bundle_name_first_match(NSString* directory, NSString* name)
len = strlen (frameworkClass->name);
if (len > 12 * sizeof(char)
&& !strncmp("NSFramework_", frameworkClass->name, 12))
&& !strncmp("NSFramework_", frameworkClass->name, 12))
{
/* The name of the framework. */
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)))
{
int len = strlen (class->name);
unsigned int len = strlen (class->name);
if (len > 12 * sizeof(char)
&& !strncmp("NSFramework_", class->name, 12))
classes[numClasses++] = class;
&& !strncmp("NSFramework_", class->name, 12))
{
classes[numClasses++] = class;
}
if (numClasses == numBufClasses)
{
Class *ptr;

View file

@ -143,7 +143,7 @@ abbrev(NSTimeZone *tz, NSDate *d)
}
}
static inline int
static inline unsigned int
lastDayOfGregorianMonth(int month, int year)
{
switch (month)
@ -485,9 +485,9 @@ static inline int getDigits(const char *from, char *to, int limit)
unsigned formatIdx = 0;
unsigned sourceIdx = 0;
char tmpStr[20];
int tmpIdx;
unsigned int tmpIdx;
unsigned had = 0;
int pos;
unsigned int pos;
BOOL hadPercent = NO;
NSString *dForm;
NSString *tForm;
@ -574,21 +574,21 @@ static inline int getDigits(const char *from, char *to, int limit)
if (sub != nil)
{
unsigned sLen = [sub length];
unsigned i;
int i;
if (sLen > 2)
{
[fd setLength:
(formatLen + sLen - 2) * sizeof(unichar)];
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];
}
}
else
{
for (i = pos+1; i < formatLen; i++)
for (i = pos+1; i < (int)formatLen; 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
timeZone: (NSTimeZone *)aTimeZone
{
int c;
unsigned int c;
NSTimeInterval s;
NSTimeInterval oldOffset;
NSTimeInterval newOffset;

View file

@ -37,7 +37,7 @@
#include <Foundation/NSCoder.h>
/* 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
# define NumberTemplate NSBoolNumber
# define TYPE_TYPE BOOL

View file

@ -250,7 +250,7 @@ static Class NSCountedSet_concrete_class;
{
unsigned c = (*cImp)(self, @selector(countForObject:), obj);
if (c <= level)
if (c <= (unsigned int)level)
{
while (c-- > 0)
{

View file

@ -138,7 +138,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
DWORD high;
DWORD got;
#else
unsigned fileLength;
long fileLength;
#endif
#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);
if (c != fileLength)
if (c != (int)fileLength)
{
NSWarnFLog(@"read of file (%s) contents failed - %s",
thePath, GSLastErrorStr(errno));
@ -800,7 +800,7 @@ failure:
*/
- (BOOL) isEqualToData: (NSData*)other
{
int len;
unsigned int len;
if (other == self)
{
return YES;
@ -947,7 +947,7 @@ failure:
* in the fwrite() call. */
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. */
{
NSWarnMLog(@"Fwrite (%s) failed - %s", thePath, GSLastErrorStr(errno));

View file

@ -37,19 +37,19 @@
typedef struct {
Class class;
/* The following are used for statistical info */
int count;
int lastc;
int total;
int peak;
unsigned int count;
unsigned int lastc;
unsigned int total;
unsigned int peak;
/* The following are used to record actual objects */
BOOL is_recording;
id *recorded_objects;
int num_recorded_objects;
int stack_size;
unsigned int num_recorded_objects;
unsigned int stack_size;
} table_entry;
static int num_classes = 0;
static int table_size = 0;
static unsigned int num_classes = 0;
static unsigned int table_size = 0;
static table_entry* the_table = 0;
@ -131,7 +131,7 @@ GSDebugAllocationActive(BOOL active)
void
GSDebugAllocationActiveRecordingObjects(Class c)
{
unsigned i;
unsigned int i;
GSDebugAllocationActive(YES);
@ -189,7 +189,7 @@ GSDebugAllocationAdd(Class c, id o)
{
if (debug_allocation)
{
int i;
unsigned int i;
for (i = 0; i < num_classes; i++)
{
@ -245,7 +245,7 @@ GSDebugAllocationAdd(Class c, id o)
[uniqueLock lock];
if (num_classes >= table_size)
{
int more = table_size + 128;
unsigned int more = table_size + 128;
table_entry *tmp;
tmp = NSZoneMalloc(NSDefaultMallocZone(), more * sizeof(table_entry));
@ -305,7 +305,7 @@ GSDebugAllocationAdd(Class c, id o)
int
GSDebugAllocationCount(Class c)
{
int i;
unsigned int i;
for (i = 0; i < num_classes; i++)
{
@ -337,7 +337,7 @@ GSDebugAllocationCount(Class c)
int
GSDebugAllocationTotal(Class c)
{
int i;
unsigned int i;
for (i = 0; i < num_classes; i++)
{
@ -364,7 +364,7 @@ GSDebugAllocationTotal(Class c)
int
GSDebugAllocationPeak(Class c)
{
int i;
unsigned int i;
for (i = 0; i < num_classes; i++)
{
@ -390,7 +390,7 @@ GSDebugAllocationClassList()
{
Class *ans;
size_t siz;
int i;
unsigned int i;
if (uniqueLock != nil)
[uniqueLock lock];
@ -439,9 +439,9 @@ GSDebugAllocationList(BOOL changeFlag)
static const char*
_GSDebugAllocationList(BOOL difference)
{
int pos = 0;
int i;
static int siz = 0;
unsigned int pos = 0;
unsigned int i;
static unsigned int siz = 0;
static char *buf = 0;
for (i = 0; i < num_classes; i++)
@ -536,9 +536,9 @@ GSDebugAllocationListAll()
static const char*
_GSDebugAllocationListAll(void)
{
int pos = 0;
int i;
static int siz = 0;
unsigned int pos = 0;
unsigned int i;
static unsigned int siz = 0;
static char *buf = 0;
for (i = 0; i < num_classes; i++)
@ -592,7 +592,7 @@ GSDebugAllocationRemove(Class c, id o)
{
if (debug_allocation)
{
int i;
unsigned int i;
for (i = 0; i < num_classes; i++)
{
@ -653,7 +653,7 @@ NSArray *
GSDebugAllocationListRecordedObjects(Class c)
{
NSArray *answer;
unsigned i, k;
unsigned int i, k;
id *tmp;
if (debug_allocation == NO)

View file

@ -146,7 +146,7 @@ _arg_addr(NSInvocation *inv, int index)
_argsRetained = NO;
if (_cframe && _sig)
{
int i;
unsigned int i;
for (i = 3; i <= _numArgs; i++)
{
@ -368,7 +368,7 @@ _arg_addr(NSInvocation *inv, int index)
}
else
{
int i;
unsigned int i;
_argsRetained = YES;
IF_NO_GC(RETAIN(_target));
@ -518,7 +518,7 @@ _arg_addr(NSInvocation *inv, int index)
- (void) encodeWithCoder: (NSCoder*)aCoder
{
const char *types = [_sig methodType];
int i;
unsigned int i;
[aCoder encodeValueOfObjCType: @encode(char*)
at: &types];
@ -567,7 +567,7 @@ _arg_addr(NSInvocation *inv, int index)
NSMethodSignature *newSig;
const char *types;
void *datum;
int i;
unsigned int i;
[aCoder decodeValueOfObjCType: @encode(char*) at: &types];
newSig = [NSMethodSignature signatureWithObjCTypes: types];
@ -666,7 +666,7 @@ _arg_addr(NSInvocation *inv, int index)
}
if (self)
{
int i;
unsigned int i;
[self setTarget: anObject];
[self setSelector: aSelector];
@ -793,7 +793,7 @@ _arg_addr(NSInvocation *inv, int index)
*/
if (frame)
{
int i;
unsigned int i;
mframe_get_arg(frame, &_info[1], &_target);
for (i = 1; i <= _numArgs; i++)

View file

@ -110,7 +110,7 @@ _NSLog_standard_printf_handler (NSString* message)
#ifdef HAVE_SYSLOG
if (GSUserDefaultsFlag(GSLogSyslog) == YES
|| write(_NSLogDescriptor, buf, len) != len)
|| write(_NSLogDescriptor, buf, len) != (int)len)
{
int mask;
/* We NULL-terminate the string in order to feed it to

View file

@ -169,7 +169,7 @@
if (_info == 0)
{
const char *types = _methodTypes;
int i;
unsigned int i;
_info = NSZoneMalloc(NSDefaultMallocZone(),
sizeof(NSArgumentInfo)*(_numArgs+1));

View file

@ -247,8 +247,8 @@ typedef struct NCTbl {
Observation **chunks;
unsigned numChunks;
GSIMapTable cache[CACHESIZE];
short chunkIndex;
short cacheIndex;
unsigned short chunkIndex;
unsigned short cacheIndex;
} NCTable;
#define TABLE ((NCTable*)_table)

View file

@ -1148,16 +1148,16 @@ static BOOL double_release_check_enabled = NO;
for (proto_list = ((struct objc_class*)self)->protocols;
proto_list; proto_list = proto_list->next)
{
int i;
unsigned int i;
for (i = 0; i < proto_list->count; i++)
{
/* xxx We should add conformsToProtocol to Protocol class. */
if ([proto_list->list[i] conformsTo: aProtocol])
{
return YES;
}
}
{
/* xxx We should add conformsToProtocol to Protocol class. */
if ([proto_list->list[i] conformsTo: aProtocol])
{
return YES;
}
}
}
if ([self superclass])

View file

@ -380,7 +380,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
count: (unsigned)expected
at: (void*)buf
{
int i;
unsigned int i;
int offset = 0;
int size = objc_sizeof_type(type);
unsigned char info;

View file

@ -357,25 +357,6 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
#define WatcherMapValueCallBacks NSOwnedPointerMapValueCallBacks
#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.
BOOL completed; // To mark operation as completed.
#ifdef HAVE_POLL
int pollfds_capacity;
int pollfds_count;
unsigned int pollfds_capacity;
unsigned int pollfds_count;
struct pollfd *pollfds;
#endif
}
@ -577,7 +558,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
int fdEnd = 0; /* Number of descriptors being monitored. */
int fdIndex;
int fdFinish;
unsigned i;
unsigned int i;
i = GSIArrayCount(watchers);
@ -689,21 +670,25 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
milliseconds = 0;
}
if (0) {
int i;
#if 0
{
unsigned int i;
fprintf(stderr, "poll %d %d:", milliseconds, pollfds_count);
for (i = 0; i < pollfds_count; i++)
fprintf(stderr, " %d,%x", pollfds[i].fd, pollfds[i].events);
fprintf(stderr, "\n");
}
#endif
poll_return = poll (pollfds, pollfds_count, milliseconds);
if (0) {
int i;
#if 0
{
unsigned int i;
fprintf(stderr, "ret %d %d:", poll_return, pollfds_count);
for (i = 0; i < pollfds_count; i++)
fprintf(stderr, " %d,%x", pollfds[i].fd, pollfds[i].revents);
fprintf(stderr, "\n");
}
#endif
NSDebugMLLog(@"NSRunLoop", @"poll returned %d\n", poll_return);

View file

@ -339,7 +339,7 @@ typedef struct {
* Internal version used by scanRadixUnsignedInt: and scanHexInt: .
*/
- (BOOL) scanUnsignedInt_: (unsigned int *)value
radix: (int)radix
radix: (unsigned int)radix
gotDigits: (BOOL)gotDigits
{
unsigned int num = 0;
@ -429,7 +429,7 @@ typedef struct {
*/
- (BOOL) scanRadixUnsignedInt: (unsigned int *)value
{
int radix;
unsigned int radix;
BOOL gotDigits = NO;
unsigned int saveScanLocation = _scanLocation;

View file

@ -608,10 +608,10 @@ deserializeFromInfo(_NSDeserializerInfo* info)
case ST_MDICT:
size = (*info->deiImp)(info->data, deiSel, info->cursor);
{
id keys[size];
id objects[size];
id d;
int i;
id keys[size];
id objects[size];
id d;
unsigned int i;
for (i = 0; i < size; i++)
{

View file

@ -588,8 +588,8 @@ handle_printf_atsign (FILE *stream,
{
if (length > 0)
{
int i;
BOOL isAscii = YES;
unsigned int i;
BOOL isAscii = YES;
if (chars == 0)
{
@ -1562,9 +1562,9 @@ handle_printf_atsign (FILE *stream,
options: (unsigned int)mask
range: (NSRange)aRange
{
int i;
int start;
int stop;
unsigned int i;
unsigned int start;
unsigned int stop;
int step;
NSRange range;
unichar (*cImp)(id, SEL, unsigned int);
@ -3511,7 +3511,7 @@ handle_printf_atsign (FILE *stream,
if (len > 0)
{
int count = 0;
unsigned int count = 0;
unichar (*caiImp)(NSString*, SEL, unsigned int);
caiImp = (unichar (*)())[self methodForSelector: caiSel];
@ -4955,9 +4955,9 @@ static id parsePlItem(pldata* pld)
if (pld->pos < pld->end && pld->ptr[pld->pos] == '*')
{
const unichar *ptr;
unsigned min;
unsigned len = 0;
int i;
unsigned min;
unsigned len = 0;
unsigned i;
pld->pos++;
min = pld->pos;

View file

@ -1514,7 +1514,7 @@ chop(NSTimeInterval since, GSTimeZone *zone)
gss32 *trans = zone->trans;
unsigned hi = zone->n_trans;
unsigned lo = 0;
int i;
unsigned int i;
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
* transition before our date.
*/
if (i == zone->n_trans || trans[i] > when)
if (i > 0 && (i == zone->n_trans || trans[i] > when))
{
i--;
}

View file

@ -455,9 +455,9 @@ static Class NSDataMallocClass;
count: (unsigned)expected
at: (void*)buf
{
int i;
unsigned int i;
int offset = 0;
int size = objc_sizeof_type(type);
unsigned int size = (unsigned int)objc_sizeof_type(type);
unsigned char info;
unsigned count;

View file

@ -358,9 +358,9 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info)
case _C_STRUCT_B:
{
int acc_size = 0;
int def_align = objc_alignof_type(typePtr-1);
int acc_align = def_align;
unsigned int acc_size = 0;
unsigned int def_align = objc_alignof_type(typePtr-1);
unsigned int acc_align = def_align;
/*
* Skip "<name>=" stuff.
@ -407,8 +407,8 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info)
case _C_UNION_B:
{
int max_size = 0;
int max_align = 0;
unsigned int max_size = 0;
unsigned int max_align = 0;
/*
* Skip "<name>=" stuff.
@ -1317,7 +1317,7 @@ mframe_build_return (arglist_t argframe,
/* A pointer to the memory that will hold the return value. */
retval_t retframe = NULL;
/* The size, in bytes, of memory pointed to by RETFRAME. */
int retsize;
unsigned int retsize;
/* Which argument number are we processing now? */
int argnum;
/* 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. */
/* Increment TYPE so we can see what it is a pointer to. */
tmptype++;
retLength = objc_sizeof_type(tmptype);
retLength = (unsigned int)objc_sizeof_type(tmptype);
/* Allocate memory to hold the value we're pointing to. */
*(void**)retframe =
NSZoneMalloc(NSDefaultMallocZone(), retLength);

View file

@ -1453,7 +1453,7 @@ static BOOL snuggleStart(NSString *t)
a = [self split: str];
for (i = 0; i < [a count]; i++)
{
int j;
unsigned int j;
str = [a objectAtIndex: i];

View file

@ -166,7 +166,7 @@
{
NSNumber *num = [lines objectAtIndex: where];
if ([num intValue] <= pos)
if ([num intValue] <= (int)pos)
{
break;
}

View file

@ -46,7 +46,7 @@ main(int argc, char** argv, char **env)
NSString *value;
NSString *user = nil;
BOOL found = NO;
int i;
unsigned int i;
#ifdef GS_PASS_ARGUMENTS
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];

View file

@ -378,7 +378,7 @@ typedef struct {
int s;
#endif /* __MINGW__ */
struct sockaddr_in addr; /* Address of process making request. */
int pos; /* Position reading data. */
unsigned int pos; /* Position reading data. */
union {
gdo_req r;
unsigned char b[GDO_REQ_SIZE];
@ -410,7 +410,7 @@ delRInfo(SOCKET s)
delRInfo(int s)
#endif /* __MINGW__ */
{
int i;
unsigned int i;
for (i = 0; i < _rInfoCount; i++)
{
@ -441,7 +441,7 @@ getRInfo(SOCKET s, int make)
getRInfo(int s, int make)
#endif
{
int i;
unsigned int i;
for (i = 0; i < _rInfoCount; i++)
{
@ -483,7 +483,7 @@ delWInfo(SOCKET s)
delWInfo(int s)
#endif /* __MINGW__ */
{
int i;
unsigned int i;
for (i = 0; i < _wInfoCount; i++)
{
@ -514,7 +514,7 @@ getWInfo(SOCKET s, int make)
getWInfo(int s, int make)
#endif
{
int i;
unsigned int i;
for (i = 0; i < _wInfoCount; i++)
{
@ -838,7 +838,7 @@ static void
prb_add(struct in_addr *p)
{
prb_type *n = 0;
int i;
unsigned int i;
if (is_local_host(*p) != 0)
{
@ -911,13 +911,13 @@ prb_add(struct in_addr *p)
static void
prb_del(struct in_addr *p)
{
int i;
unsigned int i;
for (i = 0; i < prb_used; i++)
{
if (memcmp(&prb[i]->sin, p, IASIZE) == 0)
{
int j;
unsigned int j;
free(prb[i]);
for (j = i + 1; j < prb_used; j++)
@ -1005,7 +1005,7 @@ static void
dump_stats()
{
int tcp_pending = 0;
int i;
unsigned int i;
for (i = 0; i < _wInfoCount; i++)
{
@ -1046,7 +1046,7 @@ dump_tables()
}
else
{
int i;
unsigned int i;
for (i = 0; i < prb_used; i++)
{
@ -1540,12 +1540,12 @@ load_iface(const char* from)
bcok[interfaces] = 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);
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);
gdomap_log(LOG_ERR);
@ -2008,7 +2008,7 @@ init_probe()
if ((p->addr.s_addr & mask[iface].s_addr) ==
(addr[iface].s_addr & mask[iface].s_addr))
{
int len = elen;
unsigned int len = elen;
p->direct = 1;
/* Kick off probe. */
@ -2044,7 +2044,7 @@ init_probe()
for (j = low + 1; j < high; j++)
{
struct in_addr a;
int len = elen;
unsigned int len = elen;
a.s_addr = htonl(net + j);
if (is_local_host(a))
@ -2098,7 +2098,7 @@ init_probe()
{
if (p->direct == 0)
{
int len = elen;
unsigned int len = elen;
if (is_local_host(p->addr))
{
@ -2865,8 +2865,8 @@ handle_request(int desc)
}
else if (type == GDO_SERVERS)
{
int i;
int j;
unsigned int i;
unsigned int j;
free(wi->buf);
wi->buf = (char*)malloc(sizeof(unsigned long)
@ -2984,7 +2984,7 @@ handle_request(int desc)
struct in_addr laddr;
struct in_addr raddr;
struct in_addr *other;
int elen;
unsigned int elen;
void *rbuf = ri->buf.r.name;
void *wbuf;
int i;
@ -4351,7 +4351,7 @@ printf(
prb = (plentry*)malloc(sizeof(plentry));
memset((char*)prb, '\0', sizeof(plentry));
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);
free(prb);

View file

@ -310,7 +310,7 @@ static NSString *parse_string(NSString **ptr)
-(BOOL) writeToFile: (NSString *)filename
{
int i,c;
unsigned i,c;
BOOL result;
NSMutableString *str=[[NSMutableString alloc] initWithCapacity: 32*1024];
StringsEntry *se;

View file

@ -124,28 +124,28 @@ main(int argc, char** argv, char **env)
list = [plist objectForKey: @"NSTypes"];
if (list != nil)
{
int i;
[fileContents appendString: @"MimeType="];
for (i = 0; i < [list count]; i++)
{
NSArray *types;
int j;
unsigned int i;
plist = [list objectAtIndex: i];
types = [plist objectForKey: @"NSMIMETypes"];
if (types != nil)
{
for (j = 0; j < [types count]; j++)
{
entry = [types objectAtIndex: j];
[fileContents appendFormat: @"%@;", entry];
}
[fileContents appendString: @"MimeType="];
for (i = 0; i < [list count]; i++)
{
NSArray *types;
unsigned int j;
plist = [list objectAtIndex: i];
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]
writeToFile: destName atomically: YES] == NO)

View file

@ -31,7 +31,7 @@
int
convert_unicode(NSArray *args)
{
int i;
unsigned int i;
for (i = 2; i < [args count]; i++)
{
@ -71,7 +71,7 @@ convert_unicode(NSArray *args)
int
convert_utf8(NSArray *args)
{
int i;
unsigned int i;
for (i = 2; i < [args count]; i++)
{

View file

@ -27,7 +27,7 @@ ifeq ($(FOUNDATION_LIB),gnu)
#
# FIXME - macro names
#
CONFIG_SYSTEM_INCL += @NX_CONST_STRING_CPPFLAGS@
AUXILIARY_OBJCFLAGS += @NX_CONST_STRING_OBJCFLAGS@
ifeq ($(shared),no)
CONFIG_SYSTEM_LIBS += @LIBS@
endif

4135
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -442,16 +442,16 @@ AC_CACHE_VAL(objc_compiler_supports_constant_string_class,
objc_compiler_supports_constant_string_class=no)
)
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
AC_MSG_RESULT(yes)
else
NX_CONST_STRING_CPPFLAGS=""
NX_CONST_STRING_OBJCFLAGS=""
NX_CONST_STRING_CLASS=NXConstantString
AC_MSG_RESULT(no)
fi
AC_SUBST(NX_CONST_STRING_CPPFLAGS)
AC_SUBST(NX_CONST_STRING_OBJCFLAGS)
AC_SUBST(NX_CONST_STRING_CLASS)
CPPFLAGS="$saved_CPPFLAGS"