Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1047)

Unified Diff: net/base/elements_upload_data_stream.cc

Issue 760703002: Fix "value possibly truncated" warnings on MSVC, net/base edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/elements_upload_data_stream.cc
diff --git a/net/base/elements_upload_data_stream.cc b/net/base/elements_upload_data_stream.cc
index 86ea28c72135021f6292ae7d2ec7d73bb17a318e..e8d33ee851a1229274224f2c2e3d74aedcb547df 100644
--- a/net/base/elements_upload_data_stream.cc
+++ b/net/base/elements_upload_data_stream.cc
@@ -129,10 +129,10 @@ int ElementsUploadDataStream::ReadElements(
if (read_failed_) {
// If an error occured during read operation, then pad with zero.
// Otherwise the server will hang waiting for the rest of the data.
- int num_bytes_to_fill = std::min(
+ int num_bytes_to_fill = static_cast<int>(std::min(
static_cast<uint64>(buf->BytesRemaining()),
- size() - position() - buf->BytesConsumed());
- DCHECK_LE(0, num_bytes_to_fill);
+ size() - position() - buf->BytesConsumed()));
+ DCHECK_GE(num_bytes_to_fill, 0);
memset(buf->data(), 0, num_bytes_to_fill);
buf->DidConsume(num_bytes_to_fill);
}

Powered by Google App Engine
This is Rietveld 408576698