diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2017-08-03 11:13:25 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2017-08-03 11:13:25 -0700 |
commit | 4cbbf33b773fb95aa339ee50517fd375f5120ffe (patch) | |
tree | 7b747f7af11853481922d327fc15de93f6d9b154 /src/google/protobuf/struct.pb.cc | |
parent | 778178479626b0e5b4de0701103a1bb0a067702d (diff) |
Fix invalid offsetof warning.
Use composition instead of inheritance for oneof default.
Diffstat (limited to 'src/google/protobuf/struct.pb.cc')
-rw-r--r-- | src/google/protobuf/struct.pb.cc | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 02f117fb..73c36bd7 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -19,12 +19,20 @@ namespace google { namespace protobuf { -class Struct_FieldsEntryDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Struct::Struct_FieldsEntry> { +class Struct_FieldsEntryDefaultTypeInternal { +public: + ::google::protobuf::internal::ExplicitlyConstructed<Struct::Struct_FieldsEntry> + _instance; } _Struct_FieldsEntry_default_instance_; -class StructDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Struct> { +class StructDefaultTypeInternal { +public: + ::google::protobuf::internal::ExplicitlyConstructed<Struct> + _instance; } _Struct_default_instance_; -class ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Value> { - public: +class ValueDefaultTypeInternal { +public: + ::google::protobuf::internal::ExplicitlyConstructed<Value> + _instance; int null_value_; double number_value_; ::google::protobuf::internal::ArenaStringPtr string_value_; @@ -32,7 +40,10 @@ class ValueDefaultTypeInternal : public ::google::protobuf::internal::Explicitly const ::google::protobuf::Struct* struct_value_; const ::google::protobuf::ListValue* list_value_; } _Value_default_instance_; -class ListValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<ListValue> { +class ListValueDefaultTypeInternal { +public: + ::google::protobuf::internal::ExplicitlyConstructed<ListValue> + _instance; } _ListValue_default_instance_; namespace protobuf_google_2fprotobuf_2fstruct_2eproto { @@ -109,7 +120,7 @@ void protobuf_AssignDescriptors() { AssignDescriptors( "google/protobuf/struct.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, file_level_enum_descriptors, NULL); -file_level_metadata[0].reflection = Struct::Struct_FieldsEntry::CreateReflection(file_level_metadata[0].descriptor, _Struct_FieldsEntry_default_instance_.get_mutable()); +file_level_metadata[0].reflection = Struct::Struct_FieldsEntry::CreateReflection(file_level_metadata[0].descriptor, _Struct_FieldsEntry_default_instance_._instance.get_mutable()); } void protobuf_AssignDescriptorsOnce() { @@ -128,16 +139,16 @@ void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); - _Struct_FieldsEntry_default_instance_.DefaultConstruct(); + _Struct_FieldsEntry_default_instance_._instance.DefaultConstruct(); ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Struct_FieldsEntry_default_instance_);_Struct_default_instance_.DefaultConstruct(); + &_Struct_FieldsEntry_default_instance_);_Struct_default_instance_._instance.DefaultConstruct(); ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Struct_default_instance_);_Value_default_instance_.DefaultConstruct(); + &_Struct_default_instance_);_Value_default_instance_._instance.DefaultConstruct(); ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Value_default_instance_);_ListValue_default_instance_.DefaultConstruct(); + &_Value_default_instance_);_ListValue_default_instance_._instance.DefaultConstruct(); ::google::protobuf::internal::OnShutdownDestroyMessage( - &_ListValue_default_instance_);_Struct_FieldsEntry_default_instance_.get_mutable()->set_default_instance(_Struct_FieldsEntry_default_instance_.get_mutable()); - _Struct_FieldsEntry_default_instance_.get_mutable()->InitAsDefaultInstance(); + &_ListValue_default_instance_);_Struct_FieldsEntry_default_instance_._instance.get_mutable()->set_default_instance(_Struct_FieldsEntry_default_instance_._instance.get_mutable()); + _Struct_FieldsEntry_default_instance_._instance.get_mutable()->InitAsDefaultInstance(); _Value_default_instance_.null_value_ = 0; _Value_default_instance_.number_value_ = 0; _Value_default_instance_.string_value_.UnsafeSetDefault( |