1. youngking
  2. protobuf

Commits

ken...@google.com@630680e5-0e50-0410-840e-4b1c322b438d  committed bd17509

Fix bogus sign-compare warnings in header at request of user.

  • Participants
  • Parent commits c18b919
  • Branches default

Comments (0)

Files changed (1)

File src/google/protobuf/io/coded_stream.h

View file
  • Ignore whitespace
 inline bool CodedInputStream::ReadLittleEndian32(uint32* value) {
 #if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) && \
     defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN
-  if (GOOGLE_PREDICT_TRUE(BufferSize() >= sizeof(*value))) {
+  if (GOOGLE_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) {
     memcpy(value, buffer_, sizeof(*value));
     Advance(sizeof(*value));
     return true;
 inline bool CodedInputStream::ReadLittleEndian64(uint64* value) {
 #if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) && \
     defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN
-  if (GOOGLE_PREDICT_TRUE(BufferSize() >= sizeof(*value))) {
+  if (GOOGLE_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) {
     memcpy(value, buffer_, sizeof(*value));
     Advance(sizeof(*value));
     return true;