aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
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/compiler/cpp/cpp_primitive_field.cc
parentf752d816b780fff2a6af80f330a808874e63621f (diff)
Enusre public header and generated code have no implicit converion.
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_primitive_field.cc')
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_primitive_field.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
index 020c1941..df7c1730 100644
--- a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
@@ -452,7 +452,8 @@ GenerateByteSize(io::Printer* printer) const {
printer->Print(variables_,
"if (data_size > 0) {\n"
" total_size += $tag_size$ +\n"
- " ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);\n"
+ " ::google::protobuf::internal::WireFormatLite::Int32Size(\n"
+ " static_cast<google::protobuf::int32>(data_size));\n"
"}\n"
"int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);\n"
"GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n"