From: helge Date: Mon, 3 Jul 2006 21:56:22 +0000 (+0000) Subject: 64bit fixes X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ecfdd38f08a7288be80b3ae56233a2b09e7e8f5;p=sope 64bit fixes git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1289 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/EOControl/ChangeLog b/sope-core/EOControl/ChangeLog index bb7a9ec7..5315c2be 100644 --- a/sope-core/EOControl/ChangeLog +++ b/sope-core/EOControl/ChangeLog @@ -1,3 +1,7 @@ +2006-07-04 Helge Hess + + * 64bit fixes (v4.5.66) + 2006-07-03 Helge Hess * v4.5.65 diff --git a/sope-core/EOControl/EOKeyValueCoding.m b/sope-core/EOControl/EOKeyValueCoding.m index 2c46503e..a08e3f43 100644 --- a/sope-core/EOControl/EOKeyValueCoding.m +++ b/sope-core/EOControl/EOKeyValueCoding.m @@ -195,11 +195,11 @@ static GetKeyValueBinding* newGetBinding(NSString* key, id instance) info2 = (void*)(mth->method_name); } } - if (cbuf) free(cbuf); + if (cbuf != NULL) free(cbuf); } // Lookup ivar name - if (!fptr) { + if (fptr == NULL) { Class class = [instance class]; unsigned clen; char *cbuf; @@ -211,7 +211,7 @@ static GetKeyValueBinding* newGetBinding(NSString* key, id instance) [key getCString:cbuf]; cbuf[clen] = '\0'; ckey = cbuf; - while (class) { + while (class != Nil) { for (i = 0; class->ivars && i < class->ivars->ivar_count; i++) { if (!Strcmp(ckey, class->ivars->ivar_list[i].ivar_name)) { switch(*objc_skip_type_qualifiers(class->ivars->ivar_list[i].ivar_type)) { @@ -256,14 +256,15 @@ static GetKeyValueBinding* newGetBinding(NSString* key, id instance) break; } if (fptr) { - info2 = (void*)(class->ivars->ivar_list[i].ivar_offset); + info2 = (void *)(unsigned long) + (class->ivars->ivar_list[i].ivar_offset); break; } } } class = class->super_class; } - if (cbuf) free(cbuf); + if (cbuf != NULL) free(cbuf); } // Make binding and insert into map @@ -433,8 +434,9 @@ static SetKeyValueBinding* newSetBinding(NSString* key, id instance) fptr = (void (*)(void*, void*, id, id))doubleIvarSetFunc; break; } - if (fptr) { - info2 = (void*)(class->ivars->ivar_list[i].ivar_offset); + if (fptr != NULL) { + info2 = (void *)(unsigned long) + (class->ivars->ivar_list[i].ivar_offset); break; } } @@ -474,7 +476,7 @@ static SetKeyValueBinding* newSetBinding(NSString* key, id instance) */ static unsigned keyValueMapHash(NSMapTable* table, KeyValueMethod* map) { - return [map->key hash] + (((int)(map->class)) >> 4); + return [map->key hash] + (((unsigned long)(map->class)) >> 4L); } static BOOL keyValueMapCompare(NSMapTable* table, @@ -820,7 +822,7 @@ static inline BOOL setValue(NSString* key, id instance, id value) key = (start < i) ? [[StringClass alloc] initWithCString:(const char *)&(buf[start]) length:(i - start)] - : (NSString *)@""; + : (id)@""; value = [value valueForKey:key]; [key release]; key = nil; @@ -1078,13 +1080,13 @@ static inline BOOL setValue(NSString* key, id instance, id value) /* ACCESS to keys of id type. */ -static id idMethodGetFunc(void* info1, void* info2, id self) { +static id idMethodGetFunc(void *info1, void *info2, id self) { id (*fptr)(id, SEL) = (id(*)(id, SEL))info1; id val = fptr(self, (SEL)info2); return val; } -static id idIvarGetFunc(void* info1, void* info2, id self) { - id* ptr = (id*)((char*)self + (int)info2); +static id idIvarGetFunc(void *info1, void *info2, id self) { + id *ptr = (id *)((char *)self + (unsigned long)info2); return *ptr; } @@ -1095,7 +1097,7 @@ static void idMethodSetFunc(void* info1, void* info2, id self, id val) { static void idIvarSetFunc(void* info1, void* info2, id self, id val) { - id* ptr = (id*)((char*)self + (int)info2); + id *ptr = (id *)((char*)self + (unsigned long)info2); ASSIGN(*ptr, val); } @@ -1110,19 +1112,19 @@ static id charMethodGetFunc(void* info1, void* info2, id self) static id charIvarGetFunc(void* info1, void* info2, id self) { - char* ptr = (char*)((char*)self + (int)info2); + char *ptr = (char *)((char *)self + (unsigned long)info2); return [NumberClass numberWithChar:*ptr]; } -static void charMethodSetFunc(void* info1, void* info2, id self, id val) +static void charMethodSetFunc(void *info1, void *info2, id self, id val) { void (*fptr)(id, SEL, char) = (void(*)(id, SEL, char))info1; fptr(self, (SEL)info2, [val charValue]); } -static void charIvarSetFunc(void* info1, void* info2, id self, id val) +static void charIvarSetFunc(void *info1, void *info2, id self, id val) { - char* ptr = (char*)((char*)self + (int)info2); + char *ptr = (char *)((char *)self + (unsigned long)info2); *ptr = [val charValue]; } @@ -1138,7 +1140,7 @@ static id unsignedCharMethodGetFunc(void* info1, void* info2, id self) static id unsignedCharIvarGetFunc(void* info1, void* info2, id self) { - unsigned char* ptr = (unsigned char*)((char*)self + (int)info2); + unsigned char *ptr = (unsigned char *)((char *)self + (unsigned long)info2); return [NumberClass numberWithUnsignedChar:*ptr]; } @@ -1150,7 +1152,7 @@ static void unsignedCharMethodSetFunc(void* info1, void* info2, id self, id val) static void unsignedCharIvarSetFunc(void* info1, void* info2, id self, id val) { - unsigned char* ptr = (unsigned char*)((char*)self + (int)info2); + unsigned char *ptr = (unsigned char *)((char *)self + (unsigned long)info2); *ptr = [val unsignedCharValue]; } @@ -1166,7 +1168,7 @@ static id shortMethodGetFunc(void* info1, void* info2, id self) static id shortIvarGetFunc(void* info1, void* info2, id self) { - short* ptr = (short*)((char*)self + (int)info2); + short *ptr = (short *)((char *)self + (unsigned long)info2); return [NumberClass numberWithShort:*ptr]; } @@ -1178,7 +1180,7 @@ static void shortMethodSetFunc(void* info1, void* info2, id self, id val) static void shortIvarSetFunc(void* info1, void* info2, id self, id val) { - short* ptr = (short*)((char*)self + (int)info2); + short *ptr = (short *)((char *)self + (unsigned long)info2); *ptr = [val shortValue]; } @@ -1194,7 +1196,7 @@ static id unsignedShortMethodGetFunc(void* info1, void* info2, id self) static id unsignedShortIvarGetFunc(void* info1, void* info2, id self) { - unsigned short* ptr = (unsigned short*)((char*)self + (int)info2); + unsigned short *ptr = (unsigned short*)((char *)self + (unsigned long)info2); return [NumberClass numberWithUnsignedShort:*ptr]; } @@ -1206,7 +1208,7 @@ static void unsignedShortMethodSetFunc(void* info1, void* info2, id self, id val static void unsignedShortIvarSetFunc(void* info1, void* info2, id self, id val) { - unsigned short* ptr = (unsigned short*)((char*)self + (int)info2); + unsigned short *ptr = (unsigned short*)((char *)self + (unsigned long)info2); *ptr = [val unsignedShortValue]; } @@ -1220,9 +1222,9 @@ static id intMethodGetFunc(void* info1, void* info2, id self) return [NumberClass numberWithInt:val]; } -static id intIvarGetFunc(void* info1, void* info2, id self) +static id intIvarGetFunc(void *info1, void *info2, id self) { - int* ptr = (int*)((char*)self + (int)info2); + int *ptr = (int *)((char *)self + (unsigned long)info2); return [NumberClass numberWithInt:*ptr]; } @@ -1234,7 +1236,7 @@ static void intMethodSetFunc(void* info1, void* info2, id self, id val) static void intIvarSetFunc(void* info1, void* info2, id self, id val) { - int* ptr = (int*)((char*)self + (int)info2); + int *ptr = (int *)((char *)self + (unsigned long)info2); *ptr = [val intValue]; } @@ -1250,7 +1252,7 @@ static id unsignedIntMethodGetFunc(void* info1, void* info2, id self) static id unsignedIntIvarGetFunc(void* info1, void* info2, id self) { - unsigned int* ptr = (unsigned int*)((char*)self + (int)info2); + unsigned int* ptr = (unsigned int*)((char*)self + (unsigned long)info2); return [NumberClass numberWithUnsignedInt:*ptr]; } @@ -1262,7 +1264,7 @@ static void unsignedIntMethodSetFunc(void* info1, void* info2, id self, id val) static void unsignedIntIvarSetFunc(void* info1, void* info2, id self, id val) { - unsigned int* ptr = (unsigned int*)((char*)self + (int)info2); + unsigned int* ptr = (unsigned int*)((char*)self + (unsigned long)info2); *ptr = [val unsignedIntValue]; } @@ -1278,7 +1280,7 @@ static id longMethodGetFunc(void* info1, void* info2, id self) static id longIvarGetFunc(void* info1, void* info2, id self) { - long* ptr = (long*)((char*)self + (int)info2); + long* ptr = (long*)((char*)self + (unsigned long)info2); return [NumberClass numberWithLong:*ptr]; } @@ -1290,7 +1292,7 @@ static void longMethodSetFunc(void* info1, void* info2, id self, id val) static void longIvarSetFunc(void* info1, void* info2, id self, id val) { - long* ptr = (long*)((char*)self + (int)info2); + long* ptr = (long*)((char*)self + (unsigned long)info2); *ptr = [val longValue]; } @@ -1304,7 +1306,7 @@ static id unsignedLongMethodGetFunc(void* info1, void* info2, id self) { } static id unsignedLongIvarGetFunc(void* info1, void* info2, id self) { - unsigned long* ptr = (unsigned long*)((char*)self + (int)info2); + unsigned long* ptr = (unsigned long*)((char*)self + (unsigned long)info2); return [NumberClass numberWithUnsignedLong:*ptr]; } @@ -1314,7 +1316,7 @@ static void unsignedLongMethodSetFunc(void* info1, void* info2, id self, id val) } static void unsignedLongIvarSetFunc(void* info1, void* info2, id self, id val) { - unsigned long* ptr = (unsigned long*)((char*)self + (int)info2); + unsigned long* ptr = (unsigned long*)((char*)self + (unsigned long)info2); *ptr = [val unsignedLongValue]; } @@ -1328,7 +1330,7 @@ static id longLongMethodGetFunc(void* info1, void* info2, id self) { } static id longLongIvarGetFunc(void* info1, void* info2, id self) { - long long* ptr = (long long*)((char*)self + (int)info2); + long long* ptr = (long long*)((char*)self + (unsigned long)info2); return [NumberClass numberWithLongLong:*ptr]; } @@ -1338,7 +1340,7 @@ static void longLongMethodSetFunc(void* info1, void* info2, id self, id val) { } static void longLongIvarSetFunc(void* info1, void* info2, id self, id val) { - long long* ptr = (long long*)((char*)self + (int)info2); + long long* ptr = (long long*)((char*)self + (unsigned long)info2); *ptr = [val longLongValue]; } @@ -1352,7 +1354,7 @@ static id unsignedLongLongMethodGetFunc(void* info1, void* info2, id self) { } static id unsignedLongLongIvarGetFunc(void* info1, void* info2, id self) { - unsigned long long* ptr = (unsigned long long*)((char*)self + (int)info2); + unsigned long long* ptr = (unsigned long long*)((char*)self + (unsigned long)info2); return [NumberClass numberWithUnsignedLongLong:*ptr]; } @@ -1362,7 +1364,7 @@ static void unsignedLongLongMethodSetFunc(void* info1, void* info2, id self, id } static void unsignedLongLongIvarSetFunc(void* info1, void* info2, id self, id val) { - unsigned long long* ptr = (unsigned long long*)((char*)self + (int)info2); + unsigned long long* ptr = (unsigned long long*)((char*)self + (unsigned long)info2); *ptr = [val unsignedLongLongValue]; } @@ -1376,7 +1378,7 @@ static id floatMethodGetFunc(void* info1, void* info2, id self) { } static id floatIvarGetFunc(void* info1, void* info2, id self) { - float* ptr = (float*)((char*)self + (int)info2); + float* ptr = (float*)((char*)self + (unsigned long)info2); return [NumberClass numberWithFloat:*ptr]; } @@ -1386,7 +1388,7 @@ static void floatMethodSetFunc(void* info1, void* info2, id self, id val) { } static void floatIvarSetFunc(void* info1, void* info2, id self, id val) { - float* ptr = (float*)((char*)self + (int)info2); + float* ptr = (float*)((char*)self + (unsigned long)info2); *ptr = [val floatValue]; } @@ -1400,7 +1402,7 @@ static id doubleMethodGetFunc(void* info1, void* info2, id self) { } static id doubleIvarGetFunc(void* info1, void* info2, id self) { - double* ptr = (double*)((char*)self + (int)info2); + double* ptr = (double*)((char*)self + (unsigned long)info2); return [NumberClass numberWithDouble:*ptr]; } @@ -1410,7 +1412,7 @@ static void doubleMethodSetFunc(void* info1, void* info2, id self, id val) { } static void doubleIvarSetFunc(void* info1, void* info2, id self, id val) { - double* ptr = (double*)((char*)self + (int)info2); + double* ptr = (double*)((char*)self + (unsigned long)info2); *ptr = [val doubleValue]; } diff --git a/sope-core/EOControl/EOQualifierParser.m b/sope-core/EOControl/EOQualifierParser.m index 52321db4..5f228670 100644 --- a/sope-core/EOControl/EOQualifierParser.m +++ b/sope-core/EOControl/EOQualifierParser.m @@ -587,7 +587,8 @@ static EOQualifier *_parseKeyCompQualifier(id _ctx, const char *_buf, unsigned pos = 0; BOOL valueIsKey = NO; - dict = [_ctx resultForFunction:@"parseKeyCompQualifier" atPos:(unsigned)_buf]; + dict = [_ctx resultForFunction:@"parseKeyCompQualifier" + atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) NSLog(@"_parseKeyCompQual return <%@> [cached] for <%s> ", dict, _buf); @@ -655,7 +656,7 @@ static EOQualifier *_parseKeyCompQualifier(id _ctx, const char *_buf, [_ctx setResult: [NSDictionary dictionaryWithObjects:values forKeys:keys count:2] forFunction:@"parseKeyCompQualifier" - atPos:(unsigned)_buf]; + atPos:(unsigned long)_buf]; *_qualLen = pos; } return qual; @@ -735,7 +736,7 @@ static NSString *_parseKey(id _ctx, const char *_buf, unsigned _bufLen, if (qDebug) NSLog(@"%s: _bufLen == 0 --> return nil", __PRETTY_FUNCTION__); return nil; } - dict = [_ctx resultForFunction:@"parseKey" atPos:(unsigned)_buf]; + dict = [_ctx resultForFunction:@"parseKey" atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) { NSLog(@"%s: return <%@> [cached] for <%s> ", __PRETTY_FUNCTION__, @@ -809,7 +810,7 @@ static NSString *_parseKey(id _ctx, const char *_buf, unsigned _bufLen, [_ctx setResult: [NSDictionary dictionaryWithObjects:values forKeys:keys count:2] forFunction:@"parseKey" - atPos:(unsigned)_buf]; + atPos:(unsigned long)_buf]; *_keyLen = pos; } return result; @@ -832,7 +833,7 @@ static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen, return nil; } - dict = [_ctx resultForFunction:@"parseValue" atPos:(unsigned)_buf]; + dict = [_ctx resultForFunction:@"parseValue" atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) { NSLog(@"_parseKeyCompQualifier return <%@> [cached] for <%s> ", @@ -1092,7 +1093,7 @@ static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen, keys[1] = @"object"; values[1] = obj; d = [[NSDictionary alloc] initWithObjects:values forKeys:keys count:2]; - [_ctx setResult:d forFunction:@"parseValue" atPos:(unsigned)_buf]; + [_ctx setResult:d forFunction:@"parseValue" atPos:(unsigned long)_buf]; [d release]; *_keyLen = pos; } diff --git a/sope-core/EOControl/EOSortOrdering.m b/sope-core/EOControl/EOSortOrdering.m index 7d3ac07d..1611e705 100644 --- a/sope-core/EOControl/EOSortOrdering.m +++ b/sope-core/EOControl/EOSortOrdering.m @@ -209,7 +209,7 @@ static int keyOrderComparator(id o1, id o2, EOSortOrderingContext *context) { else if ((ccmp = (void *)[v1 methodForSelector:sel])) result = ccmp(v1, sel, v2); else - result = (int)[v1 performSelector:sel withObject:v2]; + result = (unsigned long)[v1 performSelector:sel withObject:v2]; if (result != NSOrderedSame) return result; diff --git a/sope-core/EOControl/GNUmakefile.preamble b/sope-core/EOControl/GNUmakefile.preamble index d4cdb0f9..5a4c19dd 100644 --- a/sope-core/EOControl/GNUmakefile.preamble +++ b/sope-core/EOControl/GNUmakefile.preamble @@ -4,7 +4,11 @@ libEOControl_INCLUDE_DIRS += -I.. ADDITIONAL_CPPFLAGS += -Wall -funsigned-char +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 +else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib +endif # libFoundation, gstep-base diff --git a/sope-core/EOControl/Version b/sope-core/EOControl/Version index 81e751c7..bfe96d59 100644 --- a/sope-core/EOControl/Version +++ b/sope-core/EOControl/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=65 +SUBMINOR_VERSION:=66 diff --git a/sope-core/EOControl/fhs.make b/sope-core/EOControl/fhs.make index 20db66d2..ce5de3b6 100644 --- a/sope-core/EOControl/fhs.make +++ b/sope-core/EOControl/fhs.make @@ -8,6 +8,12 @@ FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ +else +FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ +endif + fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libEOControl_HEADER_FILES_INSTALL_DIR) diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index c947cc9a..19f29486 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,7 @@ +2006-07-04 Helge Hess + + * 64bit fixes (v4.5.185) + 2006-07-03 Helge Hess * v4.5.184 diff --git a/sope-core/NGExtensions/FdExt.subproj/NSAutoreleasePool+misc.m b/sope-core/NGExtensions/FdExt.subproj/NSAutoreleasePool+misc.m index c578bc4a..4421dee1 100644 --- a/sope-core/NGExtensions/FdExt.subproj/NSAutoreleasePool+misc.m +++ b/sope-core/NGExtensions/FdExt.subproj/NSAutoreleasePool+misc.m @@ -105,12 +105,13 @@ BOOL __autoreleaseEnableRetainRemove = NO; // check if retainCount is Ok if (__autoreleaseEnableCheck) { - unsigned int toCome = [NSAutoreleasePool autoreleaseCountForObject:self]; - if (toCome+1 > [self retainCount]) { + unsigned int toCome = + [NSAutoreleasePool autoreleaseCountForObject:self]; + if (toCome + 1 > [self retainCount]) { NSLog(@"Release[0x%p<%@>] release check for object %@ " @"has %d references " @"and %d pending calls to release in autorelease pools\n", - (unsigned)self, NSStringFromClass([self class]), + self, NSStringFromClass([self class]), self, [self retainCount], toCome); NSLog(@" description='%@'", [self description]); diff --git a/sope-core/NGExtensions/NGBitSet.m b/sope-core/NGExtensions/NGBitSet.m index effd5729..64428702 100644 --- a/sope-core/NGExtensions/NGBitSet.m +++ b/sope-core/NGExtensions/NGBitSet.m @@ -319,7 +319,7 @@ - (NSString *)description { return [NSString stringWithFormat: @"", - (unsigned)self, self->universe, self->count, + self, self->universe, self->count, [[self toArray] description]]; } diff --git a/sope-core/NGExtensions/NGStack.m b/sope-core/NGExtensions/NGStack.m index f2cd2c25..fda86b6b 100644 --- a/sope-core/NGExtensions/NGStack.m +++ b/sope-core/NGExtensions/NGStack.m @@ -221,7 +221,7 @@ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] capacity=%u SP=%u count=%u content=%s>", - NSStringFromClass([self class]), (unsigned)self, + NSStringFromClass([self class]), self, [self capacity], [self stackPointer], [self count], [[[self toArray] description] cString]]; } diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 6cd27609..8ce1cdda 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=184 +SUBMINOR_VERSION:=185 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39 diff --git a/sope-core/NGExtensions/fhs.make b/sope-core/NGExtensions/fhs.make index e9d3ea5e..dfe220a0 100644 --- a/sope-core/NGExtensions/fhs.make +++ b/sope-core/NGExtensions/fhs.make @@ -5,9 +5,14 @@ ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ -FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ +else +FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ +endif + fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR)$(libNGExtensions_HEADER_FILES_INSTALL_DIR) diff --git a/sope-core/NGStreams/ChangeLog b/sope-core/NGStreams/ChangeLog index f9f12df0..10c26c59 100644 --- a/sope-core/NGStreams/ChangeLog +++ b/sope-core/NGStreams/ChangeLog @@ -1,3 +1,7 @@ +2006-07-04 Helge Hess + + * 64bit fixes (v4.5.51) + 2006-07-03 Helge Hess * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.50) diff --git a/sope-core/NGStreams/NGActiveSocket.m b/sope-core/NGStreams/NGActiveSocket.m index 841cb9cc..b1dbd77e 100644 --- a/sope-core/NGStreams/NGActiveSocket.m +++ b/sope-core/NGStreams/NGActiveSocket.m @@ -1097,8 +1097,7 @@ NSMutableString *d = [NSMutableString stringWithCapacity:64]; [d appendFormat:@"<%@[0x%p]: mode=%@ address=%@", - NSStringFromClass([self class]), - (unsigned)self, + NSStringFromClass([self class]), self, [self modeDescription], [self localAddress]]; if ([self isConnected]) diff --git a/sope-core/NGStreams/NGCharBuffer.m b/sope-core/NGStreams/NGCharBuffer.m index 0c74d2ac..23f3ac5e 100644 --- a/sope-core/NGStreams/NGCharBuffer.m +++ b/sope-core/NGStreams/NGCharBuffer.m @@ -60,7 +60,7 @@ typedef struct NGCharBufferLA { self->wasEOF = NO; if ([self->source respondsToSelector:@selector(methodForSelector:)]) { - self->readCharacter = + self->readCharacter = (unichar (*)(id, SEL)) [(NSObject *)self->source methodForSelector:@selector(readCharacter)]; } } @@ -130,9 +130,10 @@ typedef struct NGCharBufferLA { if (self->readCharacter == NULL) character = [self->source readCharacter]; - else - character = (int)self->readCharacter(self->source, - @selector(readCharacter)); + else { + character = self->readCharacter(self->source, + @selector(readCharacter)); + } ix = (self->headIdx + i) & self->sizeLessOne; self->la[ix].character = character; self->la[ix].isFetched = 1; @@ -181,15 +182,12 @@ typedef struct NGCharBufferLA { } } -// description +/* description */ - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p] source=%@ la=%d", - NSStringFromClass([self class]), - (unsigned)self, - self->source, - self->bufLen - ]; + NSStringFromClass([self class]), self, + self->source, self->bufLen]; } -@end +@end /* NGCharBuffer */ diff --git a/sope-core/NGStreams/NGDatagramPacket.m b/sope-core/NGStreams/NGDatagramPacket.m index 62ff0611..528efe3e 100644 --- a/sope-core/NGStreams/NGDatagramPacket.m +++ b/sope-core/NGStreams/NGDatagramPacket.m @@ -88,7 +88,7 @@ - (NSString *)description { return [NSString stringWithFormat:@"<%@[0x%p]: from=%@ to=%@ size=%i>", - NSStringFromClass([self class]), (unsigned)self, + NSStringFromClass([self class]), self, [self sender], [self receiver], [self packetSize]]; } diff --git a/sope-core/NGStreams/NGFileStream.m b/sope-core/NGStreams/NGFileStream.m index 72824b7a..c720ee64 100644 --- a/sope-core/NGStreams/NGFileStream.m +++ b/sope-core/NGStreams/NGFileStream.m @@ -635,7 +635,7 @@ static void _checkOpen(NGFileStream *self, NSString *_reason) { - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] path=%@ mode=%@>", - NSStringFromClass([self class]), (unsigned)self, + NSStringFromClass([self class]), self, self->systemPath ? self->systemPath : (NSString *)@"nil", [self modeDescription]]; } diff --git a/sope-core/NGStreams/NGFilterStream.m b/sope-core/NGStreams/NGFilterStream.m index 1b16f220..4394fe4c 100644 --- a/sope-core/NGStreams/NGFilterStream.m +++ b/sope-core/NGStreams/NGFilterStream.m @@ -148,12 +148,12 @@ [self doesNotRecognizeSelector:[_invocation selector]]; } -// description +/* description */ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] source=%@ mode=%@>", - NSStringFromClass([self class]), (unsigned)self, + NSStringFromClass([self class]), self, self->source ? (id)self->source : (id)@"nil", [self modeDescription]]; } diff --git a/sope-core/NGStreams/NGInternetSocketAddress.m b/sope-core/NGStreams/NGInternetSocketAddress.m index d029a9de..40efcfd5 100644 --- a/sope-core/NGStreams/NGInternetSocketAddress.m +++ b/sope-core/NGStreams/NGInternetSocketAddress.m @@ -125,10 +125,12 @@ static inline NSString *_nameOfLocalhost(void) { if (sockAddr->sin_addr.s_addr != 0) { // not a wildcard address #if !defined(HAVE_GETHOSTBYADDR_R) [systemLock lock]; - newHost = NSMapGet(nameCache, (void *)sockAddr->sin_addr.s_addr); + newHost = NSMapGet(nameCache, + (void *)(unsigned long)sockAddr->sin_addr.s_addr); #else [systemLock lock]; - newHost = NSMapGet(nameCache, (void *)sockAddr->sin_addr.s_addr); + newHost = NSMapGet(nameCache, + (void *)(unsigned long)sockAddr->sin_addr.s_addr); [systemLock unlock]; #endif if (newHost == nil) { @@ -213,7 +215,8 @@ static inline NSString *_nameOfLocalhost(void) { } else if (newHost) { /* add to cache */ - NSMapInsert(nameCache, (void *)sockAddr->sin_addr.s_addr, newHost); + NSMapInsert(nameCache, + (void *)(unsigned long)sockAddr->sin_addr.s_addr, newHost); } /* TODO: should also cache unknown IPs ! */ } @@ -517,8 +520,9 @@ static inline NSString *_nameOfLocalhost(void) { u_long *ia; ia = (u_long *)&(((struct sockaddr_in *)self->address)->sin_addr.s_addr); #else - unsigned int ia; - ia = (unsigned int)&(((struct sockaddr_in *)self->address)->sin_addr.s_addr); + unsigned long ia; + ia = (unsigned long) + &(((struct sockaddr_in *)self->address)->sin_addr.s_addr); #endif if (self->hostName == nil) /* wildcard */ diff --git a/sope-core/NGStreams/NGInternetSocketDomain.m b/sope-core/NGStreams/NGInternetSocketDomain.m index a95105ca..64ec2763 100644 --- a/sope-core/NGStreams/NGInternetSocketDomain.m +++ b/sope-core/NGStreams/NGInternetSocketDomain.m @@ -113,7 +113,7 @@ static NGInternetSocketDomain *domain = nil; /* description */ - (NSString *)description { - return [NSString stringWithFormat:@"", (unsigned)self]; + return [NSString stringWithFormat:@"", self]; } @end /* NGInternetSocketDomain */ diff --git a/sope-core/NGStreams/NGLocalSocketDomain.m b/sope-core/NGStreams/NGLocalSocketDomain.m index 4f854f1b..7668efeb 100644 --- a/sope-core/NGStreams/NGLocalSocketDomain.m +++ b/sope-core/NGStreams/NGLocalSocketDomain.m @@ -129,8 +129,7 @@ static NGLocalSocketDomain *domain = nil; /* description */ - (NSString *)description { - return [NSString stringWithFormat: - @"", (unsigned)self]; + return [NSString stringWithFormat:@"", self]; } @end /* NGLocalSocketDomain */ diff --git a/sope-core/NGStreams/NGSocket.m b/sope-core/NGStreams/NGSocket.m index 8ccf24df..609a4648 100644 --- a/sope-core/NGStreams/NGSocket.m +++ b/sope-core/NGStreams/NGSocket.m @@ -54,7 +54,7 @@ #elif __APPLE__ # define SockAddrLenType unsigned int #else -# define SockAddrLenType size_t +# define SockAddrLenType socklen_t #endif @implementation NGSocket @@ -597,12 +597,12 @@ static inline BOOL getBoolOption(id self, int _option) { return error; } -// description +/* description */ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p]: fd=%i type=%i bound=%@ domain=%@>", - NSStringFromClass([self class]), (unsigned)self, + NSStringFromClass([self class]), self, [self fileDescriptor], [self socketType], [self localAddress] ? [self localAddress] : (id)@"no", diff --git a/sope-core/NGStreams/NGStream.m b/sope-core/NGStreams/NGStream.m index 857f7fee..3081eed7 100644 --- a/sope-core/NGStreams/NGStream.m +++ b/sope-core/NGStreams/NGStream.m @@ -110,7 +110,7 @@ - (NSString *)description { return [NSString stringWithFormat: @"<%@[0x%p] mode=%@>", - NSStringFromClass([self class]), (unsigned)self, + NSStringFromClass([self class]), self, [self modeDescription]]; } diff --git a/sope-core/NGStreams/NGStreams/NGCharBuffer.h b/sope-core/NGStreams/NGStreams/NGCharBuffer.h index f3f02472..4a959441 100644 --- a/sope-core/NGStreams/NGStreams/NGCharBuffer.h +++ b/sope-core/NGStreams/NGStreams/NGCharBuffer.h @@ -1,5 +1,6 @@ /* - Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2000-2006 SKYRIX Software AG + Copyright (C) 2006 Helge Hess This file is part of SOPE. @@ -47,8 +48,8 @@ struct NGCharBufferLA; BOOL wasEOF; int headIdx; int sizeLessOne; - - IMP readCharacter; + + unichar (*readCharacter)(id, SEL); } + (id)charBufferWithSource:(id)_source la:(int)_la; diff --git a/sope-core/NGStreams/Version b/sope-core/NGStreams/Version index f7227d67..b8f0fed5 100644 --- a/sope-core/NGStreams/Version +++ b/sope-core/NGStreams/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=50 +SUBMINOR_VERSION:=51