Commit d721c63b authored by claes's avatar claes

ConvertObject: arrays of attributeobjects wasn't handled

parent effa81d9
/* /*
* Proview $Id: wb_cdrep.cpp,v 1.33 2006-05-31 08:12:31 claes Exp $ * Proview $Id: wb_cdrep.cpp,v 1.34 2007-11-06 16:56:23 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -536,10 +536,21 @@ void wb_cdrep::convertSubClass( pwr_tCid cid, wb_merep *merep, ...@@ -536,10 +536,21 @@ void wb_cdrep::convertSubClass( pwr_tCid cid, wb_merep *merep,
} }
// Convert subclass // Convert subclass
if ( adrep_source->isArray()) {
for ( int j = 0; j < MIN(adrep_source->nElement(), adrep_target->nElement()); j++) {
convertSubClass( adrep_target->subClass(), merep,
(char *)body_source + adrep_source->offset() +
j * adrep_source->size() / adrep_source->nElement(),
(char *)body_target + adrep_target->offset() +
j * adrep_target->size() / adrep_target->nElement());
}
}
else {
convertSubClass( adrep_target->subClass(), merep, convertSubClass( adrep_target->subClass(), merep,
(char *)body_source + adrep_source->offset(), (char *)body_source + adrep_source->offset(),
(char *)body_target + adrep_target->offset()); (char *)body_target + adrep_target->offset());
} }
}
else { else {
// Convert attribute // Convert attribute
if ( adrep_source->type() == adrep_target->type()) { if ( adrep_source->type() == adrep_target->type()) {
...@@ -702,9 +713,20 @@ void wb_cdrep::convertObject( wb_merep *merep, void *rbody, void *dbody, ...@@ -702,9 +713,20 @@ void wb_cdrep::convertObject( wb_merep *merep, void *rbody, void *dbody,
continue; continue;
} }
// Convert subclass // Convert subclass
if ( adrep_source->isArray()) {
for ( int j = 0; j < MIN(adrep_source->nElement(), adrep_target->nElement()); j++) {
convertSubClass( adrep_target->subClass(), merep,
(char *)body_source + adrep_source->offset() +
j * adrep_source->size() / adrep_source->nElement(),
(char *)body_target + adrep_target->offset() +
j * adrep_target->size() / adrep_target->nElement());
}
}
else {
convertSubClass( adrep_target->subClass(), merep, convertSubClass( adrep_target->subClass(), merep,
(char *)body_source + adrep_source->offset(), (char *)body_source + adrep_source->offset(),
(char *)body_target + adrep_target->offset()); (char *)body_target + adrep_target->offset());
}
// Convert input and output mask // Convert input and output mask
if ( bix == pwr_eBix_dev && if ( bix == pwr_eBix_dev &&
......
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