Encoding/decoding fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16417 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-04-10 16:26:09 +00:00
parent e9b6860374
commit edfa212583
4 changed files with 62 additions and 109 deletions

View file

@ -292,34 +292,22 @@ static Class NSMutableDataMallocClass;
case _C_STRUCT_B:
{
int offset = 0;
struct objc_struct_layout layout;
if (_initialPass == NO)
{
(*_tagImp)(_dst, tagSel, _GSC_STRUCT_B);
}
while (*type != _C_STRUCT_E && *type++ != '='); /* skip "<name>=" */
for (;;)
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
(*_eValImp)(self, eValSel, type, (char*)buf + offset);
offset += objc_sizeof_type(type);
type = objc_skip_typespec(type);
if (*type == _C_STRUCT_E)
{
break;
}
else
{
int align = objc_alignof_type(type);
int rem = offset % align;
int offset;
int align;
const char *ftype;
if (rem != 0)
{
offset += align - rem;
}
}
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);
(*_eValImp)(self, eValSel, ftype, (char*)buf + offset);
}
}
return;