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/wire_format_lite_inl.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/google/protobuf/wire_format_lite_inl.h') diff --git a/src/google/protobuf/wire_format_lite_inl.h b/src/google/protobuf/wire_format_lite_inl.h index f7b98d1d..c044def8 100644 --- a/src/google/protobuf/wire_format_lite_inl.h +++ b/src/google/protobuf/wire_format_lite_inl.h @@ -696,7 +696,7 @@ inline uint8* WireFormatLite::WriteFixedNoTagToArray( const T* ii = value.unsafe_data(); const int bytes = n * static_cast(sizeof(ii[0])); - memcpy(target, ii, bytes); + memcpy(target, ii, static_cast(bytes)); return target + bytes; #else return WritePrimitiveNoTagToArray(value, Writer, target); @@ -954,7 +954,7 @@ inline uint8* WireFormatLite::InternalWriteMessageToArray( uint8* target) { target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target); target = io::CodedOutputStream::WriteVarint32ToArray( - value.GetCachedSize(), target); + static_cast(value.GetCachedSize()), target); return value.InternalSerializeWithCachedSizesToArray(deterministic, target); } @@ -975,7 +975,9 @@ inline uint8* WireFormatLite::InternalWriteMessageNoVirtualToArray( bool deterministic, uint8* target) { target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target); target = io::CodedOutputStream::WriteVarint32ToArray( - value.MessageType_WorkAroundCppLookupDefect::GetCachedSize(), target); + static_cast( + value.MessageType_WorkAroundCppLookupDefect::GetCachedSize()), + target); return value.MessageType_WorkAroundCppLookupDefect:: InternalSerializeWithCachedSizesToArray(deterministic, target); } -- cgit v1.2.3