Commit 333c3122 authored by Claes Sjofors's avatar Claes Sjofors

Wbl fix for arrays of pointers, type set to UInt64 in structfile to get correct alignment

parent 9a4ed97e
......@@ -601,20 +601,22 @@ int CnvWblToH::attribute_exec()
if ( ctx->rw->attr_array && ctx->rw->attr_pointer)
{
// Should be "'typename' *" which is changed to "pwr_tUInt64 "
// to get correct alignment for elements
fp_struct <<
" " << type_name;
" " << "pwr_tUInt64";
if ( !ctx->common_structfile_only)
cstruc->f <<
" " << type_name;
for ( i = 0; i < int(35 - strlen(type_name)); i++)
" " << "pwr_tUInt64";
for ( i = 0; i < int(35 - strlen("pwr_tUInt64")); i++)
{
fp_struct << ' ';
if ( !ctx->common_structfile_only)
cstruc->f << ' ';
}
fp_struct << " *" << pgmname << "[" << ctx->rw->attr_elements << "]" << alignstr << ";" << endl;
fp_struct << " " << pgmname << "[" << ctx->rw->attr_elements << "]" << alignstr << ";" << endl;
if ( !ctx->common_structfile_only)
cstruc->f << " *" << pgmname << "[" << ctx->rw->attr_elements << "]" << alignstr << ";" << endl;
cstruc->f << " " << pgmname << "[" << ctx->rw->attr_elements << "]" << alignstr << ";" << endl;
}
else if ( ctx->rw->attr_array)
{
......
......@@ -972,7 +972,7 @@ void wb_wblnode::buildAttribute( ref_wblnode classdef, ref_wblnode objbodydef,
o->a.type = ((pwr_sParam *)o->rbody)->Info.Type = type;
if ( o->a.flags & pwr_mAdef_pointer) {
size = sizeof( void *);
size = pwr_AlignLW(sizeof( void *));
// Align pointers on longword
*boffset = pwr_AlignLW(*boffset);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment