diff options
Diffstat (limited to 'src/google/protobuf/type.pb.cc')
-rw-r--r-- | src/google/protobuf/type.pb.cc | 2243 |
1 files changed, 660 insertions, 1583 deletions
diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index 017392c9..130af52a 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -1,172 +1,245 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/type.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include <google/protobuf/type.pb.h> #include <algorithm> #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/port.h> -#include <google/protobuf/stubs/once.h> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/wire_format_lite_inl.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif // @@protoc_insertion_point(includes) +namespace protobuf_google_2fprotobuf_2fany_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fany_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Any; +} // namespace protobuf_google_2fprotobuf_2fany_2eproto +namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SourceContext; +} // namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto +namespace protobuf_google_2fprotobuf_2ftype_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2ftype_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_EnumValue; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2ftype_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Field; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2ftype_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Option; +} // namespace protobuf_google_2fprotobuf_2ftype_2eproto namespace google { namespace protobuf { -class TypeDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Type> { +class TypeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed<Type> + _instance; } _Type_default_instance_; -class FieldDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Field> { +class FieldDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed<Field> + _instance; } _Field_default_instance_; -class EnumDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Enum> { +class EnumDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed<Enum> + _instance; } _Enum_default_instance_; -class EnumValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EnumValue> { +class EnumValueDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed<EnumValue> + _instance; } _EnumValue_default_instance_; -class OptionDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Option> { +class OptionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed<Option> + _instance; } _Option_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2ftype_2eproto { +static void InitDefaultsType() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::google::protobuf::_Type_default_instance_; + new (ptr) ::google::protobuf::Type(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Type::InitAsDefaultInstance(); +} + +LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<3> scc_info_Type = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsType}, { + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Field.base, + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Option.base, + &protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::scc_info_SourceContext.base,}}; +static void InitDefaultsField() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::google::protobuf::_Field_default_instance_; + new (ptr) ::google::protobuf::Field(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Field::InitAsDefaultInstance(); +} + +LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<1> scc_info_Field = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsField}, { + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Option.base,}}; + +static void InitDefaultsEnum() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::google::protobuf::_Enum_default_instance_; + new (ptr) ::google::protobuf::Enum(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Enum::InitAsDefaultInstance(); +} + +LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<3> scc_info_Enum = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsEnum}, { + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_EnumValue.base, + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Option.base, + &protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::scc_info_SourceContext.base,}}; + +static void InitDefaultsEnumValue() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::google::protobuf::_EnumValue_default_instance_; + new (ptr) ::google::protobuf::EnumValue(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::EnumValue::InitAsDefaultInstance(); +} -namespace { +LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<1> scc_info_EnumValue = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsEnumValue}, { + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Option.base,}}; + +static void InitDefaultsOption() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::google::protobuf::_Option_default_instance_; + new (ptr) ::google::protobuf::Option(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Option::InitAsDefaultInstance(); +} + +LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<1> scc_info_Option = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsOption}, { + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Type.base); + ::google::protobuf::internal::InitSCC(&scc_info_Field.base); + ::google::protobuf::internal::InitSCC(&scc_info_Enum.base); + ::google::protobuf::internal::InitSCC(&scc_info_EnumValue.base); + ::google::protobuf::internal::InitSCC(&scc_info_Option.base); +} ::google::protobuf::Metadata file_level_metadata[5]; const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[3]; -} // namespace - -const ::google::protobuf::uint32 TableStruct::offsets[] = { +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::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 _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, oneofs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, source_context_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, syntax_), ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::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 _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, kind_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, cardinality_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, type_url_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, oneof_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, packed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, json_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, default_value_), ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::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 _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, enumvalue_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, source_context_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, syntax_), ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::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 _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValue, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValue, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValue, options_), ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::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_), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Option, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Option, value_), }; - -static const ::google::protobuf::internal::MigrationSchema schemas[] = { - { 0, -1, sizeof(Type)}, - { 10, -1, sizeof(Field)}, - { 24, -1, sizeof(Enum)}, - { 33, -1, sizeof(EnumValue)}, - { 40, -1, sizeof(Option)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::google::protobuf::Type)}, + { 11, -1, sizeof(::google::protobuf::Field)}, + { 26, -1, sizeof(::google::protobuf::Enum)}, + { 36, -1, sizeof(::google::protobuf::EnumValue)}, + { 44, -1, sizeof(::google::protobuf::Option)}, }; 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_), + reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Type_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Field_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Enum_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_EnumValue_default_instance_), + reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Option_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); - ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/type.proto", schemas, file_default_instances, TableStruct::offsets, factory, + "google/protobuf/type.proto", schemas, file_default_instances, TableStruct::offsets, file_level_metadata, file_level_enum_descriptors, NULL); } void protobuf_AssignDescriptorsOnce() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5); } -} // namespace - -void TableStruct::Shutdown() { - _Type_default_instance_.Shutdown(); - delete file_level_metadata[0].reflection; - _Field_default_instance_.Shutdown(); - delete file_level_metadata[1].reflection; - _Enum_default_instance_.Shutdown(); - delete file_level_metadata[2].reflection; - _EnumValue_default_instance_.Shutdown(); - delete file_level_metadata[3].reflection; - _Option_default_instance_.Shutdown(); - delete file_level_metadata[4].reflection; -} - -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::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(); - _EnumValue_default_instance_.DefaultConstruct(); - _Option_default_instance_.DefaultConstruct(); - _Type_default_instance_.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>( - ::google::protobuf::SourceContext::internal_default_instance()); - _Enum_default_instance_.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>( - ::google::protobuf::SourceContext::internal_default_instance()); - _Option_default_instance_.get_mutable()->value_ = const_cast< ::google::protobuf::Any*>( - ::google::protobuf::Any::internal_default_instance()); -} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\032google/protobuf/type.proto\022\017google.pro" "tobuf\032\031google/protobuf/any.proto\032$google" "/protobuf/source_context.proto\"\327\001\n\004Type\022" @@ -212,24 +285,23 @@ void AddDescriptorsImpl() { descriptor, 1594); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/type.proto", &protobuf_RegisterTypes); - ::google::protobuf::protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptors(); - ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors(); - ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); + ::protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptors(); + ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors(); } void AddDescriptors() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2ftype_2eproto - +namespace google { +namespace protobuf { const ::google::protobuf::EnumDescriptor* Field_Kind_descriptor() { protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_enum_descriptors[0]; @@ -327,25 +399,9 @@ bool Syntax_IsValid(int value) { // =================================================================== -void Type::_slow_mutable_source_context() { - source_context_ = ::google::protobuf::Arena::Create< ::google::protobuf::SourceContext >( - GetArenaNoVirtual()); -} -::google::protobuf::SourceContext* Type::_slow_release_source_context() { - if (source_context_ == NULL) { - return NULL; - } else { - ::google::protobuf::SourceContext* temp = new ::google::protobuf::SourceContext(*source_context_); - source_context_ = NULL; - return temp; - } -} -::google::protobuf::SourceContext* Type::unsafe_arena_release_source_context() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Type.source_context) - - ::google::protobuf::SourceContext* temp = source_context_; - source_context_ = NULL; - return temp; +void Type::InitAsDefaultInstance() { + ::google::protobuf::_Type_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>( + ::google::protobuf::SourceContext::internal_default_instance()); } void Type::unsafe_arena_set_allocated_source_context( ::google::protobuf::SourceContext* source_context) { @@ -360,6 +416,12 @@ void Type::unsafe_arena_set_allocated_source_context( } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Type.source_context) } +void Type::clear_source_context() { + if (GetArenaNoVirtual() == NULL && source_context_ != NULL) { + delete source_context_; + } + source_context_ = NULL; +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Type::kNameFieldNumber; const int Type::kFieldsFieldNumber; @@ -371,9 +433,8 @@ const int Type::kSyntaxFieldNumber; Type::Type() : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); - } + ::google::protobuf::internal::InitSCC( + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Type.base); SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Type) } @@ -383,9 +444,7 @@ Type::Type(::google::protobuf::Arena* arena) fields_(arena), oneofs_(arena), options_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Type.base); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Type) @@ -395,8 +454,7 @@ Type::Type(const Type& from) _internal_metadata_(NULL), fields_(from.fields_), oneofs_(from.oneofs_), - options_(from.options_), - _cached_size_(0) { + options_(from.options_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.name().size() > 0) { @@ -414,9 +472,9 @@ Type::Type(const Type& from) void Type::SharedCtor() { name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&source_context_, 0, reinterpret_cast<char*>(&syntax_) - - reinterpret_cast<char*>(&source_context_) + sizeof(syntax_)); - _cached_size_ = 0; + ::memset(&source_context_, 0, static_cast<size_t>( + reinterpret_cast<char*>(&syntax_) - + reinterpret_cast<char*>(&source_context_)) + sizeof(syntax_)); } Type::~Type() { @@ -425,15 +483,9 @@ Type::~Type() { } void Type::SharedDtor() { - ::google::protobuf::Arena* arena = GetArenaNoVirtual(); - if (arena != NULL) { - return; - } - - name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); - if (this != internal_default_instance()) { - delete source_context_; - } + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete source_context_; } void Type::ArenaDtor(void* object) { @@ -443,26 +495,25 @@ void Type::ArenaDtor(void* object) { void Type::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Type::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Type::descriptor() { - protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[0].descriptor; + ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Type& Type::default_instance() { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Type.base); return *internal_default_instance(); } -Type* Type::New(::google::protobuf::Arena* arena) const { - return ::google::protobuf::Arena::CreateMessage<Type>(arena); -} void Type::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Type) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + fields_.Clear(); oneofs_.Clear(); options_.Clear(); @@ -472,6 +523,7 @@ void Type::Clear() { } source_context_ = NULL; syntax_ = 0; + _internal_metadata_.Clear(); } bool Type::MergePartialFromCodedStream( @@ -480,18 +532,18 @@ bool Type::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Type) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u)) { + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Type.name")); } else { @@ -503,26 +555,24 @@ bool Type::MergePartialFromCodedStream( // repeated .google.protobuf.Field fields = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(18u)) { - DO_(input->IncrementRecursionDepth()); - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, add_fields())); } else { goto handle_unusual; } - input->UnsafeDecrementRecursionDepth(); break; } // repeated string oneofs = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(26u)) { + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_oneofs())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->oneofs(this->oneofs_size() - 1).data(), - this->oneofs(this->oneofs_size() - 1).length(), + static_cast<int>(this->oneofs(this->oneofs_size() - 1).length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Type.oneofs")); } else { @@ -534,22 +584,20 @@ bool Type::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 4; case 4: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(34u)) { - DO_(input->IncrementRecursionDepth()); - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, add_options())); } else { goto handle_unusual; } - input->UnsafeDecrementRecursionDepth(); break; } // .google.protobuf.SourceContext source_context = 5; case 5: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(42u)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_source_context())); } else { goto handle_unusual; @@ -560,7 +608,7 @@ bool Type::MergePartialFromCodedStream( // .google.protobuf.Syntax syntax = 6; case 6: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(48u)) { + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -574,12 +622,11 @@ bool Type::MergePartialFromCodedStream( default: { handle_unusual: - if (tag == 0 || - ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + if (tag == 0) { goto success; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } @@ -596,10 +643,13 @@ failure: void Type::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Type) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Type.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( @@ -607,15 +657,18 @@ void Type::SerializeWithCachedSizes( } // repeated .google.protobuf.Field fields = 2; - for (unsigned int i = 0, n = this->fields_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->fields_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, this->fields(i), output); + 2, + this->fields(static_cast<int>(i)), + output); } // repeated string oneofs = 3; for (int i = 0, n = this->oneofs_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->oneofs(i).data(), this->oneofs(i).length(), + this->oneofs(i).data(), static_cast<int>(this->oneofs(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Type.oneofs"); ::google::protobuf::internal::WireFormatLite::WriteString( @@ -623,15 +676,18 @@ void Type::SerializeWithCachedSizes( } // repeated .google.protobuf.Option options = 4; - for (unsigned int i = 0, n = this->options_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->options_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, this->options(i), output); + 4, + this->options(static_cast<int>(i)), + output); } // .google.protobuf.SourceContext source_context = 5; if (this->has_source_context()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, *this->source_context_, output); + 5, this->_internal_source_context(), output); } // .google.protobuf.Syntax syntax = 6; @@ -640,17 +696,24 @@ void Type::SerializeWithCachedSizes( 6, this->syntax(), output); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } // @@protoc_insertion_point(serialize_end:google.protobuf.Type) } ::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) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Type.name"); target = @@ -659,16 +722,17 @@ void Type::SerializeWithCachedSizes( } // repeated .google.protobuf.Field fields = 2; - for (unsigned int i = 0, n = this->fields_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->fields_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 2, this->fields(i), false, target); + InternalWriteMessageToArray( + 2, this->fields(static_cast<int>(i)), deterministic, target); } // repeated string oneofs = 3; for (int i = 0, n = this->oneofs_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->oneofs(i).data(), this->oneofs(i).length(), + this->oneofs(i).data(), static_cast<int>(this->oneofs(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Type.oneofs"); target = ::google::protobuf::internal::WireFormatLite:: @@ -676,17 +740,18 @@ void Type::SerializeWithCachedSizes( } // repeated .google.protobuf.Option options = 4; - for (unsigned int i = 0, n = this->options_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->options_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 4, this->options(i), false, target); + InternalWriteMessageToArray( + 4, this->options(static_cast<int>(i)), deterministic, target); } // .google.protobuf.SourceContext source_context = 5; if (this->has_source_context()) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 5, *this->source_context_, false, target); + InternalWriteMessageToArray( + 5, this->_internal_source_context(), deterministic, target); } // .google.protobuf.Syntax syntax = 6; @@ -695,6 +760,10 @@ void Type::SerializeWithCachedSizes( 6, this->syntax(), target); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Type) return target; } @@ -703,14 +772,19 @@ size_t Type::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Type) size_t total_size = 0; + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } // repeated .google.protobuf.Field fields = 2; { - unsigned int count = this->fields_size(); + unsigned int count = static_cast<unsigned int>(this->fields_size()); total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->fields(i)); + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->fields(static_cast<int>(i))); } } @@ -724,12 +798,12 @@ size_t Type::ByteSizeLong() const { // repeated .google.protobuf.Option options = 4; { - unsigned int count = this->options_size(); + unsigned int count = static_cast<unsigned int>(this->options_size()); total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->options(i)); + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->options(static_cast<int>(i))); } } @@ -743,8 +817,8 @@ size_t Type::ByteSizeLong() const { // .google.protobuf.SourceContext source_context = 5; if (this->has_source_context()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - *this->source_context_); + ::google::protobuf::internal::WireFormatLite::MessageSize( + *source_context_); } // .google.protobuf.Syntax syntax = 6; @@ -754,9 +828,7 @@ size_t Type::ByteSizeLong() const { } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + SetCachedSize(cached_size); return total_size; } @@ -779,6 +851,9 @@ void Type::MergeFrom(const Type& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Type) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + fields_.MergeFrom(from.fields_); oneofs_.MergeFrom(from.oneofs_); options_.MergeFrom(from.options_); @@ -831,285 +906,27 @@ void Type::UnsafeArenaSwap(Type* other) { InternalSwap(other); } void Type::InternalSwap(Type* other) { - fields_.UnsafeArenaSwap(&other->fields_); - oneofs_.UnsafeArenaSwap(&other->oneofs_); - options_.UnsafeArenaSwap(&other->options_); - name_.Swap(&other->name_); - std::swap(source_context_, other->source_context_); - std::swap(syntax_, other->syntax_); - std::swap(_cached_size_, other->_cached_size_); + using std::swap; + CastToBase(&fields_)->InternalSwap(CastToBase(&other->fields_)); + oneofs_.InternalSwap(CastToBase(&other->oneofs_)); + CastToBase(&options_)->InternalSwap(CastToBase(&other->options_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(source_context_, other->source_context_); + swap(syntax_, other->syntax_); + _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata Type::GetMetadata() const { protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[0]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Type - -// string name = 1; -void Type::clear_name() { - name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -const ::std::string& Type::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Type.name) - return name_.Get(); -} -void Type::set_name(const ::std::string& value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.Type.name) -} -void Type::set_name(const char* value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.Type.name) -} -void Type::set_name(const char* value, - size_t size) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.name) -} -::std::string* Type::mutable_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Type.name) - return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Type::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Type.name) - - return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Type::unsafe_arena_release_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Type.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - - return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -void Type::set_allocated_name(::std::string* name) { - if (name != NULL) { - - } else { - - } - name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.name) -} -void Type::unsafe_arena_set_allocated_name( - ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { - - } else { - - } - name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - name, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Type.name) -} - -// repeated .google.protobuf.Field fields = 2; -int Type::fields_size() const { - return fields_.size(); -} -void Type::clear_fields() { - fields_.Clear(); -} -const ::google::protobuf::Field& Type::fields(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Type.fields) - return fields_.Get(index); -} -::google::protobuf::Field* Type::mutable_fields(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Type.fields) - return fields_.Mutable(index); -} -::google::protobuf::Field* Type::add_fields() { - // @@protoc_insertion_point(field_add:google.protobuf.Type.fields) - return fields_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >* -Type::mutable_fields() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.fields) - return &fields_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >& -Type::fields() const { - // @@protoc_insertion_point(field_list:google.protobuf.Type.fields) - return fields_; -} - -// repeated string oneofs = 3; -int Type::oneofs_size() const { - return oneofs_.size(); -} -void Type::clear_oneofs() { - oneofs_.Clear(); -} -const ::std::string& Type::oneofs(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Type.oneofs) - return oneofs_.Get(index); -} -::std::string* Type::mutable_oneofs(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Type.oneofs) - return oneofs_.Mutable(index); -} -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) -} -void Type::set_oneofs(int index, const char* value, size_t size) { - oneofs_.Mutable(index)->assign( - reinterpret_cast<const char*>(value), size); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.oneofs) -} -::std::string* Type::add_oneofs() { - // @@protoc_insertion_point(field_add_mutable:google.protobuf.Type.oneofs) - return oneofs_.Add(); -} -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) -} -void Type::add_oneofs(const char* value, size_t size) { - oneofs_.Add()->assign(reinterpret_cast<const char*>(value), size); - // @@protoc_insertion_point(field_add_pointer:google.protobuf.Type.oneofs) -} -const ::google::protobuf::RepeatedPtrField< ::std::string>& -Type::oneofs() const { - // @@protoc_insertion_point(field_list:google.protobuf.Type.oneofs) - return oneofs_; -} -::google::protobuf::RepeatedPtrField< ::std::string>* -Type::mutable_oneofs() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.oneofs) - return &oneofs_; + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages]; } -// repeated .google.protobuf.Option options = 4; -int Type::options_size() const { - return options_.size(); -} -void Type::clear_options() { - options_.Clear(); -} -const ::google::protobuf::Option& Type::options(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Type.options) - return options_.Get(index); -} -::google::protobuf::Option* Type::mutable_options(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Type.options) - return options_.Mutable(index); -} -::google::protobuf::Option* Type::add_options() { - // @@protoc_insertion_point(field_add:google.protobuf.Type.options) - return options_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* -Type::mutable_options() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.options) - return &options_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& -Type::options() const { - // @@protoc_insertion_point(field_list:google.protobuf.Type.options) - return options_; -} - -// .google.protobuf.SourceContext source_context = 5; -bool Type::has_source_context() const { - return this != internal_default_instance() && source_context_ != NULL; -} -void Type::clear_source_context() { - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_; - source_context_ = NULL; -} -const ::google::protobuf::SourceContext& Type::source_context() const { - // @@protoc_insertion_point(field_get:google.protobuf.Type.source_context) - return source_context_ != NULL ? *source_context_ - : *::google::protobuf::SourceContext::internal_default_instance(); -} -::google::protobuf::SourceContext* Type::mutable_source_context() { - - if (source_context_ == NULL) { - _slow_mutable_source_context(); - } - // @@protoc_insertion_point(field_mutable:google.protobuf.Type.source_context) - return source_context_; -} -::google::protobuf::SourceContext* Type::release_source_context() { - // @@protoc_insertion_point(field_release:google.protobuf.Type.source_context) - - if (GetArenaNoVirtual() != NULL) { - return _slow_release_source_context(); - } else { - ::google::protobuf::SourceContext* temp = source_context_; - source_context_ = NULL; - return temp; - } -} - void Type::set_allocated_source_context(::google::protobuf::SourceContext* source_context) { - ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { - delete source_context_; - } - if (source_context != NULL) { - if (message_arena != NULL) { - message_arena->Own(source_context); - } - } - source_context_ = source_context; - if (source_context) { - - } else { - - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.source_context) -} - -// .google.protobuf.Syntax syntax = 6; -void Type::clear_syntax() { - syntax_ = 0; -} -::google::protobuf::Syntax Type::syntax() const { - // @@protoc_insertion_point(field_get:google.protobuf.Type.syntax) - return static_cast< ::google::protobuf::Syntax >(syntax_); -} -void Type::set_syntax(::google::protobuf::Syntax value) { - - syntax_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Type.syntax) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void Field::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Field::kKindFieldNumber; const int Field::kCardinalityFieldNumber; @@ -1125,9 +942,8 @@ const int Field::kDefaultValueFieldNumber; Field::Field() : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); - } + ::google::protobuf::internal::InitSCC( + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Field.base); SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Field) } @@ -1135,9 +951,7 @@ Field::Field(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), options_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Field.base); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Field) @@ -1145,8 +959,7 @@ Field::Field(::google::protobuf::Arena* arena) Field::Field(const Field& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), - options_(from.options_), - _cached_size_(0) { + options_(from.options_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.name().size() > 0) { @@ -1169,8 +982,8 @@ Field::Field(const Field& from) GetArenaNoVirtual()); } ::memcpy(&kind_, &from.kind_, - reinterpret_cast<char*>(&packed_) - - reinterpret_cast<char*>(&kind_) + sizeof(packed_)); + static_cast<size_t>(reinterpret_cast<char*>(&packed_) - + reinterpret_cast<char*>(&kind_)) + sizeof(packed_)); // @@protoc_insertion_point(copy_constructor:google.protobuf.Field) } @@ -1179,9 +992,9 @@ void Field::SharedCtor() { type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&kind_, 0, reinterpret_cast<char*>(&packed_) - - reinterpret_cast<char*>(&kind_) + sizeof(packed_)); - _cached_size_ = 0; + ::memset(&kind_, 0, static_cast<size_t>( + reinterpret_cast<char*>(&packed_) - + reinterpret_cast<char*>(&kind_)) + sizeof(packed_)); } Field::~Field() { @@ -1190,15 +1003,11 @@ Field::~Field() { } void Field::SharedDtor() { - ::google::protobuf::Arena* arena = GetArenaNoVirtual(); - if (arena != NULL) { - return; - } - - name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); - type_url_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); - json_name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); - default_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + json_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + default_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::ArenaDtor(void* object) { @@ -1208,33 +1017,34 @@ void Field::ArenaDtor(void* object) { void Field::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Field::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Field::descriptor() { - protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[1].descriptor; + ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Field& Field::default_instance() { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Field.base); return *internal_default_instance(); } -Field* Field::New(::google::protobuf::Arena* arena) const { - return ::google::protobuf::Arena::CreateMessage<Field>(arena); -} void Field::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Field) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + options_.Clear(); name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); type_url_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - ::memset(&kind_, 0, reinterpret_cast<char*>(&packed_) - - reinterpret_cast<char*>(&kind_) + sizeof(packed_)); + ::memset(&kind_, 0, static_cast<size_t>( + reinterpret_cast<char*>(&packed_) - + reinterpret_cast<char*>(&kind_)) + sizeof(packed_)); + _internal_metadata_.Clear(); } bool Field::MergePartialFromCodedStream( @@ -1243,14 +1053,14 @@ bool Field::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Field) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // .google.protobuf.Field.Kind kind = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(8u)) { + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -1265,7 +1075,7 @@ bool Field::MergePartialFromCodedStream( // .google.protobuf.Field.Cardinality cardinality = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(16u)) { + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -1280,7 +1090,7 @@ bool Field::MergePartialFromCodedStream( // int32 number = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(24u)) { + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -1294,11 +1104,11 @@ bool Field::MergePartialFromCodedStream( // string name = 4; case 4: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(34u)) { + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Field.name")); } else { @@ -1310,11 +1120,11 @@ bool Field::MergePartialFromCodedStream( // string type_url = 6; case 6: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(50u)) { + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->type_url().data(), this->type_url().length(), + this->type_url().data(), static_cast<int>(this->type_url().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Field.type_url")); } else { @@ -1326,7 +1136,7 @@ bool Field::MergePartialFromCodedStream( // int32 oneof_index = 7; case 7: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(56u)) { + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -1340,7 +1150,7 @@ bool Field::MergePartialFromCodedStream( // bool packed = 8; case 8: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(64u)) { + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -1354,25 +1164,23 @@ bool Field::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 9; case 9: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(74u)) { - DO_(input->IncrementRecursionDepth()); - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, add_options())); } else { goto handle_unusual; } - input->UnsafeDecrementRecursionDepth(); break; } // string json_name = 10; case 10: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(82u)) { + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_json_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->json_name().data(), this->json_name().length(), + this->json_name().data(), static_cast<int>(this->json_name().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Field.json_name")); } else { @@ -1384,11 +1192,11 @@ bool Field::MergePartialFromCodedStream( // string default_value = 11; case 11: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(90u)) { + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_default_value())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->default_value().data(), this->default_value().length(), + this->default_value().data(), static_cast<int>(this->default_value().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Field.default_value")); } else { @@ -1399,12 +1207,11 @@ bool Field::MergePartialFromCodedStream( default: { handle_unusual: - if (tag == 0 || - ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + if (tag == 0) { goto success; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } @@ -1421,6 +1228,9 @@ failure: void Field::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Field) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // .google.protobuf.Field.Kind kind = 1; if (this->kind() != 0) { ::google::protobuf::internal::WireFormatLite::WriteEnum( @@ -1441,7 +1251,7 @@ void Field::SerializeWithCachedSizes( // string name = 4; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( @@ -1451,7 +1261,7 @@ void Field::SerializeWithCachedSizes( // string type_url = 6; if (this->type_url().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->type_url().data(), this->type_url().length(), + this->type_url().data(), static_cast<int>(this->type_url().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.type_url"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( @@ -1469,15 +1279,18 @@ void Field::SerializeWithCachedSizes( } // repeated .google.protobuf.Option options = 9; - for (unsigned int i = 0, n = this->options_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->options_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 9, this->options(i), output); + 9, + this->options(static_cast<int>(i)), + output); } // string json_name = 10; if (this->json_name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->json_name().data(), this->json_name().length(), + this->json_name().data(), static_cast<int>(this->json_name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.json_name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( @@ -1487,20 +1300,27 @@ void Field::SerializeWithCachedSizes( // string default_value = 11; if (this->default_value().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->default_value().data(), this->default_value().length(), + this->default_value().data(), static_cast<int>(this->default_value().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.default_value"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 11, this->default_value(), output); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } // @@protoc_insertion_point(serialize_end:google.protobuf.Field) } ::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::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // .google.protobuf.Field.Kind kind = 1; if (this->kind() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( @@ -1521,7 +1341,7 @@ void Field::SerializeWithCachedSizes( // string name = 4; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.name"); target = @@ -1532,7 +1352,7 @@ void Field::SerializeWithCachedSizes( // string type_url = 6; if (this->type_url().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->type_url().data(), this->type_url().length(), + this->type_url().data(), static_cast<int>(this->type_url().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.type_url"); target = @@ -1551,16 +1371,17 @@ void Field::SerializeWithCachedSizes( } // repeated .google.protobuf.Option options = 9; - for (unsigned int i = 0, n = this->options_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->options_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 9, this->options(i), false, target); + InternalWriteMessageToArray( + 9, this->options(static_cast<int>(i)), deterministic, target); } // string json_name = 10; if (this->json_name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->json_name().data(), this->json_name().length(), + this->json_name().data(), static_cast<int>(this->json_name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.json_name"); target = @@ -1571,7 +1392,7 @@ void Field::SerializeWithCachedSizes( // string default_value = 11; if (this->default_value().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->default_value().data(), this->default_value().length(), + this->default_value().data(), static_cast<int>(this->default_value().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.default_value"); target = @@ -1579,6 +1400,10 @@ void Field::SerializeWithCachedSizes( 11, this->default_value(), target); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Field) return target; } @@ -1587,14 +1412,19 @@ size_t Field::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Field) size_t total_size = 0; + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } // repeated .google.protobuf.Option options = 9; { - unsigned int count = this->options_size(); + unsigned int count = static_cast<unsigned int>(this->options_size()); total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->options(i)); + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->options(static_cast<int>(i))); } } @@ -1658,9 +1488,7 @@ size_t Field::ByteSizeLong() const { } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + SetCachedSize(cached_size); return total_size; } @@ -1683,6 +1511,9 @@ void Field::MergeFrom(const Field& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Field) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + options_.MergeFrom(from.options_); if (from.name().size() > 0) { set_name(from.name()); @@ -1751,414 +1582,35 @@ void Field::UnsafeArenaSwap(Field* other) { InternalSwap(other); } void Field::InternalSwap(Field* other) { - options_.UnsafeArenaSwap(&other->options_); - name_.Swap(&other->name_); - type_url_.Swap(&other->type_url_); - json_name_.Swap(&other->json_name_); - default_value_.Swap(&other->default_value_); - std::swap(kind_, other->kind_); - std::swap(cardinality_, other->cardinality_); - std::swap(number_, other->number_); - std::swap(oneof_index_, other->oneof_index_); - std::swap(packed_, other->packed_); - std::swap(_cached_size_, other->_cached_size_); + using std::swap; + CastToBase(&options_)->InternalSwap(CastToBase(&other->options_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + type_url_.Swap(&other->type_url_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + json_name_.Swap(&other->json_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + default_value_.Swap(&other->default_value_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(kind_, other->kind_); + swap(cardinality_, other->cardinality_); + swap(number_, other->number_); + swap(oneof_index_, other->oneof_index_); + swap(packed_, other->packed_); + _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata Field::GetMetadata() const { protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[1]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Field - -// .google.protobuf.Field.Kind kind = 1; -void Field::clear_kind() { - kind_ = 0; -} -::google::protobuf::Field_Kind Field::kind() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.kind) - return static_cast< ::google::protobuf::Field_Kind >(kind_); -} -void Field::set_kind(::google::protobuf::Field_Kind value) { - - kind_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Field.kind) -} - -// .google.protobuf.Field.Cardinality cardinality = 2; -void Field::clear_cardinality() { - cardinality_ = 0; -} -::google::protobuf::Field_Cardinality Field::cardinality() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.cardinality) - return static_cast< ::google::protobuf::Field_Cardinality >(cardinality_); -} -void Field::set_cardinality(::google::protobuf::Field_Cardinality value) { - - cardinality_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Field.cardinality) -} - -// int32 number = 3; -void Field::clear_number() { - number_ = 0; -} -::google::protobuf::int32 Field::number() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.number) - return number_; -} -void Field::set_number(::google::protobuf::int32 value) { - - number_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Field.number) -} - -// string name = 4; -void Field::clear_name() { - name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -const ::std::string& Field::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.name) - return name_.Get(); -} -void Field::set_name(const ::std::string& value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.Field.name) -} -void Field::set_name(const char* value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.Field.name) -} -void Field::set_name(const char* value, - size_t size) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.name) -} -::std::string* Field::mutable_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Field.name) - return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Field::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Field.name) - - return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Field::unsafe_arena_release_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - - return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -void Field::set_allocated_name(::std::string* name) { - if (name != NULL) { - - } else { - - } - name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.name) -} -void Field::unsafe_arena_set_allocated_name( - ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { - - } else { - - } - name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - name, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.name) -} - -// string type_url = 6; -void Field::clear_type_url() { - type_url_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -const ::std::string& Field::type_url() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.type_url) - return type_url_.Get(); -} -void Field::set_type_url(const ::std::string& value) { - - type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.Field.type_url) -} -void Field::set_type_url(const char* value) { - - type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.Field.type_url) -} -void Field::set_type_url(const char* value, - size_t size) { - - type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.type_url) -} -::std::string* Field::mutable_type_url() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Field.type_url) - return type_url_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Field::release_type_url() { - // @@protoc_insertion_point(field_release:google.protobuf.Field.type_url) - - return type_url_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Field::unsafe_arena_release_type_url() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.type_url) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - - return type_url_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -void Field::set_allocated_type_url(::std::string* type_url) { - if (type_url != NULL) { - - } else { - - } - type_url_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.type_url) -} -void Field::unsafe_arena_set_allocated_type_url( - ::std::string* type_url) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (type_url != NULL) { - - } else { - - } - type_url_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - type_url, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.type_url) -} - -// int32 oneof_index = 7; -void Field::clear_oneof_index() { - oneof_index_ = 0; -} -::google::protobuf::int32 Field::oneof_index() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.oneof_index) - return oneof_index_; -} -void Field::set_oneof_index(::google::protobuf::int32 value) { - - oneof_index_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Field.oneof_index) -} - -// bool packed = 8; -void Field::clear_packed() { - packed_ = false; -} -bool Field::packed() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.packed) - return packed_; -} -void Field::set_packed(bool value) { - - packed_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Field.packed) -} - -// repeated .google.protobuf.Option options = 9; -int Field::options_size() const { - return options_.size(); -} -void Field::clear_options() { - options_.Clear(); -} -const ::google::protobuf::Option& Field::options(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.options) - return options_.Get(index); -} -::google::protobuf::Option* Field::mutable_options(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Field.options) - return options_.Mutable(index); -} -::google::protobuf::Option* Field::add_options() { - // @@protoc_insertion_point(field_add:google.protobuf.Field.options) - return options_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* -Field::mutable_options() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Field.options) - return &options_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& -Field::options() const { - // @@protoc_insertion_point(field_list:google.protobuf.Field.options) - return options_; + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages]; } -// string json_name = 10; -void Field::clear_json_name() { - json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -const ::std::string& Field::json_name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.json_name) - return json_name_.Get(); -} -void Field::set_json_name(const ::std::string& value) { - - json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.Field.json_name) -} -void Field::set_json_name(const char* value) { - - json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.Field.json_name) -} -void Field::set_json_name(const char* value, - size_t size) { - - json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.json_name) -} -::std::string* Field::mutable_json_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Field.json_name) - return json_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Field::release_json_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Field.json_name) - - return json_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Field::unsafe_arena_release_json_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.json_name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - - return json_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -void Field::set_allocated_json_name(::std::string* json_name) { - if (json_name != NULL) { - - } else { - - } - json_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.json_name) -} -void Field::unsafe_arena_set_allocated_json_name( - ::std::string* json_name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (json_name != NULL) { - - } else { - - } - json_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - json_name, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.json_name) -} - -// string default_value = 11; -void Field::clear_default_value() { - default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -const ::std::string& Field::default_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Field.default_value) - return default_value_.Get(); -} -void Field::set_default_value(const ::std::string& value) { - - default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.Field.default_value) -} -void Field::set_default_value(const char* value) { - - default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.Field.default_value) -} -void Field::set_default_value(const char* value, - size_t size) { - - default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.default_value) -} -::std::string* Field::mutable_default_value() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Field.default_value) - return default_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Field::release_default_value() { - // @@protoc_insertion_point(field_release:google.protobuf.Field.default_value) - - return default_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Field::unsafe_arena_release_default_value() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.default_value) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - - return default_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -void Field::set_allocated_default_value(::std::string* default_value) { - if (default_value != NULL) { - - } else { - - } - default_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.default_value) -} -void Field::unsafe_arena_set_allocated_default_value( - ::std::string* default_value) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (default_value != NULL) { - - } else { - - } - default_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - default_value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.default_value) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== -void Enum::_slow_mutable_source_context() { - source_context_ = ::google::protobuf::Arena::Create< ::google::protobuf::SourceContext >( - GetArenaNoVirtual()); -} -::google::protobuf::SourceContext* Enum::_slow_release_source_context() { - if (source_context_ == NULL) { - return NULL; - } else { - ::google::protobuf::SourceContext* temp = new ::google::protobuf::SourceContext(*source_context_); - source_context_ = NULL; - return temp; - } -} -::google::protobuf::SourceContext* Enum::unsafe_arena_release_source_context() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Enum.source_context) - - ::google::protobuf::SourceContext* temp = source_context_; - source_context_ = NULL; - return temp; +void Enum::InitAsDefaultInstance() { + ::google::protobuf::_Enum_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>( + ::google::protobuf::SourceContext::internal_default_instance()); } void Enum::unsafe_arena_set_allocated_source_context( ::google::protobuf::SourceContext* source_context) { @@ -2173,6 +1625,12 @@ void Enum::unsafe_arena_set_allocated_source_context( } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Enum.source_context) } +void Enum::clear_source_context() { + if (GetArenaNoVirtual() == NULL && source_context_ != NULL) { + delete source_context_; + } + source_context_ = NULL; +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Enum::kNameFieldNumber; const int Enum::kEnumvalueFieldNumber; @@ -2183,9 +1641,8 @@ const int Enum::kSyntaxFieldNumber; Enum::Enum() : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); - } + ::google::protobuf::internal::InitSCC( + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Enum.base); SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Enum) } @@ -2194,9 +1651,7 @@ Enum::Enum(::google::protobuf::Arena* arena) _internal_metadata_(arena), enumvalue_(arena), options_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Enum.base); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Enum) @@ -2205,8 +1660,7 @@ Enum::Enum(const Enum& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), enumvalue_(from.enumvalue_), - options_(from.options_), - _cached_size_(0) { + options_(from.options_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.name().size() > 0) { @@ -2224,9 +1678,9 @@ Enum::Enum(const Enum& from) void Enum::SharedCtor() { name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&source_context_, 0, reinterpret_cast<char*>(&syntax_) - - reinterpret_cast<char*>(&source_context_) + sizeof(syntax_)); - _cached_size_ = 0; + ::memset(&source_context_, 0, static_cast<size_t>( + reinterpret_cast<char*>(&syntax_) - + reinterpret_cast<char*>(&source_context_)) + sizeof(syntax_)); } Enum::~Enum() { @@ -2235,15 +1689,9 @@ Enum::~Enum() { } void Enum::SharedDtor() { - ::google::protobuf::Arena* arena = GetArenaNoVirtual(); - if (arena != NULL) { - return; - } - - name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); - if (this != internal_default_instance()) { - delete source_context_; - } + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete source_context_; } void Enum::ArenaDtor(void* object) { @@ -2253,26 +1701,25 @@ void Enum::ArenaDtor(void* object) { void Enum::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Enum::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Enum::descriptor() { - protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[2].descriptor; + ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Enum& Enum::default_instance() { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Enum.base); return *internal_default_instance(); } -Enum* Enum::New(::google::protobuf::Arena* arena) const { - return ::google::protobuf::Arena::CreateMessage<Enum>(arena); -} void Enum::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Enum) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + enumvalue_.Clear(); options_.Clear(); name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); @@ -2281,6 +1728,7 @@ void Enum::Clear() { } source_context_ = NULL; syntax_ = 0; + _internal_metadata_.Clear(); } bool Enum::MergePartialFromCodedStream( @@ -2289,18 +1737,18 @@ bool Enum::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Enum) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u)) { + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Enum.name")); } else { @@ -2312,36 +1760,32 @@ bool Enum::MergePartialFromCodedStream( // repeated .google.protobuf.EnumValue enumvalue = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(18u)) { - DO_(input->IncrementRecursionDepth()); - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, add_enumvalue())); } else { goto handle_unusual; } - input->UnsafeDecrementRecursionDepth(); break; } // repeated .google.protobuf.Option options = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(26u)) { - DO_(input->IncrementRecursionDepth()); - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, add_options())); } else { goto handle_unusual; } - input->UnsafeDecrementRecursionDepth(); break; } // .google.protobuf.SourceContext source_context = 4; case 4: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(34u)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_source_context())); } else { goto handle_unusual; @@ -2352,7 +1796,7 @@ bool Enum::MergePartialFromCodedStream( // .google.protobuf.Syntax syntax = 5; case 5: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(40u)) { + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -2366,12 +1810,11 @@ bool Enum::MergePartialFromCodedStream( default: { handle_unusual: - if (tag == 0 || - ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + if (tag == 0) { goto success; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } @@ -2388,10 +1831,13 @@ failure: void Enum::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Enum) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Enum.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( @@ -2399,21 +1845,27 @@ void Enum::SerializeWithCachedSizes( } // repeated .google.protobuf.EnumValue enumvalue = 2; - for (unsigned int i = 0, n = this->enumvalue_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->enumvalue_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, this->enumvalue(i), output); + 2, + this->enumvalue(static_cast<int>(i)), + output); } // repeated .google.protobuf.Option options = 3; - for (unsigned int i = 0, n = this->options_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->options_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, this->options(i), output); + 3, + this->options(static_cast<int>(i)), + output); } // .google.protobuf.SourceContext source_context = 4; if (this->has_source_context()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, *this->source_context_, output); + 4, this->_internal_source_context(), output); } // .google.protobuf.Syntax syntax = 5; @@ -2422,17 +1874,24 @@ void Enum::SerializeWithCachedSizes( 5, this->syntax(), output); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } // @@protoc_insertion_point(serialize_end:google.protobuf.Enum) } ::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) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Enum.name"); target = @@ -2441,24 +1900,26 @@ void Enum::SerializeWithCachedSizes( } // repeated .google.protobuf.EnumValue enumvalue = 2; - for (unsigned int i = 0, n = this->enumvalue_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->enumvalue_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 2, this->enumvalue(i), false, target); + InternalWriteMessageToArray( + 2, this->enumvalue(static_cast<int>(i)), deterministic, target); } // repeated .google.protobuf.Option options = 3; - for (unsigned int i = 0, n = this->options_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->options_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 3, this->options(i), false, target); + InternalWriteMessageToArray( + 3, this->options(static_cast<int>(i)), deterministic, target); } // .google.protobuf.SourceContext source_context = 4; if (this->has_source_context()) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 4, *this->source_context_, false, target); + InternalWriteMessageToArray( + 4, this->_internal_source_context(), deterministic, target); } // .google.protobuf.Syntax syntax = 5; @@ -2467,6 +1928,10 @@ void Enum::SerializeWithCachedSizes( 5, this->syntax(), target); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Enum) return target; } @@ -2475,25 +1940,30 @@ size_t Enum::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Enum) size_t total_size = 0; + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } // repeated .google.protobuf.EnumValue enumvalue = 2; { - unsigned int count = this->enumvalue_size(); + unsigned int count = static_cast<unsigned int>(this->enumvalue_size()); total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->enumvalue(i)); + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->enumvalue(static_cast<int>(i))); } } // repeated .google.protobuf.Option options = 3; { - unsigned int count = this->options_size(); + unsigned int count = static_cast<unsigned int>(this->options_size()); total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->options(i)); + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->options(static_cast<int>(i))); } } @@ -2507,8 +1977,8 @@ size_t Enum::ByteSizeLong() const { // .google.protobuf.SourceContext source_context = 4; if (this->has_source_context()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - *this->source_context_); + ::google::protobuf::internal::WireFormatLite::MessageSize( + *source_context_); } // .google.protobuf.Syntax syntax = 5; @@ -2518,9 +1988,7 @@ size_t Enum::ByteSizeLong() const { } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + SetCachedSize(cached_size); return total_size; } @@ -2543,6 +2011,9 @@ void Enum::MergeFrom(const Enum& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Enum) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + enumvalue_.MergeFrom(from.enumvalue_); options_.MergeFrom(from.options_); if (from.name().size() > 0) { @@ -2594,217 +2065,26 @@ void Enum::UnsafeArenaSwap(Enum* other) { InternalSwap(other); } void Enum::InternalSwap(Enum* other) { - enumvalue_.UnsafeArenaSwap(&other->enumvalue_); - options_.UnsafeArenaSwap(&other->options_); - name_.Swap(&other->name_); - std::swap(source_context_, other->source_context_); - std::swap(syntax_, other->syntax_); - std::swap(_cached_size_, other->_cached_size_); + using std::swap; + CastToBase(&enumvalue_)->InternalSwap(CastToBase(&other->enumvalue_)); + CastToBase(&options_)->InternalSwap(CastToBase(&other->options_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(source_context_, other->source_context_); + swap(syntax_, other->syntax_); + _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata Enum::GetMetadata() const { protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[2]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Enum - -// string name = 1; -void Enum::clear_name() { - name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -const ::std::string& Enum::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Enum.name) - return name_.Get(); -} -void Enum::set_name(const ::std::string& value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.Enum.name) -} -void Enum::set_name(const char* value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.Enum.name) -} -void Enum::set_name(const char* value, - size_t size) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Enum.name) -} -::std::string* Enum::mutable_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.name) - return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Enum::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Enum.name) - - return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Enum::unsafe_arena_release_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Enum.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - - return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -void Enum::set_allocated_name(::std::string* name) { - if (name != NULL) { - - } else { - - } - name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.name) -} -void Enum::unsafe_arena_set_allocated_name( - ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { - - } else { - - } - name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - name, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Enum.name) -} - -// repeated .google.protobuf.EnumValue enumvalue = 2; -int Enum::enumvalue_size() const { - return enumvalue_.size(); -} -void Enum::clear_enumvalue() { - enumvalue_.Clear(); -} -const ::google::protobuf::EnumValue& Enum::enumvalue(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Enum.enumvalue) - return enumvalue_.Get(index); -} -::google::protobuf::EnumValue* Enum::mutable_enumvalue(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.enumvalue) - return enumvalue_.Mutable(index); -} -::google::protobuf::EnumValue* Enum::add_enumvalue() { - // @@protoc_insertion_point(field_add:google.protobuf.Enum.enumvalue) - return enumvalue_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >* -Enum::mutable_enumvalue() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.enumvalue) - return &enumvalue_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >& -Enum::enumvalue() const { - // @@protoc_insertion_point(field_list:google.protobuf.Enum.enumvalue) - return enumvalue_; -} - -// repeated .google.protobuf.Option options = 3; -int Enum::options_size() const { - return options_.size(); -} -void Enum::clear_options() { - options_.Clear(); -} -const ::google::protobuf::Option& Enum::options(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Enum.options) - return options_.Get(index); -} -::google::protobuf::Option* Enum::mutable_options(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.options) - return options_.Mutable(index); -} -::google::protobuf::Option* Enum::add_options() { - // @@protoc_insertion_point(field_add:google.protobuf.Enum.options) - return options_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* -Enum::mutable_options() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.options) - return &options_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& -Enum::options() const { - // @@protoc_insertion_point(field_list:google.protobuf.Enum.options) - return options_; -} - -// .google.protobuf.SourceContext source_context = 4; -bool Enum::has_source_context() const { - return this != internal_default_instance() && source_context_ != NULL; -} -void Enum::clear_source_context() { - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_; - source_context_ = NULL; -} -const ::google::protobuf::SourceContext& Enum::source_context() const { - // @@protoc_insertion_point(field_get:google.protobuf.Enum.source_context) - return source_context_ != NULL ? *source_context_ - : *::google::protobuf::SourceContext::internal_default_instance(); -} -::google::protobuf::SourceContext* Enum::mutable_source_context() { - - if (source_context_ == NULL) { - _slow_mutable_source_context(); - } - // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.source_context) - return source_context_; -} -::google::protobuf::SourceContext* Enum::release_source_context() { - // @@protoc_insertion_point(field_release:google.protobuf.Enum.source_context) - - if (GetArenaNoVirtual() != NULL) { - return _slow_release_source_context(); - } else { - ::google::protobuf::SourceContext* temp = source_context_; - source_context_ = NULL; - return temp; - } -} - void Enum::set_allocated_source_context(::google::protobuf::SourceContext* source_context) { - ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { - delete source_context_; - } - if (source_context != NULL) { - if (message_arena != NULL) { - message_arena->Own(source_context); - } - } - source_context_ = source_context; - if (source_context) { - - } else { - - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.source_context) -} - -// .google.protobuf.Syntax syntax = 5; -void Enum::clear_syntax() { - syntax_ = 0; -} -::google::protobuf::Syntax Enum::syntax() const { - // @@protoc_insertion_point(field_get:google.protobuf.Enum.syntax) - return static_cast< ::google::protobuf::Syntax >(syntax_); -} -void Enum::set_syntax(::google::protobuf::Syntax value) { - - syntax_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Enum.syntax) + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void EnumValue::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int EnumValue::kNameFieldNumber; const int EnumValue::kNumberFieldNumber; @@ -2813,9 +2093,8 @@ const int EnumValue::kOptionsFieldNumber; EnumValue::EnumValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); - } + ::google::protobuf::internal::InitSCC( + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_EnumValue.base); SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValue) } @@ -2823,9 +2102,7 @@ EnumValue::EnumValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), options_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_EnumValue.base); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValue) @@ -2833,8 +2110,7 @@ EnumValue::EnumValue(::google::protobuf::Arena* arena) EnumValue::EnumValue(const EnumValue& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), - options_(from.options_), - _cached_size_(0) { + options_(from.options_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.name().size() > 0) { @@ -2848,7 +2124,6 @@ EnumValue::EnumValue(const EnumValue& from) void EnumValue::SharedCtor() { name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); number_ = 0; - _cached_size_ = 0; } EnumValue::~EnumValue() { @@ -2857,12 +2132,8 @@ EnumValue::~EnumValue() { } void EnumValue::SharedDtor() { - ::google::protobuf::Arena* arena = GetArenaNoVirtual(); - if (arena != NULL) { - return; - } - - name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void EnumValue::ArenaDtor(void* object) { @@ -2872,29 +2143,29 @@ void EnumValue::ArenaDtor(void* object) { void EnumValue::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void EnumValue::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + _cached_size_.Set(size); } const ::google::protobuf::Descriptor* EnumValue::descriptor() { - protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[3].descriptor; + ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const EnumValue& EnumValue::default_instance() { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_EnumValue.base); return *internal_default_instance(); } -EnumValue* EnumValue::New(::google::protobuf::Arena* arena) const { - return ::google::protobuf::Arena::CreateMessage<EnumValue>(arena); -} void EnumValue::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.EnumValue) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + options_.Clear(); name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); number_ = 0; + _internal_metadata_.Clear(); } bool EnumValue::MergePartialFromCodedStream( @@ -2903,18 +2174,18 @@ bool EnumValue::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.EnumValue) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u)) { + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.EnumValue.name")); } else { @@ -2926,7 +2197,7 @@ bool EnumValue::MergePartialFromCodedStream( // int32 number = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(16u)) { + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -2940,25 +2211,22 @@ bool EnumValue::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(26u)) { - DO_(input->IncrementRecursionDepth()); - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, add_options())); } else { goto handle_unusual; } - input->UnsafeDecrementRecursionDepth(); break; } default: { handle_unusual: - if (tag == 0 || - ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + if (tag == 0) { goto success; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } @@ -2975,10 +2243,13 @@ failure: void EnumValue::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.EnumValue) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.EnumValue.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( @@ -2991,22 +2262,32 @@ void EnumValue::SerializeWithCachedSizes( } // repeated .google.protobuf.Option options = 3; - for (unsigned int i = 0, n = this->options_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->options_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, this->options(i), output); + 3, + this->options(static_cast<int>(i)), + output); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValue) } ::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) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.EnumValue.name"); target = @@ -3020,12 +2301,17 @@ void EnumValue::SerializeWithCachedSizes( } // repeated .google.protobuf.Option options = 3; - for (unsigned int i = 0, n = this->options_size(); i < n; i++) { + for (unsigned int i = 0, + n = static_cast<unsigned int>(this->options_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 3, this->options(i), false, target); + InternalWriteMessageToArray( + 3, this->options(static_cast<int>(i)), deterministic, target); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValue) return target; } @@ -3034,14 +2320,19 @@ size_t EnumValue::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumValue) size_t total_size = 0; + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } // repeated .google.protobuf.Option options = 3; { - unsigned int count = this->options_size(); + unsigned int count = static_cast<unsigned int>(this->options_size()); total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->options(i)); + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->options(static_cast<int>(i))); } } @@ -3060,9 +2351,7 @@ size_t EnumValue::ByteSizeLong() const { } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + SetCachedSize(cached_size); return total_size; } @@ -3085,6 +2374,9 @@ void EnumValue::MergeFrom(const EnumValue& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumValue) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + options_.MergeFrom(from.options_); if (from.name().size() > 0) { set_name(from.name()); @@ -3132,153 +2424,25 @@ void EnumValue::UnsafeArenaSwap(EnumValue* other) { InternalSwap(other); } void EnumValue::InternalSwap(EnumValue* other) { - options_.UnsafeArenaSwap(&other->options_); - name_.Swap(&other->name_); - std::swap(number_, other->number_); - std::swap(_cached_size_, other->_cached_size_); + using std::swap; + CastToBase(&options_)->InternalSwap(CastToBase(&other->options_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(number_, other->number_); + _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata EnumValue::GetMetadata() const { protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[3]; + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// EnumValue - -// string name = 1; -void EnumValue::clear_name() { - name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -const ::std::string& EnumValue::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.name) - return name_.Get(); -} -void EnumValue::set_name(const ::std::string& value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.name) -} -void EnumValue::set_name(const char* value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValue.name) -} -void EnumValue::set_name(const char* value, - size_t size) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValue.name) -} -::std::string* EnumValue::mutable_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.name) - return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* EnumValue::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.EnumValue.name) - - return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* EnumValue::unsafe_arena_release_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValue.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - - return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -void EnumValue::set_allocated_name(::std::string* name) { - if (name != NULL) { - - } else { - - } - name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValue.name) -} -void EnumValue::unsafe_arena_set_allocated_name( - ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { - - } else { - - } - name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - name, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValue.name) -} - -// int32 number = 2; -void EnumValue::clear_number() { - number_ = 0; -} -::google::protobuf::int32 EnumValue::number() const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.number) - return number_; -} -void EnumValue::set_number(::google::protobuf::int32 value) { - - number_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.number) -} - -// repeated .google.protobuf.Option options = 3; -int EnumValue::options_size() const { - return options_.size(); -} -void EnumValue::clear_options() { - options_.Clear(); -} -const ::google::protobuf::Option& EnumValue::options(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.options) - return options_.Get(index); -} -::google::protobuf::Option* EnumValue::mutable_options(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.options) - return options_.Mutable(index); -} -::google::protobuf::Option* EnumValue::add_options() { - // @@protoc_insertion_point(field_add:google.protobuf.EnumValue.options) - return options_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* -EnumValue::mutable_options() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValue.options) - return &options_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& -EnumValue::options() const { - // @@protoc_insertion_point(field_list:google.protobuf.EnumValue.options) - return options_; -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== -void Option::_slow_mutable_value() { - value_ = ::google::protobuf::Arena::Create< ::google::protobuf::Any >( - GetArenaNoVirtual()); -} -::google::protobuf::Any* Option::_slow_release_value() { - if (value_ == NULL) { - return NULL; - } else { - ::google::protobuf::Any* temp = new ::google::protobuf::Any(*value_); - value_ = NULL; - return temp; - } -} -::google::protobuf::Any* Option::unsafe_arena_release_value() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Option.value) - - ::google::protobuf::Any* temp = value_; - value_ = NULL; - return temp; +void Option::InitAsDefaultInstance() { + ::google::protobuf::_Option_default_instance_._instance.get_mutable()->value_ = const_cast< ::google::protobuf::Any*>( + ::google::protobuf::Any::internal_default_instance()); } void Option::unsafe_arena_set_allocated_value( ::google::protobuf::Any* value) { @@ -3293,6 +2457,12 @@ void Option::unsafe_arena_set_allocated_value( } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Option.value) } +void Option::clear_value() { + if (GetArenaNoVirtual() == NULL && value_ != NULL) { + delete value_; + } + value_ = NULL; +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Option::kNameFieldNumber; const int Option::kValueFieldNumber; @@ -3300,26 +2470,22 @@ const int Option::kValueFieldNumber; Option::Option() : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); - } + ::google::protobuf::internal::InitSCC( + &protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Option.base); SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Option) } Option::Option(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Option.base); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Option) } Option::Option(const Option& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), - _cached_size_(0) { + _internal_metadata_(NULL) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.name().size() > 0) { @@ -3337,7 +2503,6 @@ Option::Option(const Option& from) void Option::SharedCtor() { name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); value_ = NULL; - _cached_size_ = 0; } Option::~Option() { @@ -3346,15 +2511,9 @@ Option::~Option() { } void Option::SharedDtor() { - ::google::protobuf::Arena* arena = GetArenaNoVirtual(); - if (arena != NULL) { - return; - } - - name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); - if (this != internal_default_instance()) { - delete value_; - } + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete value_; } void Option::ArenaDtor(void* object) { @@ -3364,31 +2523,31 @@ void Option::ArenaDtor(void* object) { void Option::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Option::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Option::descriptor() { - protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[4].descriptor; + ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Option& Option::default_instance() { - protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2ftype_2eproto::scc_info_Option.base); return *internal_default_instance(); } -Option* Option::New(::google::protobuf::Arena* arena) const { - return ::google::protobuf::Arena::CreateMessage<Option>(arena); -} void Option::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Option) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); if (GetArenaNoVirtual() == NULL && value_ != NULL) { delete value_; } value_ = NULL; + _internal_metadata_.Clear(); } bool Option::MergePartialFromCodedStream( @@ -3397,18 +2556,18 @@ bool Option::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Option) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u)) { + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Option.name")); } else { @@ -3420,8 +2579,8 @@ bool Option::MergePartialFromCodedStream( // .google.protobuf.Any value = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(18u)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_value())); } else { goto handle_unusual; @@ -3431,12 +2590,11 @@ bool Option::MergePartialFromCodedStream( default: { handle_unusual: - if (tag == 0 || - ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + if (tag == 0) { goto success; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } @@ -3453,10 +2611,13 @@ failure: void Option::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Option) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Option.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( @@ -3466,20 +2627,27 @@ void Option::SerializeWithCachedSizes( // .google.protobuf.Any value = 2; if (this->has_value()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, *this->value_, output); + 2, this->_internal_value(), output); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } // @@protoc_insertion_point(serialize_end:google.protobuf.Option) } ::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) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + // string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), this->name().length(), + this->name().data(), static_cast<int>(this->name().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Option.name"); target = @@ -3490,10 +2658,14 @@ void Option::SerializeWithCachedSizes( // .google.protobuf.Any value = 2; if (this->has_value()) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 2, *this->value_, false, target); + InternalWriteMessageToArray( + 2, this->_internal_value(), deterministic, target); } + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Option) return target; } @@ -3502,6 +2674,11 @@ size_t Option::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Option) size_t total_size = 0; + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } // string name = 1; if (this->name().size() > 0) { total_size += 1 + @@ -3512,14 +2689,12 @@ size_t Option::ByteSizeLong() const { // .google.protobuf.Any value = 2; if (this->has_value()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - *this->value_); + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_); } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + SetCachedSize(cached_size); return total_size; } @@ -3542,6 +2717,9 @@ void Option::MergeFrom(const Option& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Option) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + if (from.name().size() > 0) { set_name(from.name()); } @@ -3588,140 +2766,39 @@ void Option::UnsafeArenaSwap(Option* other) { InternalSwap(other); } void Option::InternalSwap(Option* other) { - name_.Swap(&other->name_); - std::swap(value_, other->value_); - std::swap(_cached_size_, other->_cached_size_); + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(value_, other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata Option::GetMetadata() const { protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[4]; + return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Option - -// string name = 1; -void Option::clear_name() { - name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -const ::std::string& Option::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Option.name) - return name_.Get(); -} -void Option::set_name(const ::std::string& value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.Option.name) -} -void Option::set_name(const char* value) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.Option.name) -} -void Option::set_name(const char* value, - size_t size) { - - name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Option.name) -} -::std::string* Option::mutable_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Option.name) - return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Option::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Option.name) - - return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -::std::string* Option::unsafe_arena_release_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Option.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - - return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -void Option::set_allocated_name(::std::string* name) { - if (name != NULL) { - - } else { - - } - name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.name) -} -void Option::unsafe_arena_set_allocated_name( - ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { - - } else { - - } - name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - name, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Option.name) -} -// .google.protobuf.Any value = 2; -bool Option::has_value() const { - return this != internal_default_instance() && value_ != NULL; -} -void Option::clear_value() { - if (GetArenaNoVirtual() == NULL && value_ != NULL) delete value_; - value_ = NULL; +// @@protoc_insertion_point(namespace_scope) +} // namespace protobuf +} // namespace google +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Type* Arena::CreateMaybeMessage< ::google::protobuf::Type >(Arena* arena) { + return Arena::CreateMessageInternal< ::google::protobuf::Type >(arena); } -const ::google::protobuf::Any& Option::value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Option.value) - return value_ != NULL ? *value_ - : *::google::protobuf::Any::internal_default_instance(); +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Field* Arena::CreateMaybeMessage< ::google::protobuf::Field >(Arena* arena) { + return Arena::CreateMessageInternal< ::google::protobuf::Field >(arena); } -::google::protobuf::Any* Option::mutable_value() { - - if (value_ == NULL) { - _slow_mutable_value(); - } - // @@protoc_insertion_point(field_mutable:google.protobuf.Option.value) - return value_; +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Enum* Arena::CreateMaybeMessage< ::google::protobuf::Enum >(Arena* arena) { + return Arena::CreateMessageInternal< ::google::protobuf::Enum >(arena); } -::google::protobuf::Any* Option::release_value() { - // @@protoc_insertion_point(field_release:google.protobuf.Option.value) - - if (GetArenaNoVirtual() != NULL) { - return _slow_release_value(); - } else { - ::google::protobuf::Any* temp = value_; - value_ = NULL; - return temp; - } +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::EnumValue* Arena::CreateMaybeMessage< ::google::protobuf::EnumValue >(Arena* arena) { + return Arena::CreateMessageInternal< ::google::protobuf::EnumValue >(arena); } - void Option::set_allocated_value(::google::protobuf::Any* value) { - ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { - delete value_; - } - if (value != NULL) { - if (message_arena != NULL) { - message_arena->Own(value); - } - } - value_ = value; - if (value) { - - } else { - - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.value) +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Option* Arena::CreateMaybeMessage< ::google::protobuf::Option >(Arena* arena) { + return Arena::CreateMessageInternal< ::google::protobuf::Option >(arena); } - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google |