diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index 908355087..e3fb23da5 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -225,8 +225,9 @@ void Api::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Api_google_2fprotobuf_2fapi_2eproto.base); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&source_context_, 0, static_cast( - reinterpret_cast(&syntax_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&source_context_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&syntax_) - reinterpret_cast(&source_context_)) + sizeof(syntax_)); } @@ -637,8 +638,9 @@ void Method::SharedCtor() { name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); request_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); response_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&request_streaming_, 0, static_cast( - reinterpret_cast(&syntax_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&request_streaming_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&syntax_) - reinterpret_cast(&request_streaming_)) + sizeof(syntax_)); } diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index 8ef5a8b65..75c009f7a 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -2487,8 +2487,9 @@ void MessageGenerator::GenerateConstructorBody(io::Printer* printer, " reinterpret_cast(&$first$_)) + sizeof($last$_));\n"; } else { pod_template = - "::memset(&$first$_, 0, static_cast(\n" - " reinterpret_cast(&$last$_) -\n" + "::memset(reinterpret_cast(this) + static_cast(\n" + " reinterpret_cast(&$first$_) - reinterpret_cast(this)),\n" + " 0, static_cast(reinterpret_cast(&$last$_) -\n" " reinterpret_cast(&$first$_)) + sizeof($last$_));\n"; } diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 55785bc53..83d631af6 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -272,8 +272,9 @@ Version::Version(const Version& from) void Version::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Version_google_2fprotobuf_2fcompiler_2fplugin_2eproto.base); suffix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&major_, 0, static_cast( - reinterpret_cast(&patch_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&major_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&patch_) - reinterpret_cast(&major_)) + sizeof(patch_)); } diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 5f9fed317..422adf820 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1635,8 +1635,9 @@ void FileDescriptorProto::SharedCtor() { name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); syntax_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&options_, 0, static_cast( - reinterpret_cast(&source_code_info_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&options_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&source_code_info_) - reinterpret_cast(&options_)) + sizeof(source_code_info_)); } @@ -2248,8 +2249,9 @@ DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorP void DescriptorProto_ExtensionRange::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DescriptorProto_ExtensionRange_google_2fprotobuf_2fdescriptor_2eproto.base); - ::memset(&options_, 0, static_cast( - reinterpret_cast(&end_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&options_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&end_) - reinterpret_cast(&options_)) + sizeof(end_)); } @@ -2534,8 +2536,9 @@ DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(const DescriptorPro } void DescriptorProto_ReservedRange::SharedCtor() { - ::memset(&start_, 0, static_cast( - reinterpret_cast(&end_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&start_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&end_) - reinterpret_cast(&start_)) + sizeof(end_)); } @@ -3623,8 +3626,9 @@ void FieldDescriptorProto::SharedCtor() { type_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); default_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); json_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&options_, 0, static_cast( - reinterpret_cast(&proto3_optional_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&options_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&proto3_optional_) - reinterpret_cast(&options_)) + sizeof(proto3_optional_)); label_ = 1; type_ = 1; @@ -4460,8 +4464,9 @@ EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange(con } void EnumDescriptorProto_EnumReservedRange::SharedCtor() { - ::memset(&start_, 0, static_cast( - reinterpret_cast(&end_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&start_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&end_) - reinterpret_cast(&start_)) + sizeof(end_)); } @@ -5112,8 +5117,9 @@ EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProt void EnumValueDescriptorProto::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_EnumValueDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto.base); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&options_, 0, static_cast( - reinterpret_cast(&number_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&options_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&number_) - reinterpret_cast(&options_)) + sizeof(number_)); } @@ -5759,8 +5765,9 @@ void MethodDescriptorProto::SharedCtor() { name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); input_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); output_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&options_, 0, static_cast( - reinterpret_cast(&server_streaming_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&options_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&server_streaming_) - reinterpret_cast(&options_)) + sizeof(server_streaming_)); } @@ -6268,8 +6275,9 @@ void FileOptions::SharedCtor() { php_namespace_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); php_metadata_namespace_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ruby_package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&java_multiple_files_, 0, static_cast( - reinterpret_cast(&deprecated_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&java_multiple_files_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&deprecated_) - reinterpret_cast(&java_multiple_files_)) + sizeof(deprecated_)); optimize_for_ = 1; cc_enable_arenas_ = true; @@ -7144,8 +7152,9 @@ MessageOptions::MessageOptions(const MessageOptions& from) void MessageOptions::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MessageOptions_google_2fprotobuf_2fdescriptor_2eproto.base); - ::memset(&message_set_wire_format_, 0, static_cast( - reinterpret_cast(&map_entry_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&message_set_wire_format_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&map_entry_) - reinterpret_cast(&message_set_wire_format_)) + sizeof(map_entry_)); } @@ -7501,8 +7510,9 @@ FieldOptions::FieldOptions(const FieldOptions& from) void FieldOptions::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FieldOptions_google_2fprotobuf_2fdescriptor_2eproto.base); - ::memset(&ctype_, 0, static_cast( - reinterpret_cast(&jstype_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&ctype_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&jstype_) - reinterpret_cast(&ctype_)) + sizeof(jstype_)); } @@ -8127,8 +8137,9 @@ EnumOptions::EnumOptions(const EnumOptions& from) void EnumOptions::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_EnumOptions_google_2fprotobuf_2fdescriptor_2eproto.base); - ::memset(&allow_alias_, 0, static_cast( - reinterpret_cast(&deprecated_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&allow_alias_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&deprecated_) - reinterpret_cast(&allow_alias_)) + sizeof(deprecated_)); } @@ -8946,8 +8957,9 @@ MethodOptions::MethodOptions(const MethodOptions& from) void MethodOptions::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MethodOptions_google_2fprotobuf_2fdescriptor_2eproto.base); - ::memset(&deprecated_, 0, static_cast( - reinterpret_cast(&idempotency_level_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&deprecated_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&idempotency_level_) - reinterpret_cast(&deprecated_)) + sizeof(idempotency_level_)); } @@ -9560,8 +9572,9 @@ void UninterpretedOption::SharedCtor() { identifier_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); aggregate_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&positive_int_value_, 0, static_cast( - reinterpret_cast(&double_value_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&positive_int_value_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&double_value_) - reinterpret_cast(&positive_int_value_)) + sizeof(double_value_)); } @@ -10572,8 +10585,9 @@ GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(const GeneratedCodeIn void GeneratedCodeInfo_Annotation::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_GeneratedCodeInfo_Annotation_google_2fprotobuf_2fdescriptor_2eproto.base); source_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&begin_, 0, static_cast( - reinterpret_cast(&end_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&begin_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&end_) - reinterpret_cast(&begin_)) + sizeof(end_)); } diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index 055c2ae2c..0214d0806 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -101,8 +101,9 @@ Duration::Duration(const Duration& from) } void Duration::SharedCtor() { - ::memset(&seconds_, 0, static_cast( - reinterpret_cast(&nanos_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&seconds_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&nanos_) - reinterpret_cast(&seconds_)) + sizeof(nanos_)); } diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index ce57bee53..71d0ee1a0 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -101,8 +101,9 @@ Timestamp::Timestamp(const Timestamp& from) } void Timestamp::SharedCtor() { - ::memset(&seconds_, 0, static_cast( - reinterpret_cast(&nanos_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&seconds_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&nanos_) - reinterpret_cast(&seconds_)) + sizeof(nanos_)); } diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index feb993372..45fac085c 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -396,8 +396,9 @@ Type::Type(const Type& from) void Type::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Type_google_2fprotobuf_2ftype_2eproto.base); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&source_context_, 0, static_cast( - reinterpret_cast(&syntax_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&source_context_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&syntax_) - reinterpret_cast(&source_context_)) + sizeof(syntax_)); } @@ -784,8 +785,9 @@ void Field::SharedCtor() { type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); json_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); default_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&kind_, 0, static_cast( - reinterpret_cast(&packed_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&kind_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&packed_) - reinterpret_cast(&kind_)) + sizeof(packed_)); } @@ -1264,8 +1266,9 @@ Enum::Enum(const Enum& from) void Enum::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Enum_google_2fprotobuf_2ftype_2eproto.base); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&source_context_, 0, static_cast( - reinterpret_cast(&syntax_) - + ::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&source_context_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&syntax_) - reinterpret_cast(&source_context_)) + sizeof(syntax_)); }