diff --git a/ChangeLog b/ChangeLog index 349f8e064..01ef9cce1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-11-09 Richard Frith-Macdonald + + * Source/NSObject.m: use NSString implementation of + ([descriptionWithLocale:indent:to:]) + 2002-11-07 02:21 Alexander Malmberg * Source/GSString.m: (-makeImmutableCopyOnFail:): Set isa to correct diff --git a/Source/GSAttributedString.m b/Source/GSAttributedString.m index 270d6ad17..aa63eea9c 100644 --- a/Source/GSAttributedString.m +++ b/Source/GSAttributedString.m @@ -253,11 +253,11 @@ static SEL oatSel; static SEL remSel; static IMP infImp; -static void (*addImp)(); -static unsigned (*cntImp)(); -static void (*insImp)(); +static void (*addImp)(NSMutableArray*,SEL,id); +static unsigned (*cntImp)(NSArray*,SEL); +static void (*insImp)(NSMutableArray*,SEL,id,unsigned); static IMP oatImp; -static void (*remImp)(); +static void (*remImp)(NSMutableArray*,SEL,unsigned); #define NEWINFO(Z,O,L) ((*infImp)(infCls, infSel, (Z), (O), (L))) #define ADDOBJECT(O) ((*addImp)(_infoArray, addSel, (O))) @@ -265,7 +265,7 @@ static void (*remImp)(); #define OBJECTAT(I) ((*oatImp)(_infoArray, oatSel, (I))) #define REMOVEAT(I) ((*remImp)(_infoArray, remSel, (I))) -static void _setup() +static void _setup(void) { if (infCls == 0) { @@ -286,11 +286,13 @@ static void _setup() a = [NSMutableArray allocWithZone: NSDefaultMallocZone()]; a = [a initWithCapacity: 1]; - addImp = (void (*)())[a methodForSelector: addSel]; - cntImp = (unsigned (*)())[a methodForSelector: cntSel]; - insImp = (void (*)())[a methodForSelector: insSel]; + addImp = (void (*)(NSMutableArray*,SEL,id))[a methodForSelector: addSel]; + cntImp = (unsigned (*)(NSArray*,SEL))[a methodForSelector: cntSel]; + insImp = (void (*)(NSMutableArray*,SEL,id,unsigned)) + [a methodForSelector: insSel]; oatImp = [a methodForSelector: oatSel]; - remImp = (void (*)())[a methodForSelector: remSel]; + remImp = (void (*)(NSMutableArray*,SEL,unsigned)) + [a methodForSelector: remSel]; RELEASE(a); d = [NSDictionary new]; blank = cacheAttributes(d); diff --git a/Source/Makefile.preamble b/Source/Makefile.preamble index 47a677e28..b630f6c56 100644 --- a/Source/Makefile.preamble +++ b/Source/Makefile.preamble @@ -41,10 +41,10 @@ # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS = $(DEFS) $(CONFIG_SYSTEM_DEFS) -Wall \ -Wcast-align \ +#-Wstrict-prototypes \ #-Wpointer-arith \ #-Wcast-qual \ #-Wwrite-strings \ -#-Wstrict-prototypes \ #-Wmissing-prototypes \ #-Wmissing-declarations \ #-Wredundant-decls \ diff --git a/Source/NSConcreteNumber.m b/Source/NSConcreteNumber.m index f00289c1d..6be82cec6 100644 --- a/Source/NSConcreteNumber.m +++ b/Source/NSConcreteNumber.m @@ -84,7 +84,7 @@ - (id) initWithBytes: (const void*)value objCType: (const char*)type { typedef __typeof__(data) _dt; - data = *(_dt*)value; + data = *(const _dt*)value; return self; } diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index c0f0445c0..e3f8224b4 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -46,6 +46,8 @@ @class GSDictionary; @class GSMutableDictionary; +extern BOOL GSMacOSXCompatiblePropertyLists(void); + static Class NSArray_class; static Class NSDictionaryClass; static Class NSMutableDictionaryClass; @@ -738,7 +740,6 @@ compareIt(id o1, id o2, void* context) */ - (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile { - extern BOOL GSMacOSXCompatiblePropertyLists(); NSDictionary *loc; NSString *desc; @@ -774,7 +775,6 @@ compareIt(id o1, id o2, void* context) */ - (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile { - extern BOOL GSMacOSXCompatiblePropertyLists(); NSDictionary *loc; NSString *desc; diff --git a/Source/NSException.m b/Source/NSException.m index 6cb401015..98fc101c9 100644 --- a/Source/NSException.m +++ b/Source/NSException.m @@ -91,7 +91,7 @@ static void _NSFoundationUncaughtExceptionHandler (NSException *exception) { BOOL a; - extern const char* GSArgZero(); + extern const char* GSArgZero(void); _NSUncaughtExceptionHandler = _preventRecursion; #if 1 diff --git a/Source/NSGeometry.m b/Source/NSGeometry.m index 590e22b7b..7c2dbbbfb 100644 --- a/Source/NSGeometry.m +++ b/Source/NSGeometry.m @@ -41,7 +41,7 @@ #include #include -extern BOOL GSMacOSXCompatibleGeometry(); // Compatibility mode +extern BOOL GSMacOSXCompatibleGeometry(void); // Compatibility mode static Class NSStringClass = 0; static Class NSScannerClass = 0; @@ -53,7 +53,7 @@ static BOOL (*scanStringImp)(NSScanner*, SEL, NSString*, NSString**); static id (*scannerImp)(Class, SEL, NSString*); static inline void -setupCache() +setupCache(void) { if (NSStringClass == 0) { diff --git a/Source/NSNotificationCenter.m b/Source/NSNotificationCenter.m index b625f048e..b1f408044 100644 --- a/Source/NSNotificationCenter.m +++ b/Source/NSNotificationCenter.m @@ -392,7 +392,7 @@ static void endNCTable(NCTable *t) TEST_RELEASE(t->_lock); } -static NCTable *newNCTable() +static NCTable *newNCTable(void) { NCTable *t; diff --git a/Source/NSNotificationQueue.m b/Source/NSNotificationQueue.m index 38dcd883c..81693aa70 100644 --- a/Source/NSNotificationQueue.m +++ b/Source/NSNotificationQueue.m @@ -83,7 +83,7 @@ typedef struct { @end static NotificationQueueList* -currentList() +currentList(void) { NotificationQueueList *list; NSMutableDictionary *d; diff --git a/Source/NSObject.m b/Source/NSObject.m index a18a95b77..5a7dc8047 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -769,12 +769,12 @@ static BOOL double_release_check_enabled = NO; { if (self == [NSObject class]) { - extern void GSBuildStrings(); // See externs.m - extern const char* GSSetLocaleC(); // See GSLocale.m + extern void GSBuildStrings(void); // See externs.m + extern const char* GSSetLocaleC(const char*); // See GSLocale.m #ifdef __MINGW__ // See libgnustep-base-entry.m - extern void gnustep_base_socket_init(); + extern void gnustep_base_socket_init(void); gnustep_base_socket_init(); #endif @@ -2018,24 +2018,24 @@ static BOOL double_release_check_enabled = NO; } /** - * The default (NSObject) implementation of this method simply calls - * the -descriptionWithLocale:indent: method and appends - * the value returned by that method to the output object. + * Uses the [NSString] implementation. */ - (void) descriptionWithLocale: (NSDictionary*)aLocale indent: (unsigned)level to: (id)output { - [output appendString: - [(id)self descriptionWithLocale: aLocale indent: level]]; + NSString *tmp = [(id)self descriptionWithLocale: aLocale]; + + [tmp descriptionWithLocale: aLocale indent: level to: output]; } + (void) descriptionWithLocale: (NSDictionary*)aLocale indent: (unsigned)level to: (id)output { - [output appendString: - [(id)self descriptionWithLocale: aLocale indent: level]]; + NSString *tmp = [(id)self descriptionWithLocale: aLocale]; + + [tmp descriptionWithLocale: aLocale indent: level to: output]; } - (BOOL) _dealloc diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index d109dd1f9..35bceec1e 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -615,7 +615,7 @@ int main(int argc, char *argv[], char *env[]) [gnustep_global_lock lock]; if (host == nil) { - extern NSTimeInterval GSTimeNow(); + extern NSTimeInterval GSTimeNow(void); pid = [self processIdentifier]; start = (unsigned long)GSTimeNow(); @@ -869,7 +869,7 @@ GSEnvironmentFlag(const char *name, BOOL def) * methods/functions which might cause a recursive exception. */ const char* -GSArgZero() +GSArgZero(void) { if (_gnu_arg_zero == 0) return ""; diff --git a/Source/NSRange.m b/Source/NSRange.m index f52e80779..2d00dadc5 100644 --- a/Source/NSRange.m +++ b/Source/NSRange.m @@ -44,7 +44,7 @@ static BOOL (*scanStringImp)(NSScanner*, SEL, NSString*, NSString**); static id (*scannerImp)(Class, SEL, NSString*); static inline void -setupCache() +setupCache(void) { if (NSStringClass == 0) { diff --git a/Source/NSSerializer.m b/Source/NSSerializer.m index e3f610417..ee103c4f9 100644 --- a/Source/NSSerializer.m +++ b/Source/NSSerializer.m @@ -112,11 +112,11 @@ typedef struct { typedef struct { NSMutableData *data; - void (*appImp)(); // Append to data. - void* (*datImp)(); // Bytes pointer. - unsigned int (*lenImp)(); // Length of data. - void (*serImp)(); // Serialize integer. - void (*setImp)(); // Set length of data. + void (*appImp)(NSData*,SEL,const void*,unsigned); + void* (*datImp)(NSMutableData*,SEL); // Bytes pointer. + unsigned int (*lenImp)(NSData*,SEL); // Length of data. + void (*serImp)(NSMutableData*,SEL,int); // Serialize integer. + void (*setImp)(NSMutableData*,SEL,unsigned); // Set length of data. unsigned count; // String counter. GSIMapTable_t map; // For uniquing. BOOL shouldUnique; // Do we do uniquing? @@ -135,11 +135,11 @@ initSerializerInfo(_NSSerializerInfo* info, NSMutableData *d, BOOL u) c = GSObjCClass(d); info->data = d; - info->appImp = (void (*)())get_imp(c, appSel); - info->datImp = (void* (*)())get_imp(c, datSel); - info->lenImp = (unsigned int (*)())get_imp(c, lenSel); - info->serImp = (void (*)())get_imp(c, serSel); - info->setImp = (void (*)())get_imp(c, setSel); + info->appImp = (void (*)(NSData*,SEL,const void*,unsigned))get_imp(c, appSel); + info->datImp = (void* (*)(NSMutableData*,SEL))get_imp(c, datSel); + info->lenImp = (unsigned int (*)(NSData*,SEL))get_imp(c, lenSel); + info->serImp = (void (*)(NSMutableData*,SEL,int))get_imp(c, serSel); + info->setImp = (void (*)(NSMutableData*,SEL,unsigned))get_imp(c, setSel); info->shouldUnique = u; (*info->appImp)(d, appSel, &info->shouldUnique, 1); if (u)