From 51b02255990b9e45340e97174cc474076203e9ad Mon Sep 17 00:00:00 2001 From: Hao Nguyen Date: Wed, 10 Apr 2019 13:00:25 -0700 Subject: [PATCH 1/3] Down integrate to Github --- conformance/failure_list_ruby.txt | 1 + conformance/failure_list_ruby_mac.txt | 1 + .../protobuf/internal/text_format_test.py | 32 ++++- python/google/protobuf/text_format.py | 35 +++-- src/google/protobuf/any.pb.cc | 15 +- src/google/protobuf/api.pb.cc | 19 ++- src/google/protobuf/compiler/cpp/cpp_enum.cc | 2 +- src/google/protobuf/compiler/cpp/cpp_file.cc | 46 +++---- .../protobuf/compiler/cpp/cpp_message.cc | 4 +- .../protobuf/compiler/cpp/cpp_service.cc | 2 +- src/google/protobuf/compiler/plugin.pb.cc | 21 ++- src/google/protobuf/descriptor.pb.cc | 79 ++++++----- src/google/protobuf/descriptor.proto | 128 +++++++++--------- src/google/protobuf/duration.pb.cc | 15 +- src/google/protobuf/empty.pb.cc | 15 +- src/google/protobuf/field_mask.pb.cc | 15 +- .../protobuf/generated_message_reflection.cc | 23 ++-- .../protobuf/generated_message_reflection.h | 20 +-- src/google/protobuf/message.cc | 46 +++---- src/google/protobuf/message.h | 5 +- src/google/protobuf/source_context.pb.cc | 15 +- src/google/protobuf/struct.pb.cc | 23 ++-- src/google/protobuf/timestamp.pb.cc | 15 +- src/google/protobuf/type.pb.cc | 29 ++-- src/google/protobuf/wrappers.pb.cc | 31 ++--- 25 files changed, 306 insertions(+), 331 deletions(-) diff --git a/conformance/failure_list_ruby.txt b/conformance/failure_list_ruby.txt index 651cb55f57..9b5ba7f14f 100644 --- a/conformance/failure_list_ruby.txt +++ b/conformance/failure_list_ruby.txt @@ -65,3 +65,4 @@ Required.Proto3.JsonInput.IgnoreUnknownJsonNumber.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput +Required.Proto3.JsonInput.EmptyFieldMask.JsonOutput diff --git a/conformance/failure_list_ruby_mac.txt b/conformance/failure_list_ruby_mac.txt index 3114cba878..86a5da183d 100644 --- a/conformance/failure_list_ruby_mac.txt +++ b/conformance/failure_list_ruby_mac.txt @@ -70,3 +70,4 @@ Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter +Required.Proto3.JsonInput.EmptyFieldMask.JsonOutput diff --git a/python/google/protobuf/internal/text_format_test.py b/python/google/protobuf/internal/text_format_test.py index 3b0adcb712..8aff9506be 100755 --- a/python/google/protobuf/internal/text_format_test.py +++ b/python/google/protobuf/internal/text_format_test.py @@ -268,13 +268,6 @@ class TextFormatMessageToStringTests(TextFormatBase): def testPrintFloatFormat(self, message_module): # Check that float_format argument is passed to sub-message formatting. message = message_module.NestedTestAllTypes() - # We use 1.25 as it is a round number in binary. The proto 32-bit float - # will not gain additional imprecise digits as a 64-bit Python float and - # show up in its str. 32-bit 1.2 is noisy when extended to 64-bit: - # >>> struct.unpack('f', struct.pack('f', 1.2))[0] - # 1.2000000476837158 - # >>> struct.unpack('f', struct.pack('f', 1.25))[0] - # 1.25 message.payload.optional_float = 1.25 # Check rounding at 15 significant digits message.payload.optional_double = -.000003456789012345678 @@ -298,6 +291,31 @@ class TextFormatMessageToStringTests(TextFormatBase): self.RemoveRedundantZeros(text_message), 'payload {{ {0} {1} {2} {3} }}'.format(*formatted_fields)) + # 32-bit 1.2 is noisy when extended to 64-bit: + # >>> struct.unpack('f', struct.pack('f', 1.2))[0] + # 1.2000000476837158 + # TODO(jieluo): change to 1.2 with cl/241634942. + message.payload.optional_float = 1.2000000476837158 + formatted_fields = ['optional_float: 1.2', + 'optional_double: -3.45678901234568e-6', + 'repeated_float: -5642', 'repeated_double: 7.89e-5'] + text_message = text_format.MessageToString(message, float_format='.7g', + double_format='.15g') + self.CompareToGoldenText( + self.RemoveRedundantZeros(text_message), + 'payload {{\n {0}\n {1}\n {2}\n {3}\n}}\n'.format( + *formatted_fields)) + + # Test only set float_format affect both float and double fields. + formatted_fields = ['optional_float: 1.2', + 'optional_double: -3.456789e-6', + 'repeated_float: -5642', 'repeated_double: 7.89e-5'] + text_message = text_format.MessageToString(message, float_format='.7g') + self.CompareToGoldenText( + self.RemoveRedundantZeros(text_message), + 'payload {{\n {0}\n {1}\n {2}\n {3}\n}}\n'.format( + *formatted_fields)) + def testMessageToString(self, message_module): message = message_module.ForeignMessage() message.c = 123 diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py index 72116622e0..028a6acc75 100755 --- a/python/google/protobuf/text_format.py +++ b/python/google/protobuf/text_format.py @@ -65,8 +65,6 @@ _INTEGER_CHECKERS = (type_checkers.Uint32ValueChecker(), type_checkers.Int64ValueChecker()) _FLOAT_INFINITY = re.compile('-?inf(?:inity)?f?$', re.IGNORECASE) _FLOAT_NAN = re.compile('nanf?$', re.IGNORECASE) -_FLOAT_TYPES = frozenset([descriptor.FieldDescriptor.CPPTYPE_FLOAT, - descriptor.FieldDescriptor.CPPTYPE_DOUBLE]) _QUOTES = frozenset(("'", '"')) _ANY_FULL_TYPE_NAME = 'google.protobuf.Any' @@ -126,6 +124,7 @@ def MessageToString(message, pointy_brackets=False, use_index_order=False, float_format=None, + double_format=None, use_field_number=False, descriptor_pool=None, indent=0, @@ -153,8 +152,12 @@ def MessageToString(message, will be printed at the end of the message and their relative order is determined by the extension number. By default, use the field number order. - float_format: If set, use this to specify floating point number formatting + float_format: If set, use this to specify float field formatting (per the "Format Specification Mini-Language"); otherwise, str() is used. + Also affect double field if double_format is not set. + double_format: If set, use this to specify double field formatting + (per the "Format Specification Mini-Language"); otherwise, float_format + is used. use_field_number: If True, print field numbers instead of names. descriptor_pool: A DescriptorPool used to resolve Any types. indent: The initial indent level, in terms of spaces, for pretty print. @@ -169,7 +172,8 @@ def MessageToString(message, out = TextWriter(as_utf8) printer = _Printer(out, indent, as_utf8, as_one_line, use_short_repeated_primitives, pointy_brackets, - use_index_order, float_format, use_field_number, + use_index_order, float_format, double_format, + use_field_number, descriptor_pool, message_formatter, print_unknown_fields=print_unknown_fields) printer.PrintMessage(message) @@ -205,6 +209,7 @@ def PrintMessage(message, pointy_brackets=False, use_index_order=False, float_format=None, + double_format=None, use_field_number=False, descriptor_pool=None, message_formatter=None, @@ -216,6 +221,7 @@ def PrintMessage(message, pointy_brackets=pointy_brackets, use_index_order=use_index_order, float_format=float_format, + double_format=double_format, use_field_number=use_field_number, descriptor_pool=descriptor_pool, message_formatter=message_formatter, @@ -233,12 +239,13 @@ def PrintField(field, pointy_brackets=False, use_index_order=False, float_format=None, + double_format=None, message_formatter=None, print_unknown_fields=False): """Print a single field name/value pair.""" printer = _Printer(out, indent, as_utf8, as_one_line, use_short_repeated_primitives, pointy_brackets, - use_index_order, float_format, + use_index_order, float_format, double_format, message_formatter=message_formatter, print_unknown_fields=print_unknown_fields) printer.PrintField(field, value) @@ -254,12 +261,13 @@ def PrintFieldValue(field, pointy_brackets=False, use_index_order=False, float_format=None, + double_format=None, message_formatter=None, print_unknown_fields=False): """Print a single field value (not including name).""" printer = _Printer(out, indent, as_utf8, as_one_line, use_short_repeated_primitives, pointy_brackets, - use_index_order, float_format, + use_index_order, float_format, double_format, message_formatter=message_formatter, print_unknown_fields=print_unknown_fields) printer.PrintFieldValue(field, value) @@ -307,6 +315,7 @@ class _Printer(object): pointy_brackets=False, use_index_order=False, float_format=None, + double_format=None, use_field_number=False, descriptor_pool=None, message_formatter=None, @@ -333,7 +342,9 @@ class _Printer(object): field number order. float_format: If set, use this to specify floating point number formatting (per the "Format Specification Mini-Language"); otherwise, str() is - used. + used. Also affect double field if double_format is not set. + double_format: If set, use this to specify double field formatting; + otherwise, float_format is used. use_field_number: If True, print field numbers instead of names. descriptor_pool: A DescriptorPool used to resolve Any types. message_formatter: A function(message, indent, as_one_line): unicode|None @@ -349,6 +360,10 @@ class _Printer(object): self.pointy_brackets = pointy_brackets self.use_index_order = use_index_order self.float_format = float_format + if double_format is not None: + self.double_format = double_format + else: + self.double_format = float_format self.use_field_number = use_field_number self.descriptor_pool = descriptor_pool self.message_formatter = message_formatter @@ -574,8 +589,12 @@ class _Printer(object): out.write('true') else: out.write('false') - elif field.cpp_type in _FLOAT_TYPES and self.float_format is not None: + elif (field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_FLOAT and + self.float_format is not None): out.write('{1:{0}}'.format(self.float_format, value)) + elif (field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_DOUBLE and + self.double_format is not None): + out.write('{1:{0}}'.format(self.double_format, value)) else: out.write(str(value)) diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index 404de6fc7b..3ee260860b 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -57,12 +57,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Any_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fany_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fany_2eproto, "google/protobuf/any.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fany_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fany_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto, file_level_service_descriptors_google_2fprotobuf_2fany_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] = "\n\031google/protobuf/any.proto\022\017google.prot" "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002" @@ -71,9 +65,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] = "\003GPB\252\002\036Google.Protobuf.WellKnownTypesb\006p" "roto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fany_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fany_2eproto, - "google/protobuf/any.proto", &assign_descriptors_table_google_2fprotobuf_2fany_2eproto, 205, + false, descriptor_table_protodef_google_2fprotobuf_2fany_2eproto, "google/protobuf/any.proto", 205, + &descriptor_table_google_2fprotobuf_2fany_2eproto_once, AddDescriptors_google_2fprotobuf_2fany_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fany_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fany_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto, file_level_service_descriptors_google_2fprotobuf_2fany_2eproto, }; void AddDescriptors_google_2fprotobuf_2fany_2eproto() { @@ -440,7 +437,7 @@ void Any::InternalSwap(Any* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Any::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fany_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fany_2eproto); return ::file_level_metadata_google_2fprotobuf_2fany_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index c9e2123698..fdd155fc12 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -130,12 +130,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Mixin_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fapi_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fapi_2eproto, "google/protobuf/api.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fapi_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fapi_2eproto, 3, file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto, file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto[] = "\n\031google/protobuf/api.proto\022\017google.prot" "obuf\032$google/protobuf/source_context.pro" @@ -157,9 +151,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto[] = "nproto/protobuf/api;api\242\002\003GPB\252\002\036Google.P" "rotobuf.WellKnownTypesb\006proto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fapi_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fapi_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto, - "google/protobuf/api.proto", &assign_descriptors_table_google_2fprotobuf_2fapi_2eproto, 750, + false, descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto, "google/protobuf/api.proto", 750, + &descriptor_table_google_2fprotobuf_2fapi_2eproto_once, AddDescriptors_google_2fprotobuf_2fapi_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fapi_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fapi_2eproto, 3, file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto, file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto, }; void AddDescriptors_google_2fprotobuf_2fapi_2eproto() { @@ -803,7 +800,7 @@ void Api::InternalSwap(Api* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Api::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fapi_2eproto); return ::file_level_metadata_google_2fprotobuf_2fapi_2eproto[kIndexInFileMessages]; } @@ -1403,7 +1400,7 @@ void Method::InternalSwap(Method* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Method::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fapi_2eproto); return ::file_level_metadata_google_2fprotobuf_2fapi_2eproto[kIndexInFileMessages]; } @@ -1746,7 +1743,7 @@ void Mixin::InternalSwap(Mixin* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Mixin::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fapi_2eproto); return ::file_level_metadata_google_2fprotobuf_2fapi_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/compiler/cpp/cpp_enum.cc b/src/google/protobuf/compiler/cpp/cpp_enum.cc index e59099e9fa..5e2ac25364 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum.cc @@ -241,7 +241,7 @@ void EnumGenerator::GenerateMethods(int idx, io::Printer* printer) { if (HasDescriptorMethods(descriptor_->file(), options_)) { format( "const ::$proto_ns$::EnumDescriptor* $classname$_descriptor() {\n" - " ::$proto_ns$::internal::AssignDescriptors(&$assign_desc_table$);\n" + " ::$proto_ns$::internal::AssignDescriptors(&$desc_table$);\n" " return $file_level_enum_descriptors$[$1$];\n" "}\n", idx); diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index 7164bd754d..479d5b3686 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -64,10 +64,9 @@ FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options) SetCommonVars(options, &variables_); variables_["dllexport_decl"] = options.dllexport_decl; variables_["tablename"] = UniqueName("TableStruct", file_, options_); - variables_["assign_desc_table"] = - UniqueName("assign_descriptors_table", file_, options_); variables_["file_level_metadata"] = UniqueName("file_level_metadata", file_, options_); + variables_["desc_table"] = UniqueName("descriptor_table", file_, options_), variables_["file_level_enum_descriptors"] = UniqueName("file_level_enum_descriptors", file_, options_); variables_["file_level_service_descriptors"] = @@ -758,21 +757,6 @@ void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) { // --------------------------------------------------------------- - // protobuf_AssignDescriptorsOnce(): The first time it is called, calls - // AssignDescriptors(). All later times, waits for the first call to - // complete and then returns. - format( - "static " - "::$proto_ns$::internal::AssignDescriptorsTable $assign_desc_table$ = " - "{\n" - " {}, $add_descriptors$, \"$filename$\", schemas,\n" - " file_default_instances, $tablename$::offsets,\n" - " $file_level_metadata$, $1$, $file_level_enum_descriptors$, " - "$file_level_service_descriptors$,\n" - "};\n" - "\n", - message_generators_.size()); - // Embed the descriptor. We simply serialize the entire // FileDescriptorProto/ and embed it as a string literal, which is parsed and // built into real descriptors at initialization time. @@ -812,21 +796,26 @@ void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) { } format.Outdent(); + int num_deps = file_->dependency_count(); + // Now generate the AddDescriptors() function. + // We have to make the once flag separate on account of MSVC 2015, which + // does not linker-initialize constexpr constructors. :( format( + "static ::$proto_ns$::internal::once_flag $desc_table$_once;\n" "static " - "::$proto_ns$::internal::DescriptorTable $1$ = {\n" - " false, $2$,\n", - UniqueName("descriptor_table", file_, options_), protodef_name); - - const int num_deps = file_->dependency_count(); - format( - " \"$filename$\", &$assign_desc_table$, $1$,\n" + "::$proto_ns$::internal::DescriptorTable $desc_table$ = {\n" + " false, $1$, \"$filename$\", $2$,\n" + " &$desc_table$_once, $add_descriptors$, schemas,\n" + " file_default_instances, $tablename$::offsets,\n" + " $file_level_metadata$, $3$, $file_level_enum_descriptors$, " + "$file_level_service_descriptors$,\n" "};\n\n" "void $add_descriptors$() {\n" - " static constexpr ::$proto_ns$::internal::InitFunc deps[$2$] =\n" + " static constexpr ::$proto_ns$::internal::InitFunc deps[$4$] =\n" " {\n", - file_data.size(), std::max(num_deps, 1)); + protodef_name, file_data.size(), message_generators_.size(), + std::max(num_deps, 1)); for (int i = 0; i < num_deps; i++) { const FileDescriptor* dependency = file_->dependency(i); format(" ::$1$,\n", UniqueName("AddDescriptors", dependency, options_)); @@ -843,10 +832,9 @@ void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) { scc_name); } format( - " ::$proto_ns$::internal::AddDescriptors(&$1$, deps, $2$);\n" + " ::$proto_ns$::internal::AddDescriptors(&$desc_table$, deps, $1$);\n" "}\n\n", - UniqueName("descriptor_table", file_, options_), // 1 - num_deps); // 2 + num_deps); // 1 format( "// Force running AddDescriptors() at dynamic initialization time.\n" "static bool $1$ = []() { $add_descriptors$(); return true; }();\n", diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index d73d523aa5..84bd999027 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -1894,7 +1894,7 @@ void MessageGenerator::GenerateClassMethods(io::Printer* printer) { format( "::$proto_ns$::Metadata $classname$::GetMetadata() const {\n" " " - "::$proto_ns$::internal::AssignDescriptors(&::$assign_desc_table$);\n" + "::$proto_ns$::internal::AssignDescriptors(&::$desc_table$);\n" " return ::$file_level_metadata$[$1$];\n" "}\n", index_in_file_messages_); @@ -2049,7 +2049,7 @@ void MessageGenerator::GenerateClassMethods(io::Printer* printer) { if (HasDescriptorMethods(descriptor_->file(), options_)) { format( "::$proto_ns$::Metadata $classname$::GetMetadata() const {\n" - " ::$proto_ns$::internal::AssignDescriptors(&::$assign_desc_table$);\n" + " ::$proto_ns$::internal::AssignDescriptors(&::$desc_table$);\n" " return ::$file_level_metadata$[kIndexInFileMessages];\n" "}\n" "\n"); diff --git a/src/google/protobuf/compiler/cpp/cpp_service.cc b/src/google/protobuf/compiler/cpp/cpp_service.cc index 79738c5f3f..ec5e32ae93 100644 --- a/src/google/protobuf/compiler/cpp/cpp_service.cc +++ b/src/google/protobuf/compiler/cpp/cpp_service.cc @@ -182,7 +182,7 @@ void ServiceGenerator::GenerateImplementation(io::Printer* printer) { "\n" "const ::$proto_ns$::ServiceDescriptor* $classname$::descriptor() {\n" " " - "::$proto_ns$::internal::AssignDescriptors(&$assign_desc_table$);\n" + "::$proto_ns$::internal::AssignDescriptors(&$desc_table$);\n" " return $file_level_service_descriptors$[$1$];\n" "}\n" "\n" diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 16ea252c31..bdda945adc 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -164,12 +164,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto, "google/protobuf/compiler/plugin.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto, 4, file_level_enum_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto, file_level_service_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto[] = "\n%google/protobuf/compiler/plugin.proto\022" "\030google.protobuf.compiler\032 google/protob" @@ -188,9 +182,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2epro "pilerB\014PluginProtosZ9github.com/golang/p" "rotobuf/protoc-gen-go/plugin;plugin_go" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto, - "google/protobuf/compiler/plugin.proto", &assign_descriptors_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto, 638, + false, descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto, "google/protobuf/compiler/plugin.proto", 638, + &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once, AddDescriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto, 4, file_level_enum_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto, file_level_service_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto, }; void AddDescriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { @@ -654,7 +651,7 @@ void Version::InternalSwap(Version* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Version::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); return ::file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[kIndexInFileMessages]; } @@ -1140,7 +1137,7 @@ void CodeGeneratorRequest::InternalSwap(CodeGeneratorRequest* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CodeGeneratorRequest::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); return ::file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[kIndexInFileMessages]; } @@ -1579,7 +1576,7 @@ void CodeGeneratorResponse_File::InternalSwap(CodeGeneratorResponse_File* other) } ::PROTOBUF_NAMESPACE_ID::Metadata CodeGeneratorResponse_File::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); return ::file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[kIndexInFileMessages]; } @@ -1929,7 +1926,7 @@ void CodeGeneratorResponse::InternalSwap(CodeGeneratorResponse* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata CodeGeneratorResponse::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); return ::file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index f85087e624..c7bd3a13d6 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1013,12 +1013,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_GeneratedCodeInfo_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fdescriptor_2eproto, "google/protobuf/descriptor.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto, 27, file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto, file_level_service_descriptors_google_2fprotobuf_2fdescriptor_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] = "\n google/protobuf/descriptor.proto\022\017goog" "le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file" @@ -1172,9 +1166,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] = "go/descriptor;descriptor\370\001\001\242\002\003GPB\252\002\032Goog" "le.Protobuf.Reflection" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto, - "google/protobuf/descriptor.proto", &assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto, 6022, + false, descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto, "google/protobuf/descriptor.proto", 6022, + &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, AddDescriptors_google_2fprotobuf_2fdescriptor_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto, 27, file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto, file_level_service_descriptors_google_2fprotobuf_2fdescriptor_2eproto, }; void AddDescriptors_google_2fprotobuf_2fdescriptor_2eproto() { @@ -1215,7 +1212,7 @@ void AddDescriptors_google_2fprotobuf_2fdescriptor_2eproto() { static bool dynamic_init_dummy_google_2fprotobuf_2fdescriptor_2eproto = []() { AddDescriptors_google_2fprotobuf_2fdescriptor_2eproto(); return true; }(); PROTOBUF_NAMESPACE_OPEN const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldDescriptorProto_Type_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[0]; } bool FieldDescriptorProto_Type_IsValid(int value) { @@ -1268,7 +1265,7 @@ constexpr FieldDescriptorProto_Type FieldDescriptorProto::Type_MAX; constexpr int FieldDescriptorProto::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldDescriptorProto_Label_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[1]; } bool FieldDescriptorProto_Label_IsValid(int value) { @@ -1291,7 +1288,7 @@ constexpr FieldDescriptorProto_Label FieldDescriptorProto::Label_MAX; constexpr int FieldDescriptorProto::Label_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FileOptions_OptimizeMode_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[2]; } bool FileOptions_OptimizeMode_IsValid(int value) { @@ -1314,7 +1311,7 @@ constexpr FileOptions_OptimizeMode FileOptions::OptimizeMode_MAX; constexpr int FileOptions::OptimizeMode_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldOptions_CType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[3]; } bool FieldOptions_CType_IsValid(int value) { @@ -1337,7 +1334,7 @@ constexpr FieldOptions_CType FieldOptions::CType_MAX; constexpr int FieldOptions::CType_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldOptions_JSType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[4]; } bool FieldOptions_JSType_IsValid(int value) { @@ -1360,7 +1357,7 @@ constexpr FieldOptions_JSType FieldOptions::JSType_MAX; constexpr int FieldOptions::JSType_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[5]; } bool MethodOptions_IdempotencyLevel_IsValid(int value) { @@ -1685,7 +1682,7 @@ void FileDescriptorSet::InternalSwap(FileDescriptorSet* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FileDescriptorSet::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -2720,7 +2717,7 @@ void FileDescriptorProto::InternalSwap(FileDescriptorProto* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FileDescriptorProto::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -3163,7 +3160,7 @@ void DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange } ::PROTOBUF_NAMESPACE_ID::Metadata DescriptorProto_ExtensionRange::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -3525,7 +3522,7 @@ void DescriptorProto_ReservedRange::InternalSwap(DescriptorProto_ReservedRange* } ::PROTOBUF_NAMESPACE_ID::Metadata DescriptorProto_ReservedRange::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -4403,7 +4400,7 @@ void DescriptorProto::InternalSwap(DescriptorProto* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata DescriptorProto::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -4740,7 +4737,7 @@ void ExtensionRangeOptions::InternalSwap(ExtensionRangeOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ExtensionRangeOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -5655,7 +5652,7 @@ void FieldDescriptorProto::InternalSwap(FieldDescriptorProto* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FieldDescriptorProto::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -6066,7 +6063,7 @@ void OneofDescriptorProto::InternalSwap(OneofDescriptorProto* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata OneofDescriptorProto::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -6428,7 +6425,7 @@ void EnumDescriptorProto_EnumReservedRange::InternalSwap(EnumDescriptorProto_Enu } ::PROTOBUF_NAMESPACE_ID::Metadata EnumDescriptorProto_EnumReservedRange::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -7016,7 +7013,7 @@ void EnumDescriptorProto::InternalSwap(EnumDescriptorProto* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata EnumDescriptorProto::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -7478,7 +7475,7 @@ void EnumValueDescriptorProto::InternalSwap(EnumValueDescriptorProto* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata EnumValueDescriptorProto::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -7947,7 +7944,7 @@ void ServiceDescriptorProto::InternalSwap(ServiceDescriptorProto* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ServiceDescriptorProto::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -8593,7 +8590,7 @@ void MethodDescriptorProto::InternalSwap(MethodDescriptorProto* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata MethodDescriptorProto::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -10116,7 +10113,7 @@ void FileOptions::InternalSwap(FileOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FileOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -10649,7 +10646,7 @@ void MessageOptions::InternalSwap(MessageOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata MessageOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -11299,7 +11296,7 @@ void FieldOptions::InternalSwap(FieldOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FieldOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -11636,7 +11633,7 @@ void OneofOptions::InternalSwap(OneofOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata OneofOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -12081,7 +12078,7 @@ void EnumOptions::InternalSwap(EnumOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata EnumOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -12470,7 +12467,7 @@ void EnumValueOptions::InternalSwap(EnumValueOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata EnumValueOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -12859,7 +12856,7 @@ void ServiceOptions::InternalSwap(ServiceOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ServiceOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -13320,7 +13317,7 @@ void MethodOptions::InternalSwap(MethodOptions* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata MethodOptions::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -13713,7 +13710,7 @@ void UninterpretedOption_NamePart::InternalSwap(UninterpretedOption_NamePart* ot } ::PROTOBUF_NAMESPACE_ID::Metadata UninterpretedOption_NamePart::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -14376,7 +14373,7 @@ void UninterpretedOption::InternalSwap(UninterpretedOption* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata UninterpretedOption::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -14992,7 +14989,7 @@ void SourceCodeInfo_Location::InternalSwap(SourceCodeInfo_Location* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata SourceCodeInfo_Location::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -15298,7 +15295,7 @@ void SourceCodeInfo::InternalSwap(SourceCodeInfo* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata SourceCodeInfo::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -15808,7 +15805,7 @@ void GeneratedCodeInfo_Annotation::InternalSwap(GeneratedCodeInfo_Annotation* ot } ::PROTOBUF_NAMESPACE_ID::Metadata GeneratedCodeInfo_Annotation::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } @@ -16114,7 +16111,7 @@ void GeneratedCodeInfo::InternalSwap(GeneratedCodeInfo* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata GeneratedCodeInfo::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fdescriptor_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return ::file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index 8c1273dbe4..d5d794f5a3 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -40,6 +40,7 @@ syntax = "proto2"; package google.protobuf; + option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; @@ -59,8 +60,8 @@ message FileDescriptorSet { // Describes a complete .proto file. message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; @@ -115,8 +116,8 @@ message DescriptorProto { // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. @@ -137,42 +138,42 @@ message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; + TYPE_INT64 = 3; + TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - }; + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } enum Label { // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - }; + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } optional string name = 1; optional int32 number = 3; @@ -234,8 +235,8 @@ message EnumDescriptorProto { // is inclusive such that it can appropriately represent the entire int32 // domain. message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. } // Range of reserved numeric values. Reserved numeric values may not be used @@ -276,9 +277,9 @@ message MethodDescriptorProto { optional MethodOptions options = 4; // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default=false]; + optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default=false]; + optional bool server_streaming = 6 [default = false]; } @@ -314,7 +315,6 @@ message MethodDescriptorProto { // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. - message FileOptions { // Sets the Java package where classes generated from this .proto will be @@ -337,7 +337,7 @@ message FileOptions { // named by java_outer_classname. However, the outer class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default=false]; + optional bool java_multiple_files = 10 [default = false]; // This option does nothing. optional bool java_generate_equals_and_hash = 20 [deprecated=true]; @@ -348,17 +348,17 @@ message FileOptions { // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default=false]; + optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } - optional OptimizeMode optimize_for = 9 [default=SPEED]; + optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: @@ -379,20 +379,20 @@ message FileOptions { // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. - optional bool cc_generic_services = 16 [default=false]; - optional bool java_generic_services = 17 [default=false]; - optional bool py_generic_services = 18 [default=false]; - optional bool php_generic_services = 42 [default=false]; + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default=false]; + optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default=false]; + optional bool cc_enable_arenas = 31 [default = false]; // Sets the objective c class prefix which is prepended to all objective c @@ -418,8 +418,8 @@ message FileOptions { optional string php_namespace = 41; // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be used - // for determining the namespace. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. optional string php_metadata_namespace = 44; // Use this option to change the package of ruby generated classes. Default @@ -457,18 +457,18 @@ message MessageOptions { // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. - optional bool message_set_wire_format = 1 [default=false]; + optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default=false]; + optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; // Whether the message is an automatically generated map entry type for the // maps field. @@ -575,16 +575,16 @@ message FieldOptions { // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. - optional bool lazy = 5 [default=false]; + optional bool lazy = 5 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. - optional bool weak = 10 [default=false]; + optional bool weak = 10 [default = false]; // The parser stores options it doesn't recognize here. See above. @@ -614,7 +614,7 @@ message EnumOptions { // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; reserved 5; // javanano_as_lite @@ -630,7 +630,7 @@ message EnumValueOptions { // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default=false]; + optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -650,7 +650,7 @@ message ServiceOptions { // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. - optional bool deprecated = 33 [default=false]; + optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -670,18 +670,18 @@ message MethodOptions { // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default=false]; + optional bool deprecated = 33 [default = false]; // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects } - optional IdempotencyLevel idempotency_level = - 34 [default=IDEMPOTENCY_UNKNOWN]; + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -793,14 +793,14 @@ message SourceCodeInfo { // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). - repeated int32 path = 1 [packed=true]; + repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. - repeated int32 span = 2 [packed=true]; + repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be @@ -865,7 +865,7 @@ message GeneratedCodeInfo { message Annotation { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed=true]; + repeated int32 path = 1 [packed = true]; // Identifies the filesystem path to the original source .proto. optional string source_file = 2; diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index 2f66112a43..995548c370 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -57,12 +57,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Duration_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fduration_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fduration_2eproto, "google/protobuf/duration.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fduration_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fduration_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto, file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto[] = "\n\036google/protobuf/duration.proto\022\017google" ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r" @@ -71,9 +65,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto[] = "f/ptypes/duration\370\001\001\242\002\003GPB\252\002\036Google.Prot" "obuf.WellKnownTypesb\006proto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fduration_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fduration_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto, - "google/protobuf/duration.proto", &assign_descriptors_table_google_2fprotobuf_2fduration_2eproto, 227, + false, descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto, "google/protobuf/duration.proto", 227, + &descriptor_table_google_2fprotobuf_2fduration_2eproto_once, AddDescriptors_google_2fprotobuf_2fduration_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fduration_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fduration_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto, file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto, }; void AddDescriptors_google_2fprotobuf_2fduration_2eproto() { @@ -419,7 +416,7 @@ void Duration::InternalSwap(Duration* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Duration::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fduration_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fduration_2eproto); return ::file_level_metadata_google_2fprotobuf_2fduration_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc index c10bf94bc1..d27faae8aa 100644 --- a/src/google/protobuf/empty.pb.cc +++ b/src/google/protobuf/empty.pb.cc @@ -55,12 +55,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Empty_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fempty_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fempty_2eproto, "google/protobuf/empty.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fempty_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fempty_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fempty_2eproto, file_level_service_descriptors_google_2fprotobuf_2fempty_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fempty_2eproto[] = "\n\033google/protobuf/empty.proto\022\017google.pr" "otobuf\"\007\n\005EmptyBv\n\023com.google.protobufB\n" @@ -68,9 +62,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fempty_2eproto[] = "/ptypes/empty\370\001\001\242\002\003GPB\252\002\036Google.Protobuf" ".WellKnownTypesb\006proto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fempty_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fempty_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fempty_2eproto, - "google/protobuf/empty.proto", &assign_descriptors_table_google_2fprotobuf_2fempty_2eproto, 183, + false, descriptor_table_protodef_google_2fprotobuf_2fempty_2eproto, "google/protobuf/empty.proto", 183, + &descriptor_table_google_2fprotobuf_2fempty_2eproto_once, AddDescriptors_google_2fprotobuf_2fempty_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fempty_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fempty_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fempty_2eproto, file_level_service_descriptors_google_2fprotobuf_2fempty_2eproto, }; void AddDescriptors_google_2fprotobuf_2fempty_2eproto() { @@ -317,7 +314,7 @@ void Empty::InternalSwap(Empty* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Empty::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fempty_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fempty_2eproto); return ::file_level_metadata_google_2fprotobuf_2fempty_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index e360a6de73..97f566912d 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -56,12 +56,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_FieldMask_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2ffield_5fmask_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2ffield_5fmask_2eproto, "google/protobuf/field_mask.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2ffield_5fmask_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto, file_level_service_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2ffield_5fmask_2eproto[] = "\n google/protobuf/field_mask.proto\022\017goog" "le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB" @@ -70,9 +64,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2ffield_5fmask_2eproto[] "ield_mask;field_mask\370\001\001\242\002\003GPB\252\002\036Google.P" "rotobuf.WellKnownTypesb\006proto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2ffield_5fmask_2eproto, - "google/protobuf/field_mask.proto", &assign_descriptors_table_google_2fprotobuf_2ffield_5fmask_2eproto, 230, + false, descriptor_table_protodef_google_2fprotobuf_2ffield_5fmask_2eproto, "google/protobuf/field_mask.proto", 230, + &descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto_once, AddDescriptors_google_2fprotobuf_2ffield_5fmask_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2ffield_5fmask_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto, file_level_service_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto, }; void AddDescriptors_google_2fprotobuf_2ffield_5fmask_2eproto() { @@ -389,7 +386,7 @@ void FieldMask::InternalSwap(FieldMask* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FieldMask::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2ffield_5fmask_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto); return ::file_level_metadata_google_2fprotobuf_2ffield_5fmask_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index 9b2209abeb..ef57e1cadf 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -2305,7 +2305,7 @@ struct MetadataOwner { std::vector > metadata_arrays_; }; -void AssignDescriptorsImpl(const AssignDescriptorsTable* table) { +void AssignDescriptorsImpl(const DescriptorTable* table) { // Ensure the file descriptor is added to the pool. { // This only happens once per proto file. So a global mutex to serialize @@ -2342,7 +2342,7 @@ void AssignDescriptorsImpl(const AssignDescriptorsTable* table) { helper.GetCurrentMetadataPtr()); } -void AddDescriptorsImpl(const DescriptorTable* table, const InitFunc* deps, +void AddDescriptorsImpl(DescriptorTable* table, const InitFunc* deps, int num_deps) { // Ensure all dependent descriptors are registered to the generated descriptor // pool and message factory. @@ -2352,14 +2352,13 @@ void AddDescriptorsImpl(const DescriptorTable* table, const InitFunc* deps, } // Register the descriptor of this file. DescriptorPool::InternalAddGeneratedFile(table->descriptor, table->size); - MessageFactory::InternalRegisterGeneratedFile( - table->filename, table->assign_descriptors_table); + MessageFactory::InternalRegisterGeneratedFile(table); } } // namespace -void AssignDescriptors(AssignDescriptorsTable* table) { - call_once(table->once, AssignDescriptorsImpl, table); +void AssignDescriptors(const DescriptorTable* table) { + call_once(*table->once, AssignDescriptorsImpl, table); } void AddDescriptors(DescriptorTable* table, const InitFunc* deps, @@ -2380,17 +2379,13 @@ void RegisterAllTypesInternal(const Metadata* file_level_metadata, int size) { const GeneratedMessageReflection* reflection = static_cast( file_level_metadata[i].reflection); - if (reflection) { - // It's not a map type - MessageFactory::InternalRegisterGeneratedMessage( - file_level_metadata[i].descriptor, - reflection->schema_.default_instance_); - } + MessageFactory::InternalRegisterGeneratedMessage( + file_level_metadata[i].descriptor, + reflection->schema_.default_instance_); } } -void RegisterFileLevelMetadata(void* assign_descriptors_table) { - auto table = static_cast(assign_descriptors_table); +void RegisterFileLevelMetadata(DescriptorTable* table) { AssignDescriptors(table); RegisterAllTypesInternal(table->file_level_metadata, table->num_messages); } diff --git a/src/google/protobuf/generated_message_reflection.h b/src/google/protobuf/generated_message_reflection.h index 820a148833..3b9b2da878 100644 --- a/src/google/protobuf/generated_message_reflection.h +++ b/src/google/protobuf/generated_message_reflection.h @@ -661,10 +661,13 @@ class GeneratedMessageReflection final : public Reflection { typedef void (*InitFunc)(); -struct PROTOBUF_EXPORT AssignDescriptorsTable { - once_flag once; - InitFunc add_descriptors; +struct PROTOBUF_EXPORT DescriptorTable { + bool is_initialized; + const char* descriptor; const char* filename; + int size; // of serialized descriptor + once_flag* once; + InitFunc add_descriptors; const MigrationSchema* schemas; const Message* const* default_instances; const uint32* offsets; @@ -675,16 +678,7 @@ struct PROTOBUF_EXPORT AssignDescriptorsTable { const ServiceDescriptor** file_level_service_descriptors; }; -void PROTOBUF_EXPORT AssignDescriptors(AssignDescriptorsTable* table); - -struct PROTOBUF_EXPORT DescriptorTable { - bool is_initialized; - const char* descriptor; - const char* filename; - AssignDescriptorsTable* assign_descriptors_table; - int size; // of serialized descriptor -}; - +void PROTOBUF_EXPORT AssignDescriptors(const DescriptorTable* table); void PROTOBUF_EXPORT AddDescriptors(DescriptorTable* table, const InitFunc* deps, int num_deps); diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index 5fbae35246..a31cd9c5f2 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -66,6 +66,15 @@ namespace google { namespace protobuf { +namespace internal { + +// TODO(gerbens) make this factorized better. This should not have to hop +// to reflection. Currently uses GeneratedMessageReflection and thus is +// defined in generated_message_reflection.cc +void RegisterFileLevelMetadata(DescriptorTable* descriptor_table); + +} // namespace internal + using internal::ReflectionOps; using internal::WireFormat; using internal::WireFormatLite; @@ -662,22 +671,8 @@ MapIterator Reflection::MapEnd(Message* message, MessageFactory::~MessageFactory() {} -namespace internal { - -// TODO(gerbens) make this factorized better. This should not have to hop -// to reflection. Currently uses GeneratedMessageReflection and thus is -// defined in generated_message_reflection.cc -void RegisterFileLevelMetadata(void* assign_descriptors_table); - -} // namespace internal - namespace { -void RegisterFileLevelMetadata(void* assign_descriptors_table, - const std::string& filename) { - internal::RegisterFileLevelMetadata(assign_descriptors_table); -} - class GeneratedMessageFactory : public MessageFactory { public: static GeneratedMessageFactory* singleton(); @@ -687,7 +682,7 @@ class GeneratedMessageFactory : public MessageFactory { int size; }; - void RegisterFile(const char* file, void* registration_data); + void RegisterFile(google::protobuf::internal::DescriptorTable* table); void RegisterType(const Descriptor* descriptor, const Message* prototype); // implements MessageFactory --------------------------------------- @@ -695,8 +690,8 @@ class GeneratedMessageFactory : public MessageFactory { private: // Only written at static init time, so does not require locking. - std::unordered_map, - streq> + std::unordered_map, streq> file_map_; internal::WrappedMutex mutex_; @@ -710,10 +705,10 @@ GeneratedMessageFactory* GeneratedMessageFactory::singleton() { return instance; } -void GeneratedMessageFactory::RegisterFile(const char* file, - void* registration_data) { - if (!InsertIfNotPresent(&file_map_, file, registration_data)) { - GOOGLE_LOG(FATAL) << "File is already registered: " << file; +void GeneratedMessageFactory::RegisterFile( + google::protobuf::internal::DescriptorTable* table) { + if (!InsertIfNotPresent(&file_map_, table->filename, table)) { + GOOGLE_LOG(FATAL) << "File is already registered: " << table->filename; } } @@ -745,7 +740,7 @@ const Message* GeneratedMessageFactory::GetPrototype(const Descriptor* type) { if (type->file()->pool() != DescriptorPool::generated_pool()) return NULL; // Apparently the file hasn't been registered yet. Let's do that now. - void* registration_data = + internal::DescriptorTable* registration_data = FindPtrOrNull(file_map_, type->file()->name().c_str()); if (registration_data == NULL) { GOOGLE_LOG(DFATAL) << "File appears to be in generated pool but wasn't " @@ -760,7 +755,7 @@ const Message* GeneratedMessageFactory::GetPrototype(const Descriptor* type) { const Message* result = FindPtrOrNull(type_map_, type); if (result == NULL) { // Nope. OK, register everything. - RegisterFileLevelMetadata(registration_data, type->file()->name()); + internal::RegisterFileLevelMetadata(registration_data); // Should be here now. result = FindPtrOrNull(type_map_, type); } @@ -780,9 +775,8 @@ MessageFactory* MessageFactory::generated_factory() { } void MessageFactory::InternalRegisterGeneratedFile( - const char* filename, void* assign_descriptors_table) { - GeneratedMessageFactory::singleton()->RegisterFile(filename, - assign_descriptors_table); + google::protobuf::internal::DescriptorTable* table) { + GeneratedMessageFactory::singleton()->RegisterFile(table); } void MessageFactory::InternalRegisterGeneratedMessage( diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h index e274383cd0..3dc25267e1 100644 --- a/src/google/protobuf/message.h +++ b/src/google/protobuf/message.h @@ -147,6 +147,7 @@ class MapIterator; class MapReflectionTester; namespace internal { +struct DescriptorTable; class MapFieldBase; } class UnknownFieldSet; // unknown_field_set.h @@ -1087,8 +1088,8 @@ class PROTOBUF_EXPORT MessageFactory { // in the file. This strange mechanism is necessary because descriptors are // built lazily, so we can't register types by their descriptor until we // know that the descriptor exists. |filename| must be a permanent string. - static void InternalRegisterGeneratedFile(const char* filename, - void* assign_descriptors_table); + static void InternalRegisterGeneratedFile( + google::protobuf::internal::DescriptorTable* table); // For internal use only: Registers a message type. Called only by the // functions which are registered with InternalRegisterGeneratedFile(), diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc index 1f66be5a58..cf9308655d 100644 --- a/src/google/protobuf/source_context.pb.cc +++ b/src/google/protobuf/source_context.pb.cc @@ -56,12 +56,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fsource_5fcontext_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fsource_5fcontext_2eproto, "google/protobuf/source_context.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto, file_level_service_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto[] = "\n$google/protobuf/source_context.proto\022\017" "google.protobuf\"\"\n\rSourceContext\022\021\n\tfile" @@ -71,9 +65,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eprot "text\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTy" "pesb\006proto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto, - "google/protobuf/source_context.proto", &assign_descriptors_table_google_2fprotobuf_2fsource_5fcontext_2eproto, 251, + false, descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto, "google/protobuf/source_context.proto", 251, + &descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once, AddDescriptors_google_2fprotobuf_2fsource_5fcontext_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto, file_level_service_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto, }; void AddDescriptors_google_2fprotobuf_2fsource_5fcontext_2eproto() { @@ -362,7 +359,7 @@ void SourceContext::InternalSwap(SourceContext* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata SourceContext::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fsource_5fcontext_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto); return ::file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index a34cac3980..69edaf6695 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -125,12 +125,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_ListValue_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fstruct_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fstruct_2eproto, "google/protobuf/struct.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fstruct_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fstruct_2eproto, 4, file_level_enum_descriptors_google_2fprotobuf_2fstruct_2eproto, file_level_service_descriptors_google_2fprotobuf_2fstruct_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto[] = "\n\034google/protobuf/struct.proto\022\017google.p" "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo" @@ -150,9 +144,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto[] = "\252\002\036Google.Protobuf.WellKnownTypesb\006proto" "3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fstruct_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fstruct_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto, - "google/protobuf/struct.proto", &assign_descriptors_table_google_2fprotobuf_2fstruct_2eproto, 641, + false, descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto, "google/protobuf/struct.proto", 641, + &descriptor_table_google_2fprotobuf_2fstruct_2eproto_once, AddDescriptors_google_2fprotobuf_2fstruct_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fstruct_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fstruct_2eproto, 4, file_level_enum_descriptors_google_2fprotobuf_2fstruct_2eproto, file_level_service_descriptors_google_2fprotobuf_2fstruct_2eproto, }; void AddDescriptors_google_2fprotobuf_2fstruct_2eproto() { @@ -167,7 +164,7 @@ void AddDescriptors_google_2fprotobuf_2fstruct_2eproto() { static bool dynamic_init_dummy_google_2fprotobuf_2fstruct_2eproto = []() { AddDescriptors_google_2fprotobuf_2fstruct_2eproto(); return true; }(); PROTOBUF_NAMESPACE_OPEN const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* NullValue_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2fstruct_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fstruct_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2fstruct_2eproto[0]; } bool NullValue_IsValid(int value) { @@ -189,7 +186,7 @@ void Struct_FieldsEntry_DoNotUse::MergeFrom(const Struct_FieldsEntry_DoNotUse& o MergeFromInternal(other); } ::PROTOBUF_NAMESPACE_ID::Metadata Struct_FieldsEntry_DoNotUse::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fstruct_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fstruct_2eproto); return ::file_level_metadata_google_2fprotobuf_2fstruct_2eproto[0]; } void Struct_FieldsEntry_DoNotUse::MergeFrom( @@ -575,7 +572,7 @@ void Struct::InternalSwap(Struct* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Struct::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fstruct_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fstruct_2eproto); return ::file_level_metadata_google_2fprotobuf_2fstruct_2eproto[kIndexInFileMessages]; } @@ -1224,7 +1221,7 @@ void Value::InternalSwap(Value* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Value::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fstruct_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fstruct_2eproto); return ::file_level_metadata_google_2fprotobuf_2fstruct_2eproto[kIndexInFileMessages]; } @@ -1526,7 +1523,7 @@ void ListValue::InternalSwap(ListValue* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata ListValue::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fstruct_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fstruct_2eproto); return ::file_level_metadata_google_2fprotobuf_2fstruct_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index 6ec599187a..3187af7785 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -57,12 +57,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2ftimestamp_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2ftimestamp_2eproto, "google/protobuf/timestamp.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2ftimestamp_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2ftimestamp_2eproto, file_level_service_descriptors_google_2fprotobuf_2ftimestamp_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto[] = "\n\037google/protobuf/timestamp.proto\022\017googl" "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003" @@ -71,9 +65,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto[] = "obuf/ptypes/timestamp\370\001\001\242\002\003GPB\252\002\036Google." "Protobuf.WellKnownTypesb\006proto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ftimestamp_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto, - "google/protobuf/timestamp.proto", &assign_descriptors_table_google_2fprotobuf_2ftimestamp_2eproto, 231, + false, descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto, "google/protobuf/timestamp.proto", 231, + &descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once, AddDescriptors_google_2fprotobuf_2ftimestamp_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2ftimestamp_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2ftimestamp_2eproto, file_level_service_descriptors_google_2fprotobuf_2ftimestamp_2eproto, }; void AddDescriptors_google_2fprotobuf_2ftimestamp_2eproto() { @@ -419,7 +416,7 @@ void Timestamp::InternalSwap(Timestamp* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Timestamp::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2ftimestamp_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto); return ::file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index d75b30a319..5fddd13517 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -195,12 +195,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Option_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2ftype_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2ftype_2eproto, "google/protobuf/type.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2ftype_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2ftype_2eproto, 5, file_level_enum_descriptors_google_2fprotobuf_2ftype_2eproto, file_level_service_descriptors_google_2fprotobuf_2ftype_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2ftype_2eproto[] = "\n\032google/protobuf/type.proto\022\017google.pro" "tobuf\032\031google/protobuf/any.proto\032$google" @@ -243,9 +237,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2ftype_2eproto[] = "oto/protobuf/ptype;ptype\370\001\001\242\002\003GPB\252\002\036Goog" "le.Protobuf.WellKnownTypesb\006proto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2ftype_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ftype_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2ftype_2eproto, - "google/protobuf/type.proto", &assign_descriptors_table_google_2fprotobuf_2ftype_2eproto, 1594, + false, descriptor_table_protodef_google_2fprotobuf_2ftype_2eproto, "google/protobuf/type.proto", 1594, + &descriptor_table_google_2fprotobuf_2ftype_2eproto_once, AddDescriptors_google_2fprotobuf_2ftype_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2ftype_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2ftype_2eproto, 5, file_level_enum_descriptors_google_2fprotobuf_2ftype_2eproto, file_level_service_descriptors_google_2fprotobuf_2ftype_2eproto, }; void AddDescriptors_google_2fprotobuf_2ftype_2eproto() { @@ -266,7 +263,7 @@ void AddDescriptors_google_2fprotobuf_2ftype_2eproto() { static bool dynamic_init_dummy_google_2fprotobuf_2ftype_2eproto = []() { AddDescriptors_google_2fprotobuf_2ftype_2eproto(); return true; }(); PROTOBUF_NAMESPACE_OPEN const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Field_Kind_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2ftype_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2ftype_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2ftype_2eproto[0]; } bool Field_Kind_IsValid(int value) { @@ -321,7 +318,7 @@ constexpr Field_Kind Field::Kind_MAX; constexpr int Field::Kind_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Field_Cardinality_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2ftype_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2ftype_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2ftype_2eproto[1]; } bool Field_Cardinality_IsValid(int value) { @@ -346,7 +343,7 @@ constexpr Field_Cardinality Field::Cardinality_MAX; constexpr int Field::Cardinality_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Syntax_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&assign_descriptors_table_google_2fprotobuf_2ftype_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2ftype_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2ftype_2eproto[2]; } bool Syntax_IsValid(int value) { @@ -969,7 +966,7 @@ void Type::InternalSwap(Type* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Type::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2ftype_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2ftype_2eproto); return ::file_level_metadata_google_2fprotobuf_2ftype_2eproto[kIndexInFileMessages]; } @@ -1750,7 +1747,7 @@ void Field::InternalSwap(Field* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Field::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2ftype_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2ftype_2eproto); return ::file_level_metadata_google_2fprotobuf_2ftype_2eproto[kIndexInFileMessages]; } @@ -2302,7 +2299,7 @@ void Enum::InternalSwap(Enum* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Enum::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2ftype_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2ftype_2eproto); return ::file_level_metadata_google_2fprotobuf_2ftype_2eproto[kIndexInFileMessages]; } @@ -2713,7 +2710,7 @@ void EnumValue::InternalSwap(EnumValue* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata EnumValue::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2ftype_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2ftype_2eproto); return ::file_level_metadata_google_2fprotobuf_2ftype_2eproto[kIndexInFileMessages]; } @@ -3102,7 +3099,7 @@ void Option::InternalSwap(Option* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Option::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2ftype_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2ftype_2eproto); return ::file_level_metadata_google_2fprotobuf_2ftype_2eproto[kIndexInFileMessages]; } diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc index bedf4e1d8a..30675b312f 100644 --- a/src/google/protobuf/wrappers.pb.cc +++ b/src/google/protobuf/wrappers.pb.cc @@ -264,12 +264,6 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_BytesValue_default_instance_), }; -static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto = { - {}, AddDescriptors_google_2fprotobuf_2fwrappers_2eproto, "google/protobuf/wrappers.proto", schemas, - file_default_instances, TableStruct_google_2fprotobuf_2fwrappers_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fwrappers_2eproto, 9, file_level_enum_descriptors_google_2fprotobuf_2fwrappers_2eproto, file_level_service_descriptors_google_2fprotobuf_2fwrappers_2eproto, -}; - const char descriptor_table_protodef_google_2fprotobuf_2fwrappers_2eproto[] = "\n\036google/protobuf/wrappers.proto\022\017google" ".protobuf\"\034\n\013DoubleValue\022\r\n\005value\030\001 \001(\001\"" @@ -284,9 +278,12 @@ const char descriptor_table_protodef_google_2fprotobuf_2fwrappers_2eproto[] = "\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTypesb" "\006proto3" ; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fwrappers_2eproto_once; static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fwrappers_2eproto = { - false, descriptor_table_protodef_google_2fprotobuf_2fwrappers_2eproto, - "google/protobuf/wrappers.proto", &assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto, 447, + false, descriptor_table_protodef_google_2fprotobuf_2fwrappers_2eproto, "google/protobuf/wrappers.proto", 447, + &descriptor_table_google_2fprotobuf_2fwrappers_2eproto_once, AddDescriptors_google_2fprotobuf_2fwrappers_2eproto, schemas, + file_default_instances, TableStruct_google_2fprotobuf_2fwrappers_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fwrappers_2eproto, 9, file_level_enum_descriptors_google_2fprotobuf_2fwrappers_2eproto, file_level_service_descriptors_google_2fprotobuf_2fwrappers_2eproto, }; void AddDescriptors_google_2fprotobuf_2fwrappers_2eproto() { @@ -590,7 +587,7 @@ void DoubleValue::InternalSwap(DoubleValue* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata DoubleValue::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } @@ -876,7 +873,7 @@ void FloatValue::InternalSwap(FloatValue* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata FloatValue::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } @@ -1164,7 +1161,7 @@ void Int64Value::InternalSwap(Int64Value* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Int64Value::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } @@ -1452,7 +1449,7 @@ void UInt64Value::InternalSwap(UInt64Value* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata UInt64Value::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } @@ -1740,7 +1737,7 @@ void Int32Value::InternalSwap(Int32Value* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata Int32Value::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } @@ -2028,7 +2025,7 @@ void UInt32Value::InternalSwap(UInt32Value* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata UInt32Value::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } @@ -2314,7 +2311,7 @@ void BoolValue::InternalSwap(BoolValue* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata BoolValue::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } @@ -2623,7 +2620,7 @@ void StringValue::InternalSwap(StringValue* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata StringValue::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } @@ -2920,7 +2917,7 @@ void BytesValue::InternalSwap(BytesValue* other) { } ::PROTOBUF_NAMESPACE_ID::Metadata BytesValue::GetMetadata() const { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fwrappers_2eproto); + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_google_2fprotobuf_2fwrappers_2eproto); return ::file_level_metadata_google_2fprotobuf_2fwrappers_2eproto[kIndexInFileMessages]; } From 3d69bad4b2eaa9ad9ce2ddabd2c2b04b994c2671 Mon Sep 17 00:00:00 2001 From: Hao Nguyen Date: Wed, 10 Apr 2019 13:33:56 -0700 Subject: [PATCH 2/3] Update generated proto and remove a test from failure_list --- conformance/failure_list_ruby.txt | 1 - csharp/src/Google.Protobuf.Test/testprotos.pb | Bin 205179 -> 205179 bytes .../Google.Protobuf/Reflection/Descriptor.cs | 4 ++-- .../Google/Protobuf/Internal/FileOptions.php | 16 ++++++++-------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/conformance/failure_list_ruby.txt b/conformance/failure_list_ruby.txt index 9b5ba7f14f..651cb55f57 100644 --- a/conformance/failure_list_ruby.txt +++ b/conformance/failure_list_ruby.txt @@ -65,4 +65,3 @@ Required.Proto3.JsonInput.IgnoreUnknownJsonNumber.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput -Required.Proto3.JsonInput.EmptyFieldMask.JsonOutput diff --git a/csharp/src/Google.Protobuf.Test/testprotos.pb b/csharp/src/Google.Protobuf.Test/testprotos.pb index 9c68af0849e5121ef8a32d0c087f951b74f8b70c..4cac7ba0cce2e7574b9bbff1632ccfd9e56901cd 100644 GIT binary patch delta 6806 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ΠO2Pw@#jGT-IXQAjg~3u&Jy zGgD+id=+AMb8!Hp*oA0LFE6IHve|lqD0Hrg>9e#B&id;@%u1hP9mA6io$CP)o-KWr zn4PXIp|DWOSJHc4y6ptaMgYs4S+tc1tP!vUDYL$g>M7o+wRl6`wQ3tOhw3Rm zm+CSnX3{H>@>*A%BP@ttmpFt!VUirKjW;AncHcxbROXRj6k2b{+6Fb(RYLl_DMfwy z%#Y~)xOc+j2;Q|fWp!<4c?;cX(WK0=o2k-a@}7h&SCz(~NkeyW}e@ z{=3DB74HexHD-zzdE(_ip;1PhaK%rt_<^6&kBJJ?r*5O^c7B1H zfwMhZNeRt8+lC z?WJ&{D)Z+hRFk0k%*P#c+N!EkaTS$$e0Sgn^y87zTJ=|fDR~H+b}%CAGiST#G0F>6 miB%6mHS@qa`X);C>E6xsj#e0Dxc&i!U#;w+%*q~7dgQ;b#p2)q delta 6790 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 /// Use this option to change the namespace of php generated metadata classes. - /// Default is empty. When this option is empty, the proto file name will be used - /// for determining the namespace. + /// Default is empty. When this option is empty, the proto file name will be + /// used for determining the namespace. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string PhpMetadataNamespace { diff --git a/php/src/Google/Protobuf/Internal/FileOptions.php b/php/src/Google/Protobuf/Internal/FileOptions.php index c6b36bbc89..6fea195ec1 100644 --- a/php/src/Google/Protobuf/Internal/FileOptions.php +++ b/php/src/Google/Protobuf/Internal/FileOptions.php @@ -175,8 +175,8 @@ class FileOptions extends \Google\Protobuf\Internal\Message private $has_php_namespace = false; /** * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be used - * for determining the namespace. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. * * Generated from protobuf field optional string php_metadata_namespace = 44; */ @@ -280,8 +280,8 @@ class FileOptions extends \Google\Protobuf\Internal\Message * determining the namespace. * @type string $php_metadata_namespace * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be used - * for determining the namespace. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. * @type string $ruby_package * Use this option to change the package of ruby generated classes. Default * is empty. When this option is not set, the package name will be used for @@ -938,8 +938,8 @@ class FileOptions extends \Google\Protobuf\Internal\Message /** * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be used - * for determining the namespace. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. * * Generated from protobuf field optional string php_metadata_namespace = 44; * @return string @@ -951,8 +951,8 @@ class FileOptions extends \Google\Protobuf\Internal\Message /** * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be used - * for determining the namespace. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. * * Generated from protobuf field optional string php_metadata_namespace = 44; * @param string $var From 466615a8e2abb4ddd37475232e0fd897bcd5da4c Mon Sep 17 00:00:00 2001 From: Hao Nguyen Date: Wed, 10 Apr 2019 13:52:28 -0700 Subject: [PATCH 3/3] Remove Required.Proto3.JsonInput.EmptyFieldMask.JsonOutput from ruby_mac too --- conformance/failure_list_ruby_mac.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/conformance/failure_list_ruby_mac.txt b/conformance/failure_list_ruby_mac.txt index 86a5da183d..3114cba878 100644 --- a/conformance/failure_list_ruby_mac.txt +++ b/conformance/failure_list_ruby_mac.txt @@ -70,4 +70,3 @@ Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter -Required.Proto3.JsonInput.EmptyFieldMask.JsonOutput