diff options
author | Noah Eisen <ncteisen@google.com> | 2018-02-09 09:16:55 -0800 |
---|---|---|
committer | Noah Eisen <ncteisen@google.com> | 2018-02-09 09:16:55 -0800 |
commit | be82e64b3debcdb1d9ec6a149fc85af0d46bfb7e (patch) | |
tree | cc5e1234073eb250a2c319b5a4db2919fce060ea /src/core/lib/iomgr/timer_generic.cc | |
parent | 194436342137924b4fb7429bede037a4b5ec7edb (diff) |
Autofix c casts to c++ casts
Diffstat (limited to 'src/core/lib/iomgr/timer_generic.cc')
-rw-r--r-- | src/core/lib/iomgr/timer_generic.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc index ef86d237d3..b47c12b689 100644 --- a/src/core/lib/iomgr/timer_generic.cc +++ b/src/core/lib/iomgr/timer_generic.cc @@ -240,9 +240,9 @@ void grpc_timer_list_init() { uint32_t i; g_num_shards = GPR_MIN(1, 2 * gpr_cpu_num_cores()); - g_shards = (timer_shard*)gpr_zalloc(g_num_shards * sizeof(*g_shards)); + g_shards = static_cast<timer_shard*>(gpr_zalloc(g_num_shards * sizeof(*g_shards))); g_shard_queue = - (timer_shard**)gpr_zalloc(g_num_shards * sizeof(*g_shard_queue)); + static_cast<timer_shard**>(gpr_zalloc(g_num_shards * sizeof(*g_shard_queue))); g_shared_mutables.initialized = true; g_shared_mutables.checker_mu = GPR_SPINLOCK_INITIALIZER; @@ -360,7 +360,7 @@ void grpc_timer_init(grpc_timer* timer, grpc_millis deadline, } grpc_time_averaged_stats_add_sample(&shard->stats, - (double)(deadline - now) / 1000.0); + static_cast<double>(deadline - now) / 1000.0); ADD_TO_HASH_TABLE(timer); @@ -374,7 +374,7 @@ void grpc_timer_init(grpc_timer* timer, grpc_millis deadline, gpr_log(GPR_DEBUG, " .. add to shard %d with queue_deadline_cap=%" PRIdPTR " => is_first_timer=%s", - (int)(shard - g_shards), shard->queue_deadline_cap, + static_cast<int>(shard - g_shards), shard->queue_deadline_cap, is_first_timer ? "true" : "false"); } gpr_mu_unlock(&shard->mu); @@ -461,11 +461,11 @@ static int refill_heap(timer_shard* shard, gpr_atm now) { /* Compute the new cap and put all timers under it into the queue: */ shard->queue_deadline_cap = saturating_add(GPR_MAX(now, shard->queue_deadline_cap), - (gpr_atm)(deadline_delta * 1000.0)); + static_cast<gpr_atm>(deadline_delta * 1000.0)); if (grpc_timer_check_trace.enabled()) { gpr_log(GPR_DEBUG, " .. shard[%d]->queue_deadline_cap --> %" PRIdPTR, - (int)(shard - g_shards), shard->queue_deadline_cap); + static_cast<int>(shard - g_shards), shard->queue_deadline_cap); } for (timer = shard->list.next; timer != &shard->list; timer = next) { next = timer->next; @@ -490,7 +490,7 @@ static grpc_timer* pop_one(timer_shard* shard, gpr_atm now) { for (;;) { if (grpc_timer_check_trace.enabled()) { gpr_log(GPR_DEBUG, " .. shard[%d]: heap_empty=%s", - (int)(shard - g_shards), + static_cast<int>(shard - g_shards), grpc_timer_heap_is_empty(&shard->heap) ? "true" : "false"); } if (grpc_timer_heap_is_empty(&shard->heap)) { @@ -530,7 +530,7 @@ static size_t pop_timers(timer_shard* shard, gpr_atm now, gpr_mu_unlock(&shard->mu); if (grpc_timer_check_trace.enabled()) { gpr_log(GPR_DEBUG, " .. shard[%d] popped %" PRIdPTR, - (int)(shard - g_shards), n); + static_cast<int>(shard - g_shards), n); } return n; } @@ -553,7 +553,7 @@ static grpc_timer_check_result run_some_expired_timers(gpr_atm now, if (grpc_timer_check_trace.enabled()) { gpr_log(GPR_DEBUG, " .. shard[%d]->min_deadline = %" PRIdPTR, - (int)(g_shard_queue[0] - g_shards), + static_cast<int>(g_shard_queue[0] - g_shards), g_shard_queue[0]->min_deadline); } @@ -573,7 +573,7 @@ static grpc_timer_check_result run_some_expired_timers(gpr_atm now, " .. result --> %d" ", shard[%d]->min_deadline %" PRIdPTR " --> %" PRIdPTR ", now=%" PRIdPTR, - result, (int)(g_shard_queue[0] - g_shards), + result, static_cast<int>(g_shard_queue[0] - g_shards), g_shard_queue[0]->min_deadline, new_min_deadline, now); } |