revise archive format.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34832 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2012-02-27 20:07:05 +00:00
parent 3b76abbaae
commit 3aee9ca4ba
3 changed files with 93 additions and 12 deletions

View file

@ -531,12 +531,40 @@ static Class NSDataMallocClass;
{
NSUInteger i;
NSUInteger offset = 0;
NSUInteger size = (unsigned int)objc_sizeof_type(type);
unsigned int size = (unsigned int)objc_sizeof_type(type);
unsigned char info;
NSUInteger count;
(*tagImp)(src, tagSel, &info, 0, &cursor);
(*desImp)(src, desSel, &count, @encode(NSUInteger), &cursor, nil);
if ([self systemVersion] >= ((((1 * 100) + 24) * 100) + 1))
{
uint8_t c;
/* Unpack variable length count.
*/
count = 0;
for (;;)
{
count *= 128;
(*desImp)(src, desSel, &c, @encode(uint8_t), &cursor, nil);
if (c & 128)
{
count += (c & 127);
}
else
{
count += c;
break;
}
}
}
else
{
unsigned c;
(*desImp)(src, desSel, &c, @encode(unsigned), &cursor, nil);
count = c;
}
if (info != _GSC_ARY_B)
{
[NSException raise: NSInternalInconsistencyException
@ -545,7 +573,7 @@ static Class NSDataMallocClass;
if (count != expected)
{
[NSException raise: NSInternalInconsistencyException
format: @"expected array count %"PRIuPTR" and got %"PRIuPTR,
format: @"expected array count %u and got %u",
expected, count];
}
@ -1219,9 +1247,9 @@ static Class NSDataMallocClass;
- (NSData*) decodeDataObject
{
NSUInteger l;
unsigned l;
(*dValImp)(self, dValSel, @encode(NSUInteger), &l);
(*dValImp)(self, dValSel, @encode(unsigned int), &l);
if (l)
{
unsigned char c;