Tidied encoding/decoding

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6824 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2000-06-27 16:18:02 +00:00
parent 707c63f904
commit b53e8a667e
5 changed files with 109 additions and 108 deletions

View file

@ -956,20 +956,28 @@ mapClassName(NSUnarchiverObjectInfo *info)
{
void *b;
NSData *d;
NSZone *z;
b = NSZoneMalloc(zone, l);
d = [[NSData allocWithZone: zone] initWithBytesNoCopy: b
length: l
fromZone: zone];
IF_NO_GC(AUTORELEASE(d));
#if GS_WITH_GC
z = GSAtomicMallocZone();
#else
z = zone;
#endif
b = NSZoneMalloc(z, l);
[self decodeArrayOfObjCType: @encode(unsigned char)
count: l
at: b];
d = [[NSData allocWithZone: zone] initWithBytesNoCopy: b
length: l
fromZone: z];
IF_NO_GC(AUTORELEASE(d));
return d;
}
else
[NSException raise: NSInternalInconsistencyException
format: @"Decoding data object with unknown type"];
{
[NSException raise: NSInternalInconsistencyException
format: @"Decoding data object with unknown type"];
}
}
return [NSData data];
}