From fde97b451f6f53302fc708f75da51235be52ef8e Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 30 Jun 1999 19:41:03 +0000 Subject: [PATCH] Tidying git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4498 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Headers/gnustep/base/Unicode.h | 2 ++ Source/propList.h | 25 +++++++++++++++---------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index e66adb949..463035e09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jun 30 20:55:00 1999 Richard Frith-Macdonald + + * Source/PropList.h: Tidied for garbage collection. + * Source/include/Unicode.h: Added missing prototyp. + Tue Jun 29 17:50:00 1999 Richard Frith-Macdonald Patches by Hai Henningsen diff --git a/Headers/gnustep/base/Unicode.h b/Headers/gnustep/base/Unicode.h index fd4c99815..6b74293a6 100644 --- a/Headers/gnustep/base/Unicode.h +++ b/Headers/gnustep/base/Unicode.h @@ -37,5 +37,7 @@ unichar uni_toupper(unichar ch); unsigned char uni_cop(unichar u); BOOL uni_isnonsp(unichar u); unichar *uni_is_decomp(unichar u); +int encode_strtoustr(unichar* u1,const char*s1,int size, NSStringEncoding enc); + #endif /* __Unicode_h_OBJECTS_INCLUDE */ diff --git a/Source/propList.h b/Source/propList.h index 5f969801b..fa3c3f40f 100644 --- a/Source/propList.h +++ b/Source/propList.h @@ -36,7 +36,7 @@ static void setupHexdigits() { hexdigits = [NSCharacterSet characterSetWithCharactersInString: @"0123456789abcdef"]; - [hexdigits retain]; + RETAIN(hexdigits); hexdigitsImp = (BOOL(*)(id,SEL,unichar)) [hexdigits methodForSelector: cMemberSel]; } @@ -50,11 +50,12 @@ static void setupQuotables() { NSMutableCharacterSet *s; - s = (NSMutableCharacterSet*)[NSMutableCharacterSet - characterSetWithCharactersInString: - @"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz$./_"]; + s = [[NSCharacterSet characterSetWithCharactersInString: + @"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz$./_"] + mutableCopy]; [s invert]; quotables = [s copy]; + RELEASE(s); quotablesImp = (BOOL(*)(id,SEL,unichar)) [quotables methodForSelector: cMemberSel]; } @@ -66,13 +67,9 @@ static void setupWhitespce() { if (whitespce == nil) { -#if 0 - whitespce = [NSCharacterSet whitespaceAndNewlineCharacterSet]; -#else - whitespce = [NSMutableCharacterSet characterSetWithCharactersInString: + whitespce = [NSCharacterSet characterSetWithCharactersInString: @" \t\r\n\f\b"]; -#endif - [whitespce retain]; + RETAIN(whitespce); whitespceImp = (BOOL(*)(id,SEL,unichar)) [whitespce methodForSelector: cMemberSel]; } @@ -88,7 +85,9 @@ static Class plDictionary; static id (*plSet)(id, SEL, id, id); static id (*plInit)(id, SEL, void*, unsigned) = 0; static id (*plAlloc)(Class, SEL, NSZone*); +#ifndef GS_WITH_GC static id (*plAutorelease)(id, SEL); +#endif #if GSPLUNI static SEL plSel = @selector(initWithCharacters:length:); #else @@ -104,8 +103,10 @@ static void setupPl(Class c) [c methodForSelector: @selector(allocWithZone:)]; plInit = (id (*)(id, SEL, void*, unsigned)) [c instanceMethodForSelector: plSel]; +#ifndef GS_WITH_GC plAutorelease = (id (*)(id, SEL)) [c instanceMethodForSelector: @selector(autorelease)]; +#endif plArray = [NSGMutableArray class]; plAdd = (id (*)(id, SEL, id)) [plArray instanceMethodForSelector: @selector(addObject:)]; @@ -356,7 +357,9 @@ static inline id parseQuotedString(pldata* pld) } obj = (*plAlloc)(plCls, @selector(allocWithZone:), NSDefaultMallocZone()); obj = (*plInit)(obj, plSel, (void*)chars, pld->pos - start - shrink); +#ifndef GS_WITH_GC (*plAutorelease)(obj, @selector(autorelease)); +#endif } pld->pos++; return obj; @@ -376,7 +379,9 @@ static inline id parseUnquotedString(pldata *pld) } obj = (*plAlloc)(plCls, @selector(allocWithZone:), NSDefaultMallocZone()); obj = (*plInit)(obj, plSel, (void*)&pld->ptr[start], pld->pos-start); +#ifndef GS_WITH_GC (*plAutorelease)(obj, @selector(autorelease)); +#endif return obj; }