pip_cmg less code
This commit is contained in:
@@ -68,7 +68,7 @@ void header() {
|
|||||||
piCout << Cyan << "Version" << Bold << PIPVersion() << NewLine;
|
piCout << Cyan << "Version" << Bold << PIPVersion() << NewLine;
|
||||||
piCout << Green << Bold << "Usage:" << Default
|
piCout << Green << Bold << "Usage:" << Default
|
||||||
<< "\"pip_cmg [-hHqPpsAMESTG] -o <output_file> [-I<include_dir1>] [-I<include_dir1>] [...] [-D<define1>] [-D<define1>] [...] "
|
<< "\"pip_cmg [-hHqPpsAMESTG] -o <output_file> [-I<include_dir1>] [-I<include_dir1>] [...] [-D<define1>] [-D<define1>] [...] "
|
||||||
"<file1> [<file2>] [<file3>] [...]\""
|
"<file1> [<file2>] [<file3>] [...]\""
|
||||||
<< NewLine;
|
<< NewLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,7 +315,7 @@ bool writeClassStreamMembersOut(PIIOTextStream & ts, const PICodeParser::Entity
|
|||||||
if (parser.isEnum(m.type)) ts << "(int)";
|
if (parser.isEnum(m.type)) ts << "(int)";
|
||||||
ts << "v." << m.name << ";\n";
|
ts << "v." << m.name << ";\n";
|
||||||
} else {
|
} else {
|
||||||
ts << "\tcs << cs.chunk(" << cnt << ", ";
|
ts << "\tcs.add(" << cnt << ", ";
|
||||||
if (parser.isEnum(m.type)) ts << "(int)";
|
if (parser.isEnum(m.type)) ts << "(int)";
|
||||||
ts << "v." << m.name << ");\n";
|
ts << "v." << m.name << ");\n";
|
||||||
}
|
}
|
||||||
@@ -440,8 +440,8 @@ bool makeClassStream(PIIOTextStream & ts, const PICodeParser::Entity * e) {
|
|||||||
ts << "BINARY_STREAM_READ (" << e->name << ") {\n";
|
ts << "BINARY_STREAM_READ (" << e->name << ") {\n";
|
||||||
if (!simple) {
|
if (!simple) {
|
||||||
// ts << "\tif (s.size_s() < 4) return s;\n";
|
// ts << "\tif (s.size_s() < 4) return s;\n";
|
||||||
ts << "\tPIByteArray csba; s >> csba;\n";
|
ts << "\tPIChunkStream cs;\n";
|
||||||
ts << "\tPIChunkStream cs(csba);\n";
|
ts << "\tcs.extract(s);\n";
|
||||||
ts << "\twhile (!cs.atEnd()) {\n";
|
ts << "\twhile (!cs.atEnd()) {\n";
|
||||||
ts << "\t\tswitch (cs.read()) {\n";
|
ts << "\t\tswitch (cs.read()) {\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user