aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/lib/iomgr/pollset_custom.cc6
-rw-r--r--src/core/lib/iomgr/timer_generic.cc14
2 files changed, 12 insertions, 8 deletions
diff --git a/src/core/lib/iomgr/pollset_custom.cc b/src/core/lib/iomgr/pollset_custom.cc
index 601adc6d6a..70e8a4596f 100644
--- a/src/core/lib/iomgr/pollset_custom.cc
+++ b/src/core/lib/iomgr/pollset_custom.cc
@@ -69,15 +69,15 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
gpr_mu_unlock(&pollset->mu);
grpc_millis now = grpc_core::ExecCtx::Get()->Now();
- size_t timeout = 0;
+ grpc_millis timeout = 0;
if (deadline > now) {
- timeout = static_cast<size_t>(deadline - now);
+ timeout = deadline - now;
}
// We yield here because the poll() call might yield
// control back to the application
grpc_core::ExecCtx* curr = grpc_core::ExecCtx::Get();
grpc_core::ExecCtx::Set(nullptr);
- poller_vtable->poll(timeout);
+ poller_vtable->poll(static_cast<size_t>(timeout));
grpc_core::ExecCtx::Set(curr);
grpc_core::ExecCtx::Get()->InvalidateNow();
if (grpc_core::ExecCtx::Get()->HasWork()) {
diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc
index 4525984054..d3245dee4c 100644
--- a/src/core/lib/iomgr/timer_generic.cc
+++ b/src/core/lib/iomgr/timer_generic.cc
@@ -429,7 +429,8 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
note_deadline_change(shard);
if (shard->shard_queue_index == 0 && deadline < old_min_deadline) {
#if GPR_ARCH_64
- gpr_atm_no_barrier_store(&g_shared_mutables.min_timer, deadline);
+ gpr_atm_no_barrier_store(
+ static_cast<gpr_atm*>(&g_shared_mutables.min_timer), deadline);
#else
// On 32-bit systems, gpr_atm_no_barrier_store does not work on 64-bit
// types (like grpc_millis). So all reads and writes to
@@ -577,7 +578,8 @@ static grpc_timer_check_result run_some_expired_timers(grpc_millis now,
grpc_timer_check_result result = GRPC_TIMERS_NOT_CHECKED;
#if GPR_ARCH_64
- grpc_millis min_timer = gpr_atm_no_barrier_load(&g_shared_mutables.min_timer);
+ grpc_millis min_timer = static_cast<grpc_millis>(gpr_atm_no_barrier_load(
+ static_cast<gpr_atm*>(&g_shared_mutables.min_timer)));
gpr_tls_set(&g_last_seen_min_timer, min_timer);
#else
// On 32-bit systems, gpr_atm_no_barrier_load does not work on 64-bit types
@@ -637,8 +639,9 @@ static grpc_timer_check_result run_some_expired_timers(grpc_millis now,
}
#if GPR_ARCH_64
- gpr_atm_no_barrier_store(&g_shared_mutables.min_timer,
- g_shard_queue[0]->min_deadline);
+ gpr_atm_no_barrier_store(
+ static_cast<gpr_atm*>(&g_shared_mutables.min_timer),
+ g_shard_queue[0]->min_deadline);
#else
// On 32-bit systems, gpr_atm_no_barrier_store does not work on 64-bit
// types (like grpc_millis). So all reads and writes to
@@ -702,7 +705,8 @@ static grpc_timer_check_result timer_check(grpc_millis* next) {
"TIMER CHECK BEGIN: now=%" PRId64 " next=%s tls_min=%" PRId64
" glob_min=%" PRId64,
now, next_str, min_timer,
- gpr_atm_no_barrier_load(&g_shared_mutables.min_timer));
+ gpr_atm_no_barrier_load(
+ static_cast<gpr_atm*>(&g_shared_mutables.min_timer)));
#else
gpr_log(GPR_DEBUG,
"TIMER CHECK BEGIN: now=%" PRId64 " next=%s min=%" PRId64, now,