From e3c807d4e752b477b707f5d021264faf9b127304 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Fri, 23 Jun 2017 12:56:44 -0700 Subject: Fix more implicit type conversions in public headers and generated code. --- src/google/protobuf/duration.pb.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/google/protobuf/duration.pb.cc') diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index ae1a5e08..1933c6d2 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -164,14 +164,15 @@ Duration::Duration(const Duration& from) _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&seconds_, &from.seconds_, - reinterpret_cast(&nanos_) - - reinterpret_cast(&seconds_) + sizeof(nanos_)); + static_cast(reinterpret_cast(&nanos_) - + reinterpret_cast(&seconds_)) + sizeof(nanos_)); // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration) } void Duration::SharedCtor() { - ::memset(&seconds_, 0, reinterpret_cast(&nanos_) - - reinterpret_cast(&seconds_) + sizeof(nanos_)); + ::memset(&seconds_, 0, static_cast( + reinterpret_cast(&nanos_) - + reinterpret_cast(&seconds_)) + sizeof(nanos_)); _cached_size_ = 0; } @@ -215,8 +216,9 @@ Duration* Duration::New(::google::protobuf::Arena* arena) const { void Duration::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Duration) - ::memset(&seconds_, 0, reinterpret_cast(&nanos_) - - reinterpret_cast(&seconds_) + sizeof(nanos_)); + ::memset(&seconds_, 0, static_cast( + reinterpret_cast(&nanos_) - + reinterpret_cast(&seconds_)) + sizeof(nanos_)); } bool Duration::MergePartialFromCodedStream( -- cgit v1.2.3