attempting to upgrade to proto 3.5

This commit is contained in:
Kevin Darby committed 2018-12-28 16:02:52 +00:00
1 parent eb1b42a5e8
commit cc3510c6c2
368 files changed
+35764 -24867

No files matched your search

@@ -115,21 +115,21 @@ GeneratePrivateMembers(io::Printer* printer) const {
void PrimitiveFieldGenerator::
GenerateAccessorDeclarations(io::Printer* printer) const {
printer->Print(variables_, "$deprecated_attr$$type$ $name$() const;\n");
printer->Annotate("name", descriptor_);
printer->Print(variables_,
"$deprecated_attr$$type$ $name$() const;\n"
"$deprecated_attr$void set_$name$($type$ value);\n");
"$deprecated_attr$void ${$set_$name$$}$($type$ value);\n");
printer->Annotate("{", "}", descriptor_);
}
void PrimitiveFieldGenerator::
GenerateInlineAccessorDefinitions(io::Printer* printer, bool is_inline) const {
std::map<string, string> variables(variables_);
variables["inline"] = is_inline ? "inline " : "";
printer->Print(variables,
"$inline$$type$ $classname$::$name$() const {\n"
GenerateInlineAccessorDefinitions(io::Printer* printer) const {
printer->Print(variables_,
"inline $type$ $classname$::$name$() const {\n"
" // @@protoc_insertion_point(field_get:$full_name$)\n"
" return $name$_;\n"
"}\n"
"$inline$void $classname$::set_$name$($type$ value) {\n"
"inline void $classname$::set_$name$($type$ value) {\n"
" $set_hasbit$\n"
" $name$_ = value;\n"
" // @@protoc_insertion_point(field_set:$full_name$)\n"
@@ -148,7 +148,7 @@ GenerateMergingCode(io::Printer* printer) const {
void PrimitiveFieldGenerator::
GenerateSwappingCode(io::Printer* printer) const {
printer->Print(variables_, "std::swap($name$_, other->$name$_);\n");
printer->Print(variables_, "swap($name$_, other->$name$_);\n");
}
void PrimitiveFieldGenerator::
@@ -210,18 +210,16 @@ PrimitiveOneofFieldGenerator(const FieldDescriptor* descriptor,
PrimitiveOneofFieldGenerator::~PrimitiveOneofFieldGenerator() {}
void PrimitiveOneofFieldGenerator::
GenerateInlineAccessorDefinitions(io::Printer* printer, bool is_inline) const {
std::map<string, string> variables(variables_);
variables["inline"] = is_inline ? "inline " : "";
printer->Print(variables,
"$inline$$type$ $classname$::$name$() const {\n"
GenerateInlineAccessorDefinitions(io::Printer* printer) const {
printer->Print(variables_,
"inline $type$ $classname$::$name$() const {\n"
" // @@protoc_insertion_point(field_get:$full_name$)\n"
" if (has_$name$()) {\n"
" return $oneof_prefix$$name$_;\n"
" }\n"
" return $default$;\n"
"}\n"
"$inline$void $classname$::set_$name$($type$ value) {\n"
"inline void $classname$::set_$name$($type$ value) {\n"
" if (!has_$name$()) {\n"
" clear_$oneof_name$();\n"
" set_has_$name$();\n"
@@ -243,9 +241,8 @@ GenerateSwappingCode(io::Printer* printer) const {
void PrimitiveOneofFieldGenerator::
GenerateConstructorCode(io::Printer* printer) const {
printer->Print(
variables_,
"_$classname$_default_instance_.$name$_ = $default$;\n");
printer->Print(variables_,
"$ns$::_$classname$_default_instance_.$name$_ = $default$;\n");
}
void PrimitiveOneofFieldGenerator::
@@ -290,40 +287,46 @@ GeneratePrivateMembers(io::Printer* printer) const {
void RepeatedPrimitiveFieldGenerator::
GenerateAccessorDeclarations(io::Printer* printer) const {
printer->Print(variables_,
"$deprecated_attr$$type$ $name$(int index) const;\n"
"$deprecated_attr$void set_$name$(int index, $type$ value);\n"
"$deprecated_attr$void add_$name$($type$ value);\n");
"$deprecated_attr$$type$ $name$(int index) const;\n");
printer->Annotate("name", descriptor_);
printer->Print(
variables_,
"$deprecated_attr$void ${$set_$name$$}$(int index, $type$ value);\n");
printer->Annotate("{", "}", descriptor_);
printer->Print(variables_,
"$deprecated_attr$const ::google::protobuf::RepeatedField< $type$ >&\n"
" $name$() const;\n"
"$deprecated_attr$::google::protobuf::RepeatedField< $type$ >*\n"
" mutable_$name$();\n");
"$deprecated_attr$void ${$add_$name$$}$($type$ value);\n");
printer->Annotate("{", "}", descriptor_);
printer->Print(variables_,
"$deprecated_attr$const ::google::protobuf::RepeatedField< $type$ >&\n"
" $name$() const;\n");
printer->Annotate("name", descriptor_);
printer->Print(variables_,
"$deprecated_attr$::google::protobuf::RepeatedField< $type$ >*\n"
" ${$mutable_$name$$}$();\n");
printer->Annotate("{", "}", descriptor_);
}
void RepeatedPrimitiveFieldGenerator::
GenerateInlineAccessorDefinitions(io::Printer* printer, bool is_inline) const {
std::map<string, string> variables(variables_);
variables["inline"] = is_inline ? "inline " : "";
printer->Print(variables,
"$inline$$type$ $classname$::$name$(int index) const {\n"
GenerateInlineAccessorDefinitions(io::Printer* printer) const {
printer->Print(variables_,
"inline $type$ $classname$::$name$(int index) const {\n"
" // @@protoc_insertion_point(field_get:$full_name$)\n"
" return $name$_.Get(index);\n"
"}\n"
"$inline$void $classname$::set_$name$(int index, $type$ value) {\n"
"inline void $classname$::set_$name$(int index, $type$ value) {\n"
" $name$_.Set(index, value);\n"
" // @@protoc_insertion_point(field_set:$full_name$)\n"
"}\n"
"$inline$void $classname$::add_$name$($type$ value) {\n"
"inline void $classname$::add_$name$($type$ value) {\n"
" $name$_.Add(value);\n"
" // @@protoc_insertion_point(field_add:$full_name$)\n"
"}\n");
printer->Print(variables,
"$inline$const ::google::protobuf::RepeatedField< $type$ >&\n"
"}\n"
"inline const ::google::protobuf::RepeatedField< $type$ >&\n"
"$classname$::$name$() const {\n"
" // @@protoc_insertion_point(field_list:$full_name$)\n"
" return $name$_;\n"
"}\n"
"$inline$::google::protobuf::RepeatedField< $type$ >*\n"
"inline ::google::protobuf::RepeatedField< $type$ >*\n"
"$classname$::mutable_$name$() {\n"
" // @@protoc_insertion_point(field_mutable_list:$full_name$)\n"
" return &$name$_;\n"
@@ -382,7 +385,8 @@ GenerateSerializeWithCachedSizes(io::Printer* printer) const {
"$number$, "
"::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, "
"output);\n"
" output->WriteVarint32(_$name$_cached_byte_size_);\n");
" output->WriteVarint32(static_cast< ::google::protobuf::uint32>(\n"
" _$name$_cached_byte_size_));\n");
if (FixedSize(descriptor_->type()) > 0) {
// TODO(ckennelly): Use RepeatedField<T>::unsafe_data() via
@@ -422,7 +426,8 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const {
" ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n"
" target);\n"
" target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(\n"
" _$name$_cached_byte_size_, target);\n"
" static_cast< ::google::protobuf::int32>(\n"
" _$name$_cached_byte_size_), target);\n"
" target = ::google::protobuf::internal::WireFormatLite::\n"
" Write$declared_type$NoTagToArray(this->$name$_, target);\n"
"}\n");
@@ -444,7 +449,7 @@ GenerateByteSize(io::Printer* printer) const {
" $declared_type$Size(this->$name$_);\n");
} else {
printer->Print(variables_,
"unsigned int count = this->$name$_size();\n"
"unsigned int count = static_cast<unsigned int>(this->$name$_size());\n"
"size_t data_size = $fixed_size$UL * count;\n");
}
@@ -452,7 +457,8 @@ GenerateByteSize(io::Printer* printer) const {
printer->Print(variables_,
"if (data_size > 0) {\n"
" total_size += $tag_size$ +\n"
" ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);\n"
" ::google::protobuf::internal::WireFormatLite::Int32Size(\n"
" static_cast< ::google::protobuf::int32>(data_size));\n"
"}\n"
"int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);\n"
"GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n"