aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/wire_format_lite_inl.h
diff options
context:
space:
mode:
authorBo Yang <teboring@google.com>2017-06-23 12:56:44 -0700
committerBo Yang <paulyang1211@gmail.com>2017-06-24 11:28:13 -0700
commite3c807d4e752b477b707f5d021264faf9b127304 (patch)
tree505092dff769b14d6a07be62314bc948b9398090 /src/google/protobuf/wire_format_lite_inl.h
parent9c0b35cf620c4904a18e25733f50c9c0474fefa6 (diff)
downloadprotobuf-e3c807d4e752b477b707f5d021264faf9b127304.tar.gz
protobuf-e3c807d4e752b477b707f5d021264faf9b127304.tar.bz2
protobuf-e3c807d4e752b477b707f5d021264faf9b127304.zip
Fix more implicit type conversions in public headers and generated code.
Diffstat (limited to 'src/google/protobuf/wire_format_lite_inl.h')
-rw-r--r--src/google/protobuf/wire_format_lite_inl.h8
1 files changed, 5 insertions, 3 deletions
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<int>(sizeof(ii[0]));
- memcpy(target, ii, bytes);
+ memcpy(target, ii, static_cast<size_t>(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<uint32>(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<uint32>(
+ value.MessageType_WorkAroundCppLookupDefect::GetCachedSize()),
+ target);
return value.MessageType_WorkAroundCppLookupDefect::
InternalSerializeWithCachedSizesToArray(deterministic, target);
}