mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Contrib: Fix protoc-bnet generator to initialize all fields in the constructor
This commit is contained in:
@@ -174,7 +174,7 @@ void BnetFileGenerator::GenerateHeader(pb::io::Printer* printer)
|
||||
printer->Print("#include <type_traits>\n");
|
||||
}
|
||||
else
|
||||
printer->Print("#include \"Define.h\" // for TC_SHARED_API\n");
|
||||
printer->Print("#include \"Define.h\" // for TC_PROTO_API\n");
|
||||
|
||||
|
||||
printer->Print("// @@protoc_insertion_point(includes)\n");
|
||||
|
||||
@@ -285,7 +285,9 @@ GenerateSwappingCode(io::Printer* printer) const {
|
||||
|
||||
void RepeatedEnumFieldGenerator::
|
||||
GenerateConstructorCode(io::Printer* printer) const {
|
||||
// Not needed for repeated fields.
|
||||
if (descriptor_->options().packed()) {
|
||||
printer->Print(variables_, "_$name$_cached_byte_size_ = 0;\n");
|
||||
}
|
||||
}
|
||||
|
||||
void RepeatedEnumFieldGenerator::
|
||||
|
||||
@@ -335,7 +335,9 @@ GenerateSwappingCode(io::Printer* printer) const {
|
||||
|
||||
void RepeatedPrimitiveFieldGenerator::
|
||||
GenerateConstructorCode(io::Printer* printer) const {
|
||||
// Not needed for repeated fields.
|
||||
if (descriptor_->options().packed()) {
|
||||
printer->Print(variables_, "_$name$_cached_byte_size_ = 0;\n");
|
||||
}
|
||||
}
|
||||
|
||||
void RepeatedPrimitiveFieldGenerator::
|
||||
|
||||
Reference in New Issue
Block a user