git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4498 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-06-30 19:41:03 +00:00
parent e9407298cc
commit b839197599
3 changed files with 22 additions and 10 deletions

View file

@ -1,3 +1,8 @@
Wed Jun 30 20:55:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/PropList.h: Tidied for garbage collection.
* Source/include/Unicode.h: Added missing prototyp.
Tue Jun 29 17:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
Patches by Hai Henningsen

View file

@ -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 */

View file

@ -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;
}