mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
707c63f904
commit
b53e8a667e
5 changed files with 109 additions and 108 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue