Commit a0710922 authored by Claes Sjofors's avatar Claes Sjofors

Alignment bugfix class array attributes

parent 5097b8de
...@@ -178,7 +178,7 @@ int CnvWblToH::body_exec() ...@@ -178,7 +178,7 @@ int CnvWblToH::body_exec()
char struct_name[80]; char struct_name[80];
attr_count = 0; attr_count = 0;
attr_next_alignlw = 0; attr_next_alignlw = 1; // Align first attribute on longword
if ( strcmp( CnvCtx::low( ctx->rw->body_name), "devbody") == 0) { if ( strcmp( CnvCtx::low( ctx->rw->body_name), "devbody") == 0) {
if ( ctx->hpp) if ( ctx->hpp)
......
This diff is collapsed.
...@@ -2026,6 +2026,9 @@ bool wb_vrepced::buildClass( pwr_tStatus *sts, wb_orep *co) ...@@ -2026,6 +2026,9 @@ bool wb_vrepced::buildClass( pwr_tStatus *sts, wb_orep *co)
ao = next_ao; ao = next_ao;
} }
// Align body size on longword
offset = pwr_AlignLW( offset);
// Store data in Body object // Store data in Body object
m_vrep->writeAttribute( sts, bo, pwr_eBix_sys, offsetof( pwr_sObjBodyDef, Size), m_vrep->writeAttribute( sts, bo, pwr_eBix_sys, offsetof( pwr_sObjBodyDef, Size),
sizeof(offset), &offset); sizeof(offset), &offset);
...@@ -2577,7 +2580,7 @@ void wb_vrepced::printStructFile( bool hpp) ...@@ -2577,7 +2580,7 @@ void wb_vrepced::printStructFile( bool hpp)
} }
bool attr_found = false; bool attr_found = false;
int attr_next_alignlw = 0; int attr_next_alignlw = 1; // Align first attribute on longword
for ( o_adef = o_bdef->first( &sts); ODD(sts);) { for ( o_adef = o_bdef->first( &sts); ODD(sts);) {
o_adef->ref(); o_adef->ref();
......
...@@ -868,6 +868,9 @@ void wb_wblnode::buildObjBodyDef( ref_wblnode classdef) ...@@ -868,6 +868,9 @@ void wb_wblnode::buildObjBodyDef( ref_wblnode classdef)
child->buildBuffer( classdef, this, &index, &o->b.size); child->buildBuffer( classdef, this, &index, &o->b.size);
child = child->o->fws; child = child->o->fws;
} }
// Align body size on longword
o->b.size = pwr_AlignLW(o->b.size);
((pwr_sObjBodyDef *)o->rbody)->Size = o->b.size; ((pwr_sObjBodyDef *)o->rbody)->Size = o->b.size;
((pwr_sObjBodyDef *)o->rbody)->NumOfParams = index; ((pwr_sObjBodyDef *)o->rbody)->NumOfParams = index;
} }
......
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