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

Unified Diff: base/sync_socket_win.cc

Issue 596103002: Fix more disabled MSVC warnings, base/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't assume char (un)signedness Created 6 years, 3 months 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: base/sync_socket_win.cc
diff --git a/base/sync_socket_win.cc b/base/sync_socket_win.cc
index 6b2575c2f691f99c72a95c9cd478aba0ccb6e349..50aec35f55831ebf37a1b35d123645d3d3464e3f 100644
--- a/base/sync_socket_win.cc
+++ b/base/sync_socket_win.cc
@@ -151,9 +151,10 @@ size_t CancelableFileOperation(Function operation,
HANDLE events[] = { io_event->handle(), cancel_event->handle() };
const int wait_result = WaitForMultipleObjects(
ARRAYSIZE_UNSAFE(events), events, FALSE,
- timeout_in_ms == INFINITE
- ? timeout_in_ms
- : (finish_time - current_time).InMilliseconds());
+ timeout_in_ms == INFINITE ?
+ timeout_in_ms :
+ static_cast<DWORD>(
+ (finish_time - current_time).InMilliseconds()));
if (wait_result != WAIT_OBJECT_0 + 0) {
// CancelIo() doesn't synchronously cancel outstanding IO, only marks
// outstanding IO for cancellation. We must call GetOverlappedResult()
@@ -328,7 +329,8 @@ size_t CancelableSyncSocket::ReceiveWithTimeout(void* buffer,
TimeDelta timeout) {
return CancelableFileOperation(
&ReadFile, handle_, reinterpret_cast<char*>(buffer), length,
- &file_operation_, &shutdown_event_, this, timeout.InMilliseconds());
+ &file_operation_, &shutdown_event_, this,
+ static_cast<DWORD>(timeout.InMilliseconds()));
}
// static

Powered by Google App Engine
This is Rietveld 408576698