Getting rid of MS C++ warning when compiling GPR on Windows.

1>c:\users\jtattermusch\grpc_tar\src\core\support\sync_win32.c(97): warning C4244: 'function' : conversion from 'gpr_int64' to 'DWORD', possible loss of data
	Change on 2014/12/09 by jtattermusch <jtattermusch@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81724253
pull/1/merge
jtattermusch 10 years ago committed by Michael Lumish
parent 1ef8175bc5
commit 275b3ac04d
  1. 7
      src/core/support/sync_win32.c

@ -83,6 +83,7 @@ void gpr_cv_destroy(gpr_cv *cv) {
int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) {
int timeout = 0;
DWORD timeout_max_ms;
if (gpr_time_cmp(abs_deadline, gpr_inf_future) == 0) {
SleepConditionVariableCS(cv, &mu->cs, INFINITE);
} else {
@ -93,9 +94,9 @@ int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) {
if (now_ms >= deadline_ms) {
timeout = 1;
} else {
timeout =
(SleepConditionVariableCS(cv, &mu->cs, deadline_ms - now_ms) == 0 &&
GetLastError() == ERROR_TIMEOUT);
timeout_max_ms = (DWORD)min(deadline_ms - now_ms, INFINITE - 1);
timeout = (SleepConditionVariableCS(cv, &mu->cs, timeout_max_ms) == 0 &&
GetLastError() == ERROR_TIMEOUT);
}
}
return timeout;

Loading…
Cancel
Save