Commit 7f4c4fbe authored by Claes Sjofors's avatar Claes Sjofors

Wbl print fix when template objects are not found

parent ee821a34
...@@ -313,6 +313,7 @@ void wb_print_wbl::printClass(wb_volume& v, ...@@ -313,6 +313,7 @@ void wb_print_wbl::printClass(wb_volume& v,
printAttribute(v, attr2, tattr2, adef2, 0); printAttribute(v, attr2, tattr2, adef2, 0);
attr2 = attr2.after(); attr2 = attr2.after();
if ( tattr2.oddSts())
tattr2 = tattr2.after(); tattr2 = tattr2.after();
} }
} }
...@@ -530,11 +531,12 @@ void wb_print_wbl::printParameter(wb_volume& v, ...@@ -530,11 +531,12 @@ void wb_print_wbl::printParameter(wb_volume& v,
int varSize = adef.size() / nElement; int varSize = adef.size() / nElement;
char* valueb = (char *)attr.value(); char* valueb = (char *)attr.value();
char* val; char* val;
char* tvalueb = (char *)tattr.value(); char* tvalueb;
char* tval; char* tval;
char* svalp; char* svalp;
int varOffset; int varOffset;
bool parValOk; bool parValOk;
bool print_all = false;
const char* name = adef.subName(); const char* name = adef.subName();
if (valueb == NULL) { if (valueb == NULL) {
...@@ -549,9 +551,16 @@ void wb_print_wbl::printParameter(wb_volume& v, ...@@ -549,9 +551,16 @@ void wb_print_wbl::printParameter(wb_volume& v,
return; return;
} }
if ( attr == tattr) if ( tattr.evenSts()) {
// Template attribute not found, should not happen
tvalueb = (char *)calloc( 1, attr.size());
print_all = true;
}
else if ( attr == tattr)
// This is the template object itself, print all nonzero // This is the template object itself, print all nonzero
tvalueb = (char *)calloc( 1, tattr.size()); tvalueb = (char *)calloc( 1, tattr.size());
else
tvalueb = (char *)tattr.value();
for (int i = 0; i < nElement; i++) { for (int i = 0; i < nElement; i++) {
switch (adef.type()) { switch (adef.type()) {
...@@ -589,7 +598,7 @@ void wb_print_wbl::printParameter(wb_volume& v, ...@@ -589,7 +598,7 @@ void wb_print_wbl::printParameter(wb_volume& v,
val = valueb + varOffset; val = valueb + varOffset;
tval = tvalueb + varOffset; tval = tvalueb + varOffset;
if (memcmp(val, tval, varSize) == 0 && !(adef.flags() & PWR_MASK_ALWAYSWBL)) if (memcmp(val, tval, varSize) == 0 && !(adef.flags() & PWR_MASK_ALWAYSWBL) && !print_all)
continue; continue;
parValOk = printValue(v, adef, val, varSize, &svalp); parValOk = printValue(v, adef, val, varSize, &svalp);
...@@ -623,7 +632,7 @@ void wb_print_wbl::printParameter(wb_volume& v, ...@@ -623,7 +632,7 @@ void wb_print_wbl::printParameter(wb_volume& v,
break; break;
} }
} }
if ( attr == tattr) if ( tattr.evenSts() || attr == tattr)
free( tvalueb); free( tvalueb);
} }
......
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