Make NSPropertyList.m use the temporary buffer macros, instead of reimplementing them.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32062 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2011-02-11 12:21:09 +00:00
parent 45c20425df
commit ef600d4917

View file

@ -1464,22 +1464,14 @@ PString(NSString *obj, NSMutableData *output)
else if ([obj rangeOfCharacterFromSet: oldQuotables].length > 0
|| [obj characterAtIndex: 0] == '/')
{
unichar tmp[length <= 1024 ? length : 0];
unichar *ustring;
unichar *from;
unichar *end;
unsigned char *ptr;
int base = [output length];
int len = 0;
GS_BEGINITEMBUF(tmp, (length * sizeof(unichar)), unichar)
if (length <= 1024)
{
ustring = tmp;
}
else
{
ustring = NSAllocateCollectable(sizeof(unichar) * length, 0);
}
end = &ustring[length];
[obj getCharacters: ustring];
for (from = ustring; from < end; from++)
@ -1581,10 +1573,7 @@ PString(NSString *obj, NSMutableData *output)
}
*ptr++ = '"';
if (ustring != tmp)
{
NSZoneFree(NSDefaultMallocZone(), ustring);
}
GS_ENDITEMBUF();
}
else
{