Commit 11e36b1c authored by Feng Xiao's avatar Feng Xiao

Merge pull request #747 from jtattermusch/sign_mismatch

add static cast to silence signedness comparison warning
parents 66b074f4 276ce8c1
...@@ -1223,7 +1223,7 @@ void RepeatedField<Element>::Reserve(int new_size) { ...@@ -1223,7 +1223,7 @@ void RepeatedField<Element>::Reserve(int new_size) {
Arena* arena = GetArenaNoVirtual(); Arena* arena = GetArenaNoVirtual();
new_size = max(google::protobuf::internal::kMinRepeatedFieldAllocationSize, new_size = max(google::protobuf::internal::kMinRepeatedFieldAllocationSize,
max(total_size_ * 2, new_size)); max(total_size_ * 2, new_size));
GOOGLE_CHECK_LE(new_size, GOOGLE_CHECK_LE(static_cast<size_t>(new_size),
(std::numeric_limits<size_t>::max() - kRepHeaderSize) / (std::numeric_limits<size_t>::max() - kRepHeaderSize) /
sizeof(Element)) sizeof(Element))
<< "Requested size is too large to fit into size_t."; << "Requested size is too large to fit into size_t.";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment