Ver Fonte

Merge pull request #747 from jtattermusch/sign_mismatch

add static cast to silence signedness comparison warning
Feng Xiao há 10 anos atrás
pai
commit
11e36b1c39
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      src/google/protobuf/repeated_field.h

+ 1 - 1
src/google/protobuf/repeated_field.h

@@ -1223,7 +1223,7 @@ void RepeatedField<Element>::Reserve(int new_size) {
   Arena* arena = GetArenaNoVirtual();
   new_size = max(google::protobuf::internal::kMinRepeatedFieldAllocationSize,
                  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) /
            sizeof(Element))
       << "Requested size is too large to fit into size_t.";