aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/map_type_handler.h
diff options
context:
space:
mode:
authorGravatar Bo Yang <teboring@google.com>2017-06-22 15:39:19 -0700
committerGravatar Bo Yang <teboring@google.com>2017-06-23 11:58:05 -0700
commit9c0b35cf620c4904a18e25733f50c9c0474fefa6 (patch)
treed0010edbebaf6af9c4b6d1b0c5a8daa7b5102c03 /src/google/protobuf/map_type_handler.h
parentf752d816b780fff2a6af80f330a808874e63621f (diff)
Enusre public header and generated code have no implicit converion.
Diffstat (limited to 'src/google/protobuf/map_type_handler.h')
-rw-r--r--src/google/protobuf/map_type_handler.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/google/protobuf/map_type_handler.h b/src/google/protobuf/map_type_handler.h
index 301b37fe..990136ff 100644
--- a/src/google/protobuf/map_type_handler.h
+++ b/src/google/protobuf/map_type_handler.h
@@ -284,7 +284,7 @@ MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ByteSize(
template <typename Type> \
inline int MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::ByteSize( \
const MapEntryAccessorType& value) { \
- return WireFormatLite::DeclaredType##Size(value); \
+ return static_cast<int>(WireFormatLite::DeclaredType##Size(value)); \
}
GOOGLE_PROTOBUF_BYTE_SIZE(STRING, String)
@@ -320,7 +320,8 @@ template <typename Type>
inline int
MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::GetCachedSize(
const MapEntryAccessorType& value) {
- return WireFormatLite::LengthDelimitedSize(value.GetCachedSize());
+ return static_cast<int>(
+ WireFormatLite::LengthDelimitedSize(value.GetCachedSize()));
}
#define GET_CACHED_SIZE(FieldType, DeclaredType) \
@@ -328,7 +329,7 @@ MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::GetCachedSize(
inline int \
MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::GetCachedSize( \
const MapEntryAccessorType& value) { \
- return WireFormatLite::DeclaredType##Size(value); \
+ return static_cast<int>(WireFormatLite::DeclaredType##Size(value)); \
}
GET_CACHED_SIZE(STRING, String)