diff options
author | Bo Yang <teboring@google.com> | 2017-06-22 15:39:19 -0700 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2017-06-23 11:58:05 -0700 |
commit | 9c0b35cf620c4904a18e25733f50c9c0474fefa6 (patch) | |
tree | d0010edbebaf6af9c4b6d1b0c5a8daa7b5102c03 /src/google/protobuf/wire_format_lite_inl.h | |
parent | f752d816b780fff2a6af80f330a808874e63621f (diff) | |
download | protobuf-9c0b35cf620c4904a18e25733f50c9c0474fefa6.tar.gz protobuf-9c0b35cf620c4904a18e25733f50c9c0474fefa6.tar.bz2 protobuf-9c0b35cf620c4904a18e25733f50c9c0474fefa6.zip |
Enusre public header and generated code have no implicit converion.
Diffstat (limited to 'src/google/protobuf/wire_format_lite_inl.h')
-rw-r--r-- | src/google/protobuf/wire_format_lite_inl.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/google/protobuf/wire_format_lite_inl.h b/src/google/protobuf/wire_format_lite_inl.h index 05049017..f7b98d1d 100644 --- a/src/google/protobuf/wire_format_lite_inl.h +++ b/src/google/protobuf/wire_format_lite_inl.h @@ -268,7 +268,7 @@ inline bool WireFormatLite::ReadRepeatedFixedSizePrimitive( if (size > 0) { const uint8* buffer = reinterpret_cast<const uint8*>(void_pointer); // The number of bytes each type occupies on the wire. - const int per_value_size = tag_size + sizeof(value); + const int per_value_size = tag_size + static_cast<int>(sizeof(value)); // parentheses around (std::min) prevents macro expansion of min(...) int elements_available = @@ -344,8 +344,8 @@ inline bool WireFormatLite::ReadPackedFixedSizePrimitive( int length; if (!input->ReadVarintSizeAsInt(&length)) return false; const int old_entries = values->size(); - const int new_entries = length / sizeof(CType); - const int new_bytes = new_entries * sizeof(CType); + const int new_entries = length / static_cast<int>(sizeof(CType)); + const int new_bytes = new_entries * static_cast<int>(sizeof(CType)); if (new_bytes != length) return false; // We would *like* to pre-allocate the buffer to write into (for // speed), but *must* avoid performing a very large allocation due @@ -695,7 +695,7 @@ inline uint8* WireFormatLite::WriteFixedNoTagToArray( GOOGLE_DCHECK_GT(n, 0); const T* ii = value.unsafe_data(); - const int bytes = n * sizeof(ii[0]); + const int bytes = n * static_cast<int>(sizeof(ii[0])); memcpy(target, ii, bytes); return target + bytes; #else |