Skip to content

Commit

Permalink
Fix somes warning when compiling with Visual Studio 2019 on x64 target
Browse files Browse the repository at this point in the history
In visual studio 2019 x64 target, size_t are 64 bits and int are 32 bits
  • Loading branch information
gvollant authored and acozzette committed Dec 30, 2020
1 parent 6c970b5 commit 9647a7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/google/protobuf/parse_context.h
Expand Up @@ -208,7 +208,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream {
bool DoneWithCheck(const char** ptr, int d) {
GOOGLE_DCHECK(*ptr);
if (PROTOBUF_PREDICT_TRUE(*ptr < limit_end_)) return false;
int overrun = *ptr - buffer_end_;
int overrun = static_cast<int>(*ptr - buffer_end_);
GOOGLE_DCHECK_LE(overrun, kSlopBytes); // Guaranteed by parse loop.
if (overrun ==
limit_) { // No need to flip buffers if we ended on a limit.
Expand Down Expand Up @@ -347,7 +347,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream {
const char* AppendUntilEnd(const char* ptr, const A& append) {
if (ptr - buffer_end_ > limit_) return nullptr;
while (limit_ > kSlopBytes) {
int chunk_size = buffer_end_ + kSlopBytes - ptr;
size_t chunk_size = buffer_end_ + kSlopBytes - ptr;
GOOGLE_DCHECK_GE(chunk_size, 0);
append(ptr, chunk_size);
ptr = Next();
Expand Down

0 comments on commit 9647a7c

Please sign in to comment.