Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix somes warning when compiling with Visual Studio 2019 on x64 target #8125

Merged
merged 1 commit into from Dec 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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