mirror of
https://github.com/nasa/trick.git
synced 2025-02-21 17:36:42 +00:00
Ignore privacy
I moved the item size into the attribute structure itself. When moving this, I did not follow what was written before. The difference caused problems. Fixed it so the size written now matches what was written before. refs #218
This commit is contained in:
parent
54591ec005
commit
3ae6fc50e1
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include "PrintFileContents10.hh"
|
#include "PrintFileContents10.hh"
|
||||||
#include "FieldDescription.hh"
|
#include "FieldDescription.hh"
|
||||||
@ -80,10 +81,16 @@ void PrintFileContents10::print_field_attr(std::ofstream & outfile , FieldDescr
|
|||||||
outfile << " \"" << fdes->getDescription() << "\"," << std::endl ; // description
|
outfile << " \"" << fdes->getDescription() << "\"," << std::endl ; // description
|
||||||
outfile << " " << fdes->getIO() ; // io
|
outfile << " " << fdes->getIO() ; // io
|
||||||
outfile << "," << fdes->getEnumString() ; // type
|
outfile << "," << fdes->getEnumString() ; // type
|
||||||
|
// There are several cases when printing the size of a variable.
|
||||||
if ( fdes->isBitField() ) {
|
if ( fdes->isBitField() ) {
|
||||||
outfile << ",4" ; // size, bitfields are handled in 4 byte (32 bit) chunks
|
// bitfields are handled in 4 byte (32 bit) chunks
|
||||||
|
outfile << ",4" ;
|
||||||
|
} else if ( fdes->isRecord() or fdes->isEnum() or fdes->getTypeName().empty() ) {
|
||||||
|
// records enums use io_src_get_size. The sentinel has no typename
|
||||||
|
outfile << ",0" ;
|
||||||
} else {
|
} else {
|
||||||
outfile << "," << fdes->getFieldWidth() / 8 ; // size, size is saved in bits, convert to bytes.
|
// print size of the underlying type
|
||||||
|
outfile << ",sizeof(" << fdes->getTypeName() << ")" ;
|
||||||
}
|
}
|
||||||
outfile << ",0,0,Language_CPP" ; // range_min, range_max, language
|
outfile << ",0,0,Language_CPP" ; // range_min, range_max, language
|
||||||
outfile << "," << (fdes->isStatic() << 1 ) << "," << std::endl ; // mods
|
outfile << "," << (fdes->isStatic() << 1 ) << "," << std::endl ; // mods
|
||||||
|
Loading…
x
Reference in New Issue
Block a user