diff options
Diffstat (limited to 'src')
102 files changed, 4357 insertions, 3505 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 8807effd..ab9eb31b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -74,7 +74,6 @@ nobase_include_HEADERS = \ google/protobuf/stubs/atomicops_internals_atomicword_compat.h \ google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h \ google/protobuf/stubs/atomicops_internals_generic_gcc.h \ - google/protobuf/stubs/atomicops_internals_macosx.h \ google/protobuf/stubs/atomicops_internals_mips_gcc.h \ google/protobuf/stubs/atomicops_internals_solaris.h \ google/protobuf/stubs/atomicops_internals_tsan.h \ @@ -180,7 +179,7 @@ nobase_include_HEADERS = \ lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) -libprotobuf_lite_la_LDFLAGS = -version-info 11:0:0 -export-dynamic -no-undefined +libprotobuf_lite_la_LDFLAGS = -version-info 12:0:0 -export-dynamic -no-undefined libprotobuf_lite_la_SOURCES = \ google/protobuf/stubs/atomicops_internals_x86_gcc.cc \ google/protobuf/stubs/atomicops_internals_x86_msvc.cc \ @@ -221,7 +220,7 @@ libprotobuf_lite_la_SOURCES = \ google/protobuf/io/zero_copy_stream_impl_lite.cc libprotobuf_la_LIBADD = $(PTHREAD_LIBS) -libprotobuf_la_LDFLAGS = -version-info 11:0:0 -export-dynamic -no-undefined +libprotobuf_la_LDFLAGS = -version-info 12:0:0 -export-dynamic -no-undefined libprotobuf_la_SOURCES = \ $(libprotobuf_lite_la_SOURCES) \ google/protobuf/any.pb.cc \ @@ -305,7 +304,7 @@ libprotobuf_la_SOURCES = \ nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES) libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la -libprotoc_la_LDFLAGS = -version-info 11:0:0 -export-dynamic -no-undefined +libprotoc_la_LDFLAGS = -version-info 12:0:0 -export-dynamic -no-undefined libprotoc_la_SOURCES = \ google/protobuf/compiler/code_generator.cc \ google/protobuf/compiler/command_line_interface.cc \ diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index 2f0b5e8d..407dc0ad 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -19,8 +19,11 @@ namespace google { namespace protobuf { -class AnyDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Any> {}; -AnyDefaultTypeInternal _Any_default_instance_; +class AnyDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Any> { +} _Any_default_instance_; + +namespace protobuf_google_2fprotobuf_2fany_2eproto { + namespace { @@ -28,35 +31,30 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fany_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fany_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_), - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(Any)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_Any_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_Any_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/any.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fany_2eproto(), factory, + "google/protobuf/any.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -73,24 +71,24 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto() { +void TableStruct::Shutdown() { _Any_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _Any_default_instance_.DefaultConstruct(); } -void protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\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" @@ -103,20 +101,22 @@ void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_impl() { descriptor, 205); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/any.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fany_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fany_2eproto + // =================================================================== @@ -141,7 +141,7 @@ const int Any::kValueFieldNumber; Any::Any() : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto(); + protobuf_google_2fprotobuf_2fany_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Any) @@ -185,12 +185,12 @@ void Any::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Any::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2fany_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[0].descriptor; } const Any& Any::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto(); + protobuf_google_2fprotobuf_2fany_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -220,7 +220,8 @@ bool Any::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string type_url = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -235,7 +236,8 @@ bool Any::MergePartialFromCodedStream( // bytes value = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_value())); } else { @@ -289,7 +291,7 @@ void Any::SerializeWithCachedSizes( ::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any) // string type_url = 1; if (this->type_url().size() > 0) { @@ -396,8 +398,8 @@ void Any::InternalSwap(Any* other) { } ::google::protobuf::Metadata Any::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2fany_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index 48bb3c4f..1a61d5af 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -40,9 +41,16 @@ LIBPROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_; namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2fany_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fany_2eproto // =================================================================== @@ -99,7 +107,8 @@ class LIBPROTOBUF_EXPORT Any : public ::google::protobuf::Message /* @@protoc_in bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -158,11 +167,7 @@ class LIBPROTOBUF_EXPORT Any : public ::google::protobuf::Message /* @@protoc_in ::google::protobuf::internal::ArenaStringPtr value_; mutable int _cached_size_; ::google::protobuf::internal::AnyMetadata _any_metadata_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fany_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fany_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fany_2eproto::TableStruct; }; // =================================================================== diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index f0254fa3..7965d1ce 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -19,12 +19,15 @@ namespace google { namespace protobuf { -class ApiDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Api> {}; -ApiDefaultTypeInternal _Api_default_instance_; -class MethodDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Method> {}; -MethodDefaultTypeInternal _Method_default_instance_; -class MixinDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Mixin> {}; -MixinDefaultTypeInternal _Mixin_default_instance_; +class ApiDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Api> { +} _Api_default_instance_; +class MethodDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Method> { +} _Method_default_instance_; +class MixinDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Mixin> { +} _Mixin_default_instance_; + +namespace protobuf_google_2fprotobuf_2fapi_2eproto { + namespace { @@ -32,41 +35,36 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fapi_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fapi_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, methods_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, version_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, source_context_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, mixins_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, syntax_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, request_type_url_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, request_streaming_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, response_type_url_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, response_streaming_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, syntax_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, root_), - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, methods_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, source_context_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, mixins_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, syntax_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, request_type_url_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, request_streaming_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, response_type_url_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, response_streaming_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, syntax_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, root_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(Api)}, @@ -74,19 +72,19 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 22, -1, sizeof(Mixin)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_Api_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_Method_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_Mixin_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_Api_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_Method_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_Mixin_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/api.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fapi_2eproto(), factory, + "google/protobuf/api.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -103,7 +101,7 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fapi_2eproto() { +void TableStruct::Shutdown() { _Api_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; _Method_default_instance_.Shutdown(); @@ -112,12 +110,12 @@ void protobuf_ShutdownFile_google_2fprotobuf_2fapi_2eproto() { delete file_level_metadata[2].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; - ::google::protobuf::protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto(); - ::google::protobuf::protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); ::google::protobuf::internal::InitProtobufDefaults(); + ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaults(); + ::google::protobuf::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); _Api_default_instance_.DefaultConstruct(); _Method_default_instance_.DefaultConstruct(); _Mixin_default_instance_.DefaultConstruct(); @@ -125,12 +123,12 @@ void protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto_impl() { ::google::protobuf::SourceContext::internal_default_instance()); } -void protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n\031google/protobuf/api.proto\022\017google.prot" "obuf\032$google/protobuf/source_context.pro" @@ -156,22 +154,24 @@ void protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto_impl() { descriptor, 750); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/api.proto", &protobuf_RegisterTypes); - ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto(); - ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fapi_2eproto); + ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors(); + ::google::protobuf::protobuf_google_2fprotobuf_2ftype_2eproto::AddDescriptors(); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fapi_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fapi_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fapi_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fapi_2eproto + // =================================================================== @@ -188,7 +188,7 @@ const int Api::kSyntaxFieldNumber; Api::Api() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto(); + protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Api) @@ -245,12 +245,12 @@ void Api::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Api::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[0].descriptor; } const Api& Api::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto(); + protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -288,7 +288,8 @@ bool Api::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -303,7 +304,8 @@ bool Api::MergePartialFromCodedStream( // repeated .google.protobuf.Method methods = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_methods())); @@ -316,7 +318,8 @@ bool Api::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); @@ -329,7 +332,8 @@ bool Api::MergePartialFromCodedStream( // string version = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_version())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -344,7 +348,8 @@ bool Api::MergePartialFromCodedStream( // .google.protobuf.SourceContext source_context = 5; case 5: { - if (tag == 42u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_source_context())); } else { @@ -355,7 +360,8 @@ bool Api::MergePartialFromCodedStream( // repeated .google.protobuf.Mixin mixins = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_mixins())); @@ -368,7 +374,8 @@ bool Api::MergePartialFromCodedStream( // .google.protobuf.Syntax syntax = 7; case 7: { - if (tag == 56u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(56u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -459,7 +466,7 @@ void Api::SerializeWithCachedSizes( ::google::protobuf::uint8* Api::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Api) // string name = 1; if (this->name().size() > 0) { @@ -664,8 +671,8 @@ void Api::InternalSwap(Api* other) { } ::google::protobuf::Metadata Api::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -935,7 +942,7 @@ const int Method::kSyntaxFieldNumber; Method::Method() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto(); + protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Method) @@ -990,12 +997,12 @@ void Method::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Method::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1].descriptor; + protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[1].descriptor; } const Method& Method::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto(); + protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1029,7 +1036,8 @@ bool Method::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1044,7 +1052,8 @@ bool Method::MergePartialFromCodedStream( // string request_type_url = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_request_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1059,7 +1068,8 @@ bool Method::MergePartialFromCodedStream( // bool request_streaming = 3; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -1072,7 +1082,8 @@ bool Method::MergePartialFromCodedStream( // string response_type_url = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_response_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1087,7 +1098,8 @@ bool Method::MergePartialFromCodedStream( // bool response_streaming = 5; case 5: { - if (tag == 40u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -1100,7 +1112,8 @@ bool Method::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); @@ -1113,7 +1126,8 @@ bool Method::MergePartialFromCodedStream( // .google.protobuf.Syntax syntax = 7; case 7: { - if (tag == 56u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(56u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -1206,7 +1220,7 @@ void Method::SerializeWithCachedSizes( ::google::protobuf::uint8* Method::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Method) // string name = 1; if (this->name().size() > 0) { @@ -1404,8 +1418,8 @@ void Method::InternalSwap(Method* other) { } ::google::protobuf::Metadata Method::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1]; + protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[1]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1651,7 +1665,7 @@ const int Mixin::kRootFieldNumber; Mixin::Mixin() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto(); + protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Mixin) @@ -1694,12 +1708,12 @@ void Mixin::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Mixin::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2].descriptor; + protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[2].descriptor; } const Mixin& Mixin::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto(); + protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1729,7 +1743,8 @@ bool Mixin::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1744,7 +1759,8 @@ bool Mixin::MergePartialFromCodedStream( // string root = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_root())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1806,7 +1822,7 @@ void Mixin::SerializeWithCachedSizes( ::google::protobuf::uint8* Mixin::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Mixin) // string name = 1; if (this->name().size() > 0) { @@ -1917,8 +1933,8 @@ void Mixin::InternalSwap(Mixin* other) { } ::google::protobuf::Metadata Mixin::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2]; + protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[2]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index 16347dda..2eb571e6 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -65,9 +66,16 @@ LIBPROTOBUF_EXPORT extern TypeDefaultTypeInternal _Type_default_instance_; namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2fapi_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fapi_2eproto // =================================================================== @@ -114,7 +122,8 @@ class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_in bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -137,20 +146,6 @@ class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_in // accessors ------------------------------------------------------- - // string name = 1; - void clear_name(); - static const int kNameFieldNumber = 1; - const ::std::string& name() const; - void set_name(const ::std::string& value); - #if LANG_CXX11 - void set_name(::std::string&& value); - #endif - void set_name(const char* value); - void set_name(const char* value, size_t size); - ::std::string* mutable_name(); - ::std::string* release_name(); - void set_allocated_name(::std::string* name); - // repeated .google.protobuf.Method methods = 2; int methods_size() const; void clear_methods(); @@ -175,6 +170,32 @@ class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_in const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& options() const; + // repeated .google.protobuf.Mixin mixins = 6; + int mixins_size() const; + void clear_mixins(); + static const int kMixinsFieldNumber = 6; + const ::google::protobuf::Mixin& mixins(int index) const; + ::google::protobuf::Mixin* mutable_mixins(int index); + ::google::protobuf::Mixin* add_mixins(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >* + mutable_mixins(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >& + mixins() const; + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + // string version = 4; void clear_version(); static const int kVersionFieldNumber = 4; @@ -198,18 +219,6 @@ class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_in ::google::protobuf::SourceContext* release_source_context(); void set_allocated_source_context(::google::protobuf::SourceContext* source_context); - // repeated .google.protobuf.Mixin mixins = 6; - int mixins_size() const; - void clear_mixins(); - static const int kMixinsFieldNumber = 6; - const ::google::protobuf::Mixin& mixins(int index) const; - ::google::protobuf::Mixin* mutable_mixins(int index); - ::google::protobuf::Mixin* add_mixins(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >* - mutable_mixins(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >& - mixins() const; - // .google.protobuf.Syntax syntax = 7; void clear_syntax(); static const int kSyntaxFieldNumber = 7; @@ -228,11 +237,7 @@ class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_in ::google::protobuf::SourceContext* source_context_; int syntax_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fapi_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fapi_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -279,7 +284,8 @@ class LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -302,6 +308,18 @@ class LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc // accessors ------------------------------------------------------- + // repeated .google.protobuf.Option options = 6; + int options_size() const; + void clear_options(); + static const int kOptionsFieldNumber = 6; + const ::google::protobuf::Option& options(int index) const; + ::google::protobuf::Option* mutable_options(int index); + ::google::protobuf::Option* add_options(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* + mutable_options(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& + options() const; + // string name = 1; void clear_name(); static const int kNameFieldNumber = 1; @@ -330,12 +348,6 @@ class LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc ::std::string* release_request_type_url(); void set_allocated_request_type_url(::std::string* request_type_url); - // bool request_streaming = 3; - void clear_request_streaming(); - static const int kRequestStreamingFieldNumber = 3; - bool request_streaming() const; - void set_request_streaming(bool value); - // string response_type_url = 4; void clear_response_type_url(); static const int kResponseTypeUrlFieldNumber = 4; @@ -350,24 +362,18 @@ class LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc ::std::string* release_response_type_url(); void set_allocated_response_type_url(::std::string* response_type_url); + // bool request_streaming = 3; + void clear_request_streaming(); + static const int kRequestStreamingFieldNumber = 3; + bool request_streaming() const; + void set_request_streaming(bool value); + // bool response_streaming = 5; void clear_response_streaming(); static const int kResponseStreamingFieldNumber = 5; bool response_streaming() const; void set_response_streaming(bool value); - // repeated .google.protobuf.Option options = 6; - int options_size() const; - void clear_options(); - static const int kOptionsFieldNumber = 6; - const ::google::protobuf::Option& options(int index) const; - ::google::protobuf::Option* mutable_options(int index); - ::google::protobuf::Option* add_options(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* - mutable_options(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& - options() const; - // .google.protobuf.Syntax syntax = 7; void clear_syntax(); static const int kSyntaxFieldNumber = 7; @@ -386,11 +392,7 @@ class LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc bool response_streaming_; int syntax_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fapi_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fapi_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -437,7 +439,8 @@ class LIBPROTOBUF_EXPORT Mixin : public ::google::protobuf::Message /* @@protoc_ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -495,11 +498,7 @@ class LIBPROTOBUF_EXPORT Mixin : public ::google::protobuf::Message /* @@protoc_ ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr root_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fapi_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fapi_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fapi_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fapi_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; }; // =================================================================== diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index 21fd1be6..16cf8951 100755 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -62,6 +62,7 @@ void Arena::Init() { lifecycle_id_ = lifecycle_id_generator_.GetNext(); blocks_ = 0; hint_ = 0; + space_allocated_ = 0; owns_first_block_ = true; cleanup_list_ = 0; @@ -157,6 +158,7 @@ void Arena::AddBlockInternal(Block* b) { // Direct future allocations to this block. google::protobuf::internal::Release_Store(&hint_, reinterpret_cast<google::protobuf::internal::AtomicWord>(b)); } + space_allocated_ += b->size; } void Arena::AddListNode(void* elem, void (*cleanup)(void*)) { @@ -225,13 +227,8 @@ void* Arena::SlowAlloc(size_t n) { } uint64 Arena::SpaceAllocated() const { - uint64 space_allocated = 0; - Block* b = reinterpret_cast<Block*>(google::protobuf::internal::NoBarrier_Load(&blocks_)); - while (b != NULL) { - space_allocated += (b->size); - b = b->next; - } - return space_allocated; + MutexLock l(&blocks_lock_); + return space_allocated_; } uint64 Arena::SpaceUsed() const { @@ -245,16 +242,7 @@ uint64 Arena::SpaceUsed() const { } std::pair<uint64, uint64> Arena::SpaceAllocatedAndUsed() const { - uint64 allocated = 0; - uint64 used = 0; - - Block* b = reinterpret_cast<Block*>(google::protobuf::internal::NoBarrier_Load(&blocks_)); - while (b != NULL) { - allocated += b->size; - used += (b->pos - kHeaderSize); - b = b->next; - } - return std::make_pair(allocated, used); + return std::make_pair(SpaceAllocated(), SpaceUsed()); } uint64 Arena::FreeBlocks() { @@ -288,6 +276,7 @@ uint64 Arena::FreeBlocks() { } blocks_ = 0; hint_ = 0; + space_allocated_ = 0; if (!owns_first_block_) { // Make the first block that was passed in through ArenaOptions // available for reuse. diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index 87066507..05e05ebc 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -322,6 +322,17 @@ class LIBPROTOBUF_EXPORT Arena { arg); } } +#if LANG_CXX11 + template <typename T, typename Arg> GOOGLE_ATTRIBUTE_ALWAYS_INLINE + static T* Create(::google::protobuf::Arena* arena, Arg&& arg) { + if (arena == NULL) { + return new T(std::move(arg)); + } else { + return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value, + std::move(arg)); + } + } +#endif // Version of the above with two constructor arguments for the created object. template <typename T, typename Arg1, typename Arg2> GOOGLE_ATTRIBUTE_ALWAYS_INLINE @@ -449,14 +460,17 @@ class LIBPROTOBUF_EXPORT Arena { } } - // Returns the total space used by the arena, which is the sums of the sizes - // of the underlying blocks. The total space used may not include the new - // blocks that are allocated by this arena from other threads concurrently - // with the call to this method. - GOOGLE_ATTRIBUTE_NOINLINE uint64 SpaceAllocated() const; - // As above, but does not include any free space in underlying blocks. + // Returns the total space allocated by the arena, which is the sum of the + // sizes of the underlying blocks. This method is relatively fast; a counter + // is kept as blocks are allocated. + uint64 SpaceAllocated() const; + // Returns the total space used by the arena. Similar to SpaceAllocated but + // does not include free space and block overhead. The total space returned + // may not include space used by other threads executing concurrently with + // the call to this method. GOOGLE_ATTRIBUTE_NOINLINE uint64 SpaceUsed() const; - + // DEPRECATED. Please use SpaceAllocated() and SpaceUsed(). + // // Combines SpaceAllocated and SpaceUsed. Returns a pair of // <space_allocated, space_used>. GOOGLE_ATTRIBUTE_NOINLINE std::pair<uint64, uint64> SpaceAllocatedAndUsed() const; @@ -659,6 +673,18 @@ class LIBPROTOBUF_EXPORT Arena { return t; } +#if LANG_CXX11 + template <typename T, typename Arg> GOOGLE_ATTRIBUTE_ALWAYS_INLINE + T* CreateInternal(bool skip_explicit_ownership, Arg&& arg) { + T* t = new (AllocateAligned(RTTI_TYPE_ID(T), sizeof(T))) T( + std::move(arg)); + if (!skip_explicit_ownership) { + AddListNode(t, &internal::arena_destruct_object<T>); + } + return t; + } +#endif + template <typename T, typename Arg1, typename Arg2> GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal( bool skip_explicit_ownership, const Arg1& arg1, const Arg2& arg2) { @@ -884,8 +910,9 @@ class LIBPROTOBUF_EXPORT Arena { int64 lifecycle_id_; // Unique for each arena. Changes on Reset(). - google::protobuf::internal::AtomicWord blocks_; // Head of linked list of all allocated blocks - google::protobuf::internal::AtomicWord hint_; // Fast thread-local block access + google::protobuf::internal::AtomicWord blocks_; // Head of linked list of all allocated blocks + google::protobuf::internal::AtomicWord hint_; // Fast thread-local block access + uint64 space_allocated_; // Sum of sizes of all allocated blocks. // Node contains the ptr of the object to be cleaned up and the associated // cleanup function ptr. @@ -899,7 +926,7 @@ class LIBPROTOBUF_EXPORT Arena { // ptrs and cleanup methods. bool owns_first_block_; // Indicates that arena owns the first block - Mutex blocks_lock_; + mutable Mutex blocks_lock_; void AddBlock(Block* b); // Access must be synchronized, either by blocks_lock_ or by being called from diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index bef0fe5a..0c9b1fb5 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -116,6 +116,9 @@ static const char* kPathSeparator = ";"; static const char* kPathSeparator = ":"; #endif +static const char* kDefaultDirectDependenciesViolationMsg = + "File is imported but not declared in --direct_dependencies: %s"; + // Returns true if the text looks like a Windows-style absolute path, starting // with a drive letter. Example: "C:\foo". TODO(kenton): Share this with // copy in importer.cc? @@ -276,12 +279,13 @@ class CommandLineInterface::ErrorPrinter : public MultiFileErrorCollector, public io::ErrorCollector { public: ErrorPrinter(ErrorFormat format, DiskSourceTree *tree = NULL) - : format_(format), tree_(tree) {} + : format_(format), tree_(tree), found_errors_(false) {} ~ErrorPrinter() {} // implements MultiFileErrorCollector ------------------------------ void AddError(const string& filename, int line, int column, const string& message) { + found_errors_ = true; AddErrorOrWarning(filename, line, column, message, "error", std::cerr); } @@ -299,10 +303,12 @@ class CommandLineInterface::ErrorPrinter : public MultiFileErrorCollector, AddErrorOrWarning("input", line, column, message, "warning", std::clog); } + bool FoundErrors() const { return found_errors_; } + private: - void AddErrorOrWarning( - const string& filename, int line, int column, - const string& message, const string& type, ostream& out) { + void AddErrorOrWarning(const string& filename, int line, int column, + const string& message, const string& type, + std::ostream& out) { // Print full path when running under MSVS string dfile; if (format_ == CommandLineInterface::ERROR_FORMAT_MSVS && @@ -337,6 +343,7 @@ class CommandLineInterface::ErrorPrinter : public MultiFileErrorCollector, const ErrorFormat format_; DiskSourceTree *tree_; + bool found_errors_; }; // ------------------------------------------------------------------- @@ -708,14 +715,17 @@ CommandLineInterface::MemoryOutputStream::~MemoryOutputStream() { // =================================================================== CommandLineInterface::CommandLineInterface() - : mode_(MODE_COMPILE), - print_mode_(PRINT_NONE), - error_format_(ERROR_FORMAT_GCC), - direct_dependencies_explicitly_set_(false), - imports_in_descriptor_set_(false), - source_info_in_descriptor_set_(false), - disallow_services_(false), - inputs_are_proto_path_relative_(false) {} + : mode_(MODE_COMPILE), + print_mode_(PRINT_NONE), + error_format_(ERROR_FORMAT_GCC), + direct_dependencies_explicitly_set_(false), + direct_dependencies_violation_msg_( + kDefaultDirectDependenciesViolationMsg), + imports_in_descriptor_set_(false), + source_info_in_descriptor_set_(false), + disallow_services_(false), + inputs_are_proto_path_relative_(false) { +} CommandLineInterface::~CommandLineInterface() {} void CommandLineInterface::RegisterGenerator(const string& flag_name, @@ -800,10 +810,11 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) { if (direct_dependencies_.find(parsed_file->dependency(i)->name()) == direct_dependencies_.end()) { indirect_imports = true; - cerr << parsed_file->name() - << ": File is imported but not declared in " - << "--direct_dependencies: " - << parsed_file->dependency(i)->name() << std::endl; + cerr << parsed_file->name() << ": " + << StringReplace(direct_dependencies_violation_msg_, "%s", + parsed_file->dependency(i)->name(), + true /* replace_all */) + << std::endl; } } if (indirect_imports) { @@ -895,6 +906,10 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) { } } + if (error_collector.FoundErrors()) { + return 1; + } + if (mode_ == MODE_PRINT) { switch (print_mode_) { case PRINT_FREE_FIELDS: @@ -924,6 +939,7 @@ void CommandLineInterface::Clear() { proto_path_.clear(); input_files_.clear(); direct_dependencies_.clear(); + direct_dependencies_violation_msg_ = kDefaultDirectDependenciesViolationMsg; output_directives_.clear(); codec_type_.clear(); descriptor_set_name_.clear(); @@ -1015,16 +1031,34 @@ CommandLineInterface::ParseArguments(int argc, const char* const argv[]) { } // Make sure each plugin option has a matching plugin output. + bool foundUnknownPluginOption = false; for (map<string, string>::const_iterator i = plugin_parameters_.begin(); i != plugin_parameters_.end(); ++i) { - if (plugins_.find(i->first) == plugins_.end()) { + if (plugins_.find(i->first) != plugins_.end()) { + continue; + } + bool foundImplicitPlugin = false; + for (std::vector<OutputDirective>::const_iterator j = output_directives_.cbegin(); + j != output_directives_.cend(); ++j) { + if (j->generator == NULL) { + string plugin_name = PluginName(plugin_prefix_ , j->name); + if (plugin_name == i->first) { + foundImplicitPlugin = true; + break; + } + } + } + if (!foundImplicitPlugin) { std::cerr << "Unknown flag: " // strip prefix + "gen-" and add back "_opt" << "--" + i->first.substr(plugin_prefix_.size() + 4) + "_opt" << std::endl; - return PARSE_ARGUMENT_FAIL; + foundUnknownPluginOption = true; } } + if (foundUnknownPluginOption) { + return PARSE_ARGUMENT_FAIL; + } // If no --proto_path was given, use the current working directory. if (proto_path_.empty()) { @@ -1209,6 +1243,9 @@ CommandLineInterface::InterpretArgument(const string& name, GOOGLE_DCHECK(direct_dependencies_.empty()); direct_dependencies_.insert(direct.begin(), direct.end()); + } else if (name == "--direct_dependencies_violation_msg") { + direct_dependencies_violation_msg_ = value; + } else if (name == "-o" || name == "--descriptor_set_out") { if (!descriptor_set_name_.empty()) { std::cerr << name << " may only be passed once." << std::endl; diff --git a/src/google/protobuf/compiler/command_line_interface.h b/src/google/protobuf/compiler/command_line_interface.h index 28471ee7..8f8c2682 100644 --- a/src/google/protobuf/compiler/command_line_interface.h +++ b/src/google/protobuf/compiler/command_line_interface.h @@ -365,6 +365,10 @@ class LIBPROTOC_EXPORT CommandLineInterface { std::set<string> direct_dependencies_; bool direct_dependencies_explicitly_set_; + // If there's a violation of depend-on-what-you-import, this string will be + // presented to the user. "%s" will be replaced with the violating import. + string direct_dependencies_violation_msg_; + // output_directives_ lists all the files we are supposed to output and what // generator to use for each. struct OutputDirective { diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc index b2ec8426..cce1018a 100644 --- a/src/google/protobuf/compiler/command_line_interface_unittest.cc +++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc @@ -101,6 +101,7 @@ class CommandLineInterfaceTest : public testing::Test { // command is automatically split on spaces, and the string "$tmpdir" // is replaced with TestTempDir(). void Run(const string& command); + void RunWithArgs(vector<string> args); // ----------------------------------------------------------------- // Methods to set up the test (called before Run()). @@ -292,8 +293,10 @@ void CommandLineInterfaceTest::TearDown() { } void CommandLineInterfaceTest::Run(const string& command) { - std::vector<string> args = Split(command, " ", true); + RunWithArgs(Split(command, " ", true)); +} +void CommandLineInterfaceTest::RunWithArgs(vector<string> args) { if (!disallow_plugins_) { cli_.AllowPlugins("prefix-"); #ifndef GOOGLE_THIRD_PARTY_PROTOBUF @@ -686,10 +689,36 @@ TEST_F(CommandLineInterfaceTest, UnrecognizedExtraParameters) { "message Foo {}\n"); Run("protocol_compiler --plug_out=TestParameter:$tmpdir " + "--unknown_plug_a_opt=Foo " + "--unknown_plug_b_opt=Bar " + "--proto_path=$tmpdir foo.proto"); + + ExpectErrorSubstring("Unknown flag: --unknown_plug_a_opt"); + ExpectErrorSubstring("Unknown flag: --unknown_plug_b_opt"); +} + +TEST_F(CommandLineInterfaceTest, ExtraPluginParametersForOutParameters) { + // This doesn't rely on the plugin having been registred and instead that + // the existence of --[name]_out is enough to make the --[name]_opt valid. + // However, running out of process plugins found via the search path (i.e. - + // not pre registered with --plugin) isn't support in this test suite, so we + // list the options pre/post the _out directive, and then include _opt that + // will be unknown, and confirm the failure output is about the expected + // unknown directive, which means the other were accepted. + // NOTE: UnrecognizedExtraParameters confirms that if two unknown _opt + // directives appear, they both are reported. + + CreateTempFile("foo.proto", + "syntax = \"proto2\";\n" + "message Foo {}\n"); + + Run("protocol_compiler --plug_out=TestParameter:$tmpdir " + "--xyz_opt=foo=bar --xyz_out=$tmpdir " + "--abc_out=$tmpdir --abc_opt=foo=bar " "--unknown_plug_opt=Foo " "--proto_path=$tmpdir foo.proto"); - ExpectErrorSubstring("Unknown flag: --unknown_plug_opt"); + ExpectErrorText("Unknown flag: --unknown_plug_opt\n"); } TEST_F(CommandLineInterfaceTest, Insert) { @@ -996,6 +1025,27 @@ TEST_F(CommandLineInterfaceTest, DirectDependencies_ProvidedMultipleTimes) { "':'.\n"); } +TEST_F(CommandLineInterfaceTest, DirectDependencies_CustomErrorMessage) { + CreateTempFile("foo.proto", + "syntax = \"proto2\";\n" + "import \"bar.proto\";\n" + "message Foo { optional Bar bar = 1; }"); + CreateTempFile("bar.proto", + "syntax = \"proto2\";\n" + "message Bar { optional string text = 1; }"); + + vector<string> commands; + commands.push_back("protocol_compiler"); + commands.push_back("--test_out=$tmpdir"); + commands.push_back("--proto_path=$tmpdir"); + commands.push_back("--direct_dependencies="); + commands.push_back("--direct_dependencies_violation_msg=Bla \"%s\" Bla"); + commands.push_back("foo.proto"); + RunWithArgs(commands); + + ExpectErrorText("foo.proto: Bla \"bar.proto\" Bla\n"); +} + TEST_F(CommandLineInterfaceTest, CwdRelativeInputs) { // Test that we can accept working-directory-relative input files. @@ -1283,6 +1333,19 @@ TEST_F(CommandLineInterfaceTest, ParseErrorsMultipleFiles) { "foo.proto: Import \"baz.proto\" was not found or had errors.\n"); } +TEST_F(CommandLineInterfaceTest, RecursiveImportFails) { + // Create a proto file that imports itself. + CreateTempFile("foo.proto", + "syntax = \"proto2\";\n" + "import \"foo.proto\";\n"); + + Run("protocol_compiler --test_out=$tmpdir " + "--proto_path=$tmpdir foo.proto"); + + ExpectErrorSubstring( + "foo.proto: File recursively imports itself: foo.proto -> foo.proto\n"); +} + TEST_F(CommandLineInterfaceTest, InputNotFoundError) { // Test what happens if the input file is not found. diff --git a/src/google/protobuf/compiler/cpp/cpp_enum.cc b/src/google/protobuf/compiler/cpp/cpp_enum.cc index 9493d5f8..6a8a83d1 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum.cc @@ -251,13 +251,15 @@ void EnumGenerator::GenerateMethods(io::Printer* printer) { vars["classname"] = classname_; vars["index_in_metadata"] = SimpleItoa(index_in_metadata_); vars["constexpr"] = options_.proto_h ? "constexpr " : ""; + vars["file_namespace"] = FileLevelNamespace(descriptor_->file()->name()); if (HasDescriptorMethods(descriptor_->file(), options_)) { printer->Print( vars, "const ::google::protobuf::EnumDescriptor* $classname$_descriptor() {\n" - " protobuf_AssignDescriptorsOnce();\n" - " return file_level_enum_descriptors[$index_in_metadata$];\n" + " $file_namespace$::protobuf_AssignDescriptorsOnce();\n" + " return " + "$file_namespace$::file_level_enum_descriptors[$index_in_metadata$];\n" "}\n"); } diff --git a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc index b6658079..e4b17a98 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc @@ -230,7 +230,7 @@ void EnumOneofFieldGenerator:: GenerateConstructorCode(io::Printer* printer) const { printer->Print( variables_, - " $classname$_default_oneof_instance_.$name$_ = $default$;\n"); + "_$classname$_default_instance_.$name$_ = $default$;\n"); } // =================================================================== @@ -436,7 +436,7 @@ GenerateSerializeWithCachedSizes(io::Printer* printer) const { "}\n"); } printer->Print(variables_, - "for (int i = 0; i < this->$name$_size(); i++) {\n"); + "for (int i = 0, n = this->$name$_size(); i < n; i++) {\n"); if (descriptor_->is_packed()) { printer->Print(variables_, " ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(\n" @@ -464,7 +464,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const { "}\n"); } printer->Print(variables_, - "for (int i = 0; i < this->$name$_size(); i++) {\n"); + "for (int i = 0, n = this->$name$_size(); i < n; i++) {\n"); if (descriptor_->is_packed()) { printer->Print(variables_, " target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(\n" diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index 9cfd6ec6..0e5e2f18 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -284,8 +284,13 @@ void FileGenerator::GenerateSource(io::Printer* printer) { if (IsMapEntryMessage(message_generators_[i]->descriptor_)) continue; printer->Print( "class $classname$DefaultTypeInternal : " - "public ::google::protobuf::internal::ExplicitlyConstructed<$classname$> {};\n" - "$classname$DefaultTypeInternal _$classname$_default_instance_;\n", + "public ::google::protobuf::internal::ExplicitlyConstructed<$classname$> {\n", + "classname", message_generators_[i]->classname_); + printer->Indent(); + message_generators_[i]->GenerateExtraDefaultFields(printer); + printer->Outdent(); + printer->Print( + "} _$classname$_default_instance_;\n", "classname", message_generators_[i]->classname_); } @@ -301,6 +306,12 @@ void FileGenerator::GenerateSource(io::Printer* printer) { } } + printer->Print( + "\n" + "namespace $file_namespace$ {\n" + "\n", + "file_namespace", FileLevelNamespace(file_->name())); + if (HasDescriptorMethods(file_, options_)) { printer->Print( "\n" @@ -324,10 +335,6 @@ void FileGenerator::GenerateSource(io::Printer* printer) { "size", SimpleItoa(file_->service_count())); } - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->GenerateDescriptorDeclarations(printer); - } - printer->Print( "\n" "} // namespace\n" @@ -338,6 +345,12 @@ void FileGenerator::GenerateSource(io::Printer* printer) { // library, all this does is initialize default instances.) GenerateBuildDescriptors(printer); + printer->Print( + "\n" + "} // namespace $file_namespace$\n" + "\n", + "file_namespace", FileLevelNamespace(file_->name())); + // Generate enums. for (int i = 0; i < enum_generators_.size(); i++) { enum_generators_[i]->GenerateMethods(printer); @@ -473,28 +486,16 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { if (HasDescriptorMethods(file_, options_)) { if (!message_generators_.empty()) { - printer->Print( - "\n" - "const ::google::protobuf::uint32* $offsetfunname$() GOOGLE_ATTRIBUTE_COLD;\n" - "const ::google::protobuf::uint32* $offsetfunname$() {\n", - "offsetfunname", GlobalOffsetTableName(file_->name())); - printer->Indent(); - - printer->Print("static const ::google::protobuf::uint32 offsets[] = {\n"); + printer->Print("const ::google::protobuf::uint32 TableStruct::offsets[] = {\n"); printer->Indent(); std::vector<std::pair<size_t, size_t> > pairs; for (int i = 0; i < message_generators_.size(); i++) { pairs.push_back(message_generators_[i]->GenerateOffsets(printer)); } printer->Outdent(); - printer->Outdent(); - printer->Print( - " };\n" - " return offsets;\n" - "}\n" - "\n"); - printer->Print( + "};\n" + "\n" "static const ::google::protobuf::internal::MigrationSchema schemas[] = {\n"); printer->Indent(); { @@ -508,25 +509,17 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { printer->Outdent(); printer->Print( "};\n" - "\n" - "static const ::google::protobuf::internal::DefaultInstanceData " - "file_default_instances[] = {\n"); + "\nstatic " + "::google::protobuf::Message const * const file_default_instances[] = {\n"); printer->Indent(); for (int i = 0; i < message_generators_.size(); i++) { const Descriptor* descriptor = message_generators_[i]->descriptor_; if (IsMapEntryMessage(descriptor)) continue; - string oneof_default = "NULL"; - if (message_generators_[i]->descriptor_->oneof_decl_count()) { - oneof_default = - "&" + ClassName(descriptor, false) + "_default_oneof_instance_"; - } printer->Print( - "{reinterpret_cast<const " - "::google::protobuf::Message*>(&_$classname$_default_instance_), " - "$oneof_default$},\n", - "classname", ClassName(descriptor, false), "oneof_default", - oneof_default); + "reinterpret_cast<const " + "::google::protobuf::Message*>(&_$classname$_default_instance_),\n", + "classname", ClassName(descriptor, false)); } printer->Outdent(); printer->Print( @@ -535,12 +528,11 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { } else { // we still need these symbols to exist printer->Print( - "inline ::google::protobuf::uint32* $offsetfunname$() { return NULL; }\n" + // MSVC doesn't like empty arrays, so we add a dummy. + "const ::google::protobuf::uint32 TableStruct::offsets[] = { ~0u };\n" "static const ::google::protobuf::internal::MigrationSchema* schemas = NULL;\n" - "static const ::google::protobuf::internal::DefaultInstanceData* " - "file_default_instances = NULL;\n", - "offsetfunname", - GlobalOffsetTableName(file_->name())); + "static const ::google::protobuf::Message* const* " + "file_default_instances = NULL;\n"); } // --------------------------------------------------------------- @@ -557,11 +549,11 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { // is requested *during* static init then AddDescriptors() may not have // been called yet, so we call it manually. Note that it's fine if // AddDescriptors() is called multiple times. - " $adddescriptorsname$();\n" + " AddDescriptors();\n" " ::google::protobuf::MessageFactory* factory = $factory$;\n" " AssignDescriptors(\n" " \"$filename$\", schemas, file_default_instances, " - "$offsetfunname$(), factory,\n" + "TableStruct::offsets, factory,\n" " $metadata$, $enum_descriptors$, $service_descriptors$);\n" "}\n" "\n" @@ -570,9 +562,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { " ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);\n" "}\n" "\n", - "adddescriptorsname", GlobalAddDescriptorsName(file_->name()), - "offsetfunname", GlobalOffsetTableName(file_->name()), "filename", - file_->name(), "metadata", + "filename", file_->name(), "metadata", !message_generators_.empty() ? "file_level_metadata" : "NULL", "enum_descriptors", !enum_generators_.empty() ? "file_level_enum_descriptors" : "NULL", @@ -616,8 +606,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { // ShutdownFile(): Deletes descriptors, default instances, etc. on shutdown. printer->Print( "\n" - "void $shutdownfilename$() {\n", - "shutdownfilename", GlobalShutdownFileName(file_->name())); + "void TableStruct::Shutdown() {\n"); printer->Indent(); for (int i = 0; i < message_generators_.size(); i++) { @@ -630,13 +619,12 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { // ----------------------------------------------------------------- - // Now generate the InitDefaults() function. + // Now generate the InitDefaultsImpl() function. printer->Print( - "void $initdefaultsname$_impl() {\n" + "void TableStruct::InitDefaultsImpl() {\n" " GOOGLE_PROTOBUF_VERIFY_VERSION;\n\n" - "", - // Vars. - "initdefaultsname", GlobalInitDefaultsName(file_->name())); + // Force initialization of primitive values we depend on. + " ::google::protobuf::internal::InitProtobufDefaults();\n"); printer->Indent(); @@ -645,17 +633,13 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { for (int i = 0; i < file_->dependency_count(); i++) { const FileDescriptor* dependency = file_->dependency(i); // Print the namespace prefix for the dependency. - string add_desc_name = QualifiedFileLevelSymbol( - dependency->package(), GlobalInitDefaultsName(dependency->name())); + string file_namespace = QualifiedFileLevelSymbol( + dependency->package(), FileLevelNamespace(dependency->name())); // Call its AddDescriptors function. - printer->Print( - "$name$();\n", - "name", add_desc_name); + printer->Print("$file_namespace$::InitDefaults();\n", "file_namespace", + file_namespace); } - // Force initialization of primitive values we depend on. - printer->Print("::google::protobuf::internal::InitProtobufDefaults();\n"); - // Allocate and initialize default instances. This can't be done lazily // since default instances are returned by simple accessors and are used with // extensions. Speaking of which, we also register extensions at this time. @@ -672,21 +656,17 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { printer->Print( "}\n" "\n" - "void $initdefaultsname$() {\n" + "void InitDefaults() {\n" " static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n" - " ::google::protobuf::GoogleOnceInit(&once, &$initdefaultsname$_impl);\n" - "}\n", - "initdefaultsname", GlobalInitDefaultsName(file_->name())); + " ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);\n" + "}\n"); // ----------------------------------------------------------------- // Now generate the AddDescriptors() function. printer->Print( - "void $adddescriptorsname$_impl() {\n" - " $initdefaultsname$();\n", - // Vars. - "adddescriptorsname", GlobalAddDescriptorsName(file_->name()), - "initdefaultsname", GlobalInitDefaultsName(file_->name())); + "void AddDescriptorsImpl() {\n" + " InitDefaults();\n"); printer->Indent(); if (HasDescriptorMethods(file_, options_)) { @@ -702,12 +682,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { printer->Print("static const char descriptor[] = {\n"); printer->Indent(); -#ifdef _MSC_VER - bool breakdown_large_file = true; -#else - bool breakdown_large_file = false; -#endif - if (breakdown_large_file && file_data.size() > 66538) { + if (file_data.size() > 66535) { // Workaround for MSVC: "Error C1091: compiler limit: string exceeds 65535 // bytes in length". Declare a static array of characters rather than use // a string literal. Only write 25 bytes per line. @@ -748,42 +723,36 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { for (int i = 0; i < file_->dependency_count(); i++) { const FileDescriptor* dependency = file_->dependency(i); // Print the namespace prefix for the dependency. - string add_desc_name = QualifiedFileLevelSymbol( - dependency->package(), GlobalAddDescriptorsName(dependency->name())); + string file_namespace = QualifiedFileLevelSymbol( + dependency->package(), FileLevelNamespace(dependency->name())); // Call its AddDescriptors function. - printer->Print("$adddescriptorsname$();\n", "adddescriptorsname", - add_desc_name); + printer->Print("$file_namespace$::AddDescriptors();\n", "file_namespace", + file_namespace); } printer->Print( - "::google::protobuf::internal::OnShutdown(&$shutdownfilename$);\n", - "shutdownfilename", GlobalShutdownFileName(file_->name())); + "::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);\n"); printer->Outdent(); printer->Print( "}\n" "\n" - "GOOGLE_PROTOBUF_DECLARE_ONCE($adddescriptorsname$_once_);\n" - "void $adddescriptorsname$() {\n" - " ::google::protobuf::GoogleOnceInit(&$adddescriptorsname$_once_,\n" - " &$adddescriptorsname$_impl);\n" - "}\n", - "adddescriptorsname", GlobalAddDescriptorsName(file_->name())); + "void AddDescriptors() {\n" + " static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n" + " ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);\n" + "}\n"); if (!StaticInitializersForced(file_, options_)) { - printer->Print("#ifndef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n"); + printer->Print("#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n"); } printer->Print( // With static initializers. "// Force AddDescriptors() to be called at static initialization time.\n" - "struct StaticDescriptorInitializer_$filename$ {\n" - " StaticDescriptorInitializer_$filename$() {\n" - " $adddescriptorsname$();\n" + "struct StaticDescriptorInitializer {\n" + " StaticDescriptorInitializer() {\n" + " AddDescriptors();\n" " }\n" - "} static_descriptor_initializer_$filename$_;\n", - // Vars. - "adddescriptorsname", GlobalAddDescriptorsName(file_->name()), "filename", - FilenameIdentifier(file_->name())); + "} static_descriptor_initializer;\n"); if (!StaticInitializersForced(file_, options_)) { printer->Print("#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n"); } @@ -884,10 +853,11 @@ void FileGenerator::GenerateLibraryIncludes(io::Printer* printer) { // OK, it's now safe to #include other files. printer->Print( - "#include <google/protobuf/arena.h>\n" - "#include <google/protobuf/arenastring.h>\n" - "#include <google/protobuf/generated_message_util.h>\n" - "#include <google/protobuf/metadata.h>\n"); + "#include <google/protobuf/io/coded_stream.h>\n" + "#include <google/protobuf/arena.h>\n" + "#include <google/protobuf/arenastring.h>\n" + "#include <google/protobuf/generated_message_util.h>\n" + "#include <google/protobuf/metadata.h>\n"); if (!message_generators_.empty()) { if (HasDescriptorMethods(file_, options_)) { @@ -982,12 +952,21 @@ void FileGenerator::GenerateGlobalStateFunctionDeclarations( // functions, so that we can declare them to be friends of each class. printer->Print( "\n" + "namespace $file_namespace$ {\n" "// Internal implementation detail -- do not call these.\n" - "void $dllexport_decl$$adddescriptorsname$();\n" - "void $dllexport_decl$$initdefaultsname$();\n", - "initdefaultsname", GlobalInitDefaultsName(file_->name()), - "adddescriptorsname", GlobalAddDescriptorsName(file_->name()), - "dllexport_decl", + "struct $dllexport_decl$TableStruct {\n" + " static const ::google::protobuf::uint32 offsets[];\n" + // The following function(s) need to be able to access private members of + // the messages defined in the file. So we make them static members. + // This is the internal implementation of InitDefaults. It should only + // be called by InitDefaults which makes sure it will be called only once. + " static void InitDefaultsImpl();\n" + " static void Shutdown();\n" + "};\n" + "void $dllexport_decl$AddDescriptors();\n" + "void $dllexport_decl$InitDefaults();\n" + "} // namespace $file_namespace$\n", + "file_namespace", FileLevelNamespace(file_->name()), "dllexport_decl", options_.dllexport_decl.empty() ? "" : options_.dllexport_decl + " "); } diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.cc b/src/google/protobuf/compiler/cpp/cpp_helpers.cc index 5a37b9d7..3c4dddc5 100644 --- a/src/google/protobuf/compiler/cpp/cpp_helpers.cc +++ b/src/google/protobuf/compiler/cpp/cpp_helpers.cc @@ -440,23 +440,8 @@ string FilenameIdentifier(const string& filename) { return result; } -// Return the name of the AddDescriptors() function for a given file. -string GlobalAddDescriptorsName(const string& filename) { - return "protobuf_AddDesc_" + FilenameIdentifier(filename); -} - -string GlobalInitDefaultsName(const string& filename) { - return "protobuf_InitDefaults_" + FilenameIdentifier(filename); -} - -// Return the name of the AssignDescriptors() function for a given file. -string GlobalOffsetTableName(const string& filename) { - return "protobuf_Offsets_" + FilenameIdentifier(filename); -} - -// Return the name of the ShutdownFile() function for a given file. -string GlobalShutdownFileName(const string& filename) { - return "protobuf_ShutdownFile_" + FilenameIdentifier(filename); +string FileLevelNamespace(const string& filename) { + return "protobuf_" + FilenameIdentifier(filename); } // Return the qualified C++ name for a file level symbol. diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.h b/src/google/protobuf/compiler/cpp/cpp_helpers.h index c988bda8..0f297ec8 100644 --- a/src/google/protobuf/compiler/cpp/cpp_helpers.h +++ b/src/google/protobuf/compiler/cpp/cpp_helpers.h @@ -144,21 +144,13 @@ string DefaultValue(const FieldDescriptor* field); // Convert a file name into a valid identifier. string FilenameIdentifier(const string& filename); -// Return the name of the AddDescriptors() function for a given file. -string GlobalAddDescriptorsName(const string& filename); - -// Return the name of the InitDefaults() function for a given file. -string GlobalInitDefaultsName(const string& filename); - -// Return the name of the offset table function for a given file. -string GlobalOffsetTableName(const string& filename); +// For each .proto file generates a unique namespace. In this namespace global +// definitions are put to prevent collisions. +string FileLevelNamespace(const string& filename); // Return the qualified C++ name for a file level symbol. string QualifiedFileLevelSymbol(const string& package, const string& name); -// Return the name of the ShutdownFile() function for a given file. -string GlobalShutdownFileName(const string& filename); - // Escape C++ trigraphs by escaping question marks to \? string EscapeTrigraphs(const string& to_escape); diff --git a/src/google/protobuf/compiler/cpp/cpp_map_field.cc b/src/google/protobuf/compiler/cpp/cpp_map_field.cc index 5c4b56f7..b4eaf485 100644 --- a/src/google/protobuf/compiler/cpp/cpp_map_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_map_field.cc @@ -49,6 +49,8 @@ void SetMessageVariables(const FieldDescriptor* descriptor, const Options& options) { SetCommonFieldVariables(descriptor, variables, options); (*variables)["type"] = ClassName(descriptor->message_type(), false); + (*variables)["file_namespace"] = + FileLevelNamespace(descriptor->file()->name()); (*variables)["stream_writer"] = (*variables)["declared_type"] + (HasFastArraySerialization(descriptor->message_type()->file(), options) @@ -174,7 +176,7 @@ GenerateConstructorCode(io::Printer* printer) const { if (HasDescriptorMethods(descriptor_->file(), options_)) { printer->Print(variables_, "$name$_.SetAssignDescriptorCallback(\n" - " protobuf_AssignDescriptorsOnce);\n" + " $file_namespace$::protobuf_AssignDescriptorsOnce);\n" "$name$_.SetEntryDescriptor(\n" " &$type$_descriptor);\n"); } diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index 2d3d5640..b4f1adfd 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -505,6 +505,7 @@ MessageGenerator::MessageGenerator(const Descriptor* descriptor, classname_(ClassName(descriptor, false)), options_(options), field_generators_(descriptor, options), + max_has_bit_index_(0), nested_generators_(new google::protobuf::scoped_ptr< MessageGenerator>[descriptor->nested_type_count()]), enum_generators_( @@ -523,7 +524,7 @@ MessageGenerator::MessageGenerator(const Descriptor* descriptor, OptimizePadding(&optimized_order_, options_); if (HasFieldPresence(descriptor_->file())) { - int has_bit_index = 0; + // We use -1 as a sentinel. has_bit_indices_.resize(descriptor_->field_count(), -1); for (int i = 0; i < optimized_order_.size(); i++) { const FieldDescriptor* field = optimized_order_[i]; @@ -532,19 +533,7 @@ MessageGenerator::MessageGenerator(const Descriptor* descriptor, continue; } - has_bit_indices_[field->index()] = has_bit_index; - has_bit_index++; - } - - // Assign fields that do not use has bits to be at the end. This can be - // removed once we shrink the has bits we assign. - // - // TODO(ckennelly): Shrink the has bits for these fields. - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - if (has_bit_indices_[field->index()] < 0) { - has_bit_indices_[field->index()] = has_bit_index++; - } + has_bit_indices_[field->index()] = max_has_bit_index_++; } } @@ -581,9 +570,8 @@ MessageGenerator::MessageGenerator(const Descriptor* descriptor, MessageGenerator::~MessageGenerator() {} size_t MessageGenerator::HasBitsSize() const { - // TODO(jieluo) - Optimize _has_bits_ for repeated and oneof fields. - size_t sizeof_has_bits = (descriptor_->field_count() + 31) / 32 * 4; - if (descriptor_->field_count() == 0) { + size_t sizeof_has_bits = (max_has_bit_index_ + 31) / 32 * 4; + if (sizeof_has_bits == 0) { // Zero-size arrays aren't technically allowed, and MSVC in particular // doesn't like them. We still need to declare these arrays to make // other code compile. Since this is an uncommon case, we'll just declare @@ -642,8 +630,28 @@ GenerateDependentFieldAccessorDeclarations(io::Printer* printer) { void MessageGenerator:: GenerateFieldAccessorDeclarations(io::Printer* printer) { + // optimized_fields_ does not contain fields where + // field->containing_oneof() != NULL + // so we need to iterate over those as well. + // + // We place the non-oneof fields in optimized_order_, as that controls the + // order of the _has_bits_ entries and we want GDB's pretty printers to be + // able to infer these indices from the k[FIELDNAME]FieldNumber order. + std::vector<const FieldDescriptor*> ordered_fields; + ordered_fields.reserve(descriptor_->field_count()); + + ordered_fields.insert( + ordered_fields.begin(), optimized_order_.begin(), optimized_order_.end()); for (int i = 0; i < descriptor_->field_count(); i++) { const FieldDescriptor* field = descriptor_->field(i); + if (field->containing_oneof() == NULL) { + continue; + } + ordered_fields.push_back(field); + } + + for (int i = 0; i < ordered_fields.size(); i++) { + const FieldDescriptor* field = ordered_fields[i]; PrintFieldComment(printer, field); @@ -1191,12 +1199,14 @@ GenerateClassDefinition(io::Printer* printer) { } if (HasFastArraySerialization(descriptor_->file(), options_)) { printer->Print( - "::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n" - " bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;\n" - "::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output)\n" - " const PROTOBUF_FINAL {\n" - " return InternalSerializeWithCachedSizesToArray(false, output);\n" - "}\n"); + "::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n" + " bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;\n" + "::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output)\n" + " const PROTOBUF_FINAL {\n" + " return InternalSerializeWithCachedSizesToArray(\n" + " ::google::protobuf::io::CodedOutputStream::" + "IsDefaultSerializationDeterministic(), output);\n" + "}\n"); } } @@ -1447,25 +1457,15 @@ GenerateClassDefinition(io::Printer* printer) { "::google::protobuf::internal::AnyMetadata _any_metadata_;\n"); } - // Declare AddDescriptors(), BuildDescriptors(), and ShutdownFile() as - // friends so that they can access private static variables like - // default_instance_ and reflection_. - printer->Print("friend void $dllexport_decl$ $initdefaultsname$_impl();\n", - // Vars. - "dllexport_decl", options_.dllexport_decl, "initdefaultsname", - GlobalInitDefaultsName(descriptor_->file()->name())); - printer->Print("friend void $dllexport_decl$ $adddescriptorsname$_impl();\n", - // Vars. - "dllexport_decl", options_.dllexport_decl, - "adddescriptorsname", - GlobalAddDescriptorsName(descriptor_->file()->name())); - + // The TableStruct struct needs access to the private parts, in order to + // construct the offsets of all members. + // Some InitDefault and Shutdown are defined as static member functions of + // TableStruct such that they are also allowed to access private members. printer->Print( - "friend const ::google::protobuf::uint32* $offsetfunname$();\n" - "friend void $shutdownfilename$();\n" - "\n", - "offsetfunname", GlobalOffsetTableName(descriptor_->file()->name()), - "shutdownfilename", GlobalShutdownFileName(descriptor_->file()->name())); + "friend struct $dllexport_decl$ $file_namespace$::TableStruct;\n", + // Vars. + "dllexport_decl", options_.dllexport_decl, "file_namespace", + FileLevelNamespace(descriptor_->file()->name())); printer->Outdent(); printer->Print("};"); @@ -1510,15 +1510,13 @@ GenerateInlineMethods(io::Printer* printer, bool is_inline) { } void MessageGenerator:: -GenerateDescriptorDeclarations(io::Printer* printer) { +GenerateExtraDefaultFields(io::Printer* printer) { // Generate oneof default instance for reflection usage. if (descriptor_->oneof_decl_count() > 0) { - printer->Print("struct $name$OneofInstance {\n", - "name", classname_); + printer->Print("public:\n"); for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { for (int j = 0; j < descriptor_->oneof_decl(i)->field_count(); j++) { const FieldDescriptor* field = descriptor_->oneof_decl(i)->field(j); - printer->Print(" "); if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE || (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING && EffectiveStringCType(field) != FieldOptions::STRING)) { @@ -1527,8 +1525,6 @@ GenerateDescriptorDeclarations(io::Printer* printer) { field_generators_.get(field).GeneratePrivateMembers(printer); } } - - printer->Print("} $name$_default_oneof_instance_;\n", "name", classname_); } } @@ -1555,6 +1551,7 @@ GenerateTypeRegistrations(io::Printer* printer) { std::map<string, string> vars; CollectMapInfo(descriptor_, &vars); vars["classname"] = classname_; + vars["file_namespace"] = FileLevelNamespace(descriptor_->file()->name()); const FieldDescriptor* val = descriptor_->FindFieldByName("value"); if (descriptor_->file()->syntax() == FileDescriptor::SYNTAX_PROTO2 && @@ -1570,7 +1567,8 @@ GenerateTypeRegistrations(io::Printer* printer) { printer->Print( vars, "const ::google::protobuf::Descriptor* $classname$_descriptor = " - "file_level_metadata[$index_in_metadata$].descriptor;\n" + "$file_namespace$::file_level_metadata[$index_in_metadata$].descriptor;" + "\n" "::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n" " $classname$_descriptor,\n" " ::google::protobuf::internal::MapEntry<\n" @@ -1620,7 +1618,7 @@ GenerateDefaultInstanceInitializer(io::Printer* printer) { HasDescriptorMethods(descriptor_->file(), options_))) { string name; if (field->containing_oneof()) { - name = classname_ + "_default_oneof_instance_."; + name = "_" + classname_ + "_default_instance_."; } else { name = "_" + classname_ + "_default_instance_.get_mutable()->"; } @@ -1740,11 +1738,12 @@ GenerateClassMethods(io::Printer* printer) { if (HasDescriptorMethods(descriptor_->file(), options_)) { printer->Print( "::google::protobuf::Metadata $classname$::GetMetadata() const {\n" - " protobuf_AssignDescriptorsOnce();\n" - " return file_level_metadata[$index$];\n" + " $file_namespace$::protobuf_AssignDescriptorsOnce();\n" + " return $file_namespace$::file_level_metadata[$index$];\n" "}\n" "\n", - "classname", classname_, "index", SimpleItoa(index_in_metadata_)); + "classname", classname_, "index", SimpleItoa(index_in_metadata_), + "file_namespace", FileLevelNamespace(descriptor_->file()->name())); } else { printer->Print( "::std::string $classname$::GetTypeName() const {\n" @@ -1798,7 +1797,7 @@ std::pair<size_t, size_t> MessageGenerator::GenerateOffsets( if (field->containing_oneof()) { printer->Print( "PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(" - "(&$classname$_default_oneof_instance_), $name$_),\n", + "(&_$classname$_default_instance_), $name$_),\n", "classname", classname_, "name", FieldName(field)); } else { printer->Print( @@ -1820,7 +1819,9 @@ std::pair<size_t, size_t> MessageGenerator::GenerateOffsets( if (HasFieldPresence(descriptor_->file())) { entries += has_bit_indices_.size(); for (int i = 0; i < has_bit_indices_.size(); i++) { - printer->Print("$index$,\n", "index", SimpleItoa(has_bit_indices_[i])); + const string index = has_bit_indices_[i] >= 0 ? + SimpleItoa(has_bit_indices_[i]) : "~0u"; + printer->Print("$index$,\n", "index", index); } } @@ -1849,9 +1850,10 @@ GenerateSharedConstructorCode(io::Printer* printer) { IsMapEntryMessage(descriptor_->nested_type(i))) { printer->Print( "const ::google::protobuf::Descriptor*& $type$_descriptor = " - "file_level_metadata[$index$].descriptor;\n", + "$file_namespace$::file_level_metadata[$index$].descriptor;\n", "type", ClassName(descriptor_->nested_type(i), false), "index", - SimpleItoa(nested_generators_[i]->index_in_metadata_)); + SimpleItoa(nested_generators_[i]->index_in_metadata_), + "file_namespace", FileLevelNamespace(descriptor_->file()->name())); } } @@ -2086,14 +2088,14 @@ GenerateStructors(io::Printer* printer) { "$classname$::$classname$()\n" " : $superclass$()$initializer$ {\n" " if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {\n" - " $initdefaultsname$();\n" + " $file_namespace$::InitDefaults();\n" " }\n" " SharedCtor();\n" " // @@protoc_insertion_point(constructor:$full_name$)\n" "}\n", "classname", classname_, "superclass", superclass, "full_name", descriptor_->full_name(), "initializer", initializer_null, - "initdefaultsname", GlobalInitDefaultsName(descriptor_->file()->name())); + "file_namespace", FileLevelNamespace(descriptor_->file()->name())); if (SupportsArenas(descriptor_)) { printer->Print( @@ -2102,7 +2104,7 @@ GenerateStructors(io::Printer* printer) { // When arenas are used it's safe to assume we have finished // static init time (protos with arenas are unsafe during static init) "#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n" - " $initdefaultsname$();\n" + " $file_namespace$::InitDefaults();\n" "#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n" " SharedCtor();\n" " RegisterArenaDtor(arena);\n" @@ -2110,8 +2112,7 @@ GenerateStructors(io::Printer* printer) { "}\n", "initializer", initializer_with_arena, "classname", classname_, "superclass", superclass, "full_name", descriptor_->full_name(), - "initdefaultsname", - GlobalInitDefaultsName(descriptor_->file()->name())); + "file_namespace", FileLevelNamespace(descriptor_->file()->name())); } // Generate the copy constructor. @@ -2182,9 +2183,10 @@ GenerateStructors(io::Printer* printer) { IsMapEntryMessage(descriptor_->nested_type(i))) { printer->Print( "const ::google::protobuf::Descriptor*& $type$_descriptor = " - "file_level_metadata[$index$].descriptor;\n", + "$file_namespace$::file_level_metadata[$index$].descriptor;\n", "type", ClassName(descriptor_->nested_type(i), false), "index", - SimpleItoa(nested_generators_[i]->index_in_metadata_)); + SimpleItoa(nested_generators_[i]->index_in_metadata_), + "file_namespace", FileLevelNamespace(descriptor_->file()->name())); } } @@ -2265,20 +2267,21 @@ GenerateStructors(io::Printer* printer) { !descriptor_->options().no_standard_descriptor_accessor()) { printer->Print( "const ::google::protobuf::Descriptor* $classname$::descriptor() {\n" - " protobuf_AssignDescriptorsOnce();\n" - " return file_level_metadata[$index$].descriptor;\n" + " $file_namespace$::protobuf_AssignDescriptorsOnce();\n" + " return $file_namespace$::file_level_metadata[$index$].descriptor;\n" "}\n" "\n", - "index", SimpleItoa(index_in_metadata_), "classname", classname_); + "index", SimpleItoa(index_in_metadata_), "classname", classname_, + "file_namespace", FileLevelNamespace(descriptor_->file()->name())); } printer->Print( "const $classname$& $classname$::default_instance() {\n" - " $initdefaultsname$();\n" + " $file_namespace$::InitDefaults();\n" " return *internal_default_instance();\n" "}\n\n", - "classname", classname_, "initdefaultsname", - GlobalInitDefaultsName(descriptor_->file()->name())); + "classname", classname_, "file_namespace", + FileLevelNamespace(descriptor_->file()->name())); if (SupportsArenas(descriptor_)) { printer->Print( @@ -2630,7 +2633,7 @@ GenerateSwap(io::Printer* printer) { } if (HasFieldPresence(descriptor_->file())) { - for (int i = 0; i < (descriptor_->field_count() + 31) / 32; ++i) { + for (int i = 0; i < HasBitsSize() / 4; ++i) { printer->Print("std::swap(_has_bits_[$i$], other->_has_bits_[$i$]);\n", "i", SimpleItoa(i)); } @@ -3025,7 +3028,8 @@ GenerateMergeFromCodedStream(io::Printer* printer) { const FieldGenerator& field_generator = field_generators_.get(field); // Emit code to parse the common, expected case. - printer->Print("if (tag == $commontag$u) {\n", + printer->Print("if (static_cast<::google::protobuf::uint8>(tag) ==\n" + " static_cast<::google::protobuf::uint8>($commontag$u)) {\n", "commontag", SimpleItoa(WireFormat::MakeTag(field))); if (loops) { @@ -3044,7 +3048,8 @@ GenerateMergeFromCodedStream(io::Printer* printer) { if (field->is_packed()) { internal::WireFormatLite::WireType wiretype = WireFormat::WireTypeForFieldType(field->type()); - printer->Print("} else if (tag == $uncommontag$u) {\n", + printer->Print("} else if (static_cast<::google::protobuf::uint8>(tag) ==\n" + " static_cast<::google::protobuf::uint8>($uncommontag$u)) {\n", "uncommontag", SimpleItoa( internal::WireFormatLite::MakeTag( field->number(), wiretype))); @@ -3054,7 +3059,8 @@ GenerateMergeFromCodedStream(io::Printer* printer) { } else if (field->is_packable() && !field->is_packed()) { internal::WireFormatLite::WireType wiretype = internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED; - printer->Print("} else if (tag == $uncommontag$u) {\n", + printer->Print("} else if (static_cast<::google::protobuf::uint8>(tag) ==\n" + " static_cast<::google::protobuf::uint8>($uncommontag$u)) {\n", "uncommontag", SimpleItoa( internal::WireFormatLite::MakeTag( field->number(), wiretype))); @@ -3260,7 +3266,7 @@ void MessageGenerator::GenerateSerializeOneExtensionRange( if (to_array) { printer->Print(vars, "target = _extensions_.InternalSerializeWithCachedSizesToArray(\n" - " $start$, $end$, false, target);\n\n"); + " $start$, $end$, deterministic, target);\n\n"); } else { printer->Print(vars, "_extensions_.SerializeWithCachedSizes(\n" @@ -3335,7 +3341,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) { "classname", classname_); printer->Indent(); - printer->Print("(void)deterministic; // Unused\n"); + printer->Print("(void)deterministic; // Unused\n"); printer->Print( "// @@protoc_insertion_point(serialize_to_array_start:$full_name$)\n", "full_name", descriptor_->full_name()); diff --git a/src/google/protobuf/compiler/cpp/cpp_message.h b/src/google/protobuf/compiler/cpp/cpp_message.h index c5efff12..1a804a16 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.h +++ b/src/google/protobuf/compiler/cpp/cpp_message.h @@ -91,9 +91,8 @@ class MessageGenerator { // Source file stuff. - // Generate code which declares all the global descriptor pointers which - // will be initialized by the methods below. - void GenerateDescriptorDeclarations(io::Printer* printer); + // Generate extra fields + void GenerateExtraDefaultFields(io::Printer* printer); // Generate code that calls MessageFactory::InternalRegisterGeneratedMessage() // for all types. @@ -201,6 +200,7 @@ class MessageGenerator { // optimized_order_ excludes oneof fields. std::vector<const FieldDescriptor *> optimized_order_; std::vector<int> has_bit_indices_; + int max_has_bit_index_; google::protobuf::scoped_array<google::protobuf::scoped_ptr<MessageGenerator> > nested_generators_; google::protobuf::scoped_array<google::protobuf::scoped_ptr<EnumGenerator> > enum_generators_; google::protobuf::scoped_array<google::protobuf::scoped_ptr<ExtensionGenerator> > extension_generators_; diff --git a/src/google/protobuf/compiler/cpp/cpp_message_field.cc b/src/google/protobuf/compiler/cpp/cpp_message_field.cc index 91449657..c3d1745c 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message_field.cc @@ -487,9 +487,6 @@ GenerateClearingCode(io::Printer* printer) const { void MessageFieldGenerator:: GenerateMessageClearingCode(io::Printer* printer) const { - std::map<string, string> variables(variables_); - variables["type"] = FieldMessageTypeName(descriptor_); - if (!HasFieldPresence(descriptor_->file())) { // If we don't have has-bits, message presence is indicated only by ptr != // NULL. Thus on clear, we need to delete the object. @@ -1035,7 +1032,6 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, "}\n"); } - if (!dependent_field_) { printer->Print(variables, "$inline$" diff --git a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc index 240a6e0a..4a0a23f6 100644 --- a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc @@ -245,7 +245,7 @@ void PrimitiveOneofFieldGenerator:: GenerateConstructorCode(io::Printer* printer) const { printer->Print( variables_, - " $classname$_default_oneof_instance_.$name$_ = $default$;\n"); + "_$classname$_default_instance_.$name$_ = $default$;\n"); } void PrimitiveOneofFieldGenerator:: @@ -373,6 +373,7 @@ GenerateMergeFromCodedStreamWithPacking(io::Printer* printer) const { void RepeatedPrimitiveFieldGenerator:: GenerateSerializeWithCachedSizes(io::Printer* printer) const { + bool array_written = false; if (descriptor_->is_packed()) { // Write the tag and the size. printer->Print(variables_, @@ -381,21 +382,30 @@ GenerateSerializeWithCachedSizes(io::Printer* printer) const { "$number$, " "::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, " "output);\n" - " output->WriteVarint32(_$name$_cached_byte_size_);\n" - "}\n"); + " output->WriteVarint32(_$name$_cached_byte_size_);\n"); + + if (FixedSize(descriptor_->type()) > 0) { + printer->Print(variables_, + " ::google::protobuf::internal::WireFormatLite::Write$declared_type$Array(\n" + " this->$name$().data(), this->$name$_size(), output);\n"); + array_written = true; // Wrote array all at once + } + printer->Print(variables_, "}\n"); } - printer->Print(variables_, - "for (int i = 0; i < this->$name$_size(); i++) {\n"); - if (descriptor_->is_packed()) { - printer->Print(variables_, - " ::google::protobuf::internal::WireFormatLite::Write$declared_type$NoTag(\n" - " this->$name$(i), output);\n"); - } else { + if (!array_written) { printer->Print(variables_, - " ::google::protobuf::internal::WireFormatLite::Write$declared_type$(\n" - " $number$, this->$name$(i), output);\n"); + "for (int i = 0, n = this->$name$_size(); i < n; i++) {\n"); + if (descriptor_->is_packed()) { + printer->Print(variables_, + " ::google::protobuf::internal::WireFormatLite::Write$declared_type$NoTag(\n" + " this->$name$(i), output);\n"); + } else { + printer->Print(variables_, + " ::google::protobuf::internal::WireFormatLite::Write$declared_type$(\n" + " $number$, this->$name$(i), output);\n"); + } + printer->Print("}\n"); } - printer->Print("}\n"); } void RepeatedPrimitiveFieldGenerator:: @@ -413,7 +423,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const { "}\n"); } printer->Print(variables_, - "for (int i = 0; i < this->$name$_size(); i++) {\n"); + "for (int i = 0, n = this->$name$_size(); i < n; i++) {\n"); if (descriptor_->is_packed()) { printer->Print(variables_, " target = ::google::protobuf::internal::WireFormatLite::\n" @@ -428,21 +438,17 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const { void RepeatedPrimitiveFieldGenerator:: GenerateByteSize(io::Printer* printer) const { - printer->Print(variables_, - "{\n" - " size_t data_size = 0;\n" - " unsigned int count = this->$name$_size();\n"); + printer->Print(variables_, "{\n"); printer->Indent(); int fixed_size = FixedSize(descriptor_->type()); if (fixed_size == -1) { printer->Print(variables_, - "for (unsigned int i = 0; i < count; i++) {\n" - " data_size += ::google::protobuf::internal::WireFormatLite::\n" - " $declared_type$Size(this->$name$(i));\n" - "}\n"); + "size_t data_size = ::google::protobuf::internal::WireFormatLite::\n" + " $declared_type$Size(this->$name$_);\n"); } else { printer->Print(variables_, - "data_size = $fixed_size$UL * count;\n"); + "unsigned int count = this->$name$_size();\n" + "size_t data_size = $fixed_size$UL * count;\n"); } if (descriptor_->is_packed()) { diff --git a/src/google/protobuf/compiler/cpp/cpp_service.cc b/src/google/protobuf/compiler/cpp/cpp_service.cc index d6b1ddc5..95357d9f 100644 --- a/src/google/protobuf/compiler/cpp/cpp_service.cc +++ b/src/google/protobuf/compiler/cpp/cpp_service.cc @@ -46,6 +46,7 @@ ServiceGenerator::ServiceGenerator(const ServiceDescriptor* descriptor, const Options& options) : descriptor_(descriptor) { vars_["classname"] = descriptor_->name(); + vars_["file_namespace"] = FileLevelNamespace(descriptor_->file()->name()); vars_["full_name"] = descriptor_->full_name(); if (options.dllexport_decl.empty()) { vars_["dllexport"] = ""; @@ -178,8 +179,8 @@ void ServiceGenerator::GenerateImplementation(io::Printer* printer) { "$classname$::~$classname$() {}\n" "\n" "const ::google::protobuf::ServiceDescriptor* $classname$::descriptor() {\n" - " protobuf_AssignDescriptorsOnce();\n" - " return file_level_service_descriptors[$index$];\n" + " $file_namespace$::protobuf_AssignDescriptorsOnce();\n" + " return $file_namespace$::file_level_service_descriptors[$index$];\n" "}\n" "\n" "const ::google::protobuf::ServiceDescriptor* $classname$::GetDescriptor() {\n" @@ -241,7 +242,7 @@ void ServiceGenerator::GenerateCallMethod(io::Printer* printer) { " ::google::protobuf::Message* response,\n" " ::google::protobuf::Closure* done) {\n" " GOOGLE_DCHECK_EQ(method->service(), " - "file_level_service_descriptors[$index$]);\n" + "$file_namespace$::file_level_service_descriptors[$index$]);\n" " switch(method->index()) {\n"); for (int i = 0; i < descriptor_->method_count(); i++) { diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/src/google/protobuf/compiler/cpp/cpp_string_field.cc index 2874de7d..664a2779 100644 --- a/src/google/protobuf/compiler/cpp/cpp_string_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_string_field.cc @@ -762,7 +762,7 @@ void StringOneofFieldGenerator:: GenerateConstructorCode(io::Printer* printer) const { printer->Print( variables_, - "$classname$_default_oneof_instance_.$name$_.UnsafeSetDefault(\n" + "_$classname$_default_instance_.$name$_.UnsafeSetDefault(\n" " $default_variable$);\n"); } @@ -830,17 +830,21 @@ GenerateAccessorDeclarations(io::Printer* printer) const { "$deprecated_attr$const ::std::string& $name$(int index) const;\n" "$deprecated_attr$::std::string* mutable_$name$(int index);\n" "$deprecated_attr$void set_$name$(int index, const ::std::string& value);\n" + "#if LANG_CXX11\n" + "$deprecated_attr$void set_$name$(int index, ::std::string&& value);\n" + "#endif\n" "$deprecated_attr$void set_$name$(int index, const char* value);\n" "" "$deprecated_attr$void set_$name$(" "int index, const $pointer_type$* value, size_t size);\n" "$deprecated_attr$::std::string* add_$name$();\n" "$deprecated_attr$void add_$name$(const ::std::string& value);\n" + "#if LANG_CXX11\n" + "$deprecated_attr$void add_$name$(::std::string&& value);\n" + "#endif\n" "$deprecated_attr$void add_$name$(const char* value);\n" "$deprecated_attr$void add_$name$(const $pointer_type$* value, size_t size)" - ";\n"); - - printer->Print(variables_, + ";\n" "$deprecated_attr$const ::google::protobuf::RepeatedPtrField< ::std::string>& $name$() " "const;\n" "$deprecated_attr$::google::protobuf::RepeatedPtrField< ::std::string>* mutable_$name$()" @@ -871,6 +875,12 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " // @@protoc_insertion_point(field_set:$full_name$)\n" " $name$_.Mutable(index)->assign(value);\n" "}\n" + "#if LANG_CXX11\n" + "$inline$void $classname$::set_$name$(int index, ::std::string&& value) {\n" + " // @@protoc_insertion_point(field_set:$full_name$)\n" + " $name$_.Mutable(index)->assign(std::move(value));\n" + "}\n" + "#endif\n" "$inline$void $classname$::set_$name$(int index, const char* value) {\n" " $name$_.Mutable(index)->assign(value);\n" " // @@protoc_insertion_point(field_set_char:$full_name$)\n" @@ -890,6 +900,12 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " $name$_.Add()->assign(value);\n" " // @@protoc_insertion_point(field_add:$full_name$)\n" "}\n" + "#if LANG_CXX11\n" + "$inline$void $classname$::add_$name$(::std::string&& value) {\n" + " $name$_.Add()->assign(std::move(value));\n" + " // @@protoc_insertion_point(field_add:$full_name$)\n" + "}\n" + "#endif\n" "$inline$void $classname$::add_$name$(const char* value) {\n" " $name$_.Add()->assign(value);\n" " // @@protoc_insertion_point(field_add_char:$full_name$)\n" @@ -898,8 +914,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, "$classname$::add_$name$(const $pointer_type$* value, size_t size) {\n" " $name$_.Add()->assign(reinterpret_cast<const char*>(value), size);\n" " // @@protoc_insertion_point(field_add_pointer:$full_name$)\n" - "}\n"); - printer->Print(variables, + "}\n" "$inline$const ::google::protobuf::RepeatedPtrField< ::std::string>&\n" "$classname$::$name$() const {\n" " // @@protoc_insertion_point(field_list:$full_name$)\n" @@ -954,7 +969,7 @@ GenerateMergeFromCodedStream(io::Printer* printer) const { void RepeatedStringFieldGenerator:: GenerateSerializeWithCachedSizes(io::Printer* printer) const { printer->Print(variables_, - "for (int i = 0; i < this->$name$_size(); i++) {\n"); + "for (int i = 0, n = this->$name$_size(); i < n; i++) {\n"); printer->Indent(); if (descriptor_->type() == FieldDescriptor::TYPE_STRING) { GenerateUtf8CheckCodeForString( @@ -971,7 +986,7 @@ GenerateSerializeWithCachedSizes(io::Printer* printer) const { void RepeatedStringFieldGenerator:: GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const { printer->Print(variables_, - "for (int i = 0; i < this->$name$_size(); i++) {\n"); + "for (int i = 0, n = this->$name$_size(); i < n; i++) {\n"); printer->Indent(); if (descriptor_->type() == FieldDescriptor::TYPE_STRING) { GenerateUtf8CheckCodeForString( @@ -990,7 +1005,7 @@ GenerateByteSize(io::Printer* printer) const { printer->Print(variables_, "total_size += $tag_size$ *\n" " ::google::protobuf::internal::FromIntSize(this->$name$_size());\n" - "for (int i = 0; i < this->$name$_size(); i++) {\n" + "for (int i = 0, n = this->$name$_size(); i < n; i++) {\n" " total_size += ::google::protobuf::internal::WireFormatLite::$declared_type$Size(\n" " this->$name$(i));\n" "}\n"); diff --git a/src/google/protobuf/compiler/cpp/cpp_unittest.cc b/src/google/protobuf/compiler/cpp/cpp_unittest.cc index 686c70a9..6d68ec35 100644 --- a/src/google/protobuf/compiler/cpp/cpp_unittest.cc +++ b/src/google/protobuf/compiler/cpp/cpp_unittest.cc @@ -463,6 +463,26 @@ TEST(GeneratedMessageTest, StringMove) { EXPECT_EQ(old_data, new_data); EXPECT_EQ(string(32, 'b'), message.oneof_string()); } + + // Verify that we trigger the move behavior on a repeated setter. + { + string tmp(32, 'a'); + + const char* old_data = tmp.data(); + message.add_repeated_string(std::move(tmp)); + const char* new_data = message.repeated_string(0).data(); + + EXPECT_EQ(old_data, new_data); + EXPECT_EQ(string(32, 'a'), message.repeated_string(0)); + + string tmp2(32, 'b'); + old_data = tmp2.data(); + message.set_repeated_string(0, std::move(tmp2)); + new_data = message.repeated_string(0).data(); + + EXPECT_EQ(old_data, new_data); + EXPECT_EQ(string(32, 'b'), message.repeated_string(0)); + } } #endif diff --git a/src/google/protobuf/compiler/java/java_enum_field_lite.cc b/src/google/protobuf/compiler/java/java_enum_field_lite.cc index f1dc47fc..50eed5da 100644 --- a/src/google/protobuf/compiler/java/java_enum_field_lite.cc +++ b/src/google/protobuf/compiler/java/java_enum_field_lite.cc @@ -76,6 +76,7 @@ void SetEnumVariables(const FieldDescriptor* descriptor, // by the proto compiler (*variables)["deprecation"] = descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; + (*variables)["required"] = descriptor->is_required() ? "true" : "false"; if (SupportFieldPresence(descriptor->file())) { // For singular messages and builders, one bit is used for the hasField bit. diff --git a/src/google/protobuf/compiler/java/java_message_field_lite.cc b/src/google/protobuf/compiler/java/java_message_field_lite.cc index fd78f75a..0957676c 100644 --- a/src/google/protobuf/compiler/java/java_message_field_lite.cc +++ b/src/google/protobuf/compiler/java/java_message_field_lite.cc @@ -70,6 +70,7 @@ void SetMessageVariables(const FieldDescriptor* descriptor, // by the proto compiler (*variables)["deprecation"] = descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; + (*variables)["required"] = descriptor->is_required() ? "true" : "false"; if (SupportFieldPresence(descriptor->file())) { // For singular messages and builders, one bit is used for the hasField bit. diff --git a/src/google/protobuf/compiler/java/java_message_lite.cc b/src/google/protobuf/compiler/java/java_message_lite.cc index 8cc0f01d..048d5892 100644 --- a/src/google/protobuf/compiler/java/java_message_lite.cc +++ b/src/google/protobuf/compiler/java/java_message_lite.cc @@ -928,10 +928,10 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodMergeFromStream( "com.google.protobuf.CodedInputStream input =\n" " (com.google.protobuf.CodedInputStream) arg0;\n" "com.google.protobuf.ExtensionRegistryLite extensionRegistry =\n" - " (com.google.protobuf.ExtensionRegistryLite) arg1;\n" + " (com.google.protobuf.ExtensionRegistryLite) arg1;\n"); + printer->Print( "try {\n"); printer->Indent(); - printer->Print( "boolean done = false;\n" "while (!done) {\n"); diff --git a/src/google/protobuf/compiler/java/java_primitive_field_lite.cc b/src/google/protobuf/compiler/java/java_primitive_field_lite.cc index ac39f4cf..b04bf1c2 100644 --- a/src/google/protobuf/compiler/java/java_primitive_field_lite.cc +++ b/src/google/protobuf/compiler/java/java_primitive_field_lite.cc @@ -74,6 +74,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, SimpleItoa(static_cast<int32>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = SimpleItoa( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); + (*variables)["required"] = descriptor->is_required() ? "true" : "false"; string capitalized_type = UnderscoresToCamelCase(PrimitiveTypeName(javaType), true /* cap_next_letter */); diff --git a/src/google/protobuf/compiler/java/java_shared_code_generator.cc b/src/google/protobuf/compiler/java/java_shared_code_generator.cc index 5fe68245..7bd5ad7a 100644 --- a/src/google/protobuf/compiler/java/java_shared_code_generator.cc +++ b/src/google/protobuf/compiler/java/java_shared_code_generator.cc @@ -181,13 +181,11 @@ void SharedCodeGenerator::GenerateDescriptors(io::Printer* printer) { // Find out all dependencies. std::vector<std::pair<string, string> > dependencies; for (int i = 0; i < file_->dependency_count(); i++) { - if (ShouldIncludeDependency(file_->dependency(i))) { - string filename = file_->dependency(i)->name(); - string classname = FileJavaPackage(file_->dependency(i)) + "." + - name_resolver_->GetDescriptorClassName( - file_->dependency(i)); - dependencies.push_back(std::make_pair(filename, classname)); - } + string filename = file_->dependency(i)->name(); + string classname = FileJavaPackage(file_->dependency(i)) + "." + + name_resolver_->GetDescriptorClassName( + file_->dependency(i)); + dependencies.push_back(std::make_pair(filename, classname)); } // ----------------------------------------------------------------- @@ -209,11 +207,6 @@ void SharedCodeGenerator::GenerateDescriptors(io::Printer* printer) { " }, assigner);\n"); } -bool SharedCodeGenerator::ShouldIncludeDependency( - const FileDescriptor* descriptor) { - return true; -} - } // namespace java } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/compiler/java/java_shared_code_generator.h b/src/google/protobuf/compiler/java/java_shared_code_generator.h index c8ead47a..40502270 100644 --- a/src/google/protobuf/compiler/java/java_shared_code_generator.h +++ b/src/google/protobuf/compiler/java/java_shared_code_generator.h @@ -77,11 +77,6 @@ class SharedCodeGenerator { void GenerateDescriptors(io::Printer* printer); private: - // Returns whether the dependency should be included in the output file. - // Always returns true for opensource, but used internally at Google to help - // improve compatibility with version 1 of protocol buffers. - bool ShouldIncludeDependency(const FileDescriptor* descriptor); - google::protobuf::scoped_ptr<ClassNameResolver> name_resolver_; const FileDescriptor* file_; const Options options_; diff --git a/src/google/protobuf/compiler/java/java_string_field_lite.cc b/src/google/protobuf/compiler/java/java_string_field_lite.cc index 4d2dcad8..138e59b6 100644 --- a/src/google/protobuf/compiler/java/java_string_field_lite.cc +++ b/src/google/protobuf/compiler/java/java_string_field_lite.cc @@ -85,6 +85,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, // by the proto compiler (*variables)["deprecation"] = descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; + (*variables)["required"] = descriptor->is_required() ? "true" : "false"; if (SupportFieldPresence(descriptor->file())) { // For singular messages and builders, one bit is used for the hasField bit. diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc index 09c7a2b6..7a03d42b 100644 --- a/src/google/protobuf/compiler/parser.cc +++ b/src/google/protobuf/compiler/parser.cc @@ -249,11 +249,11 @@ bool Parser::ConsumeNumber(double* output, const char* error) { input_->Next(); return true; } else if (LookingAt("inf")) { - *output = numeric_limits<double>::infinity(); + *output = std::numeric_limits<double>::infinity(); input_->Next(); return true; } else if (LookingAt("nan")) { - *output = numeric_limits<double>::quiet_NaN(); + *output = std::numeric_limits<double>::quiet_NaN(); input_->Next(); return true; } else { @@ -282,7 +282,7 @@ bool Parser::TryConsumeEndOfDeclaration( const char* text, const LocationRecorder* location) { if (LookingAt(text)) { string leading, trailing; - vector<string> detached; + std::vector<string> detached; input_->NextWithComments(&trailing, &detached, &leading); // Save the leading comments for next time, and recall the leading comments @@ -404,7 +404,7 @@ void Parser::LocationRecorder::RecordLegacyLocation(const Message* descriptor, void Parser::LocationRecorder::AttachComments( string* leading, string* trailing, - vector<string>* detached_comments) const { + std::vector<string>* detached_comments) const { GOOGLE_CHECK(!location_->has_leading_comments()); GOOGLE_CHECK(!location_->has_trailing_comments()); @@ -487,7 +487,7 @@ bool Parser::ValidateEnum(const EnumDescriptorProto* proto) { return false; } - set<int> used_values; + std::set<int> used_values; bool has_duplicates = false; for (int i = 0; i < proto->value_size(); ++i) { const EnumValueDescriptorProto enum_value = proto->value(i); @@ -2089,7 +2089,7 @@ bool SourceLocationTable::Find( const Message* descriptor, DescriptorPool::ErrorCollector::ErrorLocation location, int* line, int* column) const { - const pair<int, int>* result = + const std::pair<int, int>* result = FindOrNull(location_map_, std::make_pair(descriptor, location)); if (result == NULL) { *line = -1; diff --git a/src/google/protobuf/compiler/php/php_generator.cc b/src/google/protobuf/compiler/php/php_generator.cc index be2739ff..ec9a2365 100644 --- a/src/google/protobuf/compiler/php/php_generator.cc +++ b/src/google/protobuf/compiler/php/php_generator.cc @@ -757,12 +757,15 @@ void GenerateEnumFile(const FileDescriptor* file, const EnumDescriptor* en, std::string fullname = FilenameToClassname(filename); int lastindex = fullname.find_last_of("\\"); - GenerateEnumDocComment(&printer, en); - if (lastindex != string::npos) { + if (!file->package().empty()) { printer.Print( "namespace ^name^;\n\n", "name", fullname.substr(0, lastindex)); + } + GenerateEnumDocComment(&printer, en); + + if (lastindex != string::npos) { printer.Print( "class ^name^\n" "{\n", @@ -864,7 +867,7 @@ void GenerateMessageFile(const FileDescriptor* file, const Descriptor* message, printer.Print( "public function get^camel_name^()\n" "{\n" - " return $this->^name^;\n" + " return $this->whichOneof(\"^name^\");\n" "}\n\n", "camel_name", UnderscoresToCamelCase(oneof->name(), true), "name", oneof->name()); diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 6edb5e76..686ee477 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -20,14 +20,17 @@ namespace google { namespace protobuf { namespace compiler { -class VersionDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Version> {}; -VersionDefaultTypeInternal _Version_default_instance_; -class CodeGeneratorRequestDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorRequest> {}; -CodeGeneratorRequestDefaultTypeInternal _CodeGeneratorRequest_default_instance_; -class CodeGeneratorResponse_FileDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorResponse_File> {}; -CodeGeneratorResponse_FileDefaultTypeInternal _CodeGeneratorResponse_File_default_instance_; -class CodeGeneratorResponseDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorResponse> {}; -CodeGeneratorResponseDefaultTypeInternal _CodeGeneratorResponse_default_instance_; +class VersionDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Version> { +} _Version_default_instance_; +class CodeGeneratorRequestDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorRequest> { +} _CodeGeneratorRequest_default_instance_; +class CodeGeneratorResponse_FileDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorResponse_File> { +} _CodeGeneratorResponse_File_default_instance_; +class CodeGeneratorResponseDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorResponse> { +} _CodeGeneratorResponse_default_instance_; + +namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto { + namespace { @@ -35,55 +38,50 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fcompiler_2fplugin_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, major_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, minor_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, patch_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, suffix_), - 1, - 2, - 3, - 0, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, file_to_generate_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, parameter_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, proto_file_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, compiler_version_), - 2, - 0, - 3, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, insertion_point_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, content_), - 0, - 1, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, error_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, file_), - 0, - 1, - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, major_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, minor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, patch_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, suffix_), + 1, + 2, + 3, + 0, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, file_to_generate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, parameter_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, proto_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, compiler_version_), + ~0u, + 0, + ~0u, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, insertion_point_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, content_), + 0, + 1, + 2, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, error_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, file_), + 0, + ~0u, +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, 8, sizeof(Version)}, @@ -92,20 +90,20 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 34, 40, sizeof(CodeGeneratorResponse)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_Version_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorRequest_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorResponse_File_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorResponse_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_Version_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorRequest_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorResponse_File_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorResponse_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/compiler/plugin.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fcompiler_2fplugin_2eproto(), factory, + "google/protobuf/compiler/plugin.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -122,7 +120,7 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { +void TableStruct::Shutdown() { _Version_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; _CodeGeneratorRequest_default_instance_.Shutdown(); @@ -133,11 +131,11 @@ void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { delete file_level_metadata[3].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; - ::google::protobuf::protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); ::google::protobuf::internal::InitProtobufDefaults(); + ::google::protobuf::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); _Version_default_instance_.DefaultConstruct(); _CodeGeneratorRequest_default_instance_.DefaultConstruct(); _CodeGeneratorResponse_File_default_instance_.DefaultConstruct(); @@ -146,12 +144,12 @@ void protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl() ::google::protobuf::compiler::Version::internal_default_instance()); } -void protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n%google/protobuf/compiler/plugin.proto\022" "\030google.protobuf.compiler\032 google/protob" @@ -173,21 +171,23 @@ void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl() { descriptor, 590); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/compiler/plugin.proto", &protobuf_RegisterTypes); - ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto); + ::google::protobuf::protobuf_google_2fprotobuf_2fdescriptor_2eproto::AddDescriptors(); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fcompiler_2fplugin_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fcompiler_2fplugin_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto + // =================================================================== @@ -201,7 +201,7 @@ const int Version::kSuffixFieldNumber; Version::Version() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.Version) @@ -244,12 +244,12 @@ void Version::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Version::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[0].descriptor; } const Version& Version::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -287,7 +287,8 @@ bool Version::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 major = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { set_has_major(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -300,7 +301,8 @@ bool Version::MergePartialFromCodedStream( // optional int32 minor = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_minor(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -313,7 +315,8 @@ bool Version::MergePartialFromCodedStream( // optional int32 patch = 3; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { set_has_patch(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -326,7 +329,8 @@ bool Version::MergePartialFromCodedStream( // optional string suffix = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_suffix())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -398,7 +402,7 @@ void Version::SerializeWithCachedSizes( ::google::protobuf::uint8* Version::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.Version) // optional int32 major = 1; if (has_major()) { @@ -549,8 +553,8 @@ void Version::InternalSwap(Version* other) { } ::google::protobuf::Metadata Version::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -704,7 +708,7 @@ const int CodeGeneratorRequest::kCompilerVersionFieldNumber; CodeGeneratorRequest::CodeGeneratorRequest() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorRequest) @@ -753,12 +757,12 @@ void CodeGeneratorRequest::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CodeGeneratorRequest::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1].descriptor; + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[1].descriptor; } const CodeGeneratorRequest& CodeGeneratorRequest::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -800,7 +804,8 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated string file_to_generate = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_file_to_generate())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -816,7 +821,8 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( // optional string parameter = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_parameter())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -831,7 +837,8 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( // optional .google.protobuf.compiler.Version compiler_version = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_compiler_version())); } else { @@ -842,7 +849,8 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( // repeated .google.protobuf.FileDescriptorProto proto_file = 15; case 15: { - if (tag == 122u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(122u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_proto_file())); @@ -879,7 +887,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.compiler.CodeGeneratorRequest) // repeated string file_to_generate = 1; - for (int i = 0; i < this->file_to_generate_size(); i++) { + for (int i = 0, n = this->file_to_generate_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->file_to_generate(i).data(), this->file_to_generate(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -919,10 +927,10 @@ void CodeGeneratorRequest::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorRequest::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorRequest) // repeated string file_to_generate = 1; - for (int i = 0; i < this->file_to_generate_size(); i++) { + for (int i = 0, n = this->file_to_generate_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->file_to_generate(i).data(), this->file_to_generate(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -976,7 +984,7 @@ size_t CodeGeneratorRequest::ByteSizeLong() const { // repeated string file_to_generate = 1; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->file_to_generate_size()); - for (int i = 0; i < this->file_to_generate_size(); i++) { + for (int i = 0, n = this->file_to_generate_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->file_to_generate(i)); } @@ -1081,8 +1089,8 @@ void CodeGeneratorRequest::InternalSwap(CodeGeneratorRequest* other) { } ::google::protobuf::Metadata CodeGeneratorRequest::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1]; + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[1]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1107,6 +1115,12 @@ void CodeGeneratorRequest::set_file_to_generate(int index, const ::std::string& // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) file_to_generate_.Mutable(index)->assign(value); } +#if LANG_CXX11 +void CodeGeneratorRequest::set_file_to_generate(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) + file_to_generate_.Mutable(index)->assign(std::move(value)); +} +#endif void CodeGeneratorRequest::set_file_to_generate(int index, const char* value) { file_to_generate_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) @@ -1124,6 +1138,12 @@ void CodeGeneratorRequest::add_file_to_generate(const ::std::string& value) { file_to_generate_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } +#if LANG_CXX11 +void CodeGeneratorRequest::add_file_to_generate(::std::string&& value) { + file_to_generate_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) +} +#endif void CodeGeneratorRequest::add_file_to_generate(const char* value) { file_to_generate_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) @@ -1293,7 +1313,7 @@ const int CodeGeneratorResponse_File::kContentFieldNumber; CodeGeneratorResponse_File::CodeGeneratorResponse_File() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorResponse.File) @@ -1343,12 +1363,12 @@ void CodeGeneratorResponse_File::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CodeGeneratorResponse_File::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2].descriptor; + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[2].descriptor; } const CodeGeneratorResponse_File& CodeGeneratorResponse_File::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1392,7 +1412,8 @@ bool CodeGeneratorResponse_File::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1407,7 +1428,8 @@ bool CodeGeneratorResponse_File::MergePartialFromCodedStream( // optional string insertion_point = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_insertion_point())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1422,7 +1444,8 @@ bool CodeGeneratorResponse_File::MergePartialFromCodedStream( // optional string content = 15; case 15: { - if (tag == 122u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(122u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_content())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1499,7 +1522,7 @@ void CodeGeneratorResponse_File::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorResponse_File::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse.File) // optional string name = 1; if (has_name()) { @@ -1648,8 +1671,8 @@ void CodeGeneratorResponse_File::InternalSwap(CodeGeneratorResponse_File* other) } ::google::protobuf::Metadata CodeGeneratorResponse_File::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2]; + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[2]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1853,7 +1876,7 @@ const int CodeGeneratorResponse::kFileFieldNumber; CodeGeneratorResponse::CodeGeneratorResponse() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorResponse) @@ -1892,12 +1915,12 @@ void CodeGeneratorResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CodeGeneratorResponse::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3].descriptor; + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[3].descriptor; } const CodeGeneratorResponse& CodeGeneratorResponse::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1932,7 +1955,8 @@ bool CodeGeneratorResponse::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string error = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_error())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1947,7 +1971,8 @@ bool CodeGeneratorResponse::MergePartialFromCodedStream( // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; case 15: { - if (tag == 122u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(122u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_file())); @@ -2008,7 +2033,7 @@ void CodeGeneratorResponse::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorResponse::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse) // optional string error = 1; if (has_error()) { @@ -2127,8 +2152,8 @@ void CodeGeneratorResponse::InternalSwap(CodeGeneratorResponse* other) { } ::google::protobuf::Metadata CodeGeneratorResponse::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3]; + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[3]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 0c29b959..1b91daca 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -127,9 +128,16 @@ namespace google { namespace protobuf { namespace compiler { +namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); -void LIBPROTOC_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); +struct LIBPROTOC_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOC_EXPORT AddDescriptors(); +void LIBPROTOC_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto // =================================================================== @@ -184,7 +192,8 @@ class LIBPROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -207,6 +216,21 @@ class LIBPROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_ // accessors ------------------------------------------------------- + // optional string suffix = 4; + bool has_suffix() const; + void clear_suffix(); + static const int kSuffixFieldNumber = 4; + const ::std::string& suffix() const; + void set_suffix(const ::std::string& value); + #if LANG_CXX11 + void set_suffix(::std::string&& value); + #endif + void set_suffix(const char* value); + void set_suffix(const char* value, size_t size); + ::std::string* mutable_suffix(); + ::std::string* release_suffix(); + void set_allocated_suffix(::std::string* suffix); + // optional int32 major = 1; bool has_major() const; void clear_major(); @@ -228,21 +252,6 @@ class LIBPROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_ ::google::protobuf::int32 patch() const; void set_patch(::google::protobuf::int32 value); - // optional string suffix = 4; - bool has_suffix() const; - void clear_suffix(); - static const int kSuffixFieldNumber = 4; - const ::std::string& suffix() const; - void set_suffix(const ::std::string& value); - #if LANG_CXX11 - void set_suffix(::std::string&& value); - #endif - void set_suffix(const char* value); - void set_suffix(const char* value, size_t size); - ::std::string* mutable_suffix(); - ::std::string* release_suffix(); - void set_allocated_suffix(::std::string* suffix); - // @@protoc_insertion_point(class_scope:google.protobuf.compiler.Version) private: void set_has_major(); @@ -261,11 +270,7 @@ class LIBPROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_ ::google::protobuf::int32 major_; ::google::protobuf::int32 minor_; ::google::protobuf::int32 patch_; - friend void LIBPROTOC_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl(); - friend void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); - + friend struct LIBPROTOC_EXPORT protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -320,7 +325,8 @@ class LIBPROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -350,15 +356,33 @@ class LIBPROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message const ::std::string& file_to_generate(int index) const; ::std::string* mutable_file_to_generate(int index); void set_file_to_generate(int index, const ::std::string& value); + #if LANG_CXX11 + void set_file_to_generate(int index, ::std::string&& value); + #endif void set_file_to_generate(int index, const char* value); void set_file_to_generate(int index, const char* value, size_t size); ::std::string* add_file_to_generate(); void add_file_to_generate(const ::std::string& value); + #if LANG_CXX11 + void add_file_to_generate(::std::string&& value); + #endif void add_file_to_generate(const char* value); void add_file_to_generate(const char* value, size_t size); const ::google::protobuf::RepeatedPtrField< ::std::string>& file_to_generate() const; ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_file_to_generate(); + // repeated .google.protobuf.FileDescriptorProto proto_file = 15; + int proto_file_size() const; + void clear_proto_file(); + static const int kProtoFileFieldNumber = 15; + const ::google::protobuf::FileDescriptorProto& proto_file(int index) const; + ::google::protobuf::FileDescriptorProto* mutable_proto_file(int index); + ::google::protobuf::FileDescriptorProto* add_proto_file(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >* + mutable_proto_file(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >& + proto_file() const; + // optional string parameter = 2; bool has_parameter() const; void clear_parameter(); @@ -374,18 +398,6 @@ class LIBPROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message ::std::string* release_parameter(); void set_allocated_parameter(::std::string* parameter); - // repeated .google.protobuf.FileDescriptorProto proto_file = 15; - int proto_file_size() const; - void clear_proto_file(); - static const int kProtoFileFieldNumber = 15; - const ::google::protobuf::FileDescriptorProto& proto_file(int index) const; - ::google::protobuf::FileDescriptorProto* mutable_proto_file(int index); - ::google::protobuf::FileDescriptorProto* add_proto_file(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >* - mutable_proto_file(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >& - proto_file() const; - // optional .google.protobuf.compiler.Version compiler_version = 3; bool has_compiler_version() const; void clear_compiler_version(); @@ -409,11 +421,7 @@ class LIBPROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > proto_file_; ::google::protobuf::internal::ArenaStringPtr parameter_; ::google::protobuf::compiler::Version* compiler_version_; - friend void LIBPROTOC_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl(); - friend void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); - + friend struct LIBPROTOC_EXPORT protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -468,7 +476,8 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse_File : public ::google::protobuf::M bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -551,11 +560,7 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse_File : public ::google::protobuf::M ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr insertion_point_; ::google::protobuf::internal::ArenaStringPtr content_; - friend void LIBPROTOC_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl(); - friend void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); - + friend struct LIBPROTOC_EXPORT protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -610,7 +615,8 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Messag bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -635,6 +641,18 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Messag // accessors ------------------------------------------------------- + // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; + int file_size() const; + void clear_file(); + static const int kFileFieldNumber = 15; + const ::google::protobuf::compiler::CodeGeneratorResponse_File& file(int index) const; + ::google::protobuf::compiler::CodeGeneratorResponse_File* mutable_file(int index); + ::google::protobuf::compiler::CodeGeneratorResponse_File* add_file(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >* + mutable_file(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >& + file() const; + // optional string error = 1; bool has_error() const; void clear_error(); @@ -650,18 +668,6 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Messag ::std::string* release_error(); void set_allocated_error(::std::string* error); - // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; - int file_size() const; - void clear_file(); - static const int kFileFieldNumber = 15; - const ::google::protobuf::compiler::CodeGeneratorResponse_File& file(int index) const; - ::google::protobuf::compiler::CodeGeneratorResponse_File* mutable_file(int index); - ::google::protobuf::compiler::CodeGeneratorResponse_File* add_file(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >* - mutable_file(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >& - file() const; - // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse) private: void set_has_error(); @@ -672,11 +678,7 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Messag mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File > file_; ::google::protobuf::internal::ArenaStringPtr error_; - friend void LIBPROTOC_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl(); - friend void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto(); - + friend struct LIBPROTOC_EXPORT protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; }; // =================================================================== @@ -843,6 +845,12 @@ inline void CodeGeneratorRequest::set_file_to_generate(int index, const ::std::s // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) file_to_generate_.Mutable(index)->assign(value); } +#if LANG_CXX11 +inline void CodeGeneratorRequest::set_file_to_generate(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) + file_to_generate_.Mutable(index)->assign(std::move(value)); +} +#endif inline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value) { file_to_generate_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) @@ -860,6 +868,12 @@ inline void CodeGeneratorRequest::add_file_to_generate(const ::std::string& valu file_to_generate_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } +#if LANG_CXX11 +inline void CodeGeneratorRequest::add_file_to_generate(::std::string&& value) { + file_to_generate_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) +} +#endif inline void CodeGeneratorRequest::add_file_to_generate(const char* value) { file_to_generate_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) diff --git a/src/google/protobuf/compiler/python/python_generator.cc b/src/google/protobuf/compiler/python/python_generator.cc index f5769128..f83f155a 100644 --- a/src/google/protobuf/compiler/python/python_generator.cc +++ b/src/google/protobuf/compiler/python/python_generator.cc @@ -1380,8 +1380,17 @@ void Generator::FixOptionsForMessage(const Descriptor& descriptor) const { void Generator::CopyPublicDependenciesAliases( const string& copy_from, const FileDescriptor* file) const { for (int i = 0; i < file->public_dependency_count(); ++i) { + string module_name = ModuleName(file->public_dependency(i)->name()); string module_alias = ModuleAlias(file->public_dependency(i)->name()); - printer_->Print("$alias$ = $copy_from$.$alias$\n", "alias", module_alias, + // There's no module alias in the dependent file if it was generated by + // an old protoc (less than 3.0.0-alpha-1). Use module name in this + // situation. + printer_->Print("try:\n" + " $alias$ = $copy_from$.$alias$\n" + "except AttributeError:\n" + " $alias$ = $copy_from$.$module$\n", + "alias", module_alias, + "module", module_name, "copy_from", copy_from); CopyPublicDependenciesAliases(copy_from, file->public_dependency(i)); } diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 7dfdb377..c87327ce 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -467,7 +467,7 @@ void InitAllowedProto3Extendee() { allowed_proto3_extendees_ = new std::set<string>; const char* kOptionNames[] = { "FileOptions", "MessageOptions", "FieldOptions", "EnumOptions", - "EnumValueOptions", "ServiceOptions", "MethodOptions"}; + "EnumValueOptions", "ServiceOptions", "MethodOptions", "OneofOptions"}; for (int i = 0; i < GOOGLE_ARRAYSIZE(kOptionNames); ++i) { // descriptor.proto has a different package name in opensource. We allow // both so the opensource protocol compiler can also compile internal @@ -4114,6 +4114,14 @@ const FileDescriptor* DescriptorBuilder::BuildFileImpl( dependency = pool_->underlay_->FindFileByName(proto.dependency(i)); } + if (dependency == result) { + // Recursive import. dependency/result is not fully initialized, and it's + // dangerous to try to do anything with it. The recursive import error + // will be detected and reported in DescriptorBuilder::BuildFile(). + tables_->RollbackToLastCheckpoint(); + return NULL; + } + if (dependency == NULL) { if (pool_->allow_unknown_ || (!pool_->enforce_weak_ && weak_deps.find(i) != weak_deps.end())) { diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index bb445444..15c97d0b 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -19,56 +19,59 @@ namespace google { namespace protobuf { -class FileDescriptorSetDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorSet> {}; -FileDescriptorSetDefaultTypeInternal _FileDescriptorSet_default_instance_; -class FileDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorProto> {}; -FileDescriptorProtoDefaultTypeInternal _FileDescriptorProto_default_instance_; -class DescriptorProto_ExtensionRangeDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ExtensionRange> {}; -DescriptorProto_ExtensionRangeDefaultTypeInternal _DescriptorProto_ExtensionRange_default_instance_; -class DescriptorProto_ReservedRangeDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ReservedRange> {}; -DescriptorProto_ReservedRangeDefaultTypeInternal _DescriptorProto_ReservedRange_default_instance_; -class DescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto> {}; -DescriptorProtoDefaultTypeInternal _DescriptorProto_default_instance_; -class FieldDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FieldDescriptorProto> {}; -FieldDescriptorProtoDefaultTypeInternal _FieldDescriptorProto_default_instance_; -class OneofDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<OneofDescriptorProto> {}; -OneofDescriptorProtoDefaultTypeInternal _OneofDescriptorProto_default_instance_; -class EnumDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumDescriptorProto> {}; -EnumDescriptorProtoDefaultTypeInternal _EnumDescriptorProto_default_instance_; -class EnumValueDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumValueDescriptorProto> {}; -EnumValueDescriptorProtoDefaultTypeInternal _EnumValueDescriptorProto_default_instance_; -class ServiceDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<ServiceDescriptorProto> {}; -ServiceDescriptorProtoDefaultTypeInternal _ServiceDescriptorProto_default_instance_; -class MethodDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<MethodDescriptorProto> {}; -MethodDescriptorProtoDefaultTypeInternal _MethodDescriptorProto_default_instance_; -class FileOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FileOptions> {}; -FileOptionsDefaultTypeInternal _FileOptions_default_instance_; -class MessageOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<MessageOptions> {}; -MessageOptionsDefaultTypeInternal _MessageOptions_default_instance_; -class FieldOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FieldOptions> {}; -FieldOptionsDefaultTypeInternal _FieldOptions_default_instance_; -class OneofOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<OneofOptions> {}; -OneofOptionsDefaultTypeInternal _OneofOptions_default_instance_; -class EnumOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumOptions> {}; -EnumOptionsDefaultTypeInternal _EnumOptions_default_instance_; -class EnumValueOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumValueOptions> {}; -EnumValueOptionsDefaultTypeInternal _EnumValueOptions_default_instance_; -class ServiceOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<ServiceOptions> {}; -ServiceOptionsDefaultTypeInternal _ServiceOptions_default_instance_; -class MethodOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<MethodOptions> {}; -MethodOptionsDefaultTypeInternal _MethodOptions_default_instance_; -class UninterpretedOption_NamePartDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption_NamePart> {}; -UninterpretedOption_NamePartDefaultTypeInternal _UninterpretedOption_NamePart_default_instance_; -class UninterpretedOptionDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption> {}; -UninterpretedOptionDefaultTypeInternal _UninterpretedOption_default_instance_; -class SourceCodeInfo_LocationDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo_Location> {}; -SourceCodeInfo_LocationDefaultTypeInternal _SourceCodeInfo_Location_default_instance_; -class SourceCodeInfoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo> {}; -SourceCodeInfoDefaultTypeInternal _SourceCodeInfo_default_instance_; -class GeneratedCodeInfo_AnnotationDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo_Annotation> {}; -GeneratedCodeInfo_AnnotationDefaultTypeInternal _GeneratedCodeInfo_Annotation_default_instance_; -class GeneratedCodeInfoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo> {}; -GeneratedCodeInfoDefaultTypeInternal _GeneratedCodeInfo_default_instance_; +class FileDescriptorSetDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorSet> { +} _FileDescriptorSet_default_instance_; +class FileDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorProto> { +} _FileDescriptorProto_default_instance_; +class DescriptorProto_ExtensionRangeDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ExtensionRange> { +} _DescriptorProto_ExtensionRange_default_instance_; +class DescriptorProto_ReservedRangeDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ReservedRange> { +} _DescriptorProto_ReservedRange_default_instance_; +class DescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto> { +} _DescriptorProto_default_instance_; +class FieldDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FieldDescriptorProto> { +} _FieldDescriptorProto_default_instance_; +class OneofDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<OneofDescriptorProto> { +} _OneofDescriptorProto_default_instance_; +class EnumDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumDescriptorProto> { +} _EnumDescriptorProto_default_instance_; +class EnumValueDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumValueDescriptorProto> { +} _EnumValueDescriptorProto_default_instance_; +class ServiceDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<ServiceDescriptorProto> { +} _ServiceDescriptorProto_default_instance_; +class MethodDescriptorProtoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<MethodDescriptorProto> { +} _MethodDescriptorProto_default_instance_; +class FileOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FileOptions> { +} _FileOptions_default_instance_; +class MessageOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<MessageOptions> { +} _MessageOptions_default_instance_; +class FieldOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FieldOptions> { +} _FieldOptions_default_instance_; +class OneofOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<OneofOptions> { +} _OneofOptions_default_instance_; +class EnumOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumOptions> { +} _EnumOptions_default_instance_; +class EnumValueOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumValueOptions> { +} _EnumValueOptions_default_instance_; +class ServiceOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<ServiceOptions> { +} _ServiceOptions_default_instance_; +class MethodOptionsDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<MethodOptions> { +} _MethodOptions_default_instance_; +class UninterpretedOption_NamePartDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption_NamePart> { +} _UninterpretedOption_NamePart_default_instance_; +class UninterpretedOptionDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption> { +} _UninterpretedOption_default_instance_; +class SourceCodeInfo_LocationDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo_Location> { +} _SourceCodeInfo_Location_default_instance_; +class SourceCodeInfoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo> { +} _SourceCodeInfo_default_instance_; +class GeneratedCodeInfo_AnnotationDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo_Annotation> { +} _GeneratedCodeInfo_Annotation_default_instance_; +class GeneratedCodeInfoDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo> { +} _GeneratedCodeInfo_default_instance_; + +namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto { + namespace { @@ -77,339 +80,334 @@ const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[6]; } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, file_), - 0, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, package_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, dependency_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, public_dependency_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, weak_dependency_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, message_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, enum_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, service_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, extension_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, source_code_info_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, syntax_), - 0, - 1, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 3, - 4, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, start_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, start_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, end_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, field_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, nested_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, enum_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_range_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, oneof_decl_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, reserved_range_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, reserved_name_), - 0, - 2, - 3, - 4, - 5, - 6, - 7, - 1, - 8, - 9, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, number_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, label_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, extendee_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, default_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, oneof_index_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, json_name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, options_), - 0, - 6, - 8, - 9, - 1, - 2, - 3, - 7, - 4, - 5, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, options_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, options_), - 0, - 2, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, number_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, options_), - 0, - 2, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, method_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, options_), - 0, - 2, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, input_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, output_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, client_streaming_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, server_streaming_), - 0, - 1, - 2, - 3, - 4, - 5, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _extensions_), - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_outer_classname_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_multiple_files_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generate_equals_and_hash_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_string_check_utf8_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, optimize_for_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, go_package_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_generic_services_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generic_services_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, py_generic_services_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_enable_arenas_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, objc_class_prefix_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, csharp_namespace_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, swift_prefix_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, uninterpreted_option_), - 0, - 1, - 6, - 7, - 8, - 14, - 2, - 9, - 10, - 11, - 12, - 13, - 3, - 4, - 5, - 15, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _extensions_), - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, message_set_wire_format_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, no_standard_descriptor_accessor_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, map_entry_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, uninterpreted_option_), - 0, - 1, - 2, - 3, - 4, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _extensions_), - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, ctype_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, packed_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, jstype_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, lazy_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, weak_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, uninterpreted_option_), - 0, - 2, - 1, - 3, - 4, - 5, - 6, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _extensions_), - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, uninterpreted_option_), - 0, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _extensions_), - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, allow_alias_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, uninterpreted_option_), - 0, - 1, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _extensions_), - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, uninterpreted_option_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _extensions_), - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, uninterpreted_option_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _extensions_), - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, idempotency_level_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, uninterpreted_option_), - 0, - 1, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, name_part_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, is_extension_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, identifier_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, positive_int_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, negative_int_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, double_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, string_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, aggregate_value_), - 6, - 0, - 3, - 4, - 5, - 1, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, path_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, span_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, leading_comments_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, trailing_comments_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, leading_detached_comments_), - 2, - 3, - 0, - 1, - 4, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, location_), - 0, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, path_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, source_file_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, begin_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, end_), - 3, - 0, - 1, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, annotation_), - 0, - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, file_), + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, public_dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, weak_dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, message_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, enum_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, service_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, extension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, source_code_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, syntax_), + 0, + 1, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + 3, + 4, + 2, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, end_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, field_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, nested_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, enum_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_range_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, oneof_decl_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, reserved_range_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, reserved_name_), + 0, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + 1, + ~0u, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, label_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, extendee_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, default_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, oneof_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, json_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, options_), + 0, + 6, + 8, + 9, + 1, + 2, + 3, + 7, + 4, + 5, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, options_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, options_), + 0, + ~0u, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, options_), + 0, + 2, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, method_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, options_), + 0, + ~0u, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, input_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, output_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, client_streaming_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, server_streaming_), + 0, + 1, + 2, + 3, + 4, + 5, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _extensions_), + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_outer_classname_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_multiple_files_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generate_equals_and_hash_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_string_check_utf8_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, optimize_for_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, go_package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, py_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_enable_arenas_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, objc_class_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, csharp_namespace_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, swift_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, uninterpreted_option_), + 0, + 1, + 6, + 7, + 8, + 14, + 2, + 9, + 10, + 11, + 12, + 13, + 3, + 4, + 5, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _extensions_), + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, message_set_wire_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, no_standard_descriptor_accessor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, map_entry_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, uninterpreted_option_), + 0, + 1, + 2, + 3, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _extensions_), + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, ctype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, packed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, jstype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, lazy_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, weak_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, uninterpreted_option_), + 0, + 2, + 1, + 3, + 4, + 5, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _extensions_), + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, uninterpreted_option_), + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _extensions_), + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, allow_alias_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, uninterpreted_option_), + 0, + 1, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _extensions_), + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, uninterpreted_option_), + 0, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _extensions_), + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, uninterpreted_option_), + 0, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _extensions_), + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, idempotency_level_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, uninterpreted_option_), + 0, + 1, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, name_part_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, is_extension_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, identifier_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, positive_int_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, negative_int_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, double_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, string_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, aggregate_value_), + ~0u, + 0, + 3, + 4, + 5, + 1, + 2, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, span_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, leading_comments_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, trailing_comments_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, leading_detached_comments_), + ~0u, + ~0u, + 0, + 1, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, location_), + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, source_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, begin_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, end_), + ~0u, + 0, + 1, + 2, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, annotation_), + ~0u, +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, 5, sizeof(FileDescriptorSet)}, @@ -439,41 +437,41 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 320, 325, sizeof(GeneratedCodeInfo)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_FileDescriptorSet_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_FileDescriptorProto_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_ExtensionRange_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_ReservedRange_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_FieldDescriptorProto_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_OneofDescriptorProto_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_EnumDescriptorProto_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValueDescriptorProto_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_ServiceDescriptorProto_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_MethodDescriptorProto_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_FileOptions_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_MessageOptions_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_FieldOptions_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_OneofOptions_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_EnumOptions_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValueOptions_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_ServiceOptions_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_MethodOptions_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_UninterpretedOption_NamePart_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_UninterpretedOption_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_SourceCodeInfo_Location_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_SourceCodeInfo_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_GeneratedCodeInfo_Annotation_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_GeneratedCodeInfo_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_FileDescriptorSet_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_FileDescriptorProto_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_ExtensionRange_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_ReservedRange_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_FieldDescriptorProto_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_OneofDescriptorProto_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_EnumDescriptorProto_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValueDescriptorProto_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_ServiceDescriptorProto_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_MethodDescriptorProto_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_FileOptions_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_MessageOptions_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_FieldOptions_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_OneofOptions_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_EnumOptions_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValueOptions_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_ServiceOptions_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_MethodOptions_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_UninterpretedOption_NamePart_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_UninterpretedOption_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_SourceCodeInfo_Location_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_SourceCodeInfo_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_GeneratedCodeInfo_Annotation_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_GeneratedCodeInfo_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/descriptor.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(), factory, + "google/protobuf/descriptor.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, file_level_enum_descriptors, NULL); } @@ -490,7 +488,7 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto() { +void TableStruct::Shutdown() { _FileDescriptorSet_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; _FileDescriptorProto_default_instance_.Shutdown(); @@ -543,7 +541,7 @@ void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto() { delete file_level_metadata[24].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); @@ -592,12 +590,12 @@ void protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl() { ::google::protobuf::MethodOptions::internal_default_instance()); } -void protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n google/protobuf/descriptor.proto\022\017goog" "le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file" @@ -743,23 +741,25 @@ void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl() { descriptor, 5553); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fdescriptor_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto + const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[0]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[0]; } bool FieldDescriptorProto_Type_IsValid(int value) { switch (value) { @@ -811,8 +811,8 @@ const FieldDescriptorProto_Type FieldDescriptorProto::Type_MAX; const int FieldDescriptorProto::Type_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[1]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[1]; } bool FieldDescriptorProto_Label_IsValid(int value) { switch (value) { @@ -834,8 +834,8 @@ const FieldDescriptorProto_Label FieldDescriptorProto::Label_MAX; const int FieldDescriptorProto::Label_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[2]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[2]; } bool FileOptions_OptimizeMode_IsValid(int value) { switch (value) { @@ -857,8 +857,8 @@ const FileOptions_OptimizeMode FileOptions::OptimizeMode_MAX; const int FileOptions::OptimizeMode_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[3]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[3]; } bool FieldOptions_CType_IsValid(int value) { switch (value) { @@ -880,8 +880,8 @@ const FieldOptions_CType FieldOptions::CType_MAX; const int FieldOptions::CType_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[4]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[4]; } bool FieldOptions_JSType_IsValid(int value) { switch (value) { @@ -903,8 +903,8 @@ const FieldOptions_JSType FieldOptions::JSType_MAX; const int FieldOptions::JSType_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 const ::google::protobuf::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[5]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[5]; } bool MethodOptions_IdempotencyLevel_IsValid(int value) { switch (value) { @@ -935,7 +935,7 @@ const int FileDescriptorSet::kFileFieldNumber; FileDescriptorSet::FileDescriptorSet() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorSet) @@ -968,12 +968,12 @@ void FileDescriptorSet::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FileDescriptorSet::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[0].descriptor; } const FileDescriptorSet& FileDescriptorSet::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1004,7 +1004,8 @@ bool FileDescriptorSet::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .google.protobuf.FileDescriptorProto file = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_file())); @@ -1055,7 +1056,7 @@ void FileDescriptorSet::SerializeWithCachedSizes( ::google::protobuf::uint8* FileDescriptorSet::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorSet) // repeated .google.protobuf.FileDescriptorProto file = 1; for (unsigned int i = 0, n = this->file_size(); i < n; i++) { @@ -1152,8 +1153,8 @@ void FileDescriptorSet::InternalSwap(FileDescriptorSet* other) { } ::google::protobuf::Metadata FileDescriptorSet::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1211,7 +1212,7 @@ const int FileDescriptorProto::kSyntaxFieldNumber; FileDescriptorProto::FileDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorProto) @@ -1286,12 +1287,12 @@ void FileDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FileDescriptorProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[1].descriptor; } const FileDescriptorProto& FileDescriptorProto::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1350,7 +1351,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1365,7 +1367,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // optional string package = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_package())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1380,7 +1383,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // repeated string dependency = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_dependency())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1396,7 +1400,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.DescriptorProto message_type = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_message_type())); @@ -1409,7 +1414,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; case 5: { - if (tag == 42u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_enum_type())); @@ -1422,7 +1428,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.ServiceDescriptorProto service = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_service())); @@ -1435,7 +1442,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.FieldDescriptorProto extension = 7; case 7: { - if (tag == 58u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(58u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_extension())); @@ -1448,7 +1456,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.FileOptions options = 8; case 8: { - if (tag == 66u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(66u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -1459,7 +1468,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.SourceCodeInfo source_code_info = 9; case 9: { - if (tag == 74u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(74u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_source_code_info())); } else { @@ -1470,11 +1480,13 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // repeated int32 public_dependency = 10; case 10: { - if (tag == 80u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(80u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 80u, input, this->mutable_public_dependency()))); - } else if (tag == 82u) { + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(82u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_public_dependency()))); @@ -1486,11 +1498,13 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // repeated int32 weak_dependency = 11; case 11: { - if (tag == 88u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(88u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 88u, input, this->mutable_weak_dependency()))); - } else if (tag == 90u) { + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(90u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_weak_dependency()))); @@ -1502,7 +1516,8 @@ bool FileDescriptorProto::MergePartialFromCodedStream( // optional string syntax = 12; case 12: { - if (tag == 98u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(98u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_syntax())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1561,7 +1576,7 @@ void FileDescriptorProto::SerializeWithCachedSizes( } // repeated string dependency = 3; - for (int i = 0; i < this->dependency_size(); i++) { + for (int i = 0, n = this->dependency_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->dependency(i).data(), this->dependency(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -1607,13 +1622,13 @@ void FileDescriptorProto::SerializeWithCachedSizes( } // repeated int32 public_dependency = 10; - for (int i = 0; i < this->public_dependency_size(); i++) { + for (int i = 0, n = this->public_dependency_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 10, this->public_dependency(i), output); } // repeated int32 weak_dependency = 11; - for (int i = 0; i < this->weak_dependency_size(); i++) { + for (int i = 0, n = this->weak_dependency_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 11, this->weak_dependency(i), output); } @@ -1637,7 +1652,7 @@ void FileDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* FileDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto) // optional string name = 1; if (has_name()) { @@ -1662,7 +1677,7 @@ void FileDescriptorProto::SerializeWithCachedSizes( } // repeated string dependency = 3; - for (int i = 0; i < this->dependency_size(); i++) { + for (int i = 0, n = this->dependency_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->dependency(i).data(), this->dependency(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -1714,13 +1729,13 @@ void FileDescriptorProto::SerializeWithCachedSizes( } // repeated int32 public_dependency = 10; - for (int i = 0; i < this->public_dependency_size(); i++) { + for (int i = 0, n = this->public_dependency_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(10, this->public_dependency(i), target); } // repeated int32 weak_dependency = 11; - for (int i = 0; i < this->weak_dependency_size(); i++) { + for (int i = 0, n = this->weak_dependency_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(11, this->weak_dependency(i), target); } @@ -1756,19 +1771,15 @@ size_t FileDescriptorProto::ByteSizeLong() const { // repeated string dependency = 3; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->dependency_size()); - for (int i = 0; i < this->dependency_size(); i++) { + for (int i = 0, n = this->dependency_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->dependency(i)); } // repeated int32 public_dependency = 10; { - size_t data_size = 0; - unsigned int count = this->public_dependency_size(); - for (unsigned int i = 0; i < count; i++) { - data_size += ::google::protobuf::internal::WireFormatLite:: - Int32Size(this->public_dependency(i)); - } + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->public_dependency_); total_size += 1 * ::google::protobuf::internal::FromIntSize(this->public_dependency_size()); total_size += data_size; @@ -1776,12 +1787,8 @@ size_t FileDescriptorProto::ByteSizeLong() const { // repeated int32 weak_dependency = 11; { - size_t data_size = 0; - unsigned int count = this->weak_dependency_size(); - for (unsigned int i = 0; i < count; i++) { - data_size += ::google::protobuf::internal::WireFormatLite:: - Int32Size(this->weak_dependency(i)); - } + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->weak_dependency_); total_size += 1 * ::google::protobuf::internal::FromIntSize(this->weak_dependency_size()); total_size += data_size; @@ -1971,8 +1978,8 @@ void FileDescriptorProto::InternalSwap(FileDescriptorProto* other) { } ::google::protobuf::Metadata FileDescriptorProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[1]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -2121,6 +2128,12 @@ void FileDescriptorProto::set_dependency(int index, const ::std::string& value) // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) dependency_.Mutable(index)->assign(value); } +#if LANG_CXX11 +void FileDescriptorProto::set_dependency(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) + dependency_.Mutable(index)->assign(std::move(value)); +} +#endif void FileDescriptorProto::set_dependency(int index, const char* value) { dependency_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency) @@ -2138,6 +2151,12 @@ void FileDescriptorProto::add_dependency(const ::std::string& value) { dependency_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) } +#if LANG_CXX11 +void FileDescriptorProto::add_dependency(::std::string&& value) { + dependency_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) +} +#endif void FileDescriptorProto::add_dependency(const char* value) { dependency_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency) @@ -2501,7 +2520,7 @@ const int DescriptorProto_ExtensionRange::kEndFieldNumber; DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ExtensionRange) @@ -2538,12 +2557,12 @@ void DescriptorProto_ExtensionRange::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* DescriptorProto_ExtensionRange::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[2].descriptor; } const DescriptorProto_ExtensionRange& DescriptorProto_ExtensionRange::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -2577,7 +2596,8 @@ bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 start = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { set_has_start(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -2590,7 +2610,8 @@ bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream( // optional int32 end = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_end(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -2645,7 +2666,7 @@ void DescriptorProto_ExtensionRange::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto_ExtensionRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ExtensionRange) // optional int32 start = 1; if (has_start()) { @@ -2757,8 +2778,8 @@ void DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange } ::google::protobuf::Metadata DescriptorProto_ExtensionRange::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[2]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -2824,7 +2845,7 @@ const int DescriptorProto_ReservedRange::kEndFieldNumber; DescriptorProto_ReservedRange::DescriptorProto_ReservedRange() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ReservedRange) @@ -2861,12 +2882,12 @@ void DescriptorProto_ReservedRange::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* DescriptorProto_ReservedRange::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[3].descriptor; } const DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -2900,7 +2921,8 @@ bool DescriptorProto_ReservedRange::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 start = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { set_has_start(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -2913,7 +2935,8 @@ bool DescriptorProto_ReservedRange::MergePartialFromCodedStream( // optional int32 end = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_end(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -2968,7 +2991,7 @@ void DescriptorProto_ReservedRange::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto_ReservedRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ReservedRange) // optional int32 start = 1; if (has_start()) { @@ -3080,8 +3103,8 @@ void DescriptorProto_ReservedRange::InternalSwap(DescriptorProto_ReservedRange* } ::google::protobuf::Metadata DescriptorProto_ReservedRange::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[3]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -3155,7 +3178,7 @@ const int DescriptorProto::kReservedNameFieldNumber; DescriptorProto::DescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto) @@ -3210,12 +3233,12 @@ void DescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* DescriptorProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[4].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[4].descriptor; } const DescriptorProto& DescriptorProto::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -3263,7 +3286,8 @@ bool DescriptorProto::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -3278,7 +3302,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.FieldDescriptorProto field = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_field())); @@ -3291,7 +3316,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.DescriptorProto nested_type = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_nested_type())); @@ -3304,7 +3330,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_enum_type())); @@ -3317,7 +3344,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; case 5: { - if (tag == 42u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_extension_range())); @@ -3330,7 +3358,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.FieldDescriptorProto extension = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_extension())); @@ -3343,7 +3372,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.MessageOptions options = 7; case 7: { - if (tag == 58u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(58u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -3354,7 +3384,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; case 8: { - if (tag == 66u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(66u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_oneof_decl())); @@ -3367,7 +3398,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; case 9: { - if (tag == 74u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(74u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_reserved_range())); @@ -3380,7 +3412,8 @@ bool DescriptorProto::MergePartialFromCodedStream( // repeated string reserved_name = 10; case 10: { - if (tag == 82u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(82u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_reserved_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -3478,7 +3511,7 @@ void DescriptorProto::SerializeWithCachedSizes( } // repeated string reserved_name = 10; - for (int i = 0; i < this->reserved_name_size(); i++) { + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->reserved_name(i).data(), this->reserved_name(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -3496,7 +3529,7 @@ void DescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto) // optional string name = 1; if (has_name()) { @@ -3566,7 +3599,7 @@ void DescriptorProto::SerializeWithCachedSizes( } // repeated string reserved_name = 10; - for (int i = 0; i < this->reserved_name_size(); i++) { + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->reserved_name(i).data(), this->reserved_name(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -3672,7 +3705,7 @@ size_t DescriptorProto::ByteSizeLong() const { // repeated string reserved_name = 10; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->reserved_name_size()); - for (int i = 0; i < this->reserved_name_size(); i++) { + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->reserved_name(i)); } @@ -3785,8 +3818,8 @@ void DescriptorProto::InternalSwap(DescriptorProto* other) { } ::google::protobuf::Metadata DescriptorProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[4]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[4]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -4128,6 +4161,12 @@ void DescriptorProto::set_reserved_name(int index, const ::std::string& value) { // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) reserved_name_.Mutable(index)->assign(value); } +#if LANG_CXX11 +void DescriptorProto::set_reserved_name(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) + reserved_name_.Mutable(index)->assign(std::move(value)); +} +#endif void DescriptorProto::set_reserved_name(int index, const char* value) { reserved_name_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name) @@ -4145,6 +4184,12 @@ void DescriptorProto::add_reserved_name(const ::std::string& value) { reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) } +#if LANG_CXX11 +void DescriptorProto::add_reserved_name(::std::string&& value) { + reserved_name_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) +} +#endif void DescriptorProto::add_reserved_name(const char* value) { reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name) @@ -4184,7 +4229,7 @@ const int FieldDescriptorProto::kOptionsFieldNumber; FieldDescriptorProto::FieldDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FieldDescriptorProto) @@ -4261,12 +4306,12 @@ void FieldDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FieldDescriptorProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[5].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[5].descriptor; } const FieldDescriptorProto& FieldDescriptorProto::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -4330,7 +4375,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -4345,7 +4391,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional string extendee = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_extendee())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -4360,7 +4407,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional int32 number = 3; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { set_has_number(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -4373,7 +4421,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.FieldDescriptorProto.Label label = 4; case 4: { - if (tag == 32u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(32u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -4391,7 +4440,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.FieldDescriptorProto.Type type = 5; case 5: { - if (tag == 40u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -4409,7 +4459,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional string type_name = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_type_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -4424,7 +4475,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional string default_value = 7; case 7: { - if (tag == 58u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(58u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_default_value())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -4439,7 +4491,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.FieldOptions options = 8; case 8: { - if (tag == 66u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(66u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -4450,7 +4503,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional int32 oneof_index = 9; case 9: { - if (tag == 72u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(72u)) { set_has_oneof_index(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -4463,7 +4517,8 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( // optional string json_name = 10; case 10: { - if (tag == 82u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(82u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_json_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -4588,7 +4643,7 @@ void FieldDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldDescriptorProto) // optional string name = 1; if (has_name()) { @@ -4872,8 +4927,8 @@ void FieldDescriptorProto::InternalSwap(FieldDescriptorProto* other) { } ::google::protobuf::Metadata FieldDescriptorProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[5]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[5]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -5344,7 +5399,7 @@ const int OneofDescriptorProto::kOptionsFieldNumber; OneofDescriptorProto::OneofDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.OneofDescriptorProto) @@ -5391,12 +5446,12 @@ void OneofDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* OneofDescriptorProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[6].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[6].descriptor; } const OneofDescriptorProto& OneofDescriptorProto::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -5436,7 +5491,8 @@ bool OneofDescriptorProto::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -5451,7 +5507,8 @@ bool OneofDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.OneofOptions options = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -5510,7 +5567,7 @@ void OneofDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* OneofDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofDescriptorProto) // optional string name = 1; if (has_name()) { @@ -5634,8 +5691,8 @@ void OneofDescriptorProto::InternalSwap(OneofDescriptorProto* other) { } ::google::protobuf::Metadata OneofDescriptorProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[6]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[6]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -5761,7 +5818,7 @@ const int EnumDescriptorProto::kOptionsFieldNumber; EnumDescriptorProto::EnumDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumDescriptorProto) @@ -5809,12 +5866,12 @@ void EnumDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumDescriptorProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[7].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[7].descriptor; } const EnumDescriptorProto& EnumDescriptorProto::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -5855,7 +5912,8 @@ bool EnumDescriptorProto::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -5870,7 +5928,8 @@ bool EnumDescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.EnumValueDescriptorProto value = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_value())); @@ -5883,7 +5942,8 @@ bool EnumDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.EnumOptions options = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -5948,7 +6008,7 @@ void EnumDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumDescriptorProto) // optional string name = 1; if (has_name()) { @@ -6093,8 +6153,8 @@ void EnumDescriptorProto::InternalSwap(EnumDescriptorProto* other) { } ::google::protobuf::Metadata EnumDescriptorProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[7]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[7]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -6250,7 +6310,7 @@ const int EnumValueDescriptorProto::kOptionsFieldNumber; EnumValueDescriptorProto::EnumValueDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValueDescriptorProto) @@ -6299,12 +6359,12 @@ void EnumValueDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumValueDescriptorProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[8].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[8].descriptor; } const EnumValueDescriptorProto& EnumValueDescriptorProto::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -6345,7 +6405,8 @@ bool EnumValueDescriptorProto::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -6360,7 +6421,8 @@ bool EnumValueDescriptorProto::MergePartialFromCodedStream( // optional int32 number = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_number(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -6373,7 +6435,8 @@ bool EnumValueDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.EnumValueOptions options = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -6437,7 +6500,7 @@ void EnumValueDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValueDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueDescriptorProto) // optional string name = 1; if (has_name()) { @@ -6577,8 +6640,8 @@ void EnumValueDescriptorProto::InternalSwap(EnumValueDescriptorProto* other) { } ::google::protobuf::Metadata EnumValueDescriptorProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[8]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[8]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -6728,7 +6791,7 @@ const int ServiceDescriptorProto::kOptionsFieldNumber; ServiceDescriptorProto::ServiceDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ServiceDescriptorProto) @@ -6776,12 +6839,12 @@ void ServiceDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ServiceDescriptorProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[9].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[9].descriptor; } const ServiceDescriptorProto& ServiceDescriptorProto::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -6822,7 +6885,8 @@ bool ServiceDescriptorProto::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -6837,7 +6901,8 @@ bool ServiceDescriptorProto::MergePartialFromCodedStream( // repeated .google.protobuf.MethodDescriptorProto method = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_method())); @@ -6850,7 +6915,8 @@ bool ServiceDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.ServiceOptions options = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -6915,7 +6981,7 @@ void ServiceDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* ServiceDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceDescriptorProto) // optional string name = 1; if (has_name()) { @@ -7060,8 +7126,8 @@ void ServiceDescriptorProto::InternalSwap(ServiceDescriptorProto* other) { } ::google::protobuf::Metadata ServiceDescriptorProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[9]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[9]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -7220,7 +7286,7 @@ const int MethodDescriptorProto::kServerStreamingFieldNumber; MethodDescriptorProto::MethodDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MethodDescriptorProto) @@ -7283,12 +7349,12 @@ void MethodDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MethodDescriptorProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[10].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[10].descriptor; } const MethodDescriptorProto& MethodDescriptorProto::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -7340,7 +7406,8 @@ bool MethodDescriptorProto::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -7355,7 +7422,8 @@ bool MethodDescriptorProto::MergePartialFromCodedStream( // optional string input_type = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_input_type())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -7370,7 +7438,8 @@ bool MethodDescriptorProto::MergePartialFromCodedStream( // optional string output_type = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_output_type())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -7385,7 +7454,8 @@ bool MethodDescriptorProto::MergePartialFromCodedStream( // optional .google.protobuf.MethodOptions options = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -7396,7 +7466,8 @@ bool MethodDescriptorProto::MergePartialFromCodedStream( // optional bool client_streaming = 5 [default = false]; case 5: { - if (tag == 40u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u)) { set_has_client_streaming(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -7409,7 +7480,8 @@ bool MethodDescriptorProto::MergePartialFromCodedStream( // optional bool server_streaming = 6 [default = false]; case 6: { - if (tag == 48u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(48u)) { set_has_server_streaming(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -7500,7 +7572,7 @@ void MethodDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* MethodDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodDescriptorProto) // optional string name = 1; if (has_name()) { @@ -7698,8 +7770,8 @@ void MethodDescriptorProto::InternalSwap(MethodDescriptorProto* other) { } ::google::protobuf::Metadata MethodDescriptorProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[10]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[10]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -8010,7 +8082,7 @@ const int FileOptions::kUninterpretedOptionFieldNumber; FileOptions::FileOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FileOptions) @@ -8086,12 +8158,12 @@ void FileOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FileOptions::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[11].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[11].descriptor; } const FileOptions& FileOptions::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -8158,7 +8230,8 @@ bool FileOptions::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string java_package = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_java_package())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -8173,7 +8246,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional string java_outer_classname = 8; case 8: { - if (tag == 66u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(66u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_java_outer_classname())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -8188,7 +8262,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; case 9: { - if (tag == 72u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(72u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -8206,7 +8281,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional bool java_multiple_files = 10 [default = false]; case 10: { - if (tag == 80u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(80u)) { set_has_java_multiple_files(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -8219,7 +8295,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional string go_package = 11; case 11: { - if (tag == 90u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(90u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_go_package())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -8234,7 +8311,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional bool cc_generic_services = 16 [default = false]; case 16: { - if (tag == 128u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(128u)) { set_has_cc_generic_services(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -8247,7 +8325,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional bool java_generic_services = 17 [default = false]; case 17: { - if (tag == 136u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(136u)) { set_has_java_generic_services(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -8260,7 +8339,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional bool py_generic_services = 18 [default = false]; case 18: { - if (tag == 144u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(144u)) { set_has_py_generic_services(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -8273,7 +8353,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; case 20: { - if (tag == 160u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(160u)) { set_has_java_generate_equals_and_hash(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -8286,7 +8367,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional bool deprecated = 23 [default = false]; case 23: { - if (tag == 184u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(184u)) { set_has_deprecated(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -8299,7 +8381,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional bool java_string_check_utf8 = 27 [default = false]; case 27: { - if (tag == 216u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(216u)) { set_has_java_string_check_utf8(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -8312,7 +8395,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional bool cc_enable_arenas = 31 [default = false]; case 31: { - if (tag == 248u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(248u)) { set_has_cc_enable_arenas(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -8325,7 +8409,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional string objc_class_prefix = 36; case 36: { - if (tag == 290u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(290u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_objc_class_prefix())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -8340,7 +8425,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional string csharp_namespace = 37; case 37: { - if (tag == 298u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(298u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_csharp_namespace())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -8355,7 +8441,8 @@ bool FileOptions::MergePartialFromCodedStream( // optional string swift_prefix = 39; case 39: { - if (tag == 314u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(314u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_swift_prefix())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -8370,7 +8457,8 @@ bool FileOptions::MergePartialFromCodedStream( // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { - if (tag == 7994u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(7994u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_uninterpreted_option())); @@ -8536,7 +8624,7 @@ void FileOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* FileOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileOptions) // optional string java_package = 1; if (has_java_package()) { @@ -8659,7 +8747,7 @@ void FileOptions::SerializeWithCachedSizes( // Extension range [1000, 536870912) target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, false, target); + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( @@ -8919,8 +9007,8 @@ void FileOptions::InternalSwap(FileOptions* other) { } ::google::protobuf::Metadata FileOptions::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[11]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[11]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -9560,7 +9648,7 @@ const int MessageOptions::kUninterpretedOptionFieldNumber; MessageOptions::MessageOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MessageOptions) @@ -9599,12 +9687,12 @@ void MessageOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MessageOptions::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[12].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[12].descriptor; } const MessageOptions& MessageOptions::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -9640,7 +9728,8 @@ bool MessageOptions::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bool message_set_wire_format = 1 [default = false]; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { set_has_message_set_wire_format(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -9653,7 +9742,8 @@ bool MessageOptions::MergePartialFromCodedStream( // optional bool no_standard_descriptor_accessor = 2 [default = false]; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_no_standard_descriptor_accessor(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -9666,7 +9756,8 @@ bool MessageOptions::MergePartialFromCodedStream( // optional bool deprecated = 3 [default = false]; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { set_has_deprecated(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -9679,7 +9770,8 @@ bool MessageOptions::MergePartialFromCodedStream( // optional bool map_entry = 7; case 7: { - if (tag == 56u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(56u)) { set_has_map_entry(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -9692,7 +9784,8 @@ bool MessageOptions::MergePartialFromCodedStream( // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { - if (tag == 7994u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(7994u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_uninterpreted_option())); @@ -9772,7 +9865,7 @@ void MessageOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* MessageOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MessageOptions) // optional bool message_set_wire_format = 1 [default = false]; if (has_message_set_wire_format()) { @@ -9803,7 +9896,7 @@ void MessageOptions::SerializeWithCachedSizes( // Extension range [1000, 536870912) target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, false, target); + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( @@ -9941,8 +10034,8 @@ void MessageOptions::InternalSwap(MessageOptions* other) { } ::google::protobuf::Metadata MessageOptions::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[12]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[12]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -10091,7 +10184,7 @@ const int FieldOptions::kUninterpretedOptionFieldNumber; FieldOptions::FieldOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FieldOptions) @@ -10130,12 +10223,12 @@ void FieldOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FieldOptions::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[13].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[13].descriptor; } const FieldOptions& FieldOptions::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -10171,7 +10264,8 @@ bool FieldOptions::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -10189,7 +10283,8 @@ bool FieldOptions::MergePartialFromCodedStream( // optional bool packed = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_packed(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -10202,7 +10297,8 @@ bool FieldOptions::MergePartialFromCodedStream( // optional bool deprecated = 3 [default = false]; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { set_has_deprecated(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -10215,7 +10311,8 @@ bool FieldOptions::MergePartialFromCodedStream( // optional bool lazy = 5 [default = false]; case 5: { - if (tag == 40u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u)) { set_has_lazy(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -10228,7 +10325,8 @@ bool FieldOptions::MergePartialFromCodedStream( // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; case 6: { - if (tag == 48u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(48u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -10246,7 +10344,8 @@ bool FieldOptions::MergePartialFromCodedStream( // optional bool weak = 10 [default = false]; case 10: { - if (tag == 80u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(80u)) { set_has_weak(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -10259,7 +10358,8 @@ bool FieldOptions::MergePartialFromCodedStream( // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { - if (tag == 7994u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(7994u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_uninterpreted_option())); @@ -10351,7 +10451,7 @@ void FieldOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldOptions) // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; if (has_ctype()) { @@ -10394,7 +10494,7 @@ void FieldOptions::SerializeWithCachedSizes( // Extension range [1000, 536870912) target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, false, target); + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( @@ -10552,8 +10652,8 @@ void FieldOptions::InternalSwap(FieldOptions* other) { } ::google::protobuf::Metadata FieldOptions::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[13]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[13]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -10746,7 +10846,7 @@ const int OneofOptions::kUninterpretedOptionFieldNumber; OneofOptions::OneofOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.OneofOptions) @@ -10780,12 +10880,12 @@ void OneofOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* OneofOptions::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[14].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[14].descriptor; } const OneofOptions& OneofOptions::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -10817,7 +10917,8 @@ bool OneofOptions::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { - if (tag == 7994u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(7994u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_uninterpreted_option())); @@ -10877,7 +10978,7 @@ void OneofOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* OneofOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofOptions) // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { @@ -10888,7 +10989,7 @@ void OneofOptions::SerializeWithCachedSizes( // Extension range [1000, 536870912) target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, false, target); + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( @@ -10986,8 +11087,8 @@ void OneofOptions::InternalSwap(OneofOptions* other) { } ::google::protobuf::Metadata OneofOptions::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[14]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[14]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -11036,7 +11137,7 @@ const int EnumOptions::kUninterpretedOptionFieldNumber; EnumOptions::EnumOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumOptions) @@ -11075,12 +11176,12 @@ void EnumOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumOptions::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[15].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[15].descriptor; } const EnumOptions& EnumOptions::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -11116,7 +11217,8 @@ bool EnumOptions::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bool allow_alias = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_allow_alias(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -11129,7 +11231,8 @@ bool EnumOptions::MergePartialFromCodedStream( // optional bool deprecated = 3 [default = false]; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { set_has_deprecated(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -11142,7 +11245,8 @@ bool EnumOptions::MergePartialFromCodedStream( // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { - if (tag == 7994u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(7994u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_uninterpreted_option())); @@ -11212,7 +11316,7 @@ void EnumOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumOptions) // optional bool allow_alias = 2; if (has_allow_alias()) { @@ -11233,7 +11337,7 @@ void EnumOptions::SerializeWithCachedSizes( // Extension range [1000, 536870912) target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, false, target); + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( @@ -11353,8 +11457,8 @@ void EnumOptions::InternalSwap(EnumOptions* other) { } ::google::protobuf::Metadata EnumOptions::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[15]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[15]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -11450,7 +11554,7 @@ const int EnumValueOptions::kUninterpretedOptionFieldNumber; EnumValueOptions::EnumValueOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValueOptions) @@ -11486,12 +11590,12 @@ void EnumValueOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumValueOptions::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[16].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[16].descriptor; } const EnumValueOptions& EnumValueOptions::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -11524,7 +11628,8 @@ bool EnumValueOptions::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bool deprecated = 1 [default = false]; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { set_has_deprecated(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -11537,7 +11642,8 @@ bool EnumValueOptions::MergePartialFromCodedStream( // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { - if (tag == 7994u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(7994u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_uninterpreted_option())); @@ -11602,7 +11708,7 @@ void EnumValueOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValueOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueOptions) // optional bool deprecated = 1 [default = false]; if (has_deprecated()) { @@ -11618,7 +11724,7 @@ void EnumValueOptions::SerializeWithCachedSizes( // Extension range [1000, 536870912) target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, false, target); + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( @@ -11725,8 +11831,8 @@ void EnumValueOptions::InternalSwap(EnumValueOptions* other) { } ::google::protobuf::Metadata EnumValueOptions::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[16]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[16]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -11798,7 +11904,7 @@ const int ServiceOptions::kUninterpretedOptionFieldNumber; ServiceOptions::ServiceOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ServiceOptions) @@ -11834,12 +11940,12 @@ void ServiceOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ServiceOptions::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[17].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[17].descriptor; } const ServiceOptions& ServiceOptions::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -11872,7 +11978,8 @@ bool ServiceOptions::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bool deprecated = 33 [default = false]; case 33: { - if (tag == 264u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(264u)) { set_has_deprecated(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -11885,7 +11992,8 @@ bool ServiceOptions::MergePartialFromCodedStream( // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { - if (tag == 7994u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(7994u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_uninterpreted_option())); @@ -11950,7 +12058,7 @@ void ServiceOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* ServiceOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceOptions) // optional bool deprecated = 33 [default = false]; if (has_deprecated()) { @@ -11966,7 +12074,7 @@ void ServiceOptions::SerializeWithCachedSizes( // Extension range [1000, 536870912) target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, false, target); + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( @@ -12073,8 +12181,8 @@ void ServiceOptions::InternalSwap(ServiceOptions* other) { } ::google::protobuf::Metadata ServiceOptions::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[17]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[17]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -12147,7 +12255,7 @@ const int MethodOptions::kUninterpretedOptionFieldNumber; MethodOptions::MethodOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MethodOptions) @@ -12186,12 +12294,12 @@ void MethodOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MethodOptions::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[18].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[18].descriptor; } const MethodOptions& MethodOptions::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -12227,7 +12335,8 @@ bool MethodOptions::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bool deprecated = 33 [default = false]; case 33: { - if (tag == 264u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(264u)) { set_has_deprecated(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -12240,7 +12349,8 @@ bool MethodOptions::MergePartialFromCodedStream( // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; case 34: { - if (tag == 272u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(272u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -12258,7 +12368,8 @@ bool MethodOptions::MergePartialFromCodedStream( // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { - if (tag == 7994u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(7994u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_uninterpreted_option())); @@ -12329,7 +12440,7 @@ void MethodOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* MethodOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodOptions) // optional bool deprecated = 33 [default = false]; if (has_deprecated()) { @@ -12351,7 +12462,7 @@ void MethodOptions::SerializeWithCachedSizes( // Extension range [1000, 536870912) target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, false, target); + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( @@ -12472,8 +12583,8 @@ void MethodOptions::InternalSwap(MethodOptions* other) { } ::google::protobuf::Metadata MethodOptions::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[18]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[18]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -12570,7 +12681,7 @@ const int UninterpretedOption_NamePart::kIsExtensionFieldNumber; UninterpretedOption_NamePart::UninterpretedOption_NamePart() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption.NamePart) @@ -12610,12 +12721,12 @@ void UninterpretedOption_NamePart::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UninterpretedOption_NamePart::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[19].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[19].descriptor; } const UninterpretedOption_NamePart& UninterpretedOption_NamePart::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -12650,7 +12761,8 @@ bool UninterpretedOption_NamePart::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string name_part = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name_part())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -12665,7 +12777,8 @@ bool UninterpretedOption_NamePart::MergePartialFromCodedStream( // required bool is_extension = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_is_extension(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -12725,7 +12838,7 @@ void UninterpretedOption_NamePart::SerializeWithCachedSizes( ::google::protobuf::uint8* UninterpretedOption_NamePart::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption.NamePart) // required string name_part = 1; if (has_name_part()) { @@ -12859,8 +12972,8 @@ void UninterpretedOption_NamePart::InternalSwap(UninterpretedOption_NamePart* ot } ::google::protobuf::Metadata UninterpretedOption_NamePart::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[19]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[19]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -12969,7 +13082,7 @@ const int UninterpretedOption::kAggregateValueFieldNumber; UninterpretedOption::UninterpretedOption() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption) @@ -13025,12 +13138,12 @@ void UninterpretedOption::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UninterpretedOption::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[20].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[20].descriptor; } const UninterpretedOption& UninterpretedOption::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -13079,7 +13192,8 @@ bool UninterpretedOption::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_name())); @@ -13092,7 +13206,8 @@ bool UninterpretedOption::MergePartialFromCodedStream( // optional string identifier_value = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_identifier_value())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -13107,7 +13222,8 @@ bool UninterpretedOption::MergePartialFromCodedStream( // optional uint64 positive_int_value = 4; case 4: { - if (tag == 32u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(32u)) { set_has_positive_int_value(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( @@ -13120,7 +13236,8 @@ bool UninterpretedOption::MergePartialFromCodedStream( // optional int64 negative_int_value = 5; case 5: { - if (tag == 40u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u)) { set_has_negative_int_value(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( @@ -13133,7 +13250,8 @@ bool UninterpretedOption::MergePartialFromCodedStream( // optional double double_value = 6; case 6: { - if (tag == 49u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(49u)) { set_has_double_value(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( @@ -13146,7 +13264,8 @@ bool UninterpretedOption::MergePartialFromCodedStream( // optional bytes string_value = 7; case 7: { - if (tag == 58u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(58u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_string_value())); } else { @@ -13157,7 +13276,8 @@ bool UninterpretedOption::MergePartialFromCodedStream( // optional string aggregate_value = 8; case 8: { - if (tag == 66u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(66u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_aggregate_value())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -13251,7 +13371,7 @@ void UninterpretedOption::SerializeWithCachedSizes( ::google::protobuf::uint8* UninterpretedOption::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption) // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; for (unsigned int i = 0, n = this->name_size(); i < n; i++) { @@ -13463,8 +13583,8 @@ void UninterpretedOption::InternalSwap(UninterpretedOption* other) { } ::google::protobuf::Metadata UninterpretedOption::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[20]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[20]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -13773,7 +13893,7 @@ const int SourceCodeInfo_Location::kLeadingDetachedCommentsFieldNumber; SourceCodeInfo_Location::SourceCodeInfo_Location() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo.Location) @@ -13820,12 +13940,12 @@ void SourceCodeInfo_Location::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SourceCodeInfo_Location::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[21].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[21].descriptor; } const SourceCodeInfo_Location& SourceCodeInfo_Location::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -13868,11 +13988,13 @@ bool SourceCodeInfo_Location::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated int32 path = 1 [packed = true]; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_path()))); - } else if (tag == 8u) { + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 10u, input, this->mutable_path()))); @@ -13884,11 +14006,13 @@ bool SourceCodeInfo_Location::MergePartialFromCodedStream( // repeated int32 span = 2 [packed = true]; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_span()))); - } else if (tag == 16u) { + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 18u, input, this->mutable_span()))); @@ -13900,7 +14024,8 @@ bool SourceCodeInfo_Location::MergePartialFromCodedStream( // optional string leading_comments = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_leading_comments())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -13915,7 +14040,8 @@ bool SourceCodeInfo_Location::MergePartialFromCodedStream( // optional string trailing_comments = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_trailing_comments())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -13930,7 +14056,8 @@ bool SourceCodeInfo_Location::MergePartialFromCodedStream( // repeated string leading_detached_comments = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_leading_detached_comments())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -13974,7 +14101,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_path_cached_byte_size_); } - for (int i = 0; i < this->path_size(); i++) { + for (int i = 0, n = this->path_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->path(i), output); } @@ -13984,7 +14111,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_span_cached_byte_size_); } - for (int i = 0; i < this->span_size(); i++) { + for (int i = 0, n = this->span_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->span(i), output); } @@ -14010,7 +14137,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( } // repeated string leading_detached_comments = 6; - for (int i = 0; i < this->leading_detached_comments_size(); i++) { + for (int i = 0, n = this->leading_detached_comments_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->leading_detached_comments(i).data(), this->leading_detached_comments(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -14028,7 +14155,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceCodeInfo_Location::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo.Location) // repeated int32 path = 1 [packed = true]; if (this->path_size() > 0) { @@ -14039,7 +14166,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _path_cached_byte_size_, target); } - for (int i = 0; i < this->path_size(); i++) { + for (int i = 0, n = this->path_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->path(i), target); } @@ -14053,7 +14180,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _span_cached_byte_size_, target); } - for (int i = 0; i < this->span_size(); i++) { + for (int i = 0, n = this->span_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->span(i), target); } @@ -14081,7 +14208,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( } // repeated string leading_detached_comments = 6; - for (int i = 0; i < this->leading_detached_comments_size(); i++) { + for (int i = 0, n = this->leading_detached_comments_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->leading_detached_comments(i).data(), this->leading_detached_comments(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -14109,12 +14236,8 @@ size_t SourceCodeInfo_Location::ByteSizeLong() const { } // repeated int32 path = 1 [packed = true]; { - size_t data_size = 0; - unsigned int count = this->path_size(); - for (unsigned int i = 0; i < count; i++) { - data_size += ::google::protobuf::internal::WireFormatLite:: - Int32Size(this->path(i)); - } + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->path_); if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); @@ -14128,12 +14251,8 @@ size_t SourceCodeInfo_Location::ByteSizeLong() const { // repeated int32 span = 2 [packed = true]; { - size_t data_size = 0; - unsigned int count = this->span_size(); - for (unsigned int i = 0; i < count; i++) { - data_size += ::google::protobuf::internal::WireFormatLite:: - Int32Size(this->span(i)); - } + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->span_); if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); @@ -14148,7 +14267,7 @@ size_t SourceCodeInfo_Location::ByteSizeLong() const { // repeated string leading_detached_comments = 6; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->leading_detached_comments_size()); - for (int i = 0; i < this->leading_detached_comments_size(); i++) { + for (int i = 0, n = this->leading_detached_comments_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->leading_detached_comments(i)); } @@ -14244,8 +14363,8 @@ void SourceCodeInfo_Location::InternalSwap(SourceCodeInfo_Location* other) { } ::google::protobuf::Metadata SourceCodeInfo_Location::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[21]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[21]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -14454,6 +14573,12 @@ void SourceCodeInfo_Location::set_leading_detached_comments(int index, const ::s // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) leading_detached_comments_.Mutable(index)->assign(value); } +#if LANG_CXX11 +void SourceCodeInfo_Location::set_leading_detached_comments(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + leading_detached_comments_.Mutable(index)->assign(std::move(value)); +} +#endif void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) { leading_detached_comments_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) @@ -14471,6 +14596,12 @@ void SourceCodeInfo_Location::add_leading_detached_comments(const ::std::string& leading_detached_comments_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } +#if LANG_CXX11 +void SourceCodeInfo_Location::add_leading_detached_comments(::std::string&& value) { + leading_detached_comments_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} +#endif void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) { leading_detached_comments_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) @@ -14501,7 +14632,7 @@ const int SourceCodeInfo::kLocationFieldNumber; SourceCodeInfo::SourceCodeInfo() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo) @@ -14534,12 +14665,12 @@ void SourceCodeInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SourceCodeInfo::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[22].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[22].descriptor; } const SourceCodeInfo& SourceCodeInfo::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -14570,7 +14701,8 @@ bool SourceCodeInfo::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .google.protobuf.SourceCodeInfo.Location location = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_location())); @@ -14621,7 +14753,7 @@ void SourceCodeInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceCodeInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo) // repeated .google.protobuf.SourceCodeInfo.Location location = 1; for (unsigned int i = 0, n = this->location_size(); i < n; i++) { @@ -14717,8 +14849,8 @@ void SourceCodeInfo::InternalSwap(SourceCodeInfo* other) { } ::google::protobuf::Metadata SourceCodeInfo::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[22]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[22]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -14768,7 +14900,7 @@ const int GeneratedCodeInfo_Annotation::kEndFieldNumber; GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo.Annotation) @@ -14812,12 +14944,12 @@ void GeneratedCodeInfo_Annotation::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GeneratedCodeInfo_Annotation::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[23].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[23].descriptor; } const GeneratedCodeInfo_Annotation& GeneratedCodeInfo_Annotation::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -14856,11 +14988,13 @@ bool GeneratedCodeInfo_Annotation::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated int32 path = 1 [packed = true]; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_path()))); - } else if (tag == 8u) { + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 10u, input, this->mutable_path()))); @@ -14872,7 +15006,8 @@ bool GeneratedCodeInfo_Annotation::MergePartialFromCodedStream( // optional string source_file = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_source_file())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -14887,7 +15022,8 @@ bool GeneratedCodeInfo_Annotation::MergePartialFromCodedStream( // optional int32 begin = 3; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { set_has_begin(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -14900,7 +15036,8 @@ bool GeneratedCodeInfo_Annotation::MergePartialFromCodedStream( // optional int32 end = 4; case 4: { - if (tag == 32u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(32u)) { set_has_end(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -14941,7 +15078,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_path_cached_byte_size_); } - for (int i = 0; i < this->path_size(); i++) { + for (int i = 0, n = this->path_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->path(i), output); } @@ -14975,7 +15112,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes( ::google::protobuf::uint8* GeneratedCodeInfo_Annotation::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo.Annotation) // repeated int32 path = 1 [packed = true]; if (this->path_size() > 0) { @@ -14986,7 +15123,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes( target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _path_cached_byte_size_, target); } - for (int i = 0; i < this->path_size(); i++) { + for (int i = 0, n = this->path_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->path(i), target); } @@ -15031,12 +15168,8 @@ size_t GeneratedCodeInfo_Annotation::ByteSizeLong() const { } // repeated int32 path = 1 [packed = true]; { - size_t data_size = 0; - unsigned int count = this->path_size(); - for (unsigned int i = 0; i < count; i++) { - data_size += ::google::protobuf::internal::WireFormatLite:: - Int32Size(this->path(i)); - } + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->path_); if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); @@ -15145,8 +15278,8 @@ void GeneratedCodeInfo_Annotation::InternalSwap(GeneratedCodeInfo_Annotation* ot } ::google::protobuf::Metadata GeneratedCodeInfo_Annotation::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[23]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[23]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -15303,7 +15436,7 @@ const int GeneratedCodeInfo::kAnnotationFieldNumber; GeneratedCodeInfo::GeneratedCodeInfo() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo) @@ -15336,12 +15469,12 @@ void GeneratedCodeInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GeneratedCodeInfo::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[24].descriptor; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[24].descriptor; } const GeneratedCodeInfo& GeneratedCodeInfo::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -15372,7 +15505,8 @@ bool GeneratedCodeInfo::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_annotation())); @@ -15423,7 +15557,7 @@ void GeneratedCodeInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* GeneratedCodeInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo) // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; for (unsigned int i = 0, n = this->annotation_size(); i < n; i++) { @@ -15519,8 +15653,8 @@ void GeneratedCodeInfo::InternalSwap(GeneratedCodeInfo* other) { } ::google::protobuf::Metadata GeneratedCodeInfo::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[24]; + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[24]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index 262ca324..73b7a8dd 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -112,9 +113,16 @@ LIBPROTOBUF_EXPORT extern UninterpretedOption_NamePartDefaultTypeInternal _Unint namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto enum FieldDescriptorProto_Type { FieldDescriptorProto_Type_TYPE_DOUBLE = 1, @@ -304,7 +312,8 @@ class LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -346,11 +355,7 @@ class LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > file_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -405,7 +410,8 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -428,36 +434,6 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag // accessors ------------------------------------------------------- - // optional string name = 1; - bool has_name() const; - void clear_name(); - static const int kNameFieldNumber = 1; - const ::std::string& name() const; - void set_name(const ::std::string& value); - #if LANG_CXX11 - void set_name(::std::string&& value); - #endif - void set_name(const char* value); - void set_name(const char* value, size_t size); - ::std::string* mutable_name(); - ::std::string* release_name(); - void set_allocated_name(::std::string* name); - - // optional string package = 2; - bool has_package() const; - void clear_package(); - static const int kPackageFieldNumber = 2; - const ::std::string& package() const; - void set_package(const ::std::string& value); - #if LANG_CXX11 - void set_package(::std::string&& value); - #endif - void set_package(const char* value); - void set_package(const char* value, size_t size); - ::std::string* mutable_package(); - ::std::string* release_package(); - void set_allocated_package(::std::string* package); - // repeated string dependency = 3; int dependency_size() const; void clear_dependency(); @@ -465,10 +441,16 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag const ::std::string& dependency(int index) const; ::std::string* mutable_dependency(int index); void set_dependency(int index, const ::std::string& value); + #if LANG_CXX11 + void set_dependency(int index, ::std::string&& value); + #endif void set_dependency(int index, const char* value); void set_dependency(int index, const char* value, size_t size); ::std::string* add_dependency(); void add_dependency(const ::std::string& value); + #if LANG_CXX11 + void add_dependency(::std::string&& value); + #endif void add_dependency(const char* value); void add_dependency(const char* value, size_t size); const ::google::protobuf::RepeatedPtrField< ::std::string>& dependency() const; @@ -546,6 +528,51 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& extension() const; + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional string package = 2; + bool has_package() const; + void clear_package(); + static const int kPackageFieldNumber = 2; + const ::std::string& package() const; + void set_package(const ::std::string& value); + #if LANG_CXX11 + void set_package(::std::string&& value); + #endif + void set_package(const char* value); + void set_package(const char* value, size_t size); + ::std::string* mutable_package(); + ::std::string* release_package(); + void set_allocated_package(::std::string* package); + + // optional string syntax = 12; + bool has_syntax() const; + void clear_syntax(); + static const int kSyntaxFieldNumber = 12; + const ::std::string& syntax() const; + void set_syntax(const ::std::string& value); + #if LANG_CXX11 + void set_syntax(::std::string&& value); + #endif + void set_syntax(const char* value); + void set_syntax(const char* value, size_t size); + ::std::string* mutable_syntax(); + ::std::string* release_syntax(); + void set_allocated_syntax(::std::string* syntax); + // optional .google.protobuf.FileOptions options = 8; bool has_options() const; void clear_options(); @@ -564,21 +591,6 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag ::google::protobuf::SourceCodeInfo* release_source_code_info(); void set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info); - // optional string syntax = 12; - bool has_syntax() const; - void clear_syntax(); - static const int kSyntaxFieldNumber = 12; - const ::std::string& syntax() const; - void set_syntax(const ::std::string& value); - #if LANG_CXX11 - void set_syntax(::std::string&& value); - #endif - void set_syntax(const char* value); - void set_syntax(const char* value, size_t size); - ::std::string* mutable_syntax(); - ::std::string* release_syntax(); - void set_allocated_syntax(::std::string* syntax); - // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto) private: void set_has_name(); @@ -607,11 +619,7 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag ::google::protobuf::internal::ArenaStringPtr syntax_; ::google::protobuf::FileOptions* options_; ::google::protobuf::SourceCodeInfo* source_code_info_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -666,7 +674,8 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::proto bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -715,11 +724,7 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::proto mutable int _cached_size_; ::google::protobuf::int32 start_; ::google::protobuf::int32 end_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -774,7 +779,8 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protob bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -823,11 +829,7 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protob mutable int _cached_size_; ::google::protobuf::int32 start_; ::google::protobuf::int32 end_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -882,7 +884,8 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -908,21 +911,6 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* // accessors ------------------------------------------------------- - // optional string name = 1; - bool has_name() const; - void clear_name(); - static const int kNameFieldNumber = 1; - const ::std::string& name() const; - void set_name(const ::std::string& value); - #if LANG_CXX11 - void set_name(::std::string&& value); - #endif - void set_name(const char* value); - void set_name(const char* value, size_t size); - ::std::string* mutable_name(); - ::std::string* release_name(); - void set_allocated_name(::std::string* name); - // repeated .google.protobuf.FieldDescriptorProto field = 2; int field_size() const; void clear_field(); @@ -995,15 +983,6 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >& oneof_decl() const; - // optional .google.protobuf.MessageOptions options = 7; - bool has_options() const; - void clear_options(); - static const int kOptionsFieldNumber = 7; - const ::google::protobuf::MessageOptions& options() const; - ::google::protobuf::MessageOptions* mutable_options(); - ::google::protobuf::MessageOptions* release_options(); - void set_allocated_options(::google::protobuf::MessageOptions* options); - // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; int reserved_range_size() const; void clear_reserved_range(); @@ -1023,15 +1002,45 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* const ::std::string& reserved_name(int index) const; ::std::string* mutable_reserved_name(int index); void set_reserved_name(int index, const ::std::string& value); + #if LANG_CXX11 + void set_reserved_name(int index, ::std::string&& value); + #endif void set_reserved_name(int index, const char* value); void set_reserved_name(int index, const char* value, size_t size); ::std::string* add_reserved_name(); void add_reserved_name(const ::std::string& value); + #if LANG_CXX11 + void add_reserved_name(::std::string&& value); + #endif void add_reserved_name(const char* value); void add_reserved_name(const char* value, size_t size); const ::google::protobuf::RepeatedPtrField< ::std::string>& reserved_name() const; ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_reserved_name(); + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional .google.protobuf.MessageOptions options = 7; + bool has_options() const; + void clear_options(); + static const int kOptionsFieldNumber = 7; + const ::google::protobuf::MessageOptions& options() const; + ::google::protobuf::MessageOptions* mutable_options(); + ::google::protobuf::MessageOptions* release_options(); + void set_allocated_options(::google::protobuf::MessageOptions* options); + // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto) private: void set_has_name(); @@ -1052,11 +1061,7 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* ::google::protobuf::RepeatedPtrField< ::std::string> reserved_name_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::MessageOptions* options_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1111,7 +1116,8 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -1235,27 +1241,6 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::std::string* release_name(); void set_allocated_name(::std::string* name); - // optional int32 number = 3; - bool has_number() const; - void clear_number(); - static const int kNumberFieldNumber = 3; - ::google::protobuf::int32 number() const; - void set_number(::google::protobuf::int32 value); - - // optional .google.protobuf.FieldDescriptorProto.Label label = 4; - bool has_label() const; - void clear_label(); - static const int kLabelFieldNumber = 4; - ::google::protobuf::FieldDescriptorProto_Label label() const; - void set_label(::google::protobuf::FieldDescriptorProto_Label value); - - // optional .google.protobuf.FieldDescriptorProto.Type type = 5; - bool has_type() const; - void clear_type(); - static const int kTypeFieldNumber = 5; - ::google::protobuf::FieldDescriptorProto_Type type() const; - void set_type(::google::protobuf::FieldDescriptorProto_Type value); - // optional string type_name = 6; bool has_type_name() const; void clear_type_name(); @@ -1301,13 +1286,6 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::std::string* release_default_value(); void set_allocated_default_value(::std::string* default_value); - // optional int32 oneof_index = 9; - bool has_oneof_index() const; - void clear_oneof_index(); - static const int kOneofIndexFieldNumber = 9; - ::google::protobuf::int32 oneof_index() const; - void set_oneof_index(::google::protobuf::int32 value); - // optional string json_name = 10; bool has_json_name() const; void clear_json_name(); @@ -1332,6 +1310,34 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::google::protobuf::FieldOptions* release_options(); void set_allocated_options(::google::protobuf::FieldOptions* options); + // optional int32 number = 3; + bool has_number() const; + void clear_number(); + static const int kNumberFieldNumber = 3; + ::google::protobuf::int32 number() const; + void set_number(::google::protobuf::int32 value); + + // optional int32 oneof_index = 9; + bool has_oneof_index() const; + void clear_oneof_index(); + static const int kOneofIndexFieldNumber = 9; + ::google::protobuf::int32 oneof_index() const; + void set_oneof_index(::google::protobuf::int32 value); + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + bool has_label() const; + void clear_label(); + static const int kLabelFieldNumber = 4; + ::google::protobuf::FieldDescriptorProto_Label label() const; + void set_label(::google::protobuf::FieldDescriptorProto_Label value); + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 5; + ::google::protobuf::FieldDescriptorProto_Type type() const; + void set_type(::google::protobuf::FieldDescriptorProto_Type value); + // @@protoc_insertion_point(class_scope:google.protobuf.FieldDescriptorProto) private: void set_has_name(); @@ -1368,11 +1374,7 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::google::protobuf::int32 oneof_index_; int label_; int type_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1427,7 +1429,8 @@ class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Messa bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -1486,11 +1489,7 @@ class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Messa mutable int _cached_size_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::OneofOptions* options_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1545,7 +1544,8 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -1568,6 +1568,18 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag // accessors ------------------------------------------------------- + // repeated .google.protobuf.EnumValueDescriptorProto value = 2; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 2; + const ::google::protobuf::EnumValueDescriptorProto& value(int index) const; + ::google::protobuf::EnumValueDescriptorProto* mutable_value(int index); + ::google::protobuf::EnumValueDescriptorProto* add_value(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >* + mutable_value(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >& + value() const; + // optional string name = 1; bool has_name() const; void clear_name(); @@ -1583,18 +1595,6 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag ::std::string* release_name(); void set_allocated_name(::std::string* name); - // repeated .google.protobuf.EnumValueDescriptorProto value = 2; - int value_size() const; - void clear_value(); - static const int kValueFieldNumber = 2; - const ::google::protobuf::EnumValueDescriptorProto& value(int index) const; - ::google::protobuf::EnumValueDescriptorProto* mutable_value(int index); - ::google::protobuf::EnumValueDescriptorProto* add_value(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >* - mutable_value(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >& - value() const; - // optional .google.protobuf.EnumOptions options = 3; bool has_options() const; void clear_options(); @@ -1617,11 +1617,7 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto > value_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::EnumOptions* options_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1676,7 +1672,8 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::M bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -1714,13 +1711,6 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::M ::std::string* release_name(); void set_allocated_name(::std::string* name); - // optional int32 number = 2; - bool has_number() const; - void clear_number(); - static const int kNumberFieldNumber = 2; - ::google::protobuf::int32 number() const; - void set_number(::google::protobuf::int32 value); - // optional .google.protobuf.EnumValueOptions options = 3; bool has_options() const; void clear_options(); @@ -1730,6 +1720,13 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::M ::google::protobuf::EnumValueOptions* release_options(); void set_allocated_options(::google::protobuf::EnumValueOptions* options); + // optional int32 number = 2; + bool has_number() const; + void clear_number(); + static const int kNumberFieldNumber = 2; + ::google::protobuf::int32 number() const; + void set_number(::google::protobuf::int32 value); + // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueDescriptorProto) private: void set_has_name(); @@ -1745,11 +1742,7 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::M ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::EnumValueOptions* options_; ::google::protobuf::int32 number_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1804,7 +1797,8 @@ class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Mes bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -1827,6 +1821,18 @@ class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Mes // accessors ------------------------------------------------------- + // repeated .google.protobuf.MethodDescriptorProto method = 2; + int method_size() const; + void clear_method(); + static const int kMethodFieldNumber = 2; + const ::google::protobuf::MethodDescriptorProto& method(int index) const; + ::google::protobuf::MethodDescriptorProto* mutable_method(int index); + ::google::protobuf::MethodDescriptorProto* add_method(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >* + mutable_method(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >& + method() const; + // optional string name = 1; bool has_name() const; void clear_name(); @@ -1842,18 +1848,6 @@ class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Mes ::std::string* release_name(); void set_allocated_name(::std::string* name); - // repeated .google.protobuf.MethodDescriptorProto method = 2; - int method_size() const; - void clear_method(); - static const int kMethodFieldNumber = 2; - const ::google::protobuf::MethodDescriptorProto& method(int index) const; - ::google::protobuf::MethodDescriptorProto* mutable_method(int index); - ::google::protobuf::MethodDescriptorProto* add_method(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >* - mutable_method(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >& - method() const; - // optional .google.protobuf.ServiceOptions options = 3; bool has_options() const; void clear_options(); @@ -1876,11 +1870,7 @@ class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Mes ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto > method_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::ServiceOptions* options_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1935,7 +1925,8 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -2050,11 +2041,7 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess ::google::protobuf::MethodOptions* options_; bool client_streaming_; bool server_streaming_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2109,7 +2096,8 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -2160,6 +2148,18 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p // accessors ------------------------------------------------------- + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + // optional string java_package = 1; bool has_java_package() const; void clear_java_package(); @@ -2190,34 +2190,6 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* release_java_outer_classname(); void set_allocated_java_outer_classname(::std::string* java_outer_classname); - // optional bool java_multiple_files = 10 [default = false]; - bool has_java_multiple_files() const; - void clear_java_multiple_files(); - static const int kJavaMultipleFilesFieldNumber = 10; - bool java_multiple_files() const; - void set_java_multiple_files(bool value); - - // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; - GOOGLE_PROTOBUF_DEPRECATED_ATTR bool has_java_generate_equals_and_hash() const; - GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_java_generate_equals_and_hash(); - GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kJavaGenerateEqualsAndHashFieldNumber = 20; - GOOGLE_PROTOBUF_DEPRECATED_ATTR bool java_generate_equals_and_hash() const; - GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_java_generate_equals_and_hash(bool value); - - // optional bool java_string_check_utf8 = 27 [default = false]; - bool has_java_string_check_utf8() const; - void clear_java_string_check_utf8(); - static const int kJavaStringCheckUtf8FieldNumber = 27; - bool java_string_check_utf8() const; - void set_java_string_check_utf8(bool value); - - // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; - bool has_optimize_for() const; - void clear_optimize_for(); - static const int kOptimizeForFieldNumber = 9; - ::google::protobuf::FileOptions_OptimizeMode optimize_for() const; - void set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value); - // optional string go_package = 11; bool has_go_package() const; void clear_go_package(); @@ -2233,41 +2205,6 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* release_go_package(); void set_allocated_go_package(::std::string* go_package); - // optional bool cc_generic_services = 16 [default = false]; - bool has_cc_generic_services() const; - void clear_cc_generic_services(); - static const int kCcGenericServicesFieldNumber = 16; - bool cc_generic_services() const; - void set_cc_generic_services(bool value); - - // optional bool java_generic_services = 17 [default = false]; - bool has_java_generic_services() const; - void clear_java_generic_services(); - static const int kJavaGenericServicesFieldNumber = 17; - bool java_generic_services() const; - void set_java_generic_services(bool value); - - // optional bool py_generic_services = 18 [default = false]; - bool has_py_generic_services() const; - void clear_py_generic_services(); - static const int kPyGenericServicesFieldNumber = 18; - bool py_generic_services() const; - void set_py_generic_services(bool value); - - // optional bool deprecated = 23 [default = false]; - bool has_deprecated() const; - void clear_deprecated(); - static const int kDeprecatedFieldNumber = 23; - bool deprecated() const; - void set_deprecated(bool value); - - // optional bool cc_enable_arenas = 31 [default = false]; - bool has_cc_enable_arenas() const; - void clear_cc_enable_arenas(); - static const int kCcEnableArenasFieldNumber = 31; - bool cc_enable_arenas() const; - void set_cc_enable_arenas(bool value); - // optional string objc_class_prefix = 36; bool has_objc_class_prefix() const; void clear_objc_class_prefix(); @@ -2313,17 +2250,68 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* release_swift_prefix(); void set_allocated_swift_prefix(::std::string* swift_prefix); - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - int uninterpreted_option_size() const; - void clear_uninterpreted_option(); - static const int kUninterpretedOptionFieldNumber = 999; - const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; - ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); - ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* - mutable_uninterpreted_option(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& - uninterpreted_option() const; + // optional bool java_multiple_files = 10 [default = false]; + bool has_java_multiple_files() const; + void clear_java_multiple_files(); + static const int kJavaMultipleFilesFieldNumber = 10; + bool java_multiple_files() const; + void set_java_multiple_files(bool value); + + // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR bool has_java_generate_equals_and_hash() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_java_generate_equals_and_hash(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kJavaGenerateEqualsAndHashFieldNumber = 20; + GOOGLE_PROTOBUF_DEPRECATED_ATTR bool java_generate_equals_and_hash() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_java_generate_equals_and_hash(bool value); + + // optional bool java_string_check_utf8 = 27 [default = false]; + bool has_java_string_check_utf8() const; + void clear_java_string_check_utf8(); + static const int kJavaStringCheckUtf8FieldNumber = 27; + bool java_string_check_utf8() const; + void set_java_string_check_utf8(bool value); + + // optional bool cc_generic_services = 16 [default = false]; + bool has_cc_generic_services() const; + void clear_cc_generic_services(); + static const int kCcGenericServicesFieldNumber = 16; + bool cc_generic_services() const; + void set_cc_generic_services(bool value); + + // optional bool java_generic_services = 17 [default = false]; + bool has_java_generic_services() const; + void clear_java_generic_services(); + static const int kJavaGenericServicesFieldNumber = 17; + bool java_generic_services() const; + void set_java_generic_services(bool value); + + // optional bool py_generic_services = 18 [default = false]; + bool has_py_generic_services() const; + void clear_py_generic_services(); + static const int kPyGenericServicesFieldNumber = 18; + bool py_generic_services() const; + void set_py_generic_services(bool value); + + // optional bool deprecated = 23 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 23; + bool deprecated() const; + void set_deprecated(bool value); + + // optional bool cc_enable_arenas = 31 [default = false]; + bool has_cc_enable_arenas() const; + void clear_cc_enable_arenas(); + static const int kCcEnableArenasFieldNumber = 31; + bool cc_enable_arenas() const; + void set_cc_enable_arenas(bool value); + + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + bool has_optimize_for() const; + void clear_optimize_for(); + static const int kOptimizeForFieldNumber = 9; + ::google::protobuf::FileOptions_OptimizeMode optimize_for() const; + void set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value); GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FileOptions) // @@protoc_insertion_point(class_scope:google.protobuf.FileOptions) @@ -2380,11 +2368,7 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p bool deprecated_; bool cc_enable_arenas_; int optimize_for_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2439,7 +2423,8 @@ class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -2462,6 +2447,18 @@ class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* // accessors ------------------------------------------------------- + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + // optional bool message_set_wire_format = 1 [default = false]; bool has_message_set_wire_format() const; void clear_message_set_wire_format(); @@ -2490,18 +2487,6 @@ class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* bool map_entry() const; void set_map_entry(bool value); - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - int uninterpreted_option_size() const; - void clear_uninterpreted_option(); - static const int kUninterpretedOptionFieldNumber = 999; - const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; - ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); - ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* - mutable_uninterpreted_option(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& - uninterpreted_option() const; - GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MessageOptions) // @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions) private: @@ -2524,11 +2509,7 @@ class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* bool no_standard_descriptor_accessor_; bool deprecated_; bool map_entry_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2583,7 +2564,8 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -2662,6 +2644,18 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ // accessors ------------------------------------------------------- + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; bool has_ctype() const; void clear_ctype(); @@ -2669,13 +2663,6 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ ::google::protobuf::FieldOptions_CType ctype() const; void set_ctype(::google::protobuf::FieldOptions_CType value); - // optional bool packed = 2; - bool has_packed() const; - void clear_packed(); - static const int kPackedFieldNumber = 2; - bool packed() const; - void set_packed(bool value); - // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; bool has_jstype() const; void clear_jstype(); @@ -2683,6 +2670,13 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ ::google::protobuf::FieldOptions_JSType jstype() const; void set_jstype(::google::protobuf::FieldOptions_JSType value); + // optional bool packed = 2; + bool has_packed() const; + void clear_packed(); + static const int kPackedFieldNumber = 2; + bool packed() const; + void set_packed(bool value); + // optional bool lazy = 5 [default = false]; bool has_lazy() const; void clear_lazy(); @@ -2704,18 +2698,6 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ bool weak() const; void set_weak(bool value); - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - int uninterpreted_option_size() const; - void clear_uninterpreted_option(); - static const int kUninterpretedOptionFieldNumber = 999; - const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; - ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); - ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* - mutable_uninterpreted_option(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& - uninterpreted_option() const; - GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FieldOptions) // @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions) private: @@ -2744,11 +2726,7 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ bool lazy_; bool deprecated_; bool weak_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2803,7 +2781,8 @@ class LIBPROTOBUF_EXPORT OneofOptions : public ::google::protobuf::Message /* @@ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -2848,11 +2827,7 @@ class LIBPROTOBUF_EXPORT OneofOptions : public ::google::protobuf::Message /* @@ ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2907,7 +2882,8 @@ class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@p bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -2930,6 +2906,18 @@ class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@p // accessors ------------------------------------------------------- + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + // optional bool allow_alias = 2; bool has_allow_alias() const; void clear_allow_alias(); @@ -2944,18 +2932,6 @@ class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@p bool deprecated() const; void set_deprecated(bool value); - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - int uninterpreted_option_size() const; - void clear_uninterpreted_option(); - static const int kUninterpretedOptionFieldNumber = 999; - const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; - ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); - ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* - mutable_uninterpreted_option(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& - uninterpreted_option() const; - GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumOptions) // @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions) private: @@ -2972,11 +2948,7 @@ class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@p ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; bool allow_alias_; bool deprecated_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -3031,7 +3003,8 @@ class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message / bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -3054,13 +3027,6 @@ class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message / // accessors ------------------------------------------------------- - // optional bool deprecated = 1 [default = false]; - bool has_deprecated() const; - void clear_deprecated(); - static const int kDeprecatedFieldNumber = 1; - bool deprecated() const; - void set_deprecated(bool value); - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; int uninterpreted_option_size() const; void clear_uninterpreted_option(); @@ -3073,6 +3039,13 @@ class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message / const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional bool deprecated = 1 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 1; + bool deprecated() const; + void set_deprecated(bool value); + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumValueOptions) // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions) private: @@ -3086,11 +3059,7 @@ class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message / mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; bool deprecated_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -3145,7 +3114,8 @@ class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -3168,13 +3138,6 @@ class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* // accessors ------------------------------------------------------- - // optional bool deprecated = 33 [default = false]; - bool has_deprecated() const; - void clear_deprecated(); - static const int kDeprecatedFieldNumber = 33; - bool deprecated() const; - void set_deprecated(bool value); - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; int uninterpreted_option_size() const; void clear_uninterpreted_option(); @@ -3187,6 +3150,13 @@ class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional bool deprecated = 33 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 33; + bool deprecated() const; + void set_deprecated(bool value); + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ServiceOptions) // @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions) private: @@ -3200,11 +3170,7 @@ class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; bool deprecated_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -3259,7 +3225,8 @@ class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -3310,6 +3277,18 @@ class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @ // accessors ------------------------------------------------------- + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + // optional bool deprecated = 33 [default = false]; bool has_deprecated() const; void clear_deprecated(); @@ -3324,18 +3303,6 @@ class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @ ::google::protobuf::MethodOptions_IdempotencyLevel idempotency_level() const; void set_idempotency_level(::google::protobuf::MethodOptions_IdempotencyLevel value); - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - int uninterpreted_option_size() const; - void clear_uninterpreted_option(); - static const int kUninterpretedOptionFieldNumber = 999; - const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; - ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); - ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* - mutable_uninterpreted_option(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& - uninterpreted_option() const; - GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MethodOptions) // @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions) private: @@ -3352,11 +3319,7 @@ class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @ ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; bool deprecated_; int idempotency_level_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -3411,7 +3374,8 @@ class LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobu bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -3471,11 +3435,7 @@ class LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobu mutable int _cached_size_; ::google::protobuf::internal::ArenaStringPtr name_part_; bool is_extension_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -3530,7 +3490,8 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -3582,27 +3543,6 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag ::std::string* release_identifier_value(); void set_allocated_identifier_value(::std::string* identifier_value); - // optional uint64 positive_int_value = 4; - bool has_positive_int_value() const; - void clear_positive_int_value(); - static const int kPositiveIntValueFieldNumber = 4; - ::google::protobuf::uint64 positive_int_value() const; - void set_positive_int_value(::google::protobuf::uint64 value); - - // optional int64 negative_int_value = 5; - bool has_negative_int_value() const; - void clear_negative_int_value(); - static const int kNegativeIntValueFieldNumber = 5; - ::google::protobuf::int64 negative_int_value() const; - void set_negative_int_value(::google::protobuf::int64 value); - - // optional double double_value = 6; - bool has_double_value() const; - void clear_double_value(); - static const int kDoubleValueFieldNumber = 6; - double double_value() const; - void set_double_value(double value); - // optional bytes string_value = 7; bool has_string_value() const; void clear_string_value(); @@ -3633,6 +3573,27 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag ::std::string* release_aggregate_value(); void set_allocated_aggregate_value(::std::string* aggregate_value); + // optional uint64 positive_int_value = 4; + bool has_positive_int_value() const; + void clear_positive_int_value(); + static const int kPositiveIntValueFieldNumber = 4; + ::google::protobuf::uint64 positive_int_value() const; + void set_positive_int_value(::google::protobuf::uint64 value); + + // optional int64 negative_int_value = 5; + bool has_negative_int_value() const; + void clear_negative_int_value(); + static const int kNegativeIntValueFieldNumber = 5; + ::google::protobuf::int64 negative_int_value() const; + void set_negative_int_value(::google::protobuf::int64 value); + + // optional double double_value = 6; + bool has_double_value() const; + void clear_double_value(); + static const int kDoubleValueFieldNumber = 6; + double double_value() const; + void set_double_value(double value); + // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption) private: void set_has_identifier_value(); @@ -3658,11 +3619,7 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag ::google::protobuf::uint64 positive_int_value_; ::google::protobuf::int64 negative_int_value_; double double_value_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -3717,7 +3674,8 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -3764,6 +3722,28 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* mutable_span(); + // repeated string leading_detached_comments = 6; + int leading_detached_comments_size() const; + void clear_leading_detached_comments(); + static const int kLeadingDetachedCommentsFieldNumber = 6; + const ::std::string& leading_detached_comments(int index) const; + ::std::string* mutable_leading_detached_comments(int index); + void set_leading_detached_comments(int index, const ::std::string& value); + #if LANG_CXX11 + void set_leading_detached_comments(int index, ::std::string&& value); + #endif + void set_leading_detached_comments(int index, const char* value); + void set_leading_detached_comments(int index, const char* value, size_t size); + ::std::string* add_leading_detached_comments(); + void add_leading_detached_comments(const ::std::string& value); + #if LANG_CXX11 + void add_leading_detached_comments(::std::string&& value); + #endif + void add_leading_detached_comments(const char* value); + void add_leading_detached_comments(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& leading_detached_comments() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_leading_detached_comments(); + // optional string leading_comments = 3; bool has_leading_comments() const; void clear_leading_comments(); @@ -3794,22 +3774,6 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me ::std::string* release_trailing_comments(); void set_allocated_trailing_comments(::std::string* trailing_comments); - // repeated string leading_detached_comments = 6; - int leading_detached_comments_size() const; - void clear_leading_detached_comments(); - static const int kLeadingDetachedCommentsFieldNumber = 6; - const ::std::string& leading_detached_comments(int index) const; - ::std::string* mutable_leading_detached_comments(int index); - void set_leading_detached_comments(int index, const ::std::string& value); - void set_leading_detached_comments(int index, const char* value); - void set_leading_detached_comments(int index, const char* value, size_t size); - ::std::string* add_leading_detached_comments(); - void add_leading_detached_comments(const ::std::string& value); - void add_leading_detached_comments(const char* value); - void add_leading_detached_comments(const char* value, size_t size); - const ::google::protobuf::RepeatedPtrField< ::std::string>& leading_detached_comments() const; - ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_leading_detached_comments(); - // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location) private: void set_has_leading_comments(); @@ -3827,11 +3791,7 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me ::google::protobuf::RepeatedPtrField< ::std::string> leading_detached_comments_; ::google::protobuf::internal::ArenaStringPtr leading_comments_; ::google::protobuf::internal::ArenaStringPtr trailing_comments_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -3886,7 +3846,8 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /* bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -3930,11 +3891,7 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /* ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location > location_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -3989,7 +3946,8 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobu bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -4070,11 +4028,7 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobu ::google::protobuf::internal::ArenaStringPtr source_file_; ::google::protobuf::int32 begin_; ::google::protobuf::int32 end_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -4129,7 +4083,8 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -4173,11 +4128,7 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation > annotation_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fdescriptor_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; }; // =================================================================== @@ -4364,6 +4315,12 @@ inline void FileDescriptorProto::set_dependency(int index, const ::std::string& // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) dependency_.Mutable(index)->assign(value); } +#if LANG_CXX11 +inline void FileDescriptorProto::set_dependency(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) + dependency_.Mutable(index)->assign(std::move(value)); +} +#endif inline void FileDescriptorProto::set_dependency(int index, const char* value) { dependency_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency) @@ -4381,6 +4338,12 @@ inline void FileDescriptorProto::add_dependency(const ::std::string& value) { dependency_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) } +#if LANG_CXX11 +inline void FileDescriptorProto::add_dependency(::std::string&& value) { + dependency_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) +} +#endif inline void FileDescriptorProto::add_dependency(const char* value) { dependency_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency) @@ -5176,6 +5139,12 @@ inline void DescriptorProto::set_reserved_name(int index, const ::std::string& v // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) reserved_name_.Mutable(index)->assign(value); } +#if LANG_CXX11 +inline void DescriptorProto::set_reserved_name(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) + reserved_name_.Mutable(index)->assign(std::move(value)); +} +#endif inline void DescriptorProto::set_reserved_name(int index, const char* value) { reserved_name_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name) @@ -5193,6 +5162,12 @@ inline void DescriptorProto::add_reserved_name(const ::std::string& value) { reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) } +#if LANG_CXX11 +inline void DescriptorProto::add_reserved_name(::std::string&& value) { + reserved_name_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) +} +#endif inline void DescriptorProto::add_reserved_name(const char* value) { reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name) @@ -8317,6 +8292,12 @@ inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, co // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) leading_detached_comments_.Mutable(index)->assign(value); } +#if LANG_CXX11 +inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + leading_detached_comments_.Mutable(index)->assign(std::move(value)); +} +#endif inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) { leading_detached_comments_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) @@ -8334,6 +8315,12 @@ inline void SourceCodeInfo_Location::add_leading_detached_comments(const ::std:: leading_detached_comments_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } +#if LANG_CXX11 +inline void SourceCodeInfo_Location::add_leading_detached_comments(::std::string&& value) { + leading_detached_comments_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} +#endif inline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) { leading_detached_comments_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index 03aba076..e5f83e62 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -139,7 +139,11 @@ message FieldDescriptorProto { TYPE_FIXED32 = 7; TYPE_BOOL = 8; TYPE_STRING = 9; - TYPE_GROUP = 10; // Tag-delimited aggregate. + // 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. // New in version 2. diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index 12135b80..d9b4fb1f 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -19,8 +19,11 @@ namespace google { namespace protobuf { -class DurationDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Duration> {}; -DurationDefaultTypeInternal _Duration_default_instance_; +class DurationDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Duration> { +} _Duration_default_instance_; + +namespace protobuf_google_2fprotobuf_2fduration_2eproto { + namespace { @@ -28,35 +31,30 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fduration_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fduration_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, seconds_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, nanos_), - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, seconds_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, nanos_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(Duration)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_Duration_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_Duration_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/duration.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fduration_2eproto(), factory, + "google/protobuf/duration.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -73,24 +71,24 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto() { +void TableStruct::Shutdown() { _Duration_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _Duration_default_instance_.DefaultConstruct(); } -void protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n\036google/protobuf/duration.proto\022\017google" ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r" @@ -103,20 +101,22 @@ void protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto_impl() { descriptor, 227); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/duration.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fduration_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fduration_2eproto + // =================================================================== @@ -128,7 +128,7 @@ const int Duration::kNanosFieldNumber; Duration::Duration() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto(); + protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Duration) @@ -137,7 +137,7 @@ Duration::Duration(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto(); + protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -185,12 +185,12 @@ void Duration::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Duration::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2fduration_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[0].descriptor; } const Duration& Duration::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto(); + protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -216,7 +216,8 @@ bool Duration::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // int64 seconds = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( @@ -229,7 +230,8 @@ bool Duration::MergePartialFromCodedStream( // int32 nanos = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -279,7 +281,7 @@ void Duration::SerializeWithCachedSizes( ::google::protobuf::uint8* Duration::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration) // int64 seconds = 1; if (this->seconds() != 0) { @@ -391,8 +393,8 @@ void Duration::InternalSwap(Duration* other) { } ::google::protobuf::Metadata Duration::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2fduration_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h index f8e67cc5..591c11d1 100644 --- a/src/google/protobuf/duration.pb.h +++ b/src/google/protobuf/duration.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -39,9 +40,16 @@ LIBPROTOBUF_EXPORT extern DurationDefaultTypeInternal _Duration_default_instance namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2fduration_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fduration_2eproto // =================================================================== @@ -95,7 +103,8 @@ class LIBPROTOBUF_EXPORT Duration : public ::google::protobuf::Message /* @@prot bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -145,11 +154,7 @@ class LIBPROTOBUF_EXPORT Duration : public ::google::protobuf::Message /* @@prot ::google::protobuf::int64 seconds_; ::google::protobuf::int32 nanos_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fduration_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fduration_2eproto::TableStruct; }; // =================================================================== diff --git a/src/google/protobuf/dynamic_message.cc b/src/google/protobuf/dynamic_message.cc index d686e01e..d6bde495 100644 --- a/src/google/protobuf/dynamic_message.cc +++ b/src/google/protobuf/dynamic_message.cc @@ -239,13 +239,11 @@ class DynamicMessage : public Message { // looking back at this field. This would assume details about the // implementation of scoped_ptr. const DynamicMessage* prototype; - void* default_oneof_instance; - TypeInfo() : prototype(NULL), default_oneof_instance(NULL) {} + TypeInfo() : prototype(NULL) {} ~TypeInfo() { delete prototype; - operator delete(default_oneof_instance); } }; @@ -448,8 +446,8 @@ DynamicMessage::~DynamicMessage() { case FieldOptions::STRING: { const ::std::string* default_value = &(reinterpret_cast<const ArenaStringPtr*>( - reinterpret_cast<uint8*>( - type_info_->default_oneof_instance) + + reinterpret_cast<const uint8*>( + type_info_->prototype) + type_info_->offsets[i]) ->Get()); reinterpret_cast<ArenaStringPtr*>(field_ptr)->Destroy( @@ -539,10 +537,6 @@ void DynamicMessage::CrossLinkPrototypes() { for (int i = 0; i < descriptor->field_count(); i++) { const FieldDescriptor* field = descriptor->field(i); void* field_ptr = OffsetToPointer(type_info_->offsets[i]); - if (field->containing_oneof()) { - field_ptr = reinterpret_cast<uint8*>( - type_info_->default_oneof_instance) + type_info_->offsets[i]; - } if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && !field->is_repeated()) { @@ -614,7 +608,7 @@ DynamicMessageFactory::~DynamicMessageFactory() { iter != prototypes_->map_.end(); ++iter) { DeleteDefaultOneofInstance(iter->second->type, iter->second->offsets.get(), - iter->second->default_oneof_instance); + iter->second->prototype); delete iter->second; } } @@ -725,46 +719,44 @@ const Message* DynamicMessageFactory::GetPrototypeNoLock( // Align the final size to make sure no clever allocators think that // alignment is not necessary. - size = AlignOffset(size); type_info->size = size; - // Allocate the prototype. - void* base = operator new(size); - memset(base, 0, size); - // The prototype in type_info has to be set before creating the prototype - // instance on memory. e.g., message Foo { map<int32, Foo> a = 1; }. When - // creating prototype for Foo, prototype of the map entry will also be - // created, which needs the address of the prototype of Foo (the value in - // map). To break the cyclic dependency, we have to assgin the address of - // prototype into type_info first. - type_info->prototype = static_cast<DynamicMessage*>(base); - DynamicMessage* prototype = new(base) DynamicMessage(type_info); // Construct the reflection object. - void* default_oneof_instance = NULL; - int oneof_case_offset = -1; - if (type->oneof_decl_count() > 0) { // Compute the size of default oneof instance and offsets of default // oneof fields. - int oneof_size = 0; for (int i = 0; i < type->oneof_decl_count(); i++) { for (int j = 0; j < type->oneof_decl(i)->field_count(); j++) { const FieldDescriptor* field = type->oneof_decl(i)->field(j); int field_size = OneofFieldSpaceUsed(field); - oneof_size = AlignTo(oneof_size, std::min(kSafeAlignment, field_size)); - offsets[field->index()] = oneof_size; - oneof_size += field_size; + size = AlignTo(size, std::min(kSafeAlignment, field_size)); + offsets[field->index()] = size; + size += field_size; } } + } + size = AlignOffset(size); + + // Allocate the prototype + oneof fields. + void* base = operator new(size); + memset(base, 0, size); + + // The prototype in type_info has to be set before creating the prototype + // instance on memory. e.g., message Foo { map<int32, Foo> a = 1; }. When + // creating prototype for Foo, prototype of the map entry will also be + // created, which needs the address of the prototype of Foo (the value in + // map). To break the cyclic dependency, we have to assgin the address of + // prototype into type_info first. + type_info->prototype = static_cast<DynamicMessage*>(base); + DynamicMessage* prototype = new(base) DynamicMessage(type_info); + + if (type->oneof_decl_count() > 0) { // Construct default oneof instance. - type_info->default_oneof_instance = ::operator new(oneof_size); ConstructDefaultOneofInstance(type_info->type, type_info->offsets.get(), - type_info->default_oneof_instance); - default_oneof_instance = type_info->default_oneof_instance; - oneof_case_offset = type_info->oneof_case_offset; + prototype); } internal::ReflectionSchema schema = { @@ -774,8 +766,7 @@ const Message* DynamicMessageFactory::GetPrototypeNoLock( type_info->has_bits_offset, type_info->internal_metadata_offset, type_info->extensions_offset, - default_oneof_instance, - oneof_case_offset, + type_info->oneof_case_offset, type_info->size}; type_info->reflection.reset(new GeneratedMessageReflection( @@ -836,7 +827,7 @@ void DynamicMessageFactory::ConstructDefaultOneofInstance( void DynamicMessageFactory::DeleteDefaultOneofInstance( const Descriptor* type, const uint32 offsets[], - void* default_oneof_instance) { + const void* default_oneof_instance) { for (int i = 0; i < type->oneof_decl_count(); i++) { for (int j = 0; j < type->oneof_decl(i)->field_count(); j++) { const FieldDescriptor* field = type->oneof_decl(i)->field(j); diff --git a/src/google/protobuf/dynamic_message.h b/src/google/protobuf/dynamic_message.h index 7ff80f26..816170ea 100644 --- a/src/google/protobuf/dynamic_message.h +++ b/src/google/protobuf/dynamic_message.h @@ -38,12 +38,15 @@ #ifndef GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__ #define GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__ +#include <algorithm> #include <memory> #ifndef _SHARED_PTR_H #include <google/protobuf/stubs/shared_ptr.h> #endif +#include <vector> #include <google/protobuf/message.h> +#include <google/protobuf/repeated_field.h> #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/mutex.h> @@ -141,11 +144,92 @@ class LIBPROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory { // Delete default oneof instance. Called by ~DynamicMessageFactory. static void DeleteDefaultOneofInstance(const Descriptor* type, const uint32 offsets[], - void* default_oneof_instance); + const void* default_oneof_instance); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMessageFactory); }; +// Helper for computing a sorted list of map entries via reflection. +class LIBPROTOBUF_EXPORT DynamicMapSorter { + public: + static std::vector<const Message*> Sort(const Message& message, + int map_size, + const Reflection* reflection, + const FieldDescriptor* field) { + std::vector<const Message*> result(map_size); + const RepeatedPtrField<Message>& map_field = + reflection->GetRepeatedPtrField<Message>(message, field); + int i = 0; + for (RepeatedPtrField<Message>::const_pointer_iterator it = + map_field.pointer_begin(); it != map_field.pointer_end(); ) { + result[i++] = *it++; + } + GOOGLE_DCHECK_EQ(result.size(), static_cast<size_t>(i)); + MapEntryMessageComparator comparator(field->message_type()); + std::sort(result.begin(), result.end(), comparator); + // Complain if the keys aren't in ascending order. +#ifndef NDEBUG + for (int j = 1; j < map_size; j++) { + if (!comparator(result[j - 1], result[j])) { + GOOGLE_LOG(ERROR) << (comparator(result[j], result[j - 1]) ? + "internal error in map key sorting" : + "map keys are not unique"); + } + } +#endif + return result; + } + + private: + class LIBPROTOBUF_EXPORT MapEntryMessageComparator { + public: + explicit MapEntryMessageComparator(const Descriptor* descriptor) + : field_(descriptor->field(0)) {} + + bool operator()(const Message* a, const Message* b) { + const Reflection* reflection = a->GetReflection(); + switch (field_->cpp_type()) { + case FieldDescriptor::CPPTYPE_BOOL: { + bool first = reflection->GetBool(*a, field_); + bool second = reflection->GetBool(*b, field_); + return first < second; + } + case FieldDescriptor::CPPTYPE_INT32: { + int32 first = reflection->GetInt32(*a, field_); + int32 second = reflection->GetInt32(*b, field_); + return first < second; + } + case FieldDescriptor::CPPTYPE_INT64: { + int64 first = reflection->GetInt64(*a, field_); + int64 second = reflection->GetInt64(*b, field_); + return first < second; + } + case FieldDescriptor::CPPTYPE_UINT32: { + uint32 first = reflection->GetUInt32(*a, field_); + uint32 second = reflection->GetUInt32(*b, field_); + return first < second; + } + case FieldDescriptor::CPPTYPE_UINT64: { + uint64 first = reflection->GetUInt64(*a, field_); + uint64 second = reflection->GetUInt64(*b, field_); + return first < second; + } + case FieldDescriptor::CPPTYPE_STRING: { + string first = reflection->GetString(*a, field_); + string second = reflection->GetString(*b, field_); + return first < second; + } + default: + GOOGLE_LOG(DFATAL) << "Invalid key for map field."; + return true; + } + } + + private: + const FieldDescriptor* field_; + }; +}; + } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc index 19f4aefe..31cba097 100644 --- a/src/google/protobuf/empty.pb.cc +++ b/src/google/protobuf/empty.pb.cc @@ -19,8 +19,11 @@ namespace google { namespace protobuf { -class EmptyDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Empty> {}; -EmptyDefaultTypeInternal _Empty_default_instance_; +class EmptyDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Empty> { +} _Empty_default_instance_; + +namespace protobuf_google_2fprotobuf_2fempty_2eproto { + namespace { @@ -28,33 +31,28 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fempty_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fempty_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Empty, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Empty, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(Empty)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_Empty_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_Empty_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/empty.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fempty_2eproto(), factory, + "google/protobuf/empty.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -71,24 +69,24 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fempty_2eproto() { +void TableStruct::Shutdown() { _Empty_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _Empty_default_instance_.DefaultConstruct(); } -void protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n\033google/protobuf/empty.proto\022\017google.pr" "otobuf\"\007\n\005EmptyBv\n\023com.google.protobufB\n" @@ -100,20 +98,22 @@ void protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto_impl() { descriptor, 183); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/empty.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fempty_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fempty_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fempty_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fempty_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fempty_2eproto + // =================================================================== @@ -123,7 +123,7 @@ struct StaticDescriptorInitializer_google_2fprotobuf_2fempty_2eproto { Empty::Empty() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto(); + protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Empty) @@ -132,7 +132,7 @@ Empty::Empty(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto(); + protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -175,12 +175,12 @@ void Empty::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Empty::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2fempty_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fempty_2eproto::file_level_metadata[0].descriptor; } const Empty& Empty::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto(); + protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -226,7 +226,7 @@ void Empty::SerializeWithCachedSizes( ::google::protobuf::uint8* Empty::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Empty) // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Empty) return target; @@ -306,8 +306,8 @@ void Empty::InternalSwap(Empty* other) { } ::google::protobuf::Metadata Empty::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2fempty_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fempty_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h index 4a84bb4f..a75d6dd6 100644 --- a/src/google/protobuf/empty.pb.h +++ b/src/google/protobuf/empty.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -39,9 +40,16 @@ LIBPROTOBUF_EXPORT extern EmptyDefaultTypeInternal _Empty_default_instance_; namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2fempty_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fempty_2eproto // =================================================================== @@ -95,7 +103,8 @@ class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -131,11 +140,7 @@ class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_ typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fempty_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fempty_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fempty_2eproto::TableStruct; }; // =================================================================== diff --git a/src/google/protobuf/extension_set_heavy.cc b/src/google/protobuf/extension_set_heavy.cc index 2c37ade9..8f8f180a 100644 --- a/src/google/protobuf/extension_set_heavy.cc +++ b/src/google/protobuf/extension_set_heavy.cc @@ -35,6 +35,7 @@ // Contains methods defined in extension_set.h which cannot be part of the // lite library because they use descriptors or reflection. +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/io/zero_copy_stream_impl_lite.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/extension_set.h> @@ -413,12 +414,16 @@ uint8* ExtensionSet::SerializeWithCachedSizesToArray(int start_field_number, int end_field_number, uint8* target) const { return InternalSerializeWithCachedSizesToArray( - start_field_number, end_field_number, false, target); + start_field_number, end_field_number, + google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), + target); } uint8* ExtensionSet::SerializeMessageSetWithCachedSizesToArray( uint8* target) const { - return InternalSerializeMessageSetWithCachedSizesToArray(false, target); + return InternalSerializeMessageSetWithCachedSizesToArray( + google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), + target); } uint8* ExtensionSet::InternalSerializeWithCachedSizesToArray( @@ -587,11 +592,12 @@ ExtensionSet::Extension::InternalSerializeMessageSetItemWithCachedSizesToArray( WireFormatLite::kMessageSetTypeIdNumber, number, target); // Write message. if (is_lazy) { - target = lazymessage_value->WriteMessageToArray( - WireFormatLite::kMessageSetMessageNumber, target); + target = lazymessage_value->InternalWriteMessageToArray( + WireFormatLite::kMessageSetMessageNumber, deterministic, target); } else { - target = WireFormatLite::WriteMessageToArray( - WireFormatLite::kMessageSetMessageNumber, *message_value, target); + target = WireFormatLite::InternalWriteMessageToArray( + WireFormatLite::kMessageSetMessageNumber, *message_value, deterministic, + target); } // End group. target = io::CodedOutputStream::WriteTagToArray( diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index b7925b88..c9409fe5 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -19,8 +19,11 @@ namespace google { namespace protobuf { -class FieldMaskDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FieldMask> {}; -FieldMaskDefaultTypeInternal _FieldMask_default_instance_; +class FieldMaskDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FieldMask> { +} _FieldMask_default_instance_; + +namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto { + namespace { @@ -28,34 +31,29 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ffield_5fmask_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ffield_5fmask_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, paths_), - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, paths_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(FieldMask)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_FieldMask_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_FieldMask_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/field_mask.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2ffield_5fmask_2eproto(), factory, + "google/protobuf/field_mask.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -72,24 +70,24 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto() { +void TableStruct::Shutdown() { _FieldMask_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _FieldMask_default_instance_.DefaultConstruct(); } -void protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n google/protobuf/field_mask.proto\022\017goog" "le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB" @@ -102,20 +100,22 @@ void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_impl() { descriptor, 227); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/field_mask.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2ffield_5fmask_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto + // =================================================================== @@ -126,7 +126,7 @@ const int FieldMask::kPathsFieldNumber; FieldMask::FieldMask() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto(); + protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FieldMask) @@ -158,12 +158,12 @@ void FieldMask::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FieldMask::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::file_level_metadata[0].descriptor; } const FieldMask& FieldMask::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto(); + protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -192,7 +192,8 @@ bool FieldMask::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated string paths = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_paths())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -231,7 +232,7 @@ void FieldMask::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.FieldMask) // repeated string paths = 1; - for (int i = 0; i < this->paths_size(); i++) { + for (int i = 0, n = this->paths_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->paths(i).data(), this->paths(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, @@ -245,10 +246,10 @@ void FieldMask::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldMask::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask) // repeated string paths = 1; - for (int i = 0; i < this->paths_size(); i++) { + for (int i = 0, n = this->paths_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->paths(i).data(), this->paths(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, @@ -268,7 +269,7 @@ size_t FieldMask::ByteSizeLong() const { // repeated string paths = 1; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->paths_size()); - for (int i = 0; i < this->paths_size(); i++) { + for (int i = 0, n = this->paths_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->paths(i)); } @@ -330,8 +331,8 @@ void FieldMask::InternalSwap(FieldMask* other) { } ::google::protobuf::Metadata FieldMask::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -356,6 +357,12 @@ void FieldMask::set_paths(int index, const ::std::string& value) { // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths) paths_.Mutable(index)->assign(value); } +#if LANG_CXX11 +void FieldMask::set_paths(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths) + paths_.Mutable(index)->assign(std::move(value)); +} +#endif void FieldMask::set_paths(int index, const char* value) { paths_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths) @@ -373,6 +380,12 @@ void FieldMask::add_paths(const ::std::string& value) { paths_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths) } +#if LANG_CXX11 +void FieldMask::add_paths(::std::string&& value) { + paths_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths) +} +#endif void FieldMask::add_paths(const char* value) { paths_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths) diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h index d7600c1b..b609f235 100644 --- a/src/google/protobuf/field_mask.pb.h +++ b/src/google/protobuf/field_mask.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -39,9 +40,16 @@ LIBPROTOBUF_EXPORT extern FieldMaskDefaultTypeInternal _FieldMask_default_instan namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto // =================================================================== @@ -88,7 +96,8 @@ class LIBPROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@pro bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -118,10 +127,16 @@ class LIBPROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@pro const ::std::string& paths(int index) const; ::std::string* mutable_paths(int index); void set_paths(int index, const ::std::string& value); + #if LANG_CXX11 + void set_paths(int index, ::std::string&& value); + #endif void set_paths(int index, const char* value); void set_paths(int index, const char* value, size_t size); ::std::string* add_paths(); void add_paths(const ::std::string& value); + #if LANG_CXX11 + void add_paths(::std::string&& value); + #endif void add_paths(const char* value); void add_paths(const char* value, size_t size); const ::google::protobuf::RepeatedPtrField< ::std::string>& paths() const; @@ -133,11 +148,7 @@ class LIBPROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@pro ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::RepeatedPtrField< ::std::string> paths_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ffield_5fmask_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::TableStruct; }; // =================================================================== @@ -166,6 +177,12 @@ inline void FieldMask::set_paths(int index, const ::std::string& value) { // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths) paths_.Mutable(index)->assign(value); } +#if LANG_CXX11 +inline void FieldMask::set_paths(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths) + paths_.Mutable(index)->assign(std::move(value)); +} +#endif inline void FieldMask::set_paths(int index, const char* value) { paths_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths) @@ -183,6 +200,12 @@ inline void FieldMask::add_paths(const ::std::string& value) { paths_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths) } +#if LANG_CXX11 +inline void FieldMask::add_paths(::std::string&& value) { + paths_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths) +} +#endif inline void FieldMask::add_paths(const char* value) { paths_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths) diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index 08742232..2f8f8256 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -73,12 +73,6 @@ const string& NameOfEnum(const EnumDescriptor* descriptor, int value) { return (d == NULL ? GetEmptyString() : d->name()); } -namespace { -inline bool SupportsArenas(const Descriptor* descriptor) { - return descriptor->file()->options().cc_enable_arenas(); -} -} // anonymous namespace - // =================================================================== // Helpers for reporting usage errors (e.g. trying to use GetInt32() on // a string field). @@ -196,18 +190,7 @@ GeneratedMessageReflection::GeneratedMessageReflection( schema_(schema), descriptor_pool_((pool == NULL) ? DescriptorPool::generated_pool() : pool), - message_factory_(factory), - // TODO(haberman) remove this when upb is using our table driven. - default_instance_(schema_.default_instance_), - default_oneof_instance_(schema_.default_oneof_instance_), - offsets_(schema_.offsets_), - has_bits_indices_(schema_.has_bit_indices_), - has_bits_offset_(schema_.has_bits_offset_), - oneof_case_offset_(schema_.oneof_case_offset_), - unknown_fields_offset_(-1), - extensions_offset_(schema_.extensions_offset_), - arena_offset_(schema_.metadata_offset_), - object_size_(schema_.object_size_) { + message_factory_(factory) { } GeneratedMessageReflection::~GeneratedMessageReflection() {} @@ -643,7 +626,17 @@ void GeneratedMessageReflection::Swap( if (schema_.HasHasbits()) { uint32* has_bits1 = MutableHasBits(message1); uint32* has_bits2 = MutableHasBits(message2); - int has_bits_size = (descriptor_->field_count() + 31) / 32; + + int fields_with_has_bits = 0; + for (int i = 0; i < descriptor_->field_count(); i++) { + const FieldDescriptor* field = descriptor_->field(i); + if (field->is_repeated() || field->containing_oneof()) { + continue; + } + fields_with_has_bits++; + } + + int has_bits_size = (fields_with_has_bits + 31) / 32; for (int i = 0; i < has_bits_size; i++) { std::swap(has_bits1[i], has_bits2[i]); @@ -711,8 +704,11 @@ void GeneratedMessageReflection::SwapFields( swapped_oneof.insert(oneof_index); SwapOneofField(message1, message2, field->containing_oneof()); } else { - // Swap has bit. - SwapBit(message1, message2, field); + // Swap has bit for non-repeated fields. We have already checked for + // oneof already. + if (!field->is_repeated()) { + SwapBit(message1, message2, field); + } // Swap field. SwapField(message1, message2, field); } @@ -1006,6 +1002,7 @@ struct FieldNumberSorter { inline bool IsIndexInHasBitSet( const uint32* has_bit_set, uint32 has_bit_index) { + GOOGLE_DCHECK_NE(has_bit_index, ~0u); return ((has_bit_set[has_bit_index / 32] >> (has_bit_index % 32)) & static_cast<uint32>(1)) != 0; } @@ -1511,7 +1508,7 @@ void GeneratedMessageReflection::UnsafeArenaSetAllocatedMessage( USAGE_CHECK_ALL(SetAllocatedMessage, SINGULAR, MESSAGE); if (field->is_extension()) { - MutableExtensionSet(message)->SetAllocatedMessage( + MutableExtensionSet(message)->UnsafeArenaSetAllocatedMessage( field->number(), field->type(), field, sub_message); } else { if (field->containing_oneof()) { @@ -1579,7 +1576,9 @@ Message* GeneratedMessageReflection::UnsafeArenaReleaseMessage( MutableExtensionSet(message)->UnsafeArenaReleaseMessage(field, factory)); } else { - ClearBit(message, field); + if (!(field->is_repeated() || field->containing_oneof())) { + ClearBit(message, field); + } if (field->containing_oneof()) { if (HasOneofField(*message, field)) { *MutableOneofCase(message, field->containing_oneof()) = 0; @@ -2233,10 +2232,10 @@ namespace { // Helper function to transform migration schema into reflection schema. ReflectionSchema MigrationToReflectionSchema( - const DefaultInstanceData* default_instance_data, const uint32* offsets, + const Message* const* default_instance, const uint32* offsets, MigrationSchema migration_schema) { ReflectionSchema result; - result.default_instance_ = default_instance_data->default_instance; + result.default_instance_ = *default_instance; // First 5 offsets are offsets to the special fields. The following offsets // are the proto fields. result.offsets_ = offsets + migration_schema.offsets_index + 4; @@ -2244,18 +2243,12 @@ ReflectionSchema MigrationToReflectionSchema( result.has_bits_offset_ = offsets[migration_schema.offsets_index + 0]; result.metadata_offset_ = offsets[migration_schema.offsets_index + 1]; result.extensions_offset_ = offsets[migration_schema.offsets_index + 2]; - result.default_oneof_instance_ = default_instance_data->default_oneof_instance; result.oneof_case_offset_ = offsets[migration_schema.offsets_index + 3]; result.object_size_ = migration_schema.object_size; + result.weak_field_map_offset_ = 0; return result; } -ReflectionSchema MigrationToReflectionSchema( - const DefaultInstanceData* default_instance_data, const uint32* offsets, - ReflectionSchema schema) { - return schema; -} - template<typename Schema> class AssignDescriptorsHelper { public: @@ -2263,7 +2256,7 @@ class AssignDescriptorsHelper { Metadata* file_level_metadata, const EnumDescriptor** file_level_enum_descriptors, const Schema* schemas, - const DefaultInstanceData* default_instance_data, + const Message* const* default_instance_data, const uint32* offsets) : factory_(factory), file_level_metadata_(file_level_metadata), @@ -2303,7 +2296,7 @@ class AssignDescriptorsHelper { Metadata* file_level_metadata_; const EnumDescriptor** file_level_enum_descriptors_; const Schema* schemas_; - const DefaultInstanceData* default_instance_data_; + const Message* const * default_instance_data_; const uint32* offsets_; }; @@ -2311,7 +2304,7 @@ class AssignDescriptorsHelper { void AssignDescriptors( const string& filename, const MigrationSchema* schemas, - const DefaultInstanceData* default_instance_data, const uint32* offsets, + const Message* const* default_instances_, const uint32* offsets, MessageFactory* factory, // update the following descriptor arrays. Metadata* file_level_metadata, @@ -2325,38 +2318,7 @@ void AssignDescriptors( AssignDescriptorsHelper<MigrationSchema> helper(factory, file_level_metadata, file_level_enum_descriptors, schemas, - default_instance_data, offsets); - - for (int i = 0; i < file->message_type_count(); i++) { - helper.AssignMessageDescriptor(file->message_type(i)); - } - - for (int i = 0; i < file->enum_type_count(); i++) { - helper.AssignEnumDescriptor(file->enum_type(i)); - } - if (file->options().cc_generic_services()) { - for (int i = 0; i < file->service_count(); i++) { - file_level_service_descriptors[i] = file->service(i); - } - } -} - -void AssignDescriptors( - const string& filename, const ReflectionSchema* schemas, - MessageFactory* factory, - // update the following descriptor arrays. - Metadata* file_level_metadata, - const EnumDescriptor** file_level_enum_descriptors, - const ServiceDescriptor** file_level_service_descriptors) { - const ::google::protobuf::FileDescriptor* file = - ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(filename); - GOOGLE_CHECK(file != NULL); - - if (!factory) factory = MessageFactory::generated_factory(); - - AssignDescriptorsHelper<ReflectionSchema> helper(factory, file_level_metadata, - file_level_enum_descriptors, schemas, - NULL, NULL); + default_instances_, offsets); for (int i = 0; i < file->message_type_count(); i++) { helper.AssignMessageDescriptor(file->message_type(i)); diff --git a/src/google/protobuf/generated_message_reflection.h b/src/google/protobuf/generated_message_reflection.h index 2633ab62..2e65787f 100644 --- a/src/google/protobuf/generated_message_reflection.h +++ b/src/google/protobuf/generated_message_reflection.h @@ -107,11 +107,6 @@ class ExtensionSet; // extension_set.h // extensions_offset: Offset in the message of the ExtensionSet for the // message, or -1 if the message type has no extension // ranges. -// default_oneof_instance: The default instance of the oneofs. It is a -// struct holding the default value of all oneof fields -// for this message. It is only used to obtain pointers -// to default instances of oneof fields, which Get -// methods will return if the field is not set. // oneof_case_offset: Offset in the message of an array of uint32s of // size descriptor->oneof_decl_count(). Each uint32 // indicates what field is set for each oneof. @@ -160,8 +155,8 @@ struct ReflectionSchema { return has_bits_offset_; } - // The offset of the InternalMetadataWithArenaOffset member. - // For Lite this will actually be an InternalMetadataWithArenaOffsetLite. + // The offset of the InternalMetadataWithArena member. + // For Lite this will actually be an InternalMetadataWithArenaLite. // The schema doesn't contain enough information to distinguish between // these two cases. uint32 GetMetadataOffset() const { @@ -177,6 +172,10 @@ struct ReflectionSchema { return extensions_offset_; } + // The off set of WeakFieldMap when the message contains weak fields. + // The default is 0 for now. + int GetWeakFieldMapOffset() const { return weak_field_map_offset_; } + bool IsDefaultInstance(const Message& message) const { return &message == default_instance_; } @@ -184,10 +183,7 @@ struct ReflectionSchema { // Returns a pointer to the default value for this field. The size and type // of the underlying data depends on the field's type. const void *GetFieldDefault(const FieldDescriptor* field) const { - return field->containing_oneof() - ? reinterpret_cast<const uint8*>(default_oneof_instance_) + - offsets_[field->index()] - : reinterpret_cast<const uint8*>(default_instance_) + + return reinterpret_cast<const uint8*>(default_instance_) + offsets_[field->index()]; } @@ -203,9 +199,9 @@ struct ReflectionSchema { int has_bits_offset_; int metadata_offset_; int extensions_offset_; - const void* default_oneof_instance_; int oneof_case_offset_; int object_size_; + int weak_field_map_offset_; }; // Structs that the code generator emits directly to describe a message. @@ -214,11 +210,6 @@ struct ReflectionSchema { // // EXPERIMENTAL: these are changing rapidly, and may completely disappear // or merge with ReflectionSchema. -struct DefaultInstanceData { - const Message* default_instance; - const void* default_oneof_instance; -}; - struct MigrationSchema { int32 offsets_index; int32 has_bit_indices_index; @@ -249,7 +240,8 @@ struct MigrationSchema { // of whatever type the individual field would be. Strings and // Messages use RepeatedPtrFields while everything else uses // RepeatedFields. -class LIBPROTOBUF_EXPORT GeneratedMessageReflection PROTOBUF_FINAL : public Reflection { +class LIBPROTOBUF_EXPORT GeneratedMessageReflection PROTOBUF_FINAL + : public Reflection { public: // Constructs a GeneratedMessageReflection. // Parameters: @@ -497,21 +489,6 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection PROTOBUF_FINAL : public Refl const DescriptorPool* const descriptor_pool_; MessageFactory* const message_factory_; - // To parse directly into a proto2 generated class, the class GMR_Handlers - // needs access to member offsets and hasbits. - // upb still needs these. - // TODO(haberman) clean this up. - const Message* const default_instance_; - const void* const default_oneof_instance_; - const uint32* const offsets_; - const uint32* const has_bits_indices_; - const int has_bits_offset_; - const int oneof_case_offset_; - const int unknown_fields_offset_; - const int extensions_offset_; - const int arena_offset_; - const int object_size_; - template <class T> const T& GetRawNonOneof(const Message& message, const FieldDescriptor* field) const; @@ -741,15 +718,7 @@ T* DynamicCastToGenerated(Message* from) { LIBPROTOBUF_EXPORT void AssignDescriptors( const string& filename, const MigrationSchema* schemas, - const DefaultInstanceData* default_instance_data, const uint32* offsets, - MessageFactory* factory, - // update the following descriptor arrays. - Metadata* file_level_metadata, - const EnumDescriptor** file_level_enum_descriptors, - const ServiceDescriptor** file_level_service_descriptors); - -LIBPROTOBUF_EXPORT void AssignDescriptors( - const string& filename, const ReflectionSchema* schemas, + const Message* const* default_instances_, const uint32* offsets, MessageFactory* factory, // update the following descriptor arrays. Metadata* file_level_metadata, diff --git a/src/google/protobuf/generated_message_reflection_unittest.cc b/src/google/protobuf/generated_message_reflection_unittest.cc index e2c6cdc0..242cc4a1 100644 --- a/src/google/protobuf/generated_message_reflection_unittest.cc +++ b/src/google/protobuf/generated_message_reflection_unittest.cc @@ -48,9 +48,10 @@ #include <google/protobuf/stubs/shared_ptr.h> #endif -#include <google/protobuf/descriptor.h> #include <google/protobuf/test_util.h> #include <google/protobuf/unittest.pb.h> +#include <google/protobuf/arena.h> +#include <google/protobuf/descriptor.h> #include <google/protobuf/stubs/logging.h> #include <google/protobuf/stubs/common.h> @@ -519,6 +520,41 @@ TEST(GeneratedMessageReflectionTest, SetAllocatedMessageTest) { &to_message, TestUtil::ReflectionTester::IS_NULL); } +TEST(GeneratedMessageReflectionTest, SetAllocatedMessageOnArenaTest) { + unittest::TestAllTypes from_message1; + unittest::TestAllTypes from_message2; + ::google::protobuf::Arena arena; + unittest::TestAllTypes* to_message = + ::google::protobuf::Arena::CreateMessage<unittest::TestAllTypes>(&arena); + TestUtil::ReflectionTester reflection_tester( + unittest::TestAllTypes::descriptor()); + reflection_tester.SetAllFieldsViaReflection(&from_message1); + reflection_tester.SetAllFieldsViaReflection(&from_message2); + + // Before moving fields, we expect the nested messages to be NULL. + reflection_tester.ExpectMessagesReleasedViaReflection( + to_message, TestUtil::ReflectionTester::IS_NULL); + + // After fields are moved we should get non-NULL releases. + reflection_tester.SetAllocatedOptionalMessageFieldsToMessageViaReflection( + &from_message1, to_message); + reflection_tester.ExpectMessagesReleasedViaReflection( + to_message, TestUtil::ReflectionTester::NOT_NULL); + + // Another move to make sure that we can SetAllocated several times. + reflection_tester.SetAllocatedOptionalMessageFieldsToMessageViaReflection( + &from_message2, to_message); + reflection_tester.ExpectMessagesReleasedViaReflection( + to_message, TestUtil::ReflectionTester::NOT_NULL); + + // After SetAllocatedOptionalMessageFieldsToNullViaReflection() we expect the + // releases to be NULL again. + reflection_tester.SetAllocatedOptionalMessageFieldsToNullViaReflection( + to_message); + reflection_tester.ExpectMessagesReleasedViaReflection( + to_message, TestUtil::ReflectionTester::IS_NULL); +} + TEST(GeneratedMessageReflectionTest, SetAllocatedExtensionMessageTest) { unittest::TestAllExtensions from_message1; unittest::TestAllExtensions from_message2; @@ -552,6 +588,41 @@ TEST(GeneratedMessageReflectionTest, SetAllocatedExtensionMessageTest) { &to_message, TestUtil::ReflectionTester::IS_NULL); } +TEST(GeneratedMessageReflectionTest, SetAllocatedExtensionMessageOnArenaTest) { + ::google::protobuf::Arena arena; + unittest::TestAllExtensions* to_message = + ::google::protobuf::Arena::CreateMessage<unittest::TestAllExtensions>(&arena); + unittest::TestAllExtensions from_message1; + unittest::TestAllExtensions from_message2; + TestUtil::ReflectionTester reflection_tester( + unittest::TestAllExtensions::descriptor()); + reflection_tester.SetAllFieldsViaReflection(&from_message1); + reflection_tester.SetAllFieldsViaReflection(&from_message2); + + // Before moving fields, we expect the nested messages to be NULL. + reflection_tester.ExpectMessagesReleasedViaReflection( + to_message, TestUtil::ReflectionTester::IS_NULL); + + // After fields are moved we should get non-NULL releases. + reflection_tester.SetAllocatedOptionalMessageFieldsToMessageViaReflection( + &from_message1, to_message); + reflection_tester.ExpectMessagesReleasedViaReflection( + to_message, TestUtil::ReflectionTester::NOT_NULL); + + // Another move to make sure that we can SetAllocated several times. + reflection_tester.SetAllocatedOptionalMessageFieldsToMessageViaReflection( + &from_message2, to_message); + reflection_tester.ExpectMessagesReleasedViaReflection( + to_message, TestUtil::ReflectionTester::NOT_NULL); + + // After SetAllocatedOptionalMessageFieldsToNullViaReflection() we expect the + // releases to be NULL again. + reflection_tester.SetAllocatedOptionalMessageFieldsToNullViaReflection( + to_message); + reflection_tester.ExpectMessagesReleasedViaReflection( + to_message, TestUtil::ReflectionTester::IS_NULL); +} + TEST(GeneratedMessageReflectionTest, AddRepeatedMessage) { unittest::TestAllTypes message; @@ -723,6 +794,59 @@ TEST(GeneratedMessageReflectionTest, SetAllocatedOneofMessageTest) { delete released; } +TEST(GeneratedMessageReflectionTest, SetAllocatedOneofMessageOnArenaTest) { + unittest::TestOneof2 from_message1; + unittest::TestOneof2 from_message2; + ::google::protobuf::Arena arena; + unittest::TestOneof2* to_message = + ::google::protobuf::Arena::CreateMessage<unittest::TestOneof2>(&arena); + const Descriptor* descriptor = unittest::TestOneof2::descriptor(); + const Reflection* reflection = to_message->GetReflection(); + + Message* released = reflection->ReleaseMessage( + to_message, descriptor->FindFieldByName("foo_lazy_message")); + EXPECT_TRUE(released == NULL); + released = reflection->ReleaseMessage( + to_message, descriptor->FindFieldByName("foo_message")); + EXPECT_TRUE(released == NULL); + + TestUtil::ReflectionTester::SetOneofViaReflection(&from_message1); + TestUtil::ReflectionTester::ExpectOneofSetViaReflection(from_message1); + + TestUtil::ReflectionTester:: + SetAllocatedOptionalMessageFieldsToMessageViaReflection( + &from_message1, to_message); + const Message& sub_message = reflection->GetMessage( + *to_message, descriptor->FindFieldByName("foo_lazy_message")); + released = reflection->ReleaseMessage( + to_message, descriptor->FindFieldByName("foo_lazy_message")); + EXPECT_TRUE(released != NULL); + // Since sub_message is arena allocated, releasing it results in copying it + // into new heap-allocated memory. + EXPECT_NE(&sub_message, released); + delete released; + + TestUtil::ReflectionTester::SetOneofViaReflection(&from_message2); + + reflection->MutableMessage( + &from_message2, descriptor->FindFieldByName("foo_message")); + + TestUtil::ReflectionTester:: + SetAllocatedOptionalMessageFieldsToMessageViaReflection( + &from_message2, to_message); + + const Message& sub_message2 = reflection->GetMessage( + *to_message, descriptor->FindFieldByName("foo_message")); + released = reflection->ReleaseMessage( + to_message, descriptor->FindFieldByName("foo_message")); + EXPECT_TRUE(released != NULL); + // Since sub_message2 is arena allocated, releasing it results in copying it + // into new heap-allocated memory. + EXPECT_NE(&sub_message2, released); + delete released; +} + + TEST(GeneratedMessageReflectionTest, ReleaseMessageTest) { unittest::TestAllTypes message; TestUtil::ReflectionTester reflection_tester( diff --git a/src/google/protobuf/has_bits.h b/src/google/protobuf/has_bits.h index 133bc02a..cb1d7ccc 100644 --- a/src/google/protobuf/has_bits.h +++ b/src/google/protobuf/has_bits.h @@ -61,10 +61,41 @@ class HasBits { bool operator!=(const HasBits<doublewords>& rhs) const { return !(*this == rhs); } + + bool empty() const; + private: ::google::protobuf::uint32 has_bits_[doublewords]; }; +template <> +inline bool HasBits<1>::empty() const { + return !has_bits_[0]; +} + +template <> +inline bool HasBits<2>::empty() const { + return !(has_bits_[0] | has_bits_[1]); +} + +template <> +inline bool HasBits<3>::empty() const { + return !(has_bits_[0] | has_bits_[1] | has_bits_[2]); +} + +template <> +inline bool HasBits<4>::empty() const { + return !(has_bits_[0] | has_bits_[1] | has_bits_[2] | has_bits_[3]); +} + +template <size_t doublewords> +inline bool HasBits<doublewords>::empty() const { + for (size_t i = 0; i < doublewords; ++i) { + if (has_bits_[i]) return false; + } + return true; +} + } // namespace internal } // namespace protobuf diff --git a/src/google/protobuf/io/coded_stream.cc b/src/google/protobuf/io/coded_stream.cc index 93748ee3..3c2e0fbd 100644 --- a/src/google/protobuf/io/coded_stream.cc +++ b/src/google/protobuf/io/coded_stream.cc @@ -816,25 +816,6 @@ bool CodedOutputStream::Refresh() { } } -size_t CodedOutputStream::VarintSize32Fallback(uint32 value) { - // This computes floor(log2(value)) / 7 + 1 - // Use an explicit multiplication to implement the divide of - // a number in the 1..31 range. - GOOGLE_DCHECK_NE(0, value); // This is enforced by our caller. - - uint32 log2value = Bits::Log2FloorNonZero(value); - return static_cast<size_t>((log2value * 9 + 73) / 64); -} - -size_t CodedOutputStream::VarintSize64(uint64 value) { - // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1 - // Use an explicit multiplication to implement the divide of - // a number in the 1..63 range. - // Explicit OR 0x1 to avoid calling clz(0), which is undefined. - uint32 log2value = Bits::Log2FloorNonZero64(value | 0x1); - return static_cast<size_t>((log2value * 9 + 73) / 64); -} - uint8* CodedOutputStream::WriteStringWithSizeToArray(const string& str, uint8* target) { GOOGLE_DCHECK_LE(str.size(), kuint32max); diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index dc42e2fe..b71b4a98 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -140,6 +140,8 @@ namespace protobuf { class DescriptorPool; class MessageFactory; +namespace internal { void MapTestForceDeterministic(); } + namespace io { // Defined in this file. @@ -867,6 +869,10 @@ class LIBPROTOBUF_EXPORT CodedOutputStream { default_serialization_deterministic_; } + static bool IsDefaultSerializationDeterministic() { + return default_serialization_deterministic_; + } + private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CodedOutputStream); @@ -897,9 +903,9 @@ class LIBPROTOBUF_EXPORT CodedOutputStream { void WriteVarint32SlowPath(uint32 value); void WriteVarint64SlowPath(uint64 value); - static size_t VarintSize32Fallback(uint32 value); - // See above. Other projects may use "friend" to allow them to call this. + // Requires: no protocol buffer serialization in progress. + friend void ::google::protobuf::internal::MapTestForceDeterministic(); static void SetDefaultSerializationDeterministic() { default_serialization_deterministic_ = true; } @@ -988,8 +994,7 @@ inline const uint8* CodedInputStream::ReadLittleEndian64FromArray( inline bool CodedInputStream::ReadLittleEndian32(uint32* value) { #if defined(PROTOBUF_LITTLE_ENDIAN) if (GOOGLE_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) { - memcpy(value, buffer_, sizeof(*value)); - Advance(sizeof(*value)); + buffer_ = ReadLittleEndian32FromArray(buffer_, value); return true; } else { return ReadLittleEndian32Fallback(value); @@ -1002,8 +1007,7 @@ inline bool CodedInputStream::ReadLittleEndian32(uint32* value) { inline bool CodedInputStream::ReadLittleEndian64(uint64* value) { #if defined(PROTOBUF_LITTLE_ENDIAN) if (GOOGLE_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) { - memcpy(value, buffer_, sizeof(*value)); - Advance(sizeof(*value)); + buffer_ = ReadLittleEndian64FromArray(buffer_, value); return true; } else { return ReadLittleEndian64Fallback(value); @@ -1284,11 +1288,23 @@ inline uint8* CodedOutputStream::WriteTagToArray( } inline size_t CodedOutputStream::VarintSize32(uint32 value) { - if (value < (1 << 7)) { - return 1; - } else { - return VarintSize32Fallback(value); - } + // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1 + // Use an explicit multiplication to implement the divide of + // a number in the 1..31 range. + // Explicit OR 0x1 to avoid calling Bits::Log2FloorNonZero(0), which is + // undefined. + uint32 log2value = Bits::Log2FloorNonZero(value | 0x1); + return static_cast<size_t>((log2value * 9 + 73) / 64); +} + +inline size_t CodedOutputStream::VarintSize64(uint64 value) { + // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1 + // Use an explicit multiplication to implement the divide of + // a number in the 1..63 range. + // Explicit OR 0x1 to avoid calling Bits::Log2FloorNonZero(0), which is + // undefined. + uint32 log2value = Bits::Log2FloorNonZero64(value | 0x1); + return static_cast<size_t>((log2value * 9 + 73) / 64); } inline size_t CodedOutputStream::VarintSize32SignExtended(int32 value) { diff --git a/src/google/protobuf/io/tokenizer_unittest.cc b/src/google/protobuf/io/tokenizer_unittest.cc index a2c19522..cadeb696 100644 --- a/src/google/protobuf/io/tokenizer_unittest.cc +++ b/src/google/protobuf/io/tokenizer_unittest.cc @@ -199,8 +199,8 @@ struct SimpleTokenCase { Tokenizer::TokenType type; }; -inline ostream& operator<<(ostream& out, - const SimpleTokenCase& test_case) { +inline std::ostream& operator<<(std::ostream& out, + const SimpleTokenCase& test_case) { return out << CEscape(test_case.input); } @@ -333,8 +333,8 @@ struct MultiTokenCase { // needed. }; -inline ostream& operator<<(ostream& out, - const MultiTokenCase& test_case) { +inline std::ostream& operator<<(std::ostream& out, + const MultiTokenCase& test_case) { return out << CEscape(test_case.input); } @@ -520,8 +520,8 @@ struct DocCommentCase { const char* next_leading_comments; }; -inline ostream& operator<<(ostream& out, - const DocCommentCase& test_case) { +inline std::ostream& operator<<(std::ostream& out, + const DocCommentCase& test_case) { return out << CEscape(test_case.input); } @@ -860,8 +860,7 @@ struct ErrorCase { const char* errors; }; -inline ostream& operator<<(ostream& out, - const ErrorCase& test_case) { +inline std::ostream& operator<<(std::ostream& out, const ErrorCase& test_case) { return out << CEscape(test_case.input); } diff --git a/src/google/protobuf/io/zero_copy_stream_impl.cc b/src/google/protobuf/io/zero_copy_stream_impl.cc index 7ec2b5da..109c55c1 100644 --- a/src/google/protobuf/io/zero_copy_stream_impl.cc +++ b/src/google/protobuf/io/zero_copy_stream_impl.cc @@ -270,10 +270,8 @@ bool FileOutputStream::CopyingFileOutputStream::Write( // =================================================================== -IstreamInputStream::IstreamInputStream(istream* input, int block_size) - : copying_input_(input), - impl_(©ing_input_, block_size) { -} +IstreamInputStream::IstreamInputStream(std::istream* input, int block_size) + : copying_input_(input), impl_(©ing_input_, block_size) {} IstreamInputStream::~IstreamInputStream() {} @@ -294,9 +292,8 @@ int64 IstreamInputStream::ByteCount() const { } IstreamInputStream::CopyingIstreamInputStream::CopyingIstreamInputStream( - istream* input) - : input_(input) { -} + std::istream* input) + : input_(input) {} IstreamInputStream::CopyingIstreamInputStream::~CopyingIstreamInputStream() {} @@ -312,10 +309,8 @@ int IstreamInputStream::CopyingIstreamInputStream::Read( // =================================================================== -OstreamOutputStream::OstreamOutputStream(ostream* output, int block_size) - : copying_output_(output), - impl_(©ing_output_, block_size) { -} +OstreamOutputStream::OstreamOutputStream(std::ostream* output, int block_size) + : copying_output_(output), impl_(©ing_output_, block_size) {} OstreamOutputStream::~OstreamOutputStream() { impl_.Flush(); @@ -334,9 +329,8 @@ int64 OstreamOutputStream::ByteCount() const { } OstreamOutputStream::CopyingOstreamOutputStream::CopyingOstreamOutputStream( - ostream* output) - : output_(output) { -} + std::ostream* output) + : output_(output) {} OstreamOutputStream::CopyingOstreamOutputStream::~CopyingOstreamOutputStream() { } diff --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc index a9db8872..235cbca4 100644 --- a/src/google/protobuf/io/zero_copy_stream_unittest.cc +++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc @@ -882,7 +882,7 @@ TEST_F(IoTest, IostreamIo) { for (int i = 0; i < kBlockSizeCount; i++) { for (int j = 0; j < kBlockSizeCount; j++) { { - stringstream stream; + std::stringstream stream; { OstreamOutputStream output(&stream, kBlockSizes[i]); @@ -898,7 +898,7 @@ TEST_F(IoTest, IostreamIo) { } { - stringstream stream; + std::stringstream stream; { OstreamOutputStream output(&stream, kBlockSizes[i]); diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 47ced29f..6458714e 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -1533,8 +1533,9 @@ class Map { // Lookup size_type count(const key_type& key) const { - if (find(key) != end()) assert(key == find(key)->first); - return find(key) == end() ? 0 : 1; + const_iterator it = find(key); + GOOGLE_DCHECK(it == end() || key == it->first); + return it == end() ? 0 : 1; } const_iterator find(const key_type& key) const { return old_style_ ? const_iterator(deprecated_elements_->find(key)) diff --git a/src/google/protobuf/map_entry.h b/src/google/protobuf/map_entry.h index 07c24c02..d7db9b0f 100644 --- a/src/google/protobuf/map_entry.h +++ b/src/google/protobuf/map_entry.h @@ -251,7 +251,6 @@ class MapEntry : public MapEntryBase { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, entry_lite_._has_bits_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, _internal_metadata_), -1, - NULL, -1, sizeof(MapEntry)}; const Reflection* reflection = new GeneratedMessageReflection( diff --git a/src/google/protobuf/map_entry_lite.h b/src/google/protobuf/map_entry_lite.h index bb1d7e06..1243911b 100644 --- a/src/google/protobuf/map_entry_lite.h +++ b/src/google/protobuf/map_entry_lite.h @@ -221,9 +221,8 @@ class MapEntryLite : public MessageLite { deterministic, output); return output; } - ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { - return InternalSerializeWithCachedSizesToArray(false, output); - } + + // Don't override SerializeWithCachedSizesToArray. Use MessageLite's. int GetCachedSize() const { int size = 0; diff --git a/src/google/protobuf/map_test.cc b/src/google/protobuf/map_test.cc index d0a34d01..43fe0f44 100644 --- a/src/google/protobuf/map_test.cc +++ b/src/google/protobuf/map_test.cc @@ -91,6 +91,10 @@ using google::protobuf::unittest::TestRecursiveMapMessage; namespace protobuf { namespace internal { +void MapTestForceDeterministic() { + ::google::protobuf::io::CodedOutputStream::SetDefaultSerializationDeterministic(); +} + // Map API Test ===================================================== // Parameterized tests on whether to use old style maps. @@ -2844,7 +2848,7 @@ TEST(WireFormatForMapFieldTest, MapParseHelpers) { { // Test ParseFromIstream. protobuf_unittest::TestMap message; - stringstream stream(data); + std::stringstream stream(data); EXPECT_TRUE(message.ParseFromIstream(&stream)); EXPECT_TRUE(stream.eof()); MapTestUtil::ExpectMapFieldsSet(message); diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index a5a7feb6..b799dead 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -130,12 +130,12 @@ bool Message::ParsePartialFromFileDescriptor(int file_descriptor) { return ParsePartialFromZeroCopyStream(&input) && input.GetErrno() == 0; } -bool Message::ParseFromIstream(istream* input) { +bool Message::ParseFromIstream(std::istream* input) { io::IstreamInputStream zero_copy_input(input); return ParseFromZeroCopyStream(&zero_copy_input) && input->eof(); } -bool Message::ParsePartialFromIstream(istream* input) { +bool Message::ParsePartialFromIstream(std::istream* input) { io::IstreamInputStream zero_copy_input(input); return ParsePartialFromZeroCopyStream(&zero_copy_input) && input->eof(); } @@ -172,7 +172,7 @@ bool Message::SerializePartialToFileDescriptor(int file_descriptor) const { return SerializePartialToZeroCopyStream(&output); } -bool Message::SerializeToOstream(ostream* output) const { +bool Message::SerializeToOstream(std::ostream* output) const { { io::OstreamOutputStream zero_copy_output(output); if (!SerializeToZeroCopyStream(&zero_copy_output)) return false; @@ -180,7 +180,7 @@ bool Message::SerializeToOstream(ostream* output) const { return output->good(); } -bool Message::SerializePartialToOstream(ostream* output) const { +bool Message::SerializePartialToOstream(std::ostream* output) const { io::OstreamOutputStream zero_copy_output(output); return SerializePartialToZeroCopyStream(&zero_copy_output); } diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h index 872df7a9..4d14584d 100644 --- a/src/google/protobuf/message.h +++ b/src/google/protobuf/message.h @@ -853,7 +853,7 @@ class LIBPROTOBUF_EXPORT Reflection { // reflection->SetEnumValue(message, field, new_value); // } else { // if (field_descriptor->enum_type()-> - // FindValueByNumver(new_value) != NULL) { + // FindValueByNumber(new_value) != NULL) { // reflection->SetEnumValue(message, field, new_value); // } else if (emit_unknown_enum_values) { // reflection->MutableUnknownFields(message)->AddVarint( diff --git a/src/google/protobuf/message_lite.cc b/src/google/protobuf/message_lite.cc index a42e9ec3..b8cb3f4c 100644 --- a/src/google/protobuf/message_lite.cc +++ b/src/google/protobuf/message_lite.cc @@ -229,6 +229,7 @@ uint8* MessageLite::InternalSerializeWithCachedSizesToArray( int size = GetCachedSize(); io::ArrayOutputStream out(target, size); io::CodedOutputStream coded_out(&out); + coded_out.SetSerializationDeterministic(deterministic); SerializeWithCachedSizes(&coded_out); GOOGLE_CHECK(!coded_out.HadError()); return target + size; diff --git a/src/google/protobuf/message_unittest.cc b/src/google/protobuf/message_unittest.cc index de39fff8..c1b05bc1 100644 --- a/src/google/protobuf/message_unittest.cc +++ b/src/google/protobuf/message_unittest.cc @@ -77,7 +77,7 @@ TEST(MessageTest, SerializeHelpers) { protobuf_unittest::TestAllTypes message; TestUtil::SetAllFields(&message); - stringstream stream; + std::stringstream stream; string str1("foo"); string str2("bar"); @@ -101,7 +101,7 @@ TEST(MessageTest, SerializeHelpers) { } TEST(MessageTest, SerializeToBrokenOstream) { - ofstream out; + std::ofstream out; protobuf_unittest::TestAllTypes message; message.set_optional_int32(123); @@ -155,7 +155,7 @@ TEST(MessageTest, ParseHelpers) { { // Test ParseFromIstream. protobuf_unittest::TestAllTypes message; - stringstream stream(data); + std::stringstream stream(data); EXPECT_TRUE(message.ParseFromIstream(&stream)); EXPECT_TRUE(stream.eof()); TestUtil::ExpectAllFieldsSet(message); diff --git a/src/google/protobuf/metadata.h b/src/google/protobuf/metadata.h index f9257534..dca1fa45 100644 --- a/src/google/protobuf/metadata.h +++ b/src/google/protobuf/metadata.h @@ -172,7 +172,8 @@ class InternalMetadataWithArena public: InternalMetadataWithArena() {} explicit InternalMetadataWithArena(Arena* arena) - : InternalMetadataWithArenaBase(arena) {} + : InternalMetadataWithArenaBase<UnknownFieldSet, + InternalMetadataWithArena>(arena) {} void DoSwap(UnknownFieldSet* other) { mutable_unknown_fields()->Swap(other); @@ -201,7 +202,8 @@ class InternalMetadataWithArenaLite InternalMetadataWithArenaLite() {} explicit InternalMetadataWithArenaLite(Arena* arena) - : InternalMetadataWithArenaBase(arena) {} + : InternalMetadataWithArenaBase<string, + InternalMetadataWithArenaLite>(arena) {} void DoSwap(string* other) { mutable_unknown_fields()->swap(*other); diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index bbdef449..4e5bcf51 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -423,6 +423,11 @@ class LIBPROTOBUF_EXPORT RepeatedPtrFieldBase { void Delete(int index); template <typename TypeHandler> typename TypeHandler::Type* Add(typename TypeHandler::Type* prototype = NULL); +#if LANG_CXX11 + template <typename TypeHandler> + void Add(typename TypeHandler::Type&& value, + std::enable_if<TypeHandler::Moveable>* dummy = NULL); +#endif template <typename TypeHandler> void RemoveLast(); @@ -575,6 +580,9 @@ template <typename GenericType> class GenericTypeHandler { public: typedef GenericType Type; +#if LANG_CXX11 + static const bool Moveable = false; +#endif static inline GenericType* New(Arena* arena) { return ::google::protobuf::Arena::CreateMaybeMessage<Type>( arena, static_cast<GenericType*>(0)); @@ -686,13 +694,24 @@ inline const Message& GenericTypeHandler<Message>::default_instance() { return *null; } -class LIBPROTOBUF_EXPORT StringTypeHandler { + +class StringTypeHandler { public: typedef string Type; +#if LANG_CXX11 + static const bool Moveable = + std::is_move_constructible<Type>::value && + std::is_move_assignable<Type>::value; +#endif static inline string* New(Arena* arena) { return Arena::Create<string>(arena); } +#if LANG_CXX11 + static inline string* New(Arena* arena, std::string&& value) { + return Arena::Create<string>(arena, std::move(value)); + } +#endif static inline string* NewFromPrototype(const string*, ::google::protobuf::Arena* arena) { return New(arena); @@ -742,6 +761,9 @@ class RepeatedPtrField PROTOBUF_FINAL : public internal::RepeatedPtrFieldBase { const Element& Get(int index) const; Element* Mutable(int index); Element* Add(); +#if LANG_CXX11 + void Add(Element&& value); +#endif const Element& operator[](int index) const { return Get(index); } Element& operator[](int index) { return *Mutable(index); } @@ -983,13 +1005,13 @@ inline RepeatedField<Element>::RepeatedField(Arena* arena) : current_size_(0), total_size_(0), rep_(NULL) { - // In case arena is NULL, then we do not create rep_, as code has an invariant - // `rep_ == NULL then arena == NULL`. - if (arena != NULL) { - rep_ = reinterpret_cast<Rep*>( - ::google::protobuf::Arena::CreateArray<char>(arena, kRepHeaderSize)); - rep_->arena = arena; - } + // In case arena is NULL, then we do not create rep_, as code has an invariant + // `rep_ == NULL then arena == NULL`. + if (arena != NULL) { + rep_ = reinterpret_cast<Rep*>( + ::google::protobuf::Arena::CreateArray<char>(arena, kRepHeaderSize)); + rep_->arena = arena; + } } template <typename Element> @@ -1450,6 +1472,25 @@ inline typename TypeHandler::Type* RepeatedPtrFieldBase::Add( return result; } +#if LANG_CXX11 +template <typename TypeHandler> +inline void RepeatedPtrFieldBase::Add( + typename TypeHandler::Type&& value, + std::enable_if<TypeHandler::Moveable>*) { + if (rep_ != NULL && current_size_ < rep_->allocated_size) { + cast<TypeHandler>(rep_->elements[current_size_++]) = std::move(value); + } + if (!rep_ || rep_->allocated_size == total_size_) { + Reserve(total_size_ + 1); + } + ++rep_->allocated_size; + typename TypeHandler::Type* result = + TypeHandler::New(arena_, std::move(value)); + rep_->elements[current_size_++] = result; + return result; +} +#endif + template <typename TypeHandler> inline void RepeatedPtrFieldBase::RemoveLast() { GOOGLE_DCHECK_GT(current_size_, 0); @@ -1847,6 +1888,13 @@ inline Element* RepeatedPtrField<Element>::Add() { return RepeatedPtrFieldBase::Add<TypeHandler>(); } +#if LANG_CXX11 +template <typename Element> +inline void RepeatedPtrField<Element>::Add(Element&& value) { + RepeatedPtrFieldBase::Add<TypeHandler>(std::move(value)); +} +#endif + template <typename Element> inline void RepeatedPtrField<Element>::RemoveLast() { RepeatedPtrFieldBase::RemoveLast<TypeHandler>(); diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc index 9239a089..b6f5cfce 100644 --- a/src/google/protobuf/source_context.pb.cc +++ b/src/google/protobuf/source_context.pb.cc @@ -19,8 +19,11 @@ namespace google { namespace protobuf { -class SourceContextDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<SourceContext> {}; -SourceContextDefaultTypeInternal _SourceContext_default_instance_; +class SourceContextDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<SourceContext> { +} _SourceContext_default_instance_; + +namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto { + namespace { @@ -28,34 +31,29 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fsource_5fcontext_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fsource_5fcontext_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, file_name_), - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, file_name_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(SourceContext)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_SourceContext_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_SourceContext_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/source_context.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fsource_5fcontext_2eproto(), factory, + "google/protobuf/source_context.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -72,24 +70,24 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fsource_5fcontext_2eproto() { +void TableStruct::Shutdown() { _SourceContext_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _SourceContext_default_instance_.DefaultConstruct(); } -void protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n$google/protobuf/source_context.proto\022\017" "google.protobuf\"\"\n\rSourceContext\022\021\n\tfile" @@ -103,20 +101,22 @@ void protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto_impl() { descriptor, 251); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/source_context.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fsource_5fcontext_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fsource_5fcontext_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fsource_5fcontext_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fsource_5fcontext_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto + // =================================================================== @@ -127,7 +127,7 @@ const int SourceContext::kFileNameFieldNumber; SourceContext::SourceContext() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto(); + protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceContext) @@ -164,12 +164,12 @@ void SourceContext::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SourceContext::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::file_level_metadata[0].descriptor; } const SourceContext& SourceContext::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto(); + protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -198,7 +198,8 @@ bool SourceContext::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string file_name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_file_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -250,7 +251,7 @@ void SourceContext::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceContext::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceContext) // string file_name = 1; if (this->file_name().size() > 0) { @@ -338,8 +339,8 @@ void SourceContext::InternalSwap(SourceContext* other) { } ::google::protobuf::Metadata SourceContext::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h index ed38ba2c..10888385 100644 --- a/src/google/protobuf/source_context.pb.h +++ b/src/google/protobuf/source_context.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -39,9 +40,16 @@ LIBPROTOBUF_EXPORT extern SourceContextDefaultTypeInternal _SourceContext_defaul namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto // =================================================================== @@ -88,7 +96,8 @@ class LIBPROTOBUF_EXPORT SourceContext : public ::google::protobuf::Message /* @ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -131,11 +140,7 @@ class LIBPROTOBUF_EXPORT SourceContext : public ::google::protobuf::Message /* @ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::internal::ArenaStringPtr file_name_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fsource_5fcontext_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fsource_5fcontext_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::TableStruct; }; // =================================================================== diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 8bd2f8be..1350085c 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -19,56 +19,53 @@ namespace google { namespace protobuf { -class StructDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Struct> {}; -StructDefaultTypeInternal _Struct_default_instance_; -class ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Value> {}; -ValueDefaultTypeInternal _Value_default_instance_; -class ListValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<ListValue> {}; -ListValueDefaultTypeInternal _ListValue_default_instance_; - -namespace { - -::google::protobuf::Metadata file_level_metadata[4]; -const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; -struct ValueOneofInstance { +class StructDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Struct> { +} _Struct_default_instance_; +class ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Value> { + public: int null_value_; double number_value_; ::google::protobuf::internal::ArenaStringPtr string_value_; bool bool_value_; const ::google::protobuf::Struct* struct_value_; const ::google::protobuf::ListValue* list_value_; -} Value_default_oneof_instance_; +} _Value_default_instance_; +class ListValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<ListValue> { +} _ListValue_default_instance_; -} // namespace +namespace protobuf_google_2fprotobuf_2fstruct_2eproto { -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, fields_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _internal_metadata_), - ~0u, // no _extensions_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _oneof_case_[0]), - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), null_value_), - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), number_value_), - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), string_value_), - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), bool_value_), - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), struct_value_), - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), list_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, kind_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, values_), - }; - return offsets; -} +namespace { + +::google::protobuf::Metadata file_level_metadata[4]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; + +} // namespace + +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, fields_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _oneof_case_[0]), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&_Value_default_instance_), null_value_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&_Value_default_instance_), number_value_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&_Value_default_instance_), string_value_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&_Value_default_instance_), bool_value_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&_Value_default_instance_), struct_value_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&_Value_default_instance_), list_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, kind_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, values_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(Struct)}, @@ -76,19 +73,19 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 16, -1, sizeof(ListValue)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_Struct_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_Value_default_instance_), &Value_default_oneof_instance_}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_ListValue_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_Struct_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_Value_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_ListValue_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/struct.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto(), factory, + "google/protobuf/struct.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, file_level_enum_descriptors, NULL); } @@ -101,7 +98,7 @@ void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); - const ::google::protobuf::Descriptor* Struct_FieldsEntry_descriptor = file_level_metadata[0].descriptor; + const ::google::protobuf::Descriptor* Struct_FieldsEntry_descriptor = protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[0].descriptor; ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Struct_FieldsEntry_descriptor, ::google::protobuf::internal::MapEntry< @@ -115,7 +112,7 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto() { +void TableStruct::Shutdown() { _Struct_default_instance_.Shutdown(); delete file_level_metadata[1].reflection; _Value_default_instance_.Shutdown(); @@ -124,30 +121,30 @@ void protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto() { delete file_level_metadata[3].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _Struct_default_instance_.DefaultConstruct(); _Value_default_instance_.DefaultConstruct(); _ListValue_default_instance_.DefaultConstruct(); - Value_default_oneof_instance_.null_value_ = 0; - Value_default_oneof_instance_.number_value_ = 0; - Value_default_oneof_instance_.string_value_.UnsafeSetDefault( + _Value_default_instance_.null_value_ = 0; + _Value_default_instance_.number_value_ = 0; + _Value_default_instance_.string_value_.UnsafeSetDefault( &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - Value_default_oneof_instance_.bool_value_ = false; - Value_default_oneof_instance_.struct_value_ = const_cast< ::google::protobuf::Struct*>( + _Value_default_instance_.bool_value_ = false; + _Value_default_instance_.struct_value_ = const_cast< ::google::protobuf::Struct*>( ::google::protobuf::Struct::internal_default_instance()); - Value_default_oneof_instance_.list_value_ = const_cast< ::google::protobuf::ListValue*>( + _Value_default_instance_.list_value_ = const_cast< ::google::protobuf::ListValue*>( ::google::protobuf::ListValue::internal_default_instance()); } -void protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n\034google/protobuf/struct.proto\022\017google.p" "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo" @@ -171,23 +168,25 @@ void protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_impl() { descriptor, 641); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/struct.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fstruct_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fstruct_2eproto + const ::google::protobuf::EnumDescriptor* NullValue_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[0]; + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_enum_descriptors[0]; } bool NullValue_IsValid(int value) { switch (value) { @@ -213,7 +212,7 @@ const int Struct::kFieldsFieldNumber; Struct::Struct() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Struct) @@ -223,7 +222,7 @@ Struct::Struct(::google::protobuf::Arena* arena) _internal_metadata_(arena), fields_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -234,9 +233,9 @@ Struct::Struct(const Struct& from) _internal_metadata_(NULL), _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); - const ::google::protobuf::Descriptor*& Struct_FieldsEntry_descriptor = file_level_metadata[0].descriptor; + const ::google::protobuf::Descriptor*& Struct_FieldsEntry_descriptor = protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[0].descriptor; fields_.SetAssignDescriptorCallback( - protobuf_AssignDescriptorsOnce); + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce); fields_.SetEntryDescriptor( &Struct_FieldsEntry_descriptor); fields_.MergeFrom(from.fields_); @@ -244,9 +243,9 @@ Struct::Struct(const Struct& from) } void Struct::SharedCtor() { - const ::google::protobuf::Descriptor*& Struct_FieldsEntry_descriptor = file_level_metadata[0].descriptor; + const ::google::protobuf::Descriptor*& Struct_FieldsEntry_descriptor = protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[0].descriptor; fields_.SetAssignDescriptorCallback( - protobuf_AssignDescriptorsOnce); + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce); fields_.SetEntryDescriptor( &Struct_FieldsEntry_descriptor); _cached_size_ = 0; @@ -277,12 +276,12 @@ void Struct::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Struct::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1].descriptor; + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[1].descriptor; } const Struct& Struct::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -307,7 +306,8 @@ bool Struct::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // map<string, .google.protobuf.Value> fields = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(input->IncrementRecursionDepth()); Struct_FieldsEntry::Parser< ::google::protobuf::internal::MapField< ::std::string, ::google::protobuf::Value, @@ -412,7 +412,7 @@ void Struct::SerializeWithCachedSizes( ::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct) // map<string, .google.protobuf.Value> fields = 1; if (!this->fields().empty()) { @@ -573,8 +573,8 @@ void Struct::InternalSwap(Struct* other) { } ::google::protobuf::Metadata Struct::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1]; + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[1]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -614,7 +614,7 @@ const int Value::kListValueFieldNumber; Value::Value() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Value) @@ -623,7 +623,7 @@ Value::Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -700,12 +700,12 @@ void Value::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Value::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2].descriptor; + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[2].descriptor; } const Value& Value::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -770,7 +770,8 @@ bool Value::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // .google.protobuf.NullValue null_value = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -784,7 +785,8 @@ bool Value::MergePartialFromCodedStream( // double number_value = 2; case 2: { - if (tag == 17u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(17u)) { clear_kind(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( @@ -798,7 +800,8 @@ bool Value::MergePartialFromCodedStream( // string string_value = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_string_value())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -813,7 +816,8 @@ bool Value::MergePartialFromCodedStream( // bool bool_value = 4; case 4: { - if (tag == 32u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(32u)) { clear_kind(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -827,7 +831,8 @@ bool Value::MergePartialFromCodedStream( // .google.protobuf.Struct struct_value = 5; case 5: { - if (tag == 42u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_struct_value())); } else { @@ -838,7 +843,8 @@ bool Value::MergePartialFromCodedStream( // .google.protobuf.ListValue list_value = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_list_value())); } else { @@ -914,7 +920,7 @@ void Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value) // .google.protobuf.NullValue null_value = 1; if (has_null_value()) { @@ -1108,8 +1114,8 @@ void Value::InternalSwap(Value* other) { } ::google::protobuf::Metadata Value::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2]; + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[2]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1507,7 +1513,7 @@ const int ListValue::kValuesFieldNumber; ListValue::ListValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ListValue) @@ -1517,7 +1523,7 @@ ListValue::ListValue(::google::protobuf::Arena* arena) _internal_metadata_(arena), values_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -1561,12 +1567,12 @@ void ListValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ListValue::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3].descriptor; + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[3].descriptor; } const ListValue& ListValue::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); + protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1591,7 +1597,8 @@ bool ListValue::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .google.protobuf.Value values = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_values())); @@ -1637,7 +1644,7 @@ void ListValue::SerializeWithCachedSizes( ::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue) // repeated .google.protobuf.Value values = 1; for (unsigned int i = 0, n = this->values_size(); i < n; i++) { @@ -1737,8 +1744,8 @@ void ListValue::InternalSwap(ListValue* other) { } ::google::protobuf::Metadata ListValue::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3]; + protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[3]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h index 1037d84c..043f0c32 100644 --- a/src/google/protobuf/struct.pb.h +++ b/src/google/protobuf/struct.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -48,9 +49,16 @@ LIBPROTOBUF_EXPORT extern ValueDefaultTypeInternal _Value_default_instance_; namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2fstruct_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fstruct_2eproto enum NullValue { NULL_VALUE = 0, @@ -127,7 +135,8 @@ class LIBPROTOBUF_EXPORT Struct : public ::google::protobuf::Message /* @@protoc bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -184,11 +193,7 @@ class LIBPROTOBUF_EXPORT Struct : public ::google::protobuf::Message /* @@protoc ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, 0 > fields_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -252,7 +257,8 @@ class LIBPROTOBUF_EXPORT Value : public ::google::protobuf::Message /* @@protoc_ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -390,11 +396,7 @@ class LIBPROTOBUF_EXPORT Value : public ::google::protobuf::Message /* @@protoc_ mutable int _cached_size_; ::google::protobuf::uint32 _oneof_case_[1]; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -448,7 +450,8 @@ class LIBPROTOBUF_EXPORT ListValue : public ::google::protobuf::Message /* @@pro bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -497,11 +500,7 @@ class LIBPROTOBUF_EXPORT ListValue : public ::google::protobuf::Message /* @@pro typedef void DestructorSkippable_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value > values_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; }; // =================================================================== diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h index c25492f3..75aee306 100644 --- a/src/google/protobuf/stubs/atomicops.h +++ b/src/google/protobuf/stubs/atomicops.h @@ -194,14 +194,6 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); #elif defined(GOOGLE_PROTOBUF_OS_AIX) #include <google/protobuf/stubs/atomicops_internals_power.h> -// Apple. -#elif defined(GOOGLE_PROTOBUF_OS_APPLE) -#if __has_feature(cxx_atomic) || _GNUC_VER >= 407 -#include <google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h> -#else // __has_feature(cxx_atomic) || _GNUC_VER >= 407 -#include <google/protobuf/stubs/atomicops_internals_macosx.h> -#endif // __has_feature(cxx_atomic) || _GNUC_VER >= 407 - // GCC. #elif defined(__GNUC__) #if defined(GOOGLE_PROTOBUF_ARCH_IA32) || defined(GOOGLE_PROTOBUF_ARCH_X64) @@ -221,6 +213,9 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); #elif defined(GOOGLE_PROTOBUF_ARCH_POWER) #include <google/protobuf/stubs/atomicops_internals_power.h> #elif defined(__native_client__) +// The static_asserts in the C++11 atomics implementation cause it to fail +// with certain compilers, e.g. nvcc on macOS. Don't use elsewhere unless +// the TODO in that file is addressed. #include <google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h> #elif defined(GOOGLE_PROTOBUF_ARCH_PPC) #include <google/protobuf/stubs/atomicops_internals_ppc_gcc.h> diff --git a/src/google/protobuf/stubs/atomicops_internals_macosx.h b/src/google/protobuf/stubs/atomicops_internals_macosx.h deleted file mode 100644 index c242ef73..00000000 --- a/src/google/protobuf/stubs/atomicops_internals_macosx.h +++ /dev/null @@ -1,225 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2012 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This file is an internal atomic implementation, use atomicops.h instead. - -#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MACOSX_H_ -#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MACOSX_H_ - -#include <libkern/OSAtomic.h> - -namespace google { -namespace protobuf { -namespace internal { - -inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, - Atomic32 old_value, - Atomic32 new_value) { - Atomic32 prev_value; - do { - if (OSAtomicCompareAndSwap32(old_value, new_value, - const_cast<Atomic32*>(ptr))) { - return old_value; - } - prev_value = *ptr; - } while (prev_value == old_value); - return prev_value; -} - -inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, - Atomic32 new_value) { - Atomic32 old_value; - do { - old_value = *ptr; - } while (!OSAtomicCompareAndSwap32(old_value, new_value, - const_cast<Atomic32*>(ptr))); - return old_value; -} - -inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, - Atomic32 increment) { - return OSAtomicAdd32(increment, const_cast<Atomic32*>(ptr)); -} - -inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, - Atomic32 increment) { - return OSAtomicAdd32Barrier(increment, const_cast<Atomic32*>(ptr)); -} - -inline void MemoryBarrierInternal() { - OSMemoryBarrier(); -} - -inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, - Atomic32 old_value, - Atomic32 new_value) { - Atomic32 prev_value; - do { - if (OSAtomicCompareAndSwap32Barrier(old_value, new_value, - const_cast<Atomic32*>(ptr))) { - return old_value; - } - prev_value = *ptr; - } while (prev_value == old_value); - return prev_value; -} - -inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, - Atomic32 old_value, - Atomic32 new_value) { - return Acquire_CompareAndSwap(ptr, old_value, new_value); -} - -inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { - *ptr = value; -} - -inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { - *ptr = value; - MemoryBarrierInternal(); -} - -inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { - MemoryBarrierInternal(); - *ptr = value; -} - -inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { - return *ptr; -} - -inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { - Atomic32 value = *ptr; - MemoryBarrierInternal(); - return value; -} - -inline Atomic32 Release_Load(volatile const Atomic32* ptr) { - MemoryBarrierInternal(); - return *ptr; -} - -#ifdef __LP64__ - -// 64-bit implementation on 64-bit platform - -inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, - Atomic64 old_value, - Atomic64 new_value) { - Atomic64 prev_value; - do { - if (OSAtomicCompareAndSwap64(old_value, new_value, - reinterpret_cast<volatile int64_t*>(ptr))) { - return old_value; - } - prev_value = *ptr; - } while (prev_value == old_value); - return prev_value; -} - -inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, - Atomic64 new_value) { - Atomic64 old_value; - do { - old_value = *ptr; - } while (!OSAtomicCompareAndSwap64(old_value, new_value, - reinterpret_cast<volatile int64_t*>(ptr))); - return old_value; -} - -inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, - Atomic64 increment) { - return OSAtomicAdd64(increment, reinterpret_cast<volatile int64_t*>(ptr)); -} - -inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, - Atomic64 increment) { - return OSAtomicAdd64Barrier(increment, - reinterpret_cast<volatile int64_t*>(ptr)); -} - -inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, - Atomic64 old_value, - Atomic64 new_value) { - Atomic64 prev_value; - do { - if (OSAtomicCompareAndSwap64Barrier( - old_value, new_value, reinterpret_cast<volatile int64_t*>(ptr))) { - return old_value; - } - prev_value = *ptr; - } while (prev_value == old_value); - return prev_value; -} - -inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, - Atomic64 old_value, - Atomic64 new_value) { - // The lib kern interface does not distinguish between - // Acquire and Release memory barriers; they are equivalent. - return Acquire_CompareAndSwap(ptr, old_value, new_value); -} - -inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) { - *ptr = value; -} - -inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) { - *ptr = value; - MemoryBarrierInternal(); -} - -inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) { - MemoryBarrierInternal(); - *ptr = value; -} - -inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) { - return *ptr; -} - -inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { - Atomic64 value = *ptr; - MemoryBarrierInternal(); - return value; -} - -inline Atomic64 Release_Load(volatile const Atomic64* ptr) { - MemoryBarrierInternal(); - return *ptr; -} - -#endif // defined(__LP64__) - -} // namespace internal -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MACOSX_H_ diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index c595e205..d2611498 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -96,27 +96,27 @@ namespace internal { // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 3001000 +#define GOOGLE_PROTOBUF_VERSION 3002000 // A suffix string for alpha, beta or rc releases. Empty for stable releases. #define GOOGLE_PROTOBUF_VERSION_SUFFIX "" // The minimum library version which works with the current version of the // headers. -#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3001000 +#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3002000 // The minimum header version which works with the current version of // the library. This constant should only be used by protoc's C++ code // generator. -static const int kMinHeaderVersionForLibrary = 3001000; +static const int kMinHeaderVersionForLibrary = 3002000; // The minimum protoc version which works with the current version of the // headers. -#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3001000 +#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3002000 // The minimum header version which works with the current version of // protoc. This constant should only be used in VerifyVersion(). -static const int kMinHeaderVersionForProtoc = 3001000; +static const int kMinHeaderVersionForProtoc = 3002000; // Verifies that the headers and libraries are compatible. Use the macro // below to call this. diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 72adba6d..d37e8130 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -454,7 +454,6 @@ class BigEndian { } }; - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc index e3d908ec..778b878e 100644 --- a/src/google/protobuf/text_format.cc +++ b/src/google/protobuf/text_format.cc @@ -1646,54 +1646,6 @@ void TextFormat::Printer::PrintFieldValueToString( PrintFieldValue(message, message.GetReflection(), field, index, generator); } -class MapEntryMessageComparator { - public: - explicit MapEntryMessageComparator(const Descriptor* descriptor) - : field_(descriptor->field(0)) {} - - bool operator()(const Message* a, const Message* b) { - const Reflection* reflection = a->GetReflection(); - switch (field_->cpp_type()) { - case FieldDescriptor::CPPTYPE_BOOL: { - bool first = reflection->GetBool(*a, field_); - bool second = reflection->GetBool(*b, field_); - return first < second; - } - case FieldDescriptor::CPPTYPE_INT32: { - int32 first = reflection->GetInt32(*a, field_); - int32 second = reflection->GetInt32(*b, field_); - return first < second; - } - case FieldDescriptor::CPPTYPE_INT64: { - int64 first = reflection->GetInt64(*a, field_); - int64 second = reflection->GetInt64(*b, field_); - return first < second; - } - case FieldDescriptor::CPPTYPE_UINT32: { - uint32 first = reflection->GetUInt32(*a, field_); - uint32 second = reflection->GetUInt32(*b, field_); - return first < second; - } - case FieldDescriptor::CPPTYPE_UINT64: { - uint64 first = reflection->GetUInt64(*a, field_); - uint64 second = reflection->GetUInt64(*b, field_); - return first < second; - } - case FieldDescriptor::CPPTYPE_STRING: { - string first = reflection->GetString(*a, field_); - string second = reflection->GetString(*b, field_); - return first < second; - } - default: - GOOGLE_LOG(DFATAL) << "Invalid key for map field."; - return true; - } - } - - private: - const FieldDescriptor* field_; -}; - void TextFormat::Printer::PrintField(const Message& message, const Reflection* reflection, const FieldDescriptor* field, @@ -1714,19 +1666,10 @@ void TextFormat::Printer::PrintField(const Message& message, count = 1; } - std::vector<const Message*> sorted_map_field; - if (field->is_map()) { - const RepeatedPtrField<Message>& map_field = - reflection->GetRepeatedPtrField<Message>(message, field); - for (RepeatedPtrField<Message>::const_pointer_iterator it = - map_field.pointer_begin(); - it != map_field.pointer_end(); ++it) { - sorted_map_field.push_back(*it); - } - - MapEntryMessageComparator comparator(field->message_type()); - std::stable_sort(sorted_map_field.begin(), sorted_map_field.end(), - comparator); + std::vector<const Message*> map_entries; + const bool is_map = field->is_map(); + if (is_map) { + map_entries = DynamicMapSorter::Sort(message, count, reflection, field); } for (int j = 0; j < count; ++j) { @@ -1739,9 +1682,8 @@ void TextFormat::Printer::PrintField(const Message& message, custom_printers_, field, default_field_value_printer_.get()); const Message& sub_message = field->is_repeated() - ? (field->is_map() - ? *sorted_map_field[j] - : reflection->GetRepeatedMessage(message, field, j)) + ? (is_map ? *map_entries[j] + : reflection->GetRepeatedMessage(message, field, j)) : reflection->GetMessage(message, field); generator.Print( printer->PrintMessageStart( diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index 482c0e39..e21117b6 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -19,8 +19,11 @@ namespace google { namespace protobuf { -class TimestampDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Timestamp> {}; -TimestampDefaultTypeInternal _Timestamp_default_instance_; +class TimestampDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Timestamp> { +} _Timestamp_default_instance_; + +namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto { + namespace { @@ -28,35 +31,30 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftimestamp_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftimestamp_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, seconds_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, nanos_), - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, seconds_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, nanos_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(Timestamp)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_Timestamp_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_Timestamp_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/timestamp.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2ftimestamp_2eproto(), factory, + "google/protobuf/timestamp.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -73,24 +71,24 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto() { +void TableStruct::Shutdown() { _Timestamp_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _Timestamp_default_instance_.DefaultConstruct(); } -void protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n\037google/protobuf/timestamp.proto\022\017googl" "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003" @@ -103,20 +101,22 @@ void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto_impl() { descriptor, 231); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/timestamp.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2ftimestamp_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto + // =================================================================== @@ -128,7 +128,7 @@ const int Timestamp::kNanosFieldNumber; Timestamp::Timestamp() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); + protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Timestamp) @@ -137,7 +137,7 @@ Timestamp::Timestamp(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); + protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -185,12 +185,12 @@ void Timestamp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Timestamp::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2ftimestamp_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[0].descriptor; } const Timestamp& Timestamp::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); + protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -216,7 +216,8 @@ bool Timestamp::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // int64 seconds = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( @@ -229,7 +230,8 @@ bool Timestamp::MergePartialFromCodedStream( // int32 nanos = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -279,7 +281,7 @@ void Timestamp::SerializeWithCachedSizes( ::google::protobuf::uint8* Timestamp::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp) // int64 seconds = 1; if (this->seconds() != 0) { @@ -391,8 +393,8 @@ void Timestamp::InternalSwap(Timestamp* other) { } ::google::protobuf::Metadata Timestamp::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2ftimestamp_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h index 63875c68..e6fc09a1 100644 --- a/src/google/protobuf/timestamp.pb.h +++ b/src/google/protobuf/timestamp.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -39,9 +40,16 @@ LIBPROTOBUF_EXPORT extern TimestampDefaultTypeInternal _Timestamp_default_instan namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto // =================================================================== @@ -95,7 +103,8 @@ class LIBPROTOBUF_EXPORT Timestamp : public ::google::protobuf::Message /* @@pro bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -145,11 +154,7 @@ class LIBPROTOBUF_EXPORT Timestamp : public ::google::protobuf::Message /* @@pro ::google::protobuf::int64 seconds_; ::google::protobuf::int32 nanos_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftimestamp_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2ftimestamp_2eproto::TableStruct; }; // =================================================================== diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index 6e41dde8..8bf57ecf 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -19,16 +19,19 @@ namespace google { namespace protobuf { -class TypeDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Type> {}; -TypeDefaultTypeInternal _Type_default_instance_; -class FieldDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Field> {}; -FieldDefaultTypeInternal _Field_default_instance_; -class EnumDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Enum> {}; -EnumDefaultTypeInternal _Enum_default_instance_; -class EnumValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumValue> {}; -EnumValueDefaultTypeInternal _EnumValue_default_instance_; -class OptionDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Option> {}; -OptionDefaultTypeInternal _Option_default_instance_; +class TypeDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Type> { +} _Type_default_instance_; +class FieldDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Field> { +} _Field_default_instance_; +class EnumDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Enum> { +} _Enum_default_instance_; +class EnumValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumValue> { +} _EnumValue_default_instance_; +class OptionDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Option> { +} _Option_default_instance_; + +namespace protobuf_google_2fprotobuf_2ftype_2eproto { + namespace { @@ -37,59 +40,54 @@ const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[3]; } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftype_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftype_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, fields_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, oneofs_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, source_context_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, syntax_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, kind_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, cardinality_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, number_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, type_url_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, oneof_index_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, packed_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, json_name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, default_value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, enumvalue_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, source_context_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, syntax_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, number_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, options_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, value_), - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, oneofs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, source_context_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, syntax_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, kind_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, cardinality_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, type_url_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, oneof_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, packed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, json_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, default_value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, enumvalue_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, source_context_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, syntax_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, options_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, value_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(Type)}, @@ -99,21 +97,21 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 40, -1, sizeof(Option)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_Type_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_Field_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_Enum_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValue_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_Option_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_Type_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_Field_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_Enum_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValue_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_Option_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/type.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2ftype_2eproto(), factory, + "google/protobuf/type.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, file_level_enum_descriptors, NULL); } @@ -130,7 +128,7 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto() { +void TableStruct::Shutdown() { _Type_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; _Field_default_instance_.Shutdown(); @@ -143,12 +141,12 @@ void protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto() { delete file_level_metadata[4].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; - ::google::protobuf::protobuf_InitDefaults_google_2fprotobuf_2fany_2eproto(); - ::google::protobuf::protobuf_InitDefaults_google_2fprotobuf_2fsource_5fcontext_2eproto(); ::google::protobuf::internal::InitProtobufDefaults(); + ::google::protobuf::protobuf_google_2fprotobuf_2fany_2eproto::InitDefaults(); + ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaults(); _Type_default_instance_.DefaultConstruct(); _Field_default_instance_.DefaultConstruct(); _Enum_default_instance_.DefaultConstruct(); @@ -162,12 +160,12 @@ void protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto_impl() { ::google::protobuf::Any::internal_default_instance()); } -void protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n\032google/protobuf/type.proto\022\017google.pro" "tobuf\032\031google/protobuf/any.proto\032$google" @@ -214,25 +212,27 @@ void protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_impl() { descriptor, 1594); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/type.proto", &protobuf_RegisterTypes); - ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); - ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto(); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto); + ::google::protobuf::protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptors(); + ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors(); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2ftype_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2ftype_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2ftype_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2ftype_2eproto + const ::google::protobuf::EnumDescriptor* Field_Kind_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[0]; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_enum_descriptors[0]; } bool Field_Kind_IsValid(int value) { switch (value) { @@ -286,8 +286,8 @@ const Field_Kind Field::Kind_MAX; const int Field::Kind_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 const ::google::protobuf::EnumDescriptor* Field_Cardinality_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[1]; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_enum_descriptors[1]; } bool Field_Cardinality_IsValid(int value) { switch (value) { @@ -311,8 +311,8 @@ const Field_Cardinality Field::Cardinality_MAX; const int Field::Cardinality_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 const ::google::protobuf::EnumDescriptor* Syntax_descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_enum_descriptors[2]; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_enum_descriptors[2]; } bool Syntax_IsValid(int value) { switch (value) { @@ -372,7 +372,7 @@ const int Type::kSyntaxFieldNumber; Type::Type() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Type) @@ -384,7 +384,7 @@ Type::Type(::google::protobuf::Arena* arena) oneofs_(arena), options_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -448,12 +448,12 @@ void Type::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Type::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[0].descriptor; } const Type& Type::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -486,7 +486,8 @@ bool Type::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -501,7 +502,8 @@ bool Type::MergePartialFromCodedStream( // repeated .google.protobuf.Field fields = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_fields())); @@ -514,7 +516,8 @@ bool Type::MergePartialFromCodedStream( // repeated string oneofs = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_oneofs())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -530,7 +533,8 @@ bool Type::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); @@ -543,7 +547,8 @@ bool Type::MergePartialFromCodedStream( // .google.protobuf.SourceContext source_context = 5; case 5: { - if (tag == 42u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_source_context())); } else { @@ -554,7 +559,8 @@ bool Type::MergePartialFromCodedStream( // .google.protobuf.Syntax syntax = 6; case 6: { - if (tag == 48u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(48u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -607,7 +613,7 @@ void Type::SerializeWithCachedSizes( } // repeated string oneofs = 3; - for (int i = 0; i < this->oneofs_size(); i++) { + for (int i = 0, n = this->oneofs_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->oneofs(i).data(), this->oneofs(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, @@ -639,7 +645,7 @@ void Type::SerializeWithCachedSizes( ::google::protobuf::uint8* Type::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Type) // string name = 1; if (this->name().size() > 0) { @@ -660,7 +666,7 @@ void Type::SerializeWithCachedSizes( } // repeated string oneofs = 3; - for (int i = 0; i < this->oneofs_size(); i++) { + for (int i = 0, n = this->oneofs_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->oneofs(i).data(), this->oneofs(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, @@ -711,7 +717,7 @@ size_t Type::ByteSizeLong() const { // repeated string oneofs = 3; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->oneofs_size()); - for (int i = 0; i < this->oneofs_size(); i++) { + for (int i = 0, n = this->oneofs_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->oneofs(i)); } @@ -835,8 +841,8 @@ void Type::InternalSwap(Type* other) { } ::google::protobuf::Metadata Type::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -957,6 +963,12 @@ void Type::set_oneofs(int index, const ::std::string& value) { // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs) oneofs_.Mutable(index)->assign(value); } +#if LANG_CXX11 +void Type::set_oneofs(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs) + oneofs_.Mutable(index)->assign(std::move(value)); +} +#endif void Type::set_oneofs(int index, const char* value) { oneofs_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.Type.oneofs) @@ -974,6 +986,12 @@ void Type::add_oneofs(const ::std::string& value) { oneofs_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs) } +#if LANG_CXX11 +void Type::add_oneofs(::std::string&& value) { + oneofs_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs) +} +#endif void Type::add_oneofs(const char* value) { oneofs_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.Type.oneofs) @@ -1108,7 +1126,7 @@ const int Field::kDefaultValueFieldNumber; Field::Field() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Field) @@ -1118,7 +1136,7 @@ Field::Field(::google::protobuf::Arena* arena) _internal_metadata_(arena), options_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -1195,12 +1213,12 @@ void Field::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Field::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1].descriptor; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[1].descriptor; } const Field& Field::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1231,7 +1249,8 @@ bool Field::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // .google.protobuf.Field.Kind kind = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -1245,7 +1264,8 @@ bool Field::MergePartialFromCodedStream( // .google.protobuf.Field.Cardinality cardinality = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -1259,7 +1279,8 @@ bool Field::MergePartialFromCodedStream( // int32 number = 3; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -1272,7 +1293,8 @@ bool Field::MergePartialFromCodedStream( // string name = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1287,7 +1309,8 @@ bool Field::MergePartialFromCodedStream( // string type_url = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1302,7 +1325,8 @@ bool Field::MergePartialFromCodedStream( // int32 oneof_index = 7; case 7: { - if (tag == 56u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(56u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -1315,7 +1339,8 @@ bool Field::MergePartialFromCodedStream( // bool packed = 8; case 8: { - if (tag == 64u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(64u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -1328,7 +1353,8 @@ bool Field::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 9; case 9: { - if (tag == 74u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(74u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); @@ -1341,7 +1367,8 @@ bool Field::MergePartialFromCodedStream( // string json_name = 10; case 10: { - if (tag == 82u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(82u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_json_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1356,7 +1383,8 @@ bool Field::MergePartialFromCodedStream( // string default_value = 11; case 11: { - if (tag == 90u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(90u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_default_value())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1471,7 +1499,7 @@ void Field::SerializeWithCachedSizes( ::google::protobuf::uint8* Field::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Field) // .google.protobuf.Field.Kind kind = 1; if (this->kind() != 0) { @@ -1737,8 +1765,8 @@ void Field::InternalSwap(Field* other) { } ::google::protobuf::Metadata Field::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1]; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[1]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -2156,7 +2184,7 @@ const int Enum::kSyntaxFieldNumber; Enum::Enum() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Enum) @@ -2167,7 +2195,7 @@ Enum::Enum(::google::protobuf::Arena* arena) enumvalue_(arena), options_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -2230,12 +2258,12 @@ void Enum::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Enum::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2].descriptor; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[2].descriptor; } const Enum& Enum::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -2267,7 +2295,8 @@ bool Enum::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -2282,7 +2311,8 @@ bool Enum::MergePartialFromCodedStream( // repeated .google.protobuf.EnumValue enumvalue = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_enumvalue())); @@ -2295,7 +2325,8 @@ bool Enum::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); @@ -2308,7 +2339,8 @@ bool Enum::MergePartialFromCodedStream( // .google.protobuf.SourceContext source_context = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_source_context())); } else { @@ -2319,7 +2351,8 @@ bool Enum::MergePartialFromCodedStream( // .google.protobuf.Syntax syntax = 5; case 5: { - if (tag == 40u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -2394,7 +2427,7 @@ void Enum::SerializeWithCachedSizes( ::google::protobuf::uint8* Enum::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Enum) // string name = 1; if (this->name().size() > 0) { @@ -2570,8 +2603,8 @@ void Enum::InternalSwap(Enum* other) { } ::google::protobuf::Metadata Enum::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2]; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[2]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -2781,7 +2814,7 @@ const int EnumValue::kOptionsFieldNumber; EnumValue::EnumValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValue) @@ -2791,7 +2824,7 @@ EnumValue::EnumValue(::google::protobuf::Arena* arena) _internal_metadata_(arena), options_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -2844,12 +2877,12 @@ void EnumValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumValue::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3].descriptor; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[3].descriptor; } const EnumValue& EnumValue::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -2876,7 +2909,8 @@ bool EnumValue::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -2891,7 +2925,8 @@ bool EnumValue::MergePartialFromCodedStream( // int32 number = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -2904,7 +2939,8 @@ bool EnumValue::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); @@ -2965,7 +3001,7 @@ void EnumValue::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValue) // string name = 1; if (this->name().size() > 0) { @@ -3103,8 +3139,8 @@ void EnumValue::InternalSwap(EnumValue* other) { } ::google::protobuf::Metadata EnumValue::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3]; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[3]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -3265,7 +3301,7 @@ const int Option::kValueFieldNumber; Option::Option() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Option) @@ -3274,7 +3310,7 @@ Option::Option(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -3333,12 +3369,12 @@ void Option::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Option::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[4].descriptor; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[4].descriptor; } const Option& Option::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -3367,7 +3403,8 @@ bool Option::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -3382,7 +3419,8 @@ bool Option::MergePartialFromCodedStream( // .google.protobuf.Any value = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_value())); } else { @@ -3436,7 +3474,7 @@ void Option::SerializeWithCachedSizes( ::google::protobuf::uint8* Option::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Option) // string name = 1; if (this->name().size() > 0) { @@ -3556,8 +3594,8 @@ void Option::InternalSwap(Option* other) { } ::google::protobuf::Metadata Option::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[4]; + protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[4]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h index 73fa35a3..ae816008 100644 --- a/src/google/protobuf/type.pb.h +++ b/src/google/protobuf/type.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -60,9 +61,16 @@ LIBPROTOBUF_EXPORT extern TypeDefaultTypeInternal _Type_default_instance_; namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2ftype_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2ftype_2eproto enum Field_Kind { Field_Kind_TYPE_UNKNOWN = 0, @@ -198,7 +206,8 @@ class LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_i bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -226,20 +235,6 @@ class LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_i // accessors ------------------------------------------------------- - // string name = 1; - void clear_name(); - static const int kNameFieldNumber = 1; - const ::std::string& name() const; - void set_name(const ::std::string& value); - void set_name(const char* value); - void set_name(const char* value, size_t size); - ::std::string* mutable_name(); - ::std::string* release_name(); - void set_allocated_name(::std::string* name); - ::std::string* unsafe_arena_release_name(); - void unsafe_arena_set_allocated_name( - ::std::string* name); - // repeated .google.protobuf.Field fields = 2; int fields_size() const; void clear_fields(); @@ -259,10 +254,16 @@ class LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_i const ::std::string& oneofs(int index) const; ::std::string* mutable_oneofs(int index); void set_oneofs(int index, const ::std::string& value); + #if LANG_CXX11 + void set_oneofs(int index, ::std::string&& value); + #endif void set_oneofs(int index, const char* value); void set_oneofs(int index, const char* value, size_t size); ::std::string* add_oneofs(); void add_oneofs(const ::std::string& value); + #if LANG_CXX11 + void add_oneofs(::std::string&& value); + #endif void add_oneofs(const char* value); void add_oneofs(const char* value, size_t size); const ::google::protobuf::RepeatedPtrField< ::std::string>& oneofs() const; @@ -280,6 +281,20 @@ class LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_i const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& options() const; + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); + // .google.protobuf.SourceContext source_context = 5; bool has_source_context() const; void clear_source_context(); @@ -316,11 +331,7 @@ class LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_i ::google::protobuf::SourceContext* source_context_; int syntax_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftype_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -374,7 +385,8 @@ class LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_ bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -492,23 +504,17 @@ class LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_ // accessors ------------------------------------------------------- - // .google.protobuf.Field.Kind kind = 1; - void clear_kind(); - static const int kKindFieldNumber = 1; - ::google::protobuf::Field_Kind kind() const; - void set_kind(::google::protobuf::Field_Kind value); - - // .google.protobuf.Field.Cardinality cardinality = 2; - void clear_cardinality(); - static const int kCardinalityFieldNumber = 2; - ::google::protobuf::Field_Cardinality cardinality() const; - void set_cardinality(::google::protobuf::Field_Cardinality value); - - // int32 number = 3; - void clear_number(); - static const int kNumberFieldNumber = 3; - ::google::protobuf::int32 number() const; - void set_number(::google::protobuf::int32 value); + // repeated .google.protobuf.Option options = 9; + int options_size() const; + void clear_options(); + static const int kOptionsFieldNumber = 9; + const ::google::protobuf::Option& options(int index) const; + ::google::protobuf::Option* mutable_options(int index); + ::google::protobuf::Option* add_options(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* + mutable_options(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& + options() const; // string name = 4; void clear_name(); @@ -538,30 +544,6 @@ class LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_ void unsafe_arena_set_allocated_type_url( ::std::string* type_url); - // int32 oneof_index = 7; - void clear_oneof_index(); - static const int kOneofIndexFieldNumber = 7; - ::google::protobuf::int32 oneof_index() const; - void set_oneof_index(::google::protobuf::int32 value); - - // bool packed = 8; - void clear_packed(); - static const int kPackedFieldNumber = 8; - bool packed() const; - void set_packed(bool value); - - // repeated .google.protobuf.Option options = 9; - int options_size() const; - void clear_options(); - static const int kOptionsFieldNumber = 9; - const ::google::protobuf::Option& options(int index) const; - ::google::protobuf::Option* mutable_options(int index); - ::google::protobuf::Option* add_options(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* - mutable_options(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& - options() const; - // string json_name = 10; void clear_json_name(); static const int kJsonNameFieldNumber = 10; @@ -590,6 +572,36 @@ class LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_ void unsafe_arena_set_allocated_default_value( ::std::string* default_value); + // .google.protobuf.Field.Kind kind = 1; + void clear_kind(); + static const int kKindFieldNumber = 1; + ::google::protobuf::Field_Kind kind() const; + void set_kind(::google::protobuf::Field_Kind value); + + // .google.protobuf.Field.Cardinality cardinality = 2; + void clear_cardinality(); + static const int kCardinalityFieldNumber = 2; + ::google::protobuf::Field_Cardinality cardinality() const; + void set_cardinality(::google::protobuf::Field_Cardinality value); + + // int32 number = 3; + void clear_number(); + static const int kNumberFieldNumber = 3; + ::google::protobuf::int32 number() const; + void set_number(::google::protobuf::int32 value); + + // int32 oneof_index = 7; + void clear_oneof_index(); + static const int kOneofIndexFieldNumber = 7; + ::google::protobuf::int32 oneof_index() const; + void set_oneof_index(::google::protobuf::int32 value); + + // bool packed = 8; + void clear_packed(); + static const int kPackedFieldNumber = 8; + bool packed() const; + void set_packed(bool value); + // @@protoc_insertion_point(class_scope:google.protobuf.Field) private: @@ -608,11 +620,7 @@ class LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_ ::google::protobuf::int32 oneof_index_; bool packed_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftype_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -666,7 +674,8 @@ class LIBPROTOBUF_EXPORT Enum : public ::google::protobuf::Message /* @@protoc_i bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -694,20 +703,6 @@ class LIBPROTOBUF_EXPORT Enum : public ::google::protobuf::Message /* @@protoc_i // accessors ------------------------------------------------------- - // string name = 1; - void clear_name(); - static const int kNameFieldNumber = 1; - const ::std::string& name() const; - void set_name(const ::std::string& value); - void set_name(const char* value); - void set_name(const char* value, size_t size); - ::std::string* mutable_name(); - ::std::string* release_name(); - void set_allocated_name(::std::string* name); - ::std::string* unsafe_arena_release_name(); - void unsafe_arena_set_allocated_name( - ::std::string* name); - // repeated .google.protobuf.EnumValue enumvalue = 2; int enumvalue_size() const; void clear_enumvalue(); @@ -732,6 +727,20 @@ class LIBPROTOBUF_EXPORT Enum : public ::google::protobuf::Message /* @@protoc_i const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& options() const; + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); + // .google.protobuf.SourceContext source_context = 4; bool has_source_context() const; void clear_source_context(); @@ -767,11 +776,7 @@ class LIBPROTOBUF_EXPORT Enum : public ::google::protobuf::Message /* @@protoc_i ::google::protobuf::SourceContext* source_context_; int syntax_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftype_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -825,7 +830,8 @@ class LIBPROTOBUF_EXPORT EnumValue : public ::google::protobuf::Message /* @@pro bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -853,6 +859,18 @@ class LIBPROTOBUF_EXPORT EnumValue : public ::google::protobuf::Message /* @@pro // accessors ------------------------------------------------------- + // repeated .google.protobuf.Option options = 3; + int options_size() const; + void clear_options(); + static const int kOptionsFieldNumber = 3; + const ::google::protobuf::Option& options(int index) const; + ::google::protobuf::Option* mutable_options(int index); + ::google::protobuf::Option* add_options(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* + mutable_options(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& + options() const; + // string name = 1; void clear_name(); static const int kNameFieldNumber = 1; @@ -873,18 +891,6 @@ class LIBPROTOBUF_EXPORT EnumValue : public ::google::protobuf::Message /* @@pro ::google::protobuf::int32 number() const; void set_number(::google::protobuf::int32 value); - // repeated .google.protobuf.Option options = 3; - int options_size() const; - void clear_options(); - static const int kOptionsFieldNumber = 3; - const ::google::protobuf::Option& options(int index) const; - ::google::protobuf::Option* mutable_options(int index); - ::google::protobuf::Option* add_options(); - ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* - mutable_options(); - const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& - options() const; - // @@protoc_insertion_point(class_scope:google.protobuf.EnumValue) private: @@ -896,11 +902,7 @@ class LIBPROTOBUF_EXPORT EnumValue : public ::google::protobuf::Message /* @@pro ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::int32 number_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftype_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -954,7 +956,8 @@ class LIBPROTOBUF_EXPORT Option : public ::google::protobuf::Message /* @@protoc bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -1022,11 +1025,7 @@ class LIBPROTOBUF_EXPORT Option : public ::google::protobuf::Message /* @@protoc ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::Any* value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2ftype_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftype_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct; }; // =================================================================== @@ -1151,6 +1150,12 @@ inline void Type::set_oneofs(int index, const ::std::string& value) { // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs) oneofs_.Mutable(index)->assign(value); } +#if LANG_CXX11 +inline void Type::set_oneofs(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs) + oneofs_.Mutable(index)->assign(std::move(value)); +} +#endif inline void Type::set_oneofs(int index, const char* value) { oneofs_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.Type.oneofs) @@ -1168,6 +1173,12 @@ inline void Type::add_oneofs(const ::std::string& value) { oneofs_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs) } +#if LANG_CXX11 +inline void Type::add_oneofs(::std::string&& value) { + oneofs_.Add()->assign(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs) +} +#endif inline void Type::add_oneofs(const char* value) { oneofs_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.Type.oneofs) diff --git a/src/google/protobuf/type.proto b/src/google/protobuf/type.proto index c1e696d6..624c15ee 100644 --- a/src/google/protobuf/type.proto +++ b/src/google/protobuf/type.proto @@ -166,9 +166,15 @@ message EnumValue { // A protocol buffer option, which can be attached to a message, field, // enumeration, etc. message Option { - // The option's name. For example, `"java_package"`. + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. string name = 1; - // The option's value. For example, `"com.google.protobuf"`. + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. Any value = 2; } diff --git a/src/google/protobuf/util/field_mask_util.cc b/src/google/protobuf/util/field_mask_util.cc index 07550e6d..85cecec5 100644 --- a/src/google/protobuf/util/field_mask_util.cc +++ b/src/google/protobuf/util/field_mask_util.cc @@ -463,7 +463,8 @@ void FieldMaskTree::TrimMessage(const Node* node, Message* message) { const int32 field_count = descriptor->field_count(); for (int index = 0; index < field_count; ++index) { const FieldDescriptor* field = descriptor->field(index); - map<string, Node*>::const_iterator it = node->children.find(field->name()); + std::map<string, Node*>::const_iterator it = + node->children.find(field->name()); if (it == node->children.end()) { reflection->ClearField(message, field); } else { diff --git a/src/google/protobuf/util/internal/json_escaping.cc b/src/google/protobuf/util/internal/json_escaping.cc index 06d2791b..47e4dd6d 100644 --- a/src/google/protobuf/util/internal/json_escaping.cc +++ b/src/google/protobuf/util/internal/json_escaping.cc @@ -336,19 +336,19 @@ StringPiece EscapeCodePoint(uint32 cp, char* buffer, bool force_output) { cp >>= 6; if (cp <= 0x1f) { buffer[4] = cp | 0xc0; - sp.set(buffer + 4, 2); + sp = StringPiece(buffer + 4, 2); return sp; } buffer[4] = (cp & 0x3f) | 0x80; cp >>= 6; if (cp <= 0x0f) { buffer[3] = cp | 0xe0; - sp.set(buffer + 3, 3); + sp = StringPiece(buffer + 3, 3); return sp; } buffer[3] = (cp & 0x3f) | 0x80; buffer[2] = ((cp >> 6) & 0x07) | 0xf0; - sp.set(buffer + 2, 4); + sp = StringPiece(buffer + 2, 4); } return sp; } diff --git a/src/google/protobuf/util/internal/json_stream_parser.cc b/src/google/protobuf/util/internal/json_stream_parser.cc index 2af4ad90..b38030c3 100644 --- a/src/google/protobuf/util/internal/json_stream_parser.cc +++ b/src/google/protobuf/util/internal/json_stream_parser.cc @@ -56,6 +56,7 @@ namespace util { // this file. using util::Status; namespace error { +using util::error::CANCELLED; using util::error::INTERNAL; using util::error::INVALID_ARGUMENT; } // namespace error @@ -246,7 +247,7 @@ util::Status JsonStreamParser::RunParser() { } if (!result.ok()) { // If we were cancelled, save our state and try again later. - if (!finishing_ && result == util::Status::CANCELLED) { + if (!finishing_ && result == util::Status(error::CANCELLED, "")) { stack_.push(type); // If we have a key we still need to render, make sure to save off the // contents in our own storage. @@ -290,7 +291,7 @@ util::Status JsonStreamParser::ParseValue(TokenType type) { // don't know if the next char would be e, completing it, or something // else, making it invalid. if (!finishing_ && p_.length() < false_len) { - return util::Status::CANCELLED; + return util::Status(error::CANCELLED, ""); } return ReportFailure("Unexpected token."); } @@ -328,7 +329,7 @@ util::Status JsonStreamParser::ParseStringHelper() { // depending on if we expect more data later. if (p_.length() == 1) { if (!finishing_) { - return util::Status::CANCELLED; + return util::Status(error::CANCELLED, ""); } return ReportFailure("Closing quote expected in string."); } @@ -396,7 +397,7 @@ util::Status JsonStreamParser::ParseStringHelper() { } // If we didn't find the closing quote but we expect more data, cancel for now if (!finishing_) { - return util::Status::CANCELLED; + return util::Status(error::CANCELLED, ""); } // End of string reached without a closing quote, report an error. string_open_ = 0; @@ -413,7 +414,7 @@ util::Status JsonStreamParser::ParseStringHelper() { util::Status JsonStreamParser::ParseUnicodeEscape() { if (p_.length() < kUnicodeEscapedLength) { if (!finishing_) { - return util::Status::CANCELLED; + return util::Status(error::CANCELLED, ""); } return ReportFailure("Illegal hex string."); } @@ -430,7 +431,7 @@ util::Status JsonStreamParser::ParseUnicodeEscape() { code <= JsonEscaping::kMaxHighSurrogate) { if (p_.length() < 2 * kUnicodeEscapedLength) { if (!finishing_) { - return util::Status::CANCELLED; + return util::Status(error::CANCELLED, ""); } if (!coerce_to_utf8_) { return ReportFailure("Missing low surrogate."); @@ -524,7 +525,7 @@ util::Status JsonStreamParser::ParseNumberHelper(NumberResult* result) { // If the entire input is a valid number, and we may have more content in the // future, we abort for now and resume when we know more. if (index == length && !finishing_) { - return util::Status::CANCELLED; + return util::Status(error::CANCELLED, ""); } // Create a string containing just the number, so we can use safe_strtoX @@ -679,7 +680,7 @@ util::Status JsonStreamParser::ParseArrayValue(TokenType type) { // empty-null array value is relying on this ARRAY_MID token. stack_.push(ARRAY_MID); util::Status result = ParseValue(type); - if (result == util::Status::CANCELLED) { + if (result == util::Status(error::CANCELLED, "")) { // If we were cancelled, pop back off the ARRAY_MID so we don't try to // push it on again when we try over. stack_.pop(); @@ -758,7 +759,7 @@ util::Status JsonStreamParser::ReportFailure(StringPiece message) { util::Status JsonStreamParser::ReportUnknown(StringPiece message) { // If we aren't finishing the parse, cancel parsing and try later. if (!finishing_) { - return util::Status::CANCELLED; + return util::Status(error::CANCELLED, ""); } if (p_.empty()) { return ReportFailure(StrCat("Unexpected end of string. ", message)); @@ -788,7 +789,7 @@ util::Status JsonStreamParser::ParseKey() { // we can't know if the key was complete or not. if (!finishing_ && p_.empty()) { p_ = original; - return util::Status::CANCELLED; + return util::Status(error::CANCELLED, ""); } // Since we aren't using the key storage, clear it out. key_storage_.clear(); diff --git a/src/google/protobuf/util/internal/protostream_objectsource.cc b/src/google/protobuf/util/internal/protostream_objectsource.cc index a970dc12..f9fd7b01 100644 --- a/src/google/protobuf/util/internal/protostream_objectsource.cc +++ b/src/google/protobuf/util/internal/protostream_objectsource.cc @@ -120,6 +120,7 @@ ProtoStreamObjectSource::ProtoStreamObjectSource( own_typeinfo_(true), type_(type), use_lower_camel_for_enums_(false), + use_ints_for_enums_(false), recursion_depth_(0), max_recursion_depth_(kDefaultMaxRecursionDepth), render_unknown_fields_(false), @@ -135,6 +136,7 @@ ProtoStreamObjectSource::ProtoStreamObjectSource( own_typeinfo_(false), type_(type), use_lower_camel_for_enums_(false), + use_ints_for_enums_(false), recursion_depth_(0), max_recursion_depth_(kDefaultMaxRecursionDepth), render_unknown_fields_(false), @@ -858,6 +860,12 @@ Status ProtoStreamObjectSource::RenderNonMessageField( break; } + // No need to lookup enum type if we need to render int. + if (use_ints_for_enums_) { + ow->RenderInt32(field_name, buffer32); + break; + } + // Get the nested enum type for this field. // TODO(skarvaje): Avoid string manipulation. Find ways to speed this // up. @@ -1024,15 +1032,8 @@ bool ProtoStreamObjectSource::IsMap( const google::protobuf::Field& field) const { const google::protobuf::Type* field_type = typeinfo_->GetTypeByTypeUrl(field.type_url()); - - // TODO(xiaofeng): Unify option names. return field.kind() == google::protobuf::Field_Kind_TYPE_MESSAGE && - (GetBoolOptionOrDefault(field_type->options(), - "google.protobuf.MessageOptions.map_entry", - false) || - GetBoolOptionOrDefault(field_type->options(), "map_entry", false) || - GetBoolOptionOrDefault(field_type->options(), - "proto2.MessageOptions.map_entry", false)); + google::protobuf::util::converter::IsMap(field, *field_type); } std::pair<int64, int32> ProtoStreamObjectSource::ReadSecondsAndNanos( @@ -1128,4 +1129,3 @@ const string FormatNanos(uint32 nanos, bool with_trailing_zeros) { } // namespace util } // namespace protobuf } // namespace google - diff --git a/src/google/protobuf/util/internal/protostream_objectsource.h b/src/google/protobuf/util/internal/protostream_objectsource.h index 88ca652b..63d5f455 100644 --- a/src/google/protobuf/util/internal/protostream_objectsource.h +++ b/src/google/protobuf/util/internal/protostream_objectsource.h @@ -110,6 +110,12 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource { use_lower_camel_for_enums_ = value; } + // Sets whether to always output enums as ints, by default this is off, and + // enums are rendered as strings. + void set_use_ints_for_enums(bool value) { + use_ints_for_enums_ = value; + } + // Sets the max recursion depth of proto message to be deserialized. Proto // messages over this depth will fail to be deserialized. // Default value is 64. @@ -285,6 +291,9 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource { // Whether to render enums using lowerCamelCase. Defaults to false. bool use_lower_camel_for_enums_; + // Whether to render enums as ints always. Defaults to false. + bool use_ints_for_enums_; + // Tracks current recursion depth. mutable int recursion_depth_; diff --git a/src/google/protobuf/util/internal/protostream_objectsource_test.cc b/src/google/protobuf/util/internal/protostream_objectsource_test.cc index bf29c17a..e215c4ab 100644 --- a/src/google/protobuf/util/internal/protostream_objectsource_test.cc +++ b/src/google/protobuf/util/internal/protostream_objectsource_test.cc @@ -102,6 +102,7 @@ class ProtostreamObjectSourceTest mock_(), ow_(&mock_), use_lower_camel_for_enums_(false), + use_ints_for_enums_(false), add_trailing_zeros_(false) { helper_.ResetTypeInfo(Book::descriptor(), Proto3Message::descriptor()); } @@ -114,7 +115,7 @@ class ProtostreamObjectSourceTest } Status ExecuteTest(const Message& msg, const Descriptor* descriptor) { - ostringstream oss; + std::ostringstream oss; msg.SerializePartialToOstream(&oss); string proto = oss.str(); ArrayInputStream arr_stream(proto.data(), proto.size()); @@ -123,6 +124,7 @@ class ProtostreamObjectSourceTest google::protobuf::scoped_ptr<ProtoStreamObjectSource> os( helper_.NewProtoSource(&in_stream, GetTypeUrl(descriptor))); if (use_lower_camel_for_enums_) os->set_use_lower_camel_for_enums(true); + if (use_ints_for_enums_) os->set_use_ints_for_enums(true); os->set_max_recursion_depth(64); return os->WriteTo(&mock_); } @@ -270,6 +272,8 @@ class ProtostreamObjectSourceTest void UseLowerCamelForEnums() { use_lower_camel_for_enums_ = true; } + void UseIntsForEnums() { use_ints_for_enums_ = true; } + void AddTrailingZeros() { add_trailing_zeros_ = true; } testing::TypeInfoTestHelper helper_; @@ -277,6 +281,7 @@ class ProtostreamObjectSourceTest ::testing::NiceMock<MockObjectWriter> mock_; ExpectingObjectWriter ow_; bool use_lower_camel_for_enums_; + bool use_ints_for_enums_; bool add_trailing_zeros_; }; @@ -498,6 +503,18 @@ TEST_P(ProtostreamObjectSourceTest, EnumCaseIsUnchangedByDefault) { DoTest(book, Book::descriptor()); } +TEST_P(ProtostreamObjectSourceTest, UseIntsForEnumsTest) { + Book book; + book.set_type(Book::ACTION_AND_ADVENTURE); + + UseIntsForEnums(); + + ow_.StartObject("") + ->RenderInt32("type", 3) + ->EndObject(); + DoTest(book, Book::descriptor()); +} + TEST_P(ProtostreamObjectSourceTest, UnknownEnum) { Proto3Message message; message.set_enum_value(static_cast<Proto3Message::NestedEnum>(1234)); diff --git a/src/google/protobuf/util/internal/protostream_objectwriter.cc b/src/google/protobuf/util/internal/protostream_objectwriter.cc index c37e671c..6c9bc30e 100644 --- a/src/google/protobuf/util/internal/protostream_objectwriter.cc +++ b/src/google/protobuf/util/internal/protostream_objectwriter.cc @@ -1238,13 +1238,7 @@ bool ProtoStreamObjectWriter::IsMap(const google::protobuf::Field& field) { const google::protobuf::Type* field_type = typeinfo()->GetTypeByTypeUrl(field.type_url()); - // TODO(xiaofeng): Unify option names. - return GetBoolOptionOrDefault(field_type->options(), - "google.protobuf.MessageOptions.map_entry", - false) || - GetBoolOptionOrDefault(field_type->options(), "map_entry", false) || - GetBoolOptionOrDefault(field_type->options(), - "proto2.MessageOptions.map_entry", false); + return google::protobuf::util::converter::IsMap(field, *field_type); } bool ProtoStreamObjectWriter::IsAny(const google::protobuf::Field& field) { @@ -1269,4 +1263,3 @@ bool ProtoStreamObjectWriter::IsStructListValue( } // namespace util } // namespace protobuf } // namespace google - diff --git a/src/google/protobuf/util/internal/utility.cc b/src/google/protobuf/util/internal/utility.cc index 05759e85..6daf24eb 100644 --- a/src/google/protobuf/util/internal/utility.cc +++ b/src/google/protobuf/util/internal/utility.cc @@ -356,23 +356,25 @@ bool IsValidBoolString(const string& bool_string) { bool IsMap(const google::protobuf::Field& field, const google::protobuf::Type& type) { - return ( - field.cardinality() == - google::protobuf::Field_Cardinality_CARDINALITY_REPEATED && - (GetBoolOptionOrDefault( - type.options(), "google.protobuf.MessageOptions.map_entry", false) || - GetBoolOptionOrDefault(type.options(), "proto2.MessageOptions.map_entry", - false))); + return field.cardinality() == + google::protobuf::Field_Cardinality_CARDINALITY_REPEATED && + (GetBoolOptionOrDefault(type.options(), "map_entry", false) || + GetBoolOptionOrDefault(type.options(), + "google.protobuf.MessageOptions.map_entry", false) || + GetBoolOptionOrDefault(type.options(), + "google.protobuf.MessageOptions.map_entry", + false)); } bool IsMessageSetWireFormat(const google::protobuf::Type& type) { - return ( - GetBoolOptionOrDefault( - type.options(), - "google.protobuf.MessageOptions.message_set_wire_format", false) || - GetBoolOptionOrDefault(type.options(), - "proto2.MessageOptions.message_set_wire_format", - false)); + return GetBoolOptionOrDefault(type.options(), "message_set_wire_format", + false) || + GetBoolOptionOrDefault(type.options(), + "google.protobuf.MessageOptions.message_set_wire_format", + false) || + GetBoolOptionOrDefault( + type.options(), + "google.protobuf.MessageOptions.message_set_wire_format", false); } string DoubleAsString(double value) { @@ -412,4 +414,3 @@ bool SafeStrToFloat(StringPiece str, float* value) { } // namespace util } // namespace protobuf } // namespace google - diff --git a/src/google/protobuf/util/json_format_proto3.proto b/src/google/protobuf/util/json_format_proto3.proto index 3835b30e..8a0441c8 100644 --- a/src/google/protobuf/util/json_format_proto3.proto +++ b/src/google/protobuf/util/json_format_proto3.proto @@ -32,6 +32,8 @@ syntax = "proto3"; package proto3; +option java_package = "com.google.protobuf.util"; +option java_outer_classname = "JsonFormatProto3"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; diff --git a/src/google/protobuf/util/json_util.cc b/src/google/protobuf/util/json_util.cc index d7ac2dba..c65e5323 100644 --- a/src/google/protobuf/util/json_util.cc +++ b/src/google/protobuf/util/json_util.cc @@ -79,6 +79,7 @@ util::Status BinaryToJsonStream(TypeResolver* resolver, google::protobuf::Type type; RETURN_IF_ERROR(resolver->ResolveMessageType(type_url, &type)); converter::ProtoStreamObjectSource proto_source(&in_stream, resolver, type); + proto_source.set_use_ints_for_enums(options.always_print_enums_as_ints); io::CodedOutputStream out_stream(json_output); converter::JsonObjectWriter json_writer(options.add_whitespace ? " " : "", &out_stream); diff --git a/src/google/protobuf/util/json_util.h b/src/google/protobuf/util/json_util.h index 6d3cee52..8dda70c3 100644 --- a/src/google/protobuf/util/json_util.h +++ b/src/google/protobuf/util/json_util.h @@ -61,9 +61,13 @@ struct JsonPrintOptions { // set to 0 will be omitted. Set this flag to true will override the default // behavior and print primitive fields regardless of their values. bool always_print_primitive_fields; + // Whether to always print enums as ints. By default they are rendered as + // strings. + bool always_print_enums_as_ints; JsonPrintOptions() : add_whitespace(false), - always_print_primitive_fields(false) { + always_print_primitive_fields(false), + always_print_enums_as_ints(false) { } }; diff --git a/src/google/protobuf/util/json_util_test.cc b/src/google/protobuf/util/json_util_test.cc index 3ce779c9..796718d5 100644 --- a/src/google/protobuf/util/json_util_test.cc +++ b/src/google/protobuf/util/json_util_test.cc @@ -36,6 +36,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/descriptor_database.h> #include <google/protobuf/dynamic_message.h> +#include <google/protobuf/util/internal/testdata/maps.pb.h> #include <google/protobuf/util/json_format_proto3.pb.h> #include <google/protobuf/util/type_resolver.h> #include <google/protobuf/util/type_resolver_util.h> @@ -50,6 +51,7 @@ using proto3::FOO; using proto3::BAR; using proto3::TestMessage; using proto3::TestMap; +using testing::MapIn; static const char kTypeUrlPrefix[] = "type.googleapis.com"; @@ -62,7 +64,7 @@ static string GetTypeUrl(const Descriptor* message) { // only cover some very basic cases to make sure the wrappers have forwarded // parameters to the underlying implementation correctly. More detailed // tests are contained in the //net/proto2/util/converter directory. -class JsonUtilTest : public testing::Test { +class JsonUtilTest : public ::testing::Test { protected: JsonUtilTest() { } @@ -158,6 +160,29 @@ TEST_F(JsonUtilTest, TestDefaultValues) { ToJson(m, options)); } +TEST_F(JsonUtilTest, TestAlwaysPrintEnumsAsInts) { + TestMessage orig; + orig.set_enum_value(proto3::EnumType::BAR); + orig.add_repeated_enum_value(proto3::EnumType::FOO); + orig.add_repeated_enum_value(proto3::EnumType::BAR); + + JsonPrintOptions print_options; + print_options.always_print_enums_as_ints = true; + + string expected_json = + "{\"enumValue\":1,\"repeatedEnumValue\":[0,1]}"; + EXPECT_EQ(expected_json, ToJson(orig, print_options)); + + TestMessage parsed; + JsonParseOptions parse_options; + ASSERT_TRUE(FromJson(expected_json, &parsed, parse_options)); + + EXPECT_EQ(proto3::EnumType::BAR, parsed.enum_value()); + EXPECT_EQ(2, parsed.repeated_enum_value_size()); + EXPECT_EQ(proto3::EnumType::FOO, parsed.repeated_enum_value(0)); + EXPECT_EQ(proto3::EnumType::BAR, parsed.repeated_enum_value(1)); +} + TEST_F(JsonUtilTest, ParseMessage) { // Some random message but good enough to verify that the parsing warpper // functions are working properly. @@ -196,6 +221,17 @@ TEST_F(JsonUtilTest, ParseMap) { EXPECT_EQ(message.DebugString(), other.DebugString()); } +TEST_F(JsonUtilTest, ParsePrimitiveMapIn) { + MapIn message; + JsonPrintOptions print_options; + print_options.always_print_primitive_fields = true; + JsonParseOptions parse_options; + EXPECT_EQ("{\"other\":\"\",\"things\":[],\"mapInput\":{}}", ToJson(message, print_options)); + MapIn other; + ASSERT_TRUE(FromJson(ToJson(message, print_options), &other, parse_options)); + EXPECT_EQ(message.DebugString(), other.DebugString()); +} + TEST_F(JsonUtilTest, TestParseIgnoreUnknownFields) { TestMessage m; JsonParseOptions options; diff --git a/src/google/protobuf/util/time_util.h b/src/google/protobuf/util/time_util.h index 432c9f0a..b8846935 100644 --- a/src/google/protobuf/util/time_util.h +++ b/src/google/protobuf/util/time_util.h @@ -237,7 +237,7 @@ inline Duration operator%(const Duration& d1, const Duration& d2) { return result %= d2; } -inline ostream& operator<<(ostream& out, const Duration& d) { +inline std::ostream& operator<<(std::ostream& out, const Duration& d) { out << google::protobuf::util::TimeUtil::ToString(d); return out; } @@ -284,7 +284,7 @@ inline Timestamp operator-(const Timestamp& t, const Duration& d) { } LIBPROTOBUF_EXPORT Duration operator-(const Timestamp& t1, const Timestamp& t2); -inline ostream& operator<<(ostream& out, const Timestamp& t) { +inline std::ostream& operator<<(std::ostream& out, const Timestamp& t) { out << google::protobuf::util::TimeUtil::ToString(t); return out; } diff --git a/src/google/protobuf/wire_format.cc b/src/google/protobuf/wire_format.cc index 88a1a234..bd5b2489 100644 --- a/src/google/protobuf/wire_format.cc +++ b/src/google/protobuf/wire_format.cc @@ -42,6 +42,8 @@ #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/stringprintf.h> #include <google/protobuf/descriptor.h> +#include <google/protobuf/dynamic_message.h> +#include <google/protobuf/map_field.h> #include <google/protobuf/wire_format_lite_inl.h> #include <google/protobuf/descriptor.pb.h> #include <google/protobuf/io/coded_stream.h> @@ -834,6 +836,13 @@ void WireFormat::SerializeFieldWithCachedSizes( count = 1; } + // map_entries is for maps that'll be deterministically serialized. + std::vector<const Message*> map_entries; + if (count > 1 && field->is_map() && output->IsSerializationDeterministic()) { + map_entries = + DynamicMapSorter::Sort(message, count, message_reflection, field); + } + const bool is_packed = field->is_packed(); if (is_packed && count > 0) { WireFormatLite::WriteTag(field->number(), @@ -877,15 +886,17 @@ void WireFormat::SerializeFieldWithCachedSizes( HANDLE_PRIMITIVE_TYPE(BOOL, bool, Bool, Bool) #undef HANDLE_PRIMITIVE_TYPE -#define HANDLE_TYPE(TYPE, TYPE_METHOD, CPPTYPE_METHOD) \ - case FieldDescriptor::TYPE_##TYPE: \ - WireFormatLite::Write##TYPE_METHOD( \ - field->number(), \ - field->is_repeated() ? \ - message_reflection->GetRepeated##CPPTYPE_METHOD( \ - message, field, j) : \ - message_reflection->Get##CPPTYPE_METHOD(message, field), \ - output); \ +#define HANDLE_TYPE(TYPE, TYPE_METHOD, CPPTYPE_METHOD) \ + case FieldDescriptor::TYPE_##TYPE: \ + WireFormatLite::Write##TYPE_METHOD( \ + field->number(), \ + field->is_repeated() ? \ + (map_entries.empty() ? \ + message_reflection->GetRepeated##CPPTYPE_METHOD( \ + message, field, j) : \ + *map_entries[j]) : \ + message_reflection->Get##CPPTYPE_METHOD(message, field), \ + output); \ break; HANDLE_TYPE(GROUP , Group , Message) diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h index de8ea574..5e9aca52 100644 --- a/src/google/protobuf/wire_format.h +++ b/src/google/protobuf/wire_format.h @@ -327,6 +327,9 @@ inline void WireFormat::VerifyUTF8StringNamedField( #ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED WireFormatLite::VerifyUtf8String( data, size, static_cast<WireFormatLite::Operation>(op), field_name); +#else + // Avoid the compiler warning about unused variables. + (void)data; (void)size; (void)op; (void)field_name; #endif } diff --git a/src/google/protobuf/wire_format_lite.cc b/src/google/protobuf/wire_format_lite.cc index 5a8857ed..e46ac400 100644 --- a/src/google/protobuf/wire_format_lite.cc +++ b/src/google/protobuf/wire_format_lite.cc @@ -34,6 +34,9 @@ #include <google/protobuf/wire_format_lite_inl.h> +#ifdef __SSE_4_1__ +#include <immintrin.h> +#endif #include <stack> #include <string> #include <vector> @@ -337,6 +340,90 @@ bool WireFormatLite::ReadPackedEnumPreserveUnknowns( return true; } +namespace { +void EncodeFixedSizeValue(float v, uint8* dest) { + WireFormatLite::WriteFloatNoTagToArray(v, dest); +} + +void EncodeFixedSizeValue(double v, uint8* dest) { + WireFormatLite::WriteDoubleNoTagToArray(v, dest); +} + +void EncodeFixedSizeValue(uint32 v, uint8* dest) { + WireFormatLite::WriteFixed32NoTagToArray(v, dest); +} + +void EncodeFixedSizeValue(uint64 v, uint8* dest) { + WireFormatLite::WriteFixed64NoTagToArray(v, dest); +} + +void EncodeFixedSizeValue(int32 v, uint8* dest) { + WireFormatLite::WriteSFixed32NoTagToArray(v, dest); +} + +void EncodeFixedSizeValue(int64 v, uint8* dest) { + WireFormatLite::WriteSFixed64NoTagToArray(v, dest); +} + +void EncodeFixedSizeValue(bool v, uint8* dest) { + WireFormatLite::WriteBoolNoTagToArray(v, dest); +} +} // anonymous namespace + +template <typename CType> +static void WriteArray(const CType* a, int n, io::CodedOutputStream* output) { +#if defined(PROTOBUF_LITTLE_ENDIAN) + output->WriteRaw(reinterpret_cast<const char*>(a), n * sizeof(a[0])); +#else + const int kAtATime = 128; + uint8 buf[sizeof(CType) * kAtATime]; + for (int i = 0; i < n; i += kAtATime) { + int to_do = min(kAtATime, n - i); + uint8* ptr = buf; + for (int j = 0; j < to_do; j++) { + EncodeFixedSizeValue(a[i+j], ptr); + ptr += sizeof(a[0]); + } + output->WriteRaw(buf, to_do * sizeof(a[0])); + } +#endif +} + +void WireFormatLite::WriteFloatArray(const float* a, int n, + io::CodedOutputStream* output) { + WriteArray<float>(a, n, output); +} + +void WireFormatLite::WriteDoubleArray(const double* a, int n, + io::CodedOutputStream* output) { + WriteArray<double>(a, n, output); +} + +void WireFormatLite::WriteFixed32Array(const uint32* a, int n, + io::CodedOutputStream* output) { + WriteArray<uint32>(a, n, output); +} + +void WireFormatLite::WriteFixed64Array(const uint64* a, int n, + io::CodedOutputStream* output) { + WriteArray<uint64>(a, n, output); +} + +void WireFormatLite::WriteSFixed32Array(const int32* a, int n, + io::CodedOutputStream* output) { + WriteArray<int32>(a, n, output); +} + +void WireFormatLite::WriteSFixed64Array(const int64* a, int n, + io::CodedOutputStream* output) { + WriteArray<int64>(a, n, output); +} + +void WireFormatLite::WriteBoolArray(const bool* a, int n, + io::CodedOutputStream* output) { + WriteArray<bool>(a, n, output); +} + void WireFormatLite::WriteInt32(int field_number, int32 value, io::CodedOutputStream* output) { WriteTag(field_number, WIRETYPE_VARINT, output); @@ -540,6 +627,152 @@ bool WireFormatLite::VerifyUtf8String(const char* data, return true; } +#ifdef __SSE_4_1__ +template<typename T, bool ZigZag, bool SignExtended> +static size_t VarintSize( + const T* data, const int n, + const internal::enable_if<sizeof(T) == 4>::type* = NULL) { +#if __cplusplus >= 201103L + // is_unsigned<T> => !ZigZag + static_assert((std::is_unsigned<T>::value ^ ZigZag) || + std::is_signed<T>::value, + "Cannot ZigZag encode unsigned types"); + // is_unsigned<T> => !SignExtended + static_assert((std::is_unsigned<T>::value ^ SignExtended) || + std::is_signed<T>::value, + "Cannot SignExtended unsigned types"); +#endif + + union vus32 { + uint32 u[4]; + int32 s[4]; + __m128i v; + }; + + static const vus32 ones = {{1, 1, 1, 1}}; + + // CodedOutputStream::VarintSize32SignExtended returns 10 for negative + // numbers. We can apply the UInt32Size algorithm, and simultaneously logical + // shift the MSB into the LSB to determine if it is negative. + static const vus32 fives = {{5, 5, 5, 5}}; + + // sum is the vectorized-output of calling CodedOutputStream::VarintSize32 on + // the processed elements. + // + // msb_sum is the count of set most-significant bits. When computing the + // vectorized CodedOutputStream::VarintSize32SignExtended, negative values + // have the most significant bit set. VarintSize32SignExtended returns 10 and + // VarintSize32 returns 5. msb_sum allows us to compute: + // VarintSize32SignExtended = msb_sum * 5 + VarintSize32 + vus32 sum, v, msb_sum; + sum.v = _mm_setzero_si128(); + msb_sum.v = _mm_setzero_si128(); + + int rounded = n & ~(3); + int i; + for (i = 0; i < rounded; i += 4) { + v.v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(&data[i])); + + if (ZigZag) { + // Note: the right-shift must be arithmetic + v.v = _mm_xor_si128(_mm_slli_epi32(v.v, 1), _mm_srai_epi32(v.v, 31)); + } + + sum.v = _mm_add_epi32(sum.v, ones.v); + if (SignExtended) { + msb_sum.v = _mm_add_epi32(msb_sum.v, _mm_srli_epi32(v.v, 31)); + } + + v.v = _mm_srli_epi32(v.v, 7); + + for (int j = 0; j < 4; j++) { + __m128i min = _mm_min_epi32(v.v, ones.v); + + sum.v = _mm_add_epi32(sum.v, min); + v.v = _mm_srli_epi32(v.v, 7); + } + } + + if (SignExtended) { + vus32 extensions; + extensions.v = _mm_mullo_epi32(msb_sum.v, fives.v); + + sum.v = _mm_add_epi32(sum.v, extensions.v); + } + + // TODO(ckennelly): Can we avoid the sign conversion? + size_t out = _mm_cvtsi128_si32( + _mm_hadd_epi32(_mm_hadd_epi32(sum.v, ones.v), ones.v)); + + // Finish tail. + for (; i < n; i++) { + if (ZigZag) { + out += WireFormatLite::SInt32Size(data[i]); + } else if (SignExtended) { + out += WireFormatLite::Int32Size(data[i]); + } else { + out += WireFormatLite::UInt32Size(data[i]); + } + } + + return out; +} + +size_t WireFormatLite::Int32Size(const RepeatedField<int32>& value) { + return VarintSize<int32, false, true>(value.data(), value.size()); +} + +size_t WireFormatLite::UInt32Size(const RepeatedField<uint32>& value) { + return VarintSize<uint32, false, false>(value.data(), value.size()); +} + +size_t WireFormatLite::SInt32Size(const RepeatedField<int32>& value) { + return VarintSize<int32, true, true>(value.data(), value.size()); +} + +size_t WireFormatLite::EnumSize(const RepeatedField<int>& value) { + // On ILP64, sizeof(int) == 8, which would require a different template. + return VarintSize<int, false, true>(value.data(), value.size()); +} + +#else // !__SSE_4_1__ +size_t WireFormatLite::Int32Size(const RepeatedField<int32>& value) { + size_t out = 0; + const int n = value.size(); + for (int i = 0; i < n; i++) { + out += Int32Size(value.Get(i)); + } + return out; +} + +size_t WireFormatLite::UInt32Size(const RepeatedField<uint32>& value) { + size_t out = 0; + const int n = value.size(); + for (int i = 0; i < n; i++) { + out += UInt32Size(value.Get(i)); + } + return out; +} + +size_t WireFormatLite::SInt32Size(const RepeatedField<int32>& value) { + size_t out = 0; + const int n = value.size(); + for (int i = 0; i < n; i++) { + out += SInt32Size(value.Get(i)); + } + return out; +} + +size_t WireFormatLite::EnumSize(const RepeatedField<int>& value) { + size_t out = 0; + const int n = value.size(); + for (int i = 0; i < n; i++) { + out += EnumSize(value.Get(i)); + } + return out; +} +#endif + } // namespace internal } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/wire_format_lite.h b/src/google/protobuf/wire_format_lite.h index cfd1688c..60355144 100644 --- a/src/google/protobuf/wire_format_lite.h +++ b/src/google/protobuf/wire_format_lite.h @@ -42,9 +42,20 @@ #include <string> #include <google/protobuf/stubs/common.h> +#include <google/protobuf/repeated_field.h> #include <google/protobuf/message_lite.h> #include <google/protobuf/io/coded_stream.h> // for CodedOutputStream::Varint32Size +// Avoid conflict with iOS where <ConditionalMacros.h> #defines TYPE_BOOL. +// +// If some one needs the macro TYPE_BOOL in a file that includes this header, it's +// possible to bring it back using push/pop_macro as follows. +// +// #pragma push_macro("TYPE_BOOL") +// #include this header and/or all headers that need the macro to be undefined. +// #pragma pop_macro("TYPE_BOOL") +#undef TYPE_BOOL + namespace google { namespace protobuf { @@ -379,6 +390,15 @@ class LIBPROTOBUF_EXPORT WireFormatLite { INL static void WriteBoolNoTag (bool value, output); INL static void WriteEnumNoTag (int value, output); + // Write array of primitive fields, without tags + static void WriteFloatArray (const float* a, int n, output); + static void WriteDoubleArray (const double* a, int n, output); + static void WriteFixed32Array (const uint32* a, int n, output); + static void WriteFixed64Array (const uint64* a, int n, output); + static void WriteSFixed32Array(const int32* a, int n, output); + static void WriteSFixed64Array(const int64* a, int n, output); + static void WriteBoolArray (const bool* a, int n, output); + // Write fields, including tags. static void WriteInt32 (field_number, int32 value, output); static void WriteInt64 (field_number, int64 value, output); @@ -527,6 +547,14 @@ class LIBPROTOBUF_EXPORT WireFormatLite { static inline size_t SInt64Size ( int64 value); static inline size_t EnumSize ( int value); + static size_t Int32Size (const RepeatedField< int32>& value); + static inline size_t Int64Size (const RepeatedField< int64>& value); + static size_t UInt32Size(const RepeatedField<uint32>& value); + static inline size_t UInt64Size(const RepeatedField<uint64>& value); + static size_t SInt32Size(const RepeatedField< int32>& value); + static inline size_t SInt64Size(const RepeatedField< int64>& value); + static size_t EnumSize (const RepeatedField< int>& value); + // These types always have the same size. static const size_t kFixed32Size = 4; static const size_t kFixed64Size = 8; diff --git a/src/google/protobuf/wire_format_lite_inl.h b/src/google/protobuf/wire_format_lite_inl.h index 0e46e994..aa3bb3a6 100644 --- a/src/google/protobuf/wire_format_lite_inl.h +++ b/src/google/protobuf/wire_format_lite_inl.h @@ -872,6 +872,33 @@ inline size_t WireFormatLite::LengthDelimitedSize(size_t length) { static_cast<uint32>(length)); } +size_t WireFormatLite::Int64Size (const RepeatedField< int64>& value) { + size_t out = 0; + const int n = value.size(); + for (int i = 0; i < n; i++) { + out += Int64Size(value.Get(i)); + } + return out; +} + +size_t WireFormatLite::UInt64Size(const RepeatedField<uint64>& value) { + size_t out = 0; + const int n = value.size(); + for (int i = 0; i < n; i++) { + out += UInt64Size(value.Get(i)); + } + return out; +} + +size_t WireFormatLite::SInt64Size(const RepeatedField< int64>& value) { + size_t out = 0; + const int n = value.size(); + for (int i = 0; i < n; i++) { + out += SInt64Size(value.Get(i)); + } + return out; +} + } // namespace internal } // namespace protobuf diff --git a/src/google/protobuf/wire_format_unittest.cc b/src/google/protobuf/wire_format_unittest.cc index faf27b62..897fec00 100644 --- a/src/google/protobuf/wire_format_unittest.cc +++ b/src/google/protobuf/wire_format_unittest.cc @@ -1283,6 +1283,136 @@ TEST_F(Utf8ValidationTest, OldVerifyUTF8String) { } +TEST(RepeatedVarint, Int32) { + RepeatedField<int32> v; + + // Insert -2^n, 2^n and 2^n-1. + for (int n = 0; n < 10; n++) { + v.Add(-(1 << n)); + v.Add(1 << n); + v.Add((1 << n) - 1); + } + + // Check consistency with the scalar Int32Size. + size_t expected = 0; + for (int i = 0; i < v.size(); i++) { + expected += WireFormatLite::Int32Size(v[i]); + } + + EXPECT_EQ(expected, WireFormatLite::Int32Size(v)); +} + +TEST(RepeatedVarint, Int64) { + RepeatedField<int64> v; + + // Insert -2^n, 2^n and 2^n-1. + for (int n = 0; n < 10; n++) { + v.Add(-(1 << n)); + v.Add(1 << n); + v.Add((1 << n) - 1); + } + + // Check consistency with the scalar Int64Size. + size_t expected = 0; + for (int i = 0; i < v.size(); i++) { + expected += WireFormatLite::Int64Size(v[i]); + } + + EXPECT_EQ(expected, WireFormatLite::Int64Size(v)); +} + +TEST(RepeatedVarint, SInt32) { + RepeatedField<int32> v; + + // Insert -2^n, 2^n and 2^n-1. + for (int n = 0; n < 10; n++) { + v.Add(-(1 << n)); + v.Add(1 << n); + v.Add((1 << n) - 1); + } + + // Check consistency with the scalar SInt32Size. + size_t expected = 0; + for (int i = 0; i < v.size(); i++) { + expected += WireFormatLite::SInt32Size(v[i]); + } + + EXPECT_EQ(expected, WireFormatLite::SInt32Size(v)); +} + +TEST(RepeatedVarint, SInt64) { + RepeatedField<int64> v; + + // Insert -2^n, 2^n and 2^n-1. + for (int n = 0; n < 10; n++) { + v.Add(-(1 << n)); + v.Add(1 << n); + v.Add((1 << n) - 1); + } + + // Check consistency with the scalar SInt64Size. + size_t expected = 0; + for (int i = 0; i < v.size(); i++) { + expected += WireFormatLite::SInt64Size(v[i]); + } + + EXPECT_EQ(expected, WireFormatLite::SInt64Size(v)); +} + +TEST(RepeatedVarint, UInt32) { + RepeatedField<uint32> v; + + // Insert 2^n and 2^n-1. + for (int n = 0; n < 10; n++) { + v.Add(1 << n); + v.Add((1 << n) - 1); + } + + // Check consistency with the scalar UInt32Size. + size_t expected = 0; + for (int i = 0; i < v.size(); i++) { + expected += WireFormatLite::UInt32Size(v[i]); + } + + EXPECT_EQ(expected, WireFormatLite::UInt32Size(v)); +} + +TEST(RepeatedVarint, UInt64) { + RepeatedField<uint64> v; + + // Insert 2^n and 2^n-1. + for (int n = 0; n < 10; n++) { + v.Add(1 << n); + v.Add((1 << n) - 1); + } + + // Check consistency with the scalar UInt64Size. + size_t expected = 0; + for (int i = 0; i < v.size(); i++) { + expected += WireFormatLite::UInt64Size(v[i]); + } + + EXPECT_EQ(expected, WireFormatLite::UInt64Size(v)); +} + +TEST(RepeatedVarint, Enum) { + RepeatedField<int> v; + + // Insert 2^n and 2^n-1. + for (int n = 0; n < 10; n++) { + v.Add(1 << n); + v.Add((1 << n) - 1); + } + + // Check consistency with the scalar EnumSize. + size_t expected = 0; + for (int i = 0; i < v.size(); i++) { + expected += WireFormatLite::EnumSize(v[i]); + } + + EXPECT_EQ(expected, WireFormatLite::EnumSize(v)); +} + } // namespace } // namespace internal } // namespace protobuf diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc index 82a8d9e2..0dad64a4 100644 --- a/src/google/protobuf/wrappers.pb.cc +++ b/src/google/protobuf/wrappers.pb.cc @@ -19,24 +19,27 @@ namespace google { namespace protobuf { -class DoubleValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<DoubleValue> {}; -DoubleValueDefaultTypeInternal _DoubleValue_default_instance_; -class FloatValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FloatValue> {}; -FloatValueDefaultTypeInternal _FloatValue_default_instance_; -class Int64ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Int64Value> {}; -Int64ValueDefaultTypeInternal _Int64Value_default_instance_; -class UInt64ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UInt64Value> {}; -UInt64ValueDefaultTypeInternal _UInt64Value_default_instance_; -class Int32ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Int32Value> {}; -Int32ValueDefaultTypeInternal _Int32Value_default_instance_; -class UInt32ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UInt32Value> {}; -UInt32ValueDefaultTypeInternal _UInt32Value_default_instance_; -class BoolValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<BoolValue> {}; -BoolValueDefaultTypeInternal _BoolValue_default_instance_; -class StringValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<StringValue> {}; -StringValueDefaultTypeInternal _StringValue_default_instance_; -class BytesValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<BytesValue> {}; -BytesValueDefaultTypeInternal _BytesValue_default_instance_; +class DoubleValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<DoubleValue> { +} _DoubleValue_default_instance_; +class FloatValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FloatValue> { +} _FloatValue_default_instance_; +class Int64ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Int64Value> { +} _Int64Value_default_instance_; +class UInt64ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UInt64Value> { +} _UInt64Value_default_instance_; +class Int32ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Int32Value> { +} _Int32Value_default_instance_; +class UInt32ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UInt32Value> { +} _UInt32Value_default_instance_; +class BoolValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<BoolValue> { +} _BoolValue_default_instance_; +class StringValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<StringValue> { +} _StringValue_default_instance_; +class BytesValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<BytesValue> { +} _BytesValue_default_instance_; + +namespace protobuf_google_2fprotobuf_2fwrappers_2eproto { + namespace { @@ -44,58 +47,53 @@ namespace { } // namespace - -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto() GOOGLE_ATTRIBUTE_COLD; -const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto() { - static const ::google::protobuf::uint32 offsets[] = { - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DoubleValue, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DoubleValue, value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatValue, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatValue, value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int64Value, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int64Value, value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt64Value, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt64Value, value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int32Value, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int32Value, value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt32Value, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt32Value, value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BoolValue, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BoolValue, value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringValue, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringValue, value_), - ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BytesValue, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BytesValue, value_), - }; - return offsets; -} +const ::google::protobuf::uint32 TableStruct::offsets[] = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DoubleValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DoubleValue, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatValue, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int64Value, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int64Value, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt64Value, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt64Value, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int32Value, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int32Value, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt32Value, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt32Value, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BoolValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BoolValue, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringValue, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BytesValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BytesValue, value_), +}; static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 0, -1, sizeof(DoubleValue)}, @@ -109,25 +107,25 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] = { { 40, -1, sizeof(BytesValue)}, }; -static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = { - {reinterpret_cast<const ::google::protobuf::Message*>(&_DoubleValue_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_FloatValue_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_Int64Value_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_UInt64Value_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_Int32Value_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_UInt32Value_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_BoolValue_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_StringValue_default_instance_), NULL}, - {reinterpret_cast<const ::google::protobuf::Message*>(&_BytesValue_default_instance_), NULL}, +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast<const ::google::protobuf::Message*>(&_DoubleValue_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_FloatValue_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_Int64Value_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_UInt64Value_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_Int32Value_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_UInt32Value_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_BoolValue_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_StringValue_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&_BytesValue_default_instance_), }; namespace { void protobuf_AssignDescriptors() { - protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto(); + AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/wrappers.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(), factory, + "google/protobuf/wrappers.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } @@ -144,7 +142,7 @@ void protobuf_RegisterTypes(const ::std::string&) { } // namespace -void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto() { +void TableStruct::Shutdown() { _DoubleValue_default_instance_.Shutdown(); delete file_level_metadata[0].reflection; _FloatValue_default_instance_.Shutdown(); @@ -165,7 +163,7 @@ void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto() { delete file_level_metadata[8].reflection; } -void protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl() { +void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); @@ -180,12 +178,12 @@ void protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl() { _BytesValue_default_instance_.DefaultConstruct(); } -void protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto() { +void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } -void protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); +void AddDescriptorsImpl() { + InitDefaults(); static const char descriptor[] = { "\n\036google/protobuf/wrappers.proto\022\017google" ".protobuf\"\034\n\013DoubleValue\022\r\n\005value\030\001 \001(\001\"" @@ -204,20 +202,22 @@ void protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl() { descriptor, 447); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/wrappers.proto", &protobuf_RegisterTypes); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto); + ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_once_); -void protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto() { - ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_once_, - &protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl); +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_google_2fprotobuf_2fwrappers_2eproto { - StaticDescriptorInitializer_google_2fprotobuf_2fwrappers_2eproto() { - protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto(); +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); } -} static_descriptor_initializer_google_2fprotobuf_2fwrappers_2eproto_; +} static_descriptor_initializer; + +} // namespace protobuf_google_2fprotobuf_2fwrappers_2eproto + // =================================================================== @@ -228,7 +228,7 @@ const int DoubleValue::kValueFieldNumber; DoubleValue::DoubleValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.DoubleValue) @@ -237,7 +237,7 @@ DoubleValue::DoubleValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -282,12 +282,12 @@ void DoubleValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* DoubleValue::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[0].descriptor; } const DoubleValue& DoubleValue::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -312,7 +312,8 @@ bool DoubleValue::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // double value = 1; case 1: { - if (tag == 9u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(9u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( @@ -357,7 +358,7 @@ void DoubleValue::SerializeWithCachedSizes( ::google::protobuf::uint8* DoubleValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DoubleValue) // double value = 1; if (this->value() != 0) { @@ -451,8 +452,8 @@ void DoubleValue::InternalSwap(DoubleValue* other) { } ::google::protobuf::Metadata DoubleValue::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[0]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[0]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -483,7 +484,7 @@ const int FloatValue::kValueFieldNumber; FloatValue::FloatValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FloatValue) @@ -492,7 +493,7 @@ FloatValue::FloatValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -537,12 +538,12 @@ void FloatValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FloatValue::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[1].descriptor; } const FloatValue& FloatValue::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -567,7 +568,8 @@ bool FloatValue::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // float value = 1; case 1: { - if (tag == 13u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(13u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( @@ -612,7 +614,7 @@ void FloatValue::SerializeWithCachedSizes( ::google::protobuf::uint8* FloatValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FloatValue) // float value = 1; if (this->value() != 0) { @@ -706,8 +708,8 @@ void FloatValue::InternalSwap(FloatValue* other) { } ::google::protobuf::Metadata FloatValue::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[1]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[1]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -738,7 +740,7 @@ const int Int64Value::kValueFieldNumber; Int64Value::Int64Value() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Int64Value) @@ -747,7 +749,7 @@ Int64Value::Int64Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -792,12 +794,12 @@ void Int64Value::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Int64Value::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[2].descriptor; } const Int64Value& Int64Value::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -822,7 +824,8 @@ bool Int64Value::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // int64 value = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( @@ -867,7 +870,7 @@ void Int64Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Int64Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int64Value) // int64 value = 1; if (this->value() != 0) { @@ -963,8 +966,8 @@ void Int64Value::InternalSwap(Int64Value* other) { } ::google::protobuf::Metadata Int64Value::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[2]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[2]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -995,7 +998,7 @@ const int UInt64Value::kValueFieldNumber; UInt64Value::UInt64Value() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.UInt64Value) @@ -1004,7 +1007,7 @@ UInt64Value::UInt64Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -1049,12 +1052,12 @@ void UInt64Value::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UInt64Value::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[3].descriptor; } const UInt64Value& UInt64Value::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1079,7 +1082,8 @@ bool UInt64Value::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // uint64 value = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( @@ -1124,7 +1128,7 @@ void UInt64Value::SerializeWithCachedSizes( ::google::protobuf::uint8* UInt64Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt64Value) // uint64 value = 1; if (this->value() != 0) { @@ -1220,8 +1224,8 @@ void UInt64Value::InternalSwap(UInt64Value* other) { } ::google::protobuf::Metadata UInt64Value::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[3]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[3]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1252,7 +1256,7 @@ const int Int32Value::kValueFieldNumber; Int32Value::Int32Value() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Int32Value) @@ -1261,7 +1265,7 @@ Int32Value::Int32Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -1306,12 +1310,12 @@ void Int32Value::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Int32Value::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[4].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[4].descriptor; } const Int32Value& Int32Value::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1336,7 +1340,8 @@ bool Int32Value::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // int32 value = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -1381,7 +1386,7 @@ void Int32Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Int32Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int32Value) // int32 value = 1; if (this->value() != 0) { @@ -1477,8 +1482,8 @@ void Int32Value::InternalSwap(Int32Value* other) { } ::google::protobuf::Metadata Int32Value::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[4]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[4]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1509,7 +1514,7 @@ const int UInt32Value::kValueFieldNumber; UInt32Value::UInt32Value() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.UInt32Value) @@ -1518,7 +1523,7 @@ UInt32Value::UInt32Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -1563,12 +1568,12 @@ void UInt32Value::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UInt32Value::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[5].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[5].descriptor; } const UInt32Value& UInt32Value::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1593,7 +1598,8 @@ bool UInt32Value::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // uint32 value = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( @@ -1638,7 +1644,7 @@ void UInt32Value::SerializeWithCachedSizes( ::google::protobuf::uint8* UInt32Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt32Value) // uint32 value = 1; if (this->value() != 0) { @@ -1734,8 +1740,8 @@ void UInt32Value::InternalSwap(UInt32Value* other) { } ::google::protobuf::Metadata UInt32Value::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[5]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[5]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1766,7 +1772,7 @@ const int BoolValue::kValueFieldNumber; BoolValue::BoolValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.BoolValue) @@ -1775,7 +1781,7 @@ BoolValue::BoolValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -1820,12 +1826,12 @@ void BoolValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* BoolValue::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[6].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[6].descriptor; } const BoolValue& BoolValue::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -1850,7 +1856,8 @@ bool BoolValue::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // bool value = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -1895,7 +1902,7 @@ void BoolValue::SerializeWithCachedSizes( ::google::protobuf::uint8* BoolValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BoolValue) // bool value = 1; if (this->value() != 0) { @@ -1989,8 +1996,8 @@ void BoolValue::InternalSwap(BoolValue* other) { } ::google::protobuf::Metadata BoolValue::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[6]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[6]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -2021,7 +2028,7 @@ const int StringValue::kValueFieldNumber; StringValue::StringValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.StringValue) @@ -2030,7 +2037,7 @@ StringValue::StringValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -2080,12 +2087,12 @@ void StringValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* StringValue::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[7].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[7].descriptor; } const StringValue& StringValue::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -2110,7 +2117,8 @@ bool StringValue::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string value = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_value())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -2162,7 +2170,7 @@ void StringValue::SerializeWithCachedSizes( ::google::protobuf::uint8* StringValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.StringValue) // string value = 1; if (this->value().size() > 0) { @@ -2264,8 +2272,8 @@ void StringValue::InternalSwap(StringValue* other) { } ::google::protobuf::Metadata StringValue::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[7]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[7]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -2348,7 +2356,7 @@ const int BytesValue::kValueFieldNumber; BytesValue::BytesValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.BytesValue) @@ -2357,7 +2365,7 @@ BytesValue::BytesValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); @@ -2407,12 +2415,12 @@ void BytesValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* BytesValue::descriptor() { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[8].descriptor; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[8].descriptor; } const BytesValue& BytesValue::default_instance() { - protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); + protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); return *internal_default_instance(); } @@ -2437,7 +2445,8 @@ bool BytesValue::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // bytes value = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_value())); } else { @@ -2481,7 +2490,7 @@ void BytesValue::SerializeWithCachedSizes( ::google::protobuf::uint8* BytesValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BytesValue) // bytes value = 1; if (this->value().size() > 0) { @@ -2579,8 +2588,8 @@ void BytesValue::InternalSwap(BytesValue* other) { } ::google::protobuf::Metadata BytesValue::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - return file_level_metadata[8]; + protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[8]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h index cf8e1693..61b0510d 100644 --- a/src/google/protobuf/wrappers.pb.h +++ b/src/google/protobuf/wrappers.pb.h @@ -8,17 +8,18 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 3001000 +#if GOOGLE_PROTOBUF_VERSION < 3002000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif +#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> @@ -63,9 +64,16 @@ LIBPROTOBUF_EXPORT extern UInt64ValueDefaultTypeInternal _UInt64Value_default_in namespace google { namespace protobuf { +namespace protobuf_google_2fprotobuf_2fwrappers_2eproto { // Internal implementation detail -- do not call these. -void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto(); -void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto(); +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::uint32 offsets[]; + static void InitDefaultsImpl(); + static void Shutdown(); +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaults(); +} // namespace protobuf_google_2fprotobuf_2fwrappers_2eproto // =================================================================== @@ -119,7 +127,8 @@ class LIBPROTOBUF_EXPORT DoubleValue : public ::google::protobuf::Message /* @@p bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -162,11 +171,7 @@ class LIBPROTOBUF_EXPORT DoubleValue : public ::google::protobuf::Message /* @@p typedef void DestructorSkippable_; double value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -220,7 +225,8 @@ class LIBPROTOBUF_EXPORT FloatValue : public ::google::protobuf::Message /* @@pr bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -263,11 +269,7 @@ class LIBPROTOBUF_EXPORT FloatValue : public ::google::protobuf::Message /* @@pr typedef void DestructorSkippable_; float value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -321,7 +323,8 @@ class LIBPROTOBUF_EXPORT Int64Value : public ::google::protobuf::Message /* @@pr bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -364,11 +367,7 @@ class LIBPROTOBUF_EXPORT Int64Value : public ::google::protobuf::Message /* @@pr typedef void DestructorSkippable_; ::google::protobuf::int64 value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -422,7 +421,8 @@ class LIBPROTOBUF_EXPORT UInt64Value : public ::google::protobuf::Message /* @@p bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -465,11 +465,7 @@ class LIBPROTOBUF_EXPORT UInt64Value : public ::google::protobuf::Message /* @@p typedef void DestructorSkippable_; ::google::protobuf::uint64 value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -523,7 +519,8 @@ class LIBPROTOBUF_EXPORT Int32Value : public ::google::protobuf::Message /* @@pr bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -566,11 +563,7 @@ class LIBPROTOBUF_EXPORT Int32Value : public ::google::protobuf::Message /* @@pr typedef void DestructorSkippable_; ::google::protobuf::int32 value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -624,7 +617,8 @@ class LIBPROTOBUF_EXPORT UInt32Value : public ::google::protobuf::Message /* @@p bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -667,11 +661,7 @@ class LIBPROTOBUF_EXPORT UInt32Value : public ::google::protobuf::Message /* @@p typedef void DestructorSkippable_; ::google::protobuf::uint32 value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -725,7 +715,8 @@ class LIBPROTOBUF_EXPORT BoolValue : public ::google::protobuf::Message /* @@pro bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -768,11 +759,7 @@ class LIBPROTOBUF_EXPORT BoolValue : public ::google::protobuf::Message /* @@pro typedef void DestructorSkippable_; bool value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -826,7 +813,8 @@ class LIBPROTOBUF_EXPORT StringValue : public ::google::protobuf::Message /* @@p bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -877,11 +865,7 @@ class LIBPROTOBUF_EXPORT StringValue : public ::google::protobuf::Message /* @@p typedef void DestructorSkippable_; ::google::protobuf::internal::ArenaStringPtr value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -935,7 +919,8 @@ class LIBPROTOBUF_EXPORT BytesValue : public ::google::protobuf::Message /* @@pr bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PROTOBUF_FINAL { - return InternalSerializeWithCachedSizesToArray(false, output); + return InternalSerializeWithCachedSizesToArray( + ::google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(), output); } int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: @@ -986,11 +971,7 @@ class LIBPROTOBUF_EXPORT BytesValue : public ::google::protobuf::Message /* @@pr typedef void DestructorSkippable_; ::google::protobuf::internal::ArenaStringPtr value_; mutable int _cached_size_; - friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto_impl(); - friend const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fwrappers_2eproto(); - friend void protobuf_ShutdownFile_google_2fprotobuf_2fwrappers_2eproto(); - + friend struct LIBPROTOBUF_EXPORT protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct; }; // =================================================================== |