aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-02-09 10:23:30 -0800
committerGravatar ncteisen <ncteisen@gmail.com>2018-02-09 17:49:00 -0800
commite1bec40dfb8ff7562fc6a6dafb6d0369294e852f (patch)
treeca54df0049fbf0e519d4ec49699646d953e6c9fa
parent4d20a666850b732cf1562487fb5f46ab9654105f (diff)
Manually fix build issue
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc2
-rw-r--r--src/core/ext/filters/client_channel/retry_throttle.cc2
-rw-r--r--src/core/ext/filters/max_age/max_age_filter.cc6
-rw-r--r--src/core/lib/gpr/arena.cc2
-rw-r--r--src/core/lib/gpr/thd_posix.cc10
-rw-r--r--src/core/lib/iomgr/executor.cc4
-rw-r--r--src/core/lib/iomgr/resource_quota.cc4
-rw-r--r--src/core/lib/surface/call.cc2
-rw-r--r--src/core/lib/surface/channel.cc8
-rw-r--r--src/core/lib/surface/completion_queue.cc2
-rw-r--r--src/core/lib/transport/connectivity_state.cc20
-rw-r--r--test/core/iomgr/tcp_server_posix_test.cc3
12 files changed, 29 insertions, 36 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
index 3929ed0843..0b5a798be3 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
@@ -114,7 +114,7 @@ void grpc_grpclb_client_stats_add_call_dropped_locked(
}
static void atomic_get_and_reset_counter(int64_t* value, gpr_atm* counter) {
- *value = static_cast<int64_t> gpr_atm_acq_load(counter);
+ *value = static_cast<int64_t>(gpr_atm_acq_load(counter));
gpr_atm_full_fetch_add(counter, (gpr_atm)(-*value));
}
diff --git a/src/core/ext/filters/client_channel/retry_throttle.cc b/src/core/ext/filters/client_channel/retry_throttle.cc
index dd33b69102..a98e27860a 100644
--- a/src/core/ext/filters/client_channel/retry_throttle.cc
+++ b/src/core/ext/filters/client_channel/retry_throttle.cc
@@ -116,7 +116,7 @@ static grpc_server_retry_throttle_data* grpc_server_retry_throttle_data_create(
// we will start out doing the same thing on the new one.
if (old_throttle_data != nullptr) {
double token_fraction =
- static_cast<int> gpr_atm_acq_load(&old_throttle_data->milli_tokens) /
+ static_cast<int>(gpr_atm_acq_load(&old_throttle_data->milli_tokens)) /
static_cast<double>(old_throttle_data->max_milli_tokens);
initial_milli_tokens = static_cast<int>(token_fraction * max_milli_tokens);
}
diff --git a/src/core/ext/filters/max_age/max_age_filter.cc b/src/core/ext/filters/max_age/max_age_filter.cc
index 415a90959d..abb9d69036 100644
--- a/src/core/ext/filters/max_age/max_age_filter.cc
+++ b/src/core/ext/filters/max_age/max_age_filter.cc
@@ -285,8 +285,8 @@ static void max_idle_timer_cb(void* arg, grpc_error* error) {
GRPC_CHANNEL_STACK_REF(chand->channel_stack,
"max_age max_idle_timer");
grpc_timer_init(&chand->max_idle_timer,
- static_cast<grpc_millis> gpr_atm_no_barrier_load(
- &chand->last_enter_idle_time_millis) +
+ static_cast<grpc_millis>(gpr_atm_no_barrier_load(
+ &chand->last_enter_idle_time_millis)) +
chand->max_connection_idle,
&chand->max_idle_timer_cb);
/* idle_state may have already been set to
@@ -384,7 +384,7 @@ add_random_max_connection_age_jitter_and_convert_to_grpc_millis(int value) {
double result = multiplier * value;
/* INT_MAX - 0.5 converts the value to float, so that result will not be
cast to int implicitly before the comparison. */
- return result > (static_cast<double> GRPC_MILLIS_INF_FUTURE) - 0.5
+ return result > (static_cast<double>(GRPC_MILLIS_INF_FUTURE)) - 0.5
? GRPC_MILLIS_INF_FUTURE
: static_cast<grpc_millis>(result);
}
diff --git a/src/core/lib/gpr/arena.cc b/src/core/lib/gpr/arena.cc
index 5bc575f711..2d514df68b 100644
--- a/src/core/lib/gpr/arena.cc
+++ b/src/core/lib/gpr/arena.cc
@@ -78,7 +78,7 @@ void* gpr_arena_alloc(gpr_arena* arena, size_t size) {
zone* next_z = (zone*)gpr_atm_acq_load(&z->next_atm);
if (next_z == nullptr) {
size_t next_z_size =
- static_cast<size_t> gpr_atm_no_barrier_load(&arena->size_so_far);
+ static_cast<size_t>(gpr_atm_no_barrier_load(&arena->size_so_far));
next_z = static_cast<zone*>(zalloc_aligned(
ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(zone)) + next_z_size));
next_z->size_begin = z->size_end;
diff --git a/src/core/lib/gpr/thd_posix.cc b/src/core/lib/gpr/thd_posix.cc
index ce268e1fbc..e8730b9c66 100644
--- a/src/core/lib/gpr/thd_posix.cc
+++ b/src/core/lib/gpr/thd_posix.cc
@@ -99,17 +99,13 @@ int gpr_thd_new(gpr_thd_id* t, const char* thd_name,
free(a);
dec_thd_count();
}
- *t = static_cast<gpr_thd_id>(p);
+ *t = (gpr_thd_id)p;
return thread_started;
}
-gpr_thd_id gpr_thd_currentid(void) {
- return static_cast<gpr_thd_id>(pthread_self());
-}
+gpr_thd_id gpr_thd_currentid(void) { return (gpr_thd_id)pthread_self(); }
-void gpr_thd_join(gpr_thd_id t) {
- pthread_join(static_cast<pthread_t>(t), nullptr);
-}
+void gpr_thd_join(gpr_thd_id t) { pthread_join((pthread_t)t, nullptr); }
/*****************************************
* Only used when fork support is enabled
diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc
index 16782dacc5..7ab987c19e 100644
--- a/src/core/lib/iomgr/executor.cc
+++ b/src/core/lib/iomgr/executor.cc
@@ -190,7 +190,7 @@ static void executor_push(grpc_closure* closure, grpc_error* error,
do {
retry_push = false;
size_t cur_thread_count =
- static_cast<size_t> gpr_atm_no_barrier_load(&g_cur_threads);
+ static_cast<size_t>(gpr_atm_no_barrier_load(&g_cur_threads));
if (cur_thread_count == 0) {
if (executor_trace.enabled()) {
#ifndef NDEBUG
@@ -258,7 +258,7 @@ static void executor_push(grpc_closure* closure, grpc_error* error,
}
if (try_new_thread && gpr_spinlock_trylock(&g_adding_thread_lock)) {
cur_thread_count =
- static_cast<size_t> gpr_atm_no_barrier_load(&g_cur_threads);
+ static_cast<size_t>(gpr_atm_no_barrier_load(&g_cur_threads));
if (cur_thread_count < g_max_threads) {
gpr_atm_no_barrier_store(&g_cur_threads, cur_thread_count + 1);
diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc
index da310694ef..c4763f3229 100644
--- a/src/core/lib/iomgr/resource_quota.cc
+++ b/src/core/lib/iomgr/resource_quota.cc
@@ -659,8 +659,8 @@ void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
}
size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota) {
- return static_cast<size_t> gpr_atm_no_barrier_load(
- &resource_quota->last_size);
+ return static_cast<size_t>(
+ gpr_atm_no_barrier_load(&resource_quota->last_size));
}
/*******************************************************************************
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc
index db7c01cc33..2d5077525c 100644
--- a/src/core/lib/surface/call.cc
+++ b/src/core/lib/surface/call.cc
@@ -1195,7 +1195,7 @@ static void finish_batch_completion(void* user_data,
}
static grpc_error* consolidate_batch_errors(batch_control* bctl) {
- size_t n = static_cast<size_t> gpr_atm_acq_load(&bctl->num_errors);
+ size_t n = static_cast<size_t>(gpr_atm_acq_load(&bctl->num_errors));
if (n == 0) {
return GRPC_ERROR_NONE;
} else if (n == 1) {
diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc
index 6c73c2cd76..d536027c08 100644
--- a/src/core/lib/surface/channel.cc
+++ b/src/core/lib/surface/channel.cc
@@ -190,16 +190,16 @@ size_t grpc_channel_get_call_size_estimate(grpc_channel* channel) {
(which is common) - which tends to help most allocators reuse memory
2. a small amount of allowed growth over the estimate without hitting
the arena size doubling case, reducing overall memory usage */
- return (static_cast<size_t> gpr_atm_no_barrier_load(
- &channel->call_size_estimate) +
+ return (static_cast<size_t>(
+ gpr_atm_no_barrier_load(&channel->call_size_estimate)) +
2 * ROUND_UP_SIZE) &
~static_cast<size_t>(ROUND_UP_SIZE - 1);
}
void grpc_channel_update_call_size_estimate(grpc_channel* channel,
size_t size) {
- size_t cur =
- static_cast<size_t> gpr_atm_no_barrier_load(&channel->call_size_estimate);
+ size_t cur = static_cast<size_t>(
+ gpr_atm_no_barrier_load(&channel->call_size_estimate));
if (cur < size) {
/* size grew: update estimate */
gpr_atm_no_barrier_cas(&channel->call_size_estimate,
diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc
index d1f3276257..d0363917b0 100644
--- a/src/core/lib/surface/completion_queue.cc
+++ b/src/core/lib/surface/completion_queue.cc
@@ -417,7 +417,7 @@ static grpc_cq_completion* cq_event_queue_pop(grpc_cq_event_queue* q) {
/* Note: The counter is not incremented/decremented atomically with push/pop.
* The count is only eventually consistent */
static long cq_event_queue_num_items(grpc_cq_event_queue* q) {
- return static_cast<long> gpr_atm_no_barrier_load(&q->num_queue_items);
+ return static_cast<long>(gpr_atm_no_barrier_load(&q->num_queue_items));
}
grpc_completion_queue* grpc_completion_queue_create_internal(
diff --git a/src/core/lib/transport/connectivity_state.cc b/src/core/lib/transport/connectivity_state.cc
index a5b7bb508f..17f3529a0e 100644
--- a/src/core/lib/transport/connectivity_state.cc
+++ b/src/core/lib/transport/connectivity_state.cc
@@ -73,9 +73,8 @@ void grpc_connectivity_state_destroy(grpc_connectivity_state_tracker* tracker) {
grpc_connectivity_state grpc_connectivity_state_check(
grpc_connectivity_state_tracker* tracker) {
- grpc_connectivity_state cur =
- static_cast<grpc_connectivity_state> gpr_atm_no_barrier_load(
- &tracker->current_state_atm);
+ grpc_connectivity_state cur = static_cast<grpc_connectivity_state>(
+ gpr_atm_no_barrier_load(&tracker->current_state_atm));
if (grpc_connectivity_state_trace.enabled()) {
gpr_log(GPR_DEBUG, "CONWATCH: %p %s: get %s", tracker, tracker->name,
grpc_connectivity_state_name(cur));
@@ -85,9 +84,8 @@ grpc_connectivity_state grpc_connectivity_state_check(
grpc_connectivity_state grpc_connectivity_state_get(
grpc_connectivity_state_tracker* tracker, grpc_error** error) {
- grpc_connectivity_state cur =
- static_cast<grpc_connectivity_state> gpr_atm_no_barrier_load(
- &tracker->current_state_atm);
+ grpc_connectivity_state cur = static_cast<grpc_connectivity_state>(
+ gpr_atm_no_barrier_load(&tracker->current_state_atm));
if (grpc_connectivity_state_trace.enabled()) {
gpr_log(GPR_DEBUG, "CONWATCH: %p %s: get %s", tracker, tracker->name,
grpc_connectivity_state_name(cur));
@@ -106,9 +104,8 @@ bool grpc_connectivity_state_has_watchers(
bool grpc_connectivity_state_notify_on_state_change(
grpc_connectivity_state_tracker* tracker, grpc_connectivity_state* current,
grpc_closure* notify) {
- grpc_connectivity_state cur =
- static_cast<grpc_connectivity_state> gpr_atm_no_barrier_load(
- &tracker->current_state_atm);
+ grpc_connectivity_state cur = static_cast<grpc_connectivity_state>(
+ gpr_atm_no_barrier_load(&tracker->current_state_atm));
if (grpc_connectivity_state_trace.enabled()) {
if (current == nullptr) {
gpr_log(GPR_DEBUG, "CONWATCH: %p %s: unsubscribe notify=%p", tracker,
@@ -157,9 +154,8 @@ bool grpc_connectivity_state_notify_on_state_change(
void grpc_connectivity_state_set(grpc_connectivity_state_tracker* tracker,
grpc_connectivity_state state,
grpc_error* error, const char* reason) {
- grpc_connectivity_state cur =
- static_cast<grpc_connectivity_state> gpr_atm_no_barrier_load(
- &tracker->current_state_atm);
+ grpc_connectivity_state cur = static_cast<grpc_connectivity_state>(
+ gpr_atm_no_barrier_load(&tracker->current_state_atm));
grpc_connectivity_state_watcher* w;
if (grpc_connectivity_state_trace.enabled()) {
const char* error_string = grpc_error_string(error);
diff --git a/test/core/iomgr/tcp_server_posix_test.cc b/test/core/iomgr/tcp_server_posix_test.cc
index 221c993fe7..dde77da547 100644
--- a/test/core/iomgr/tcp_server_posix_test.cc
+++ b/test/core/iomgr/tcp_server_posix_test.cc
@@ -309,7 +309,8 @@ static void test_connect(size_t num_connects,
gpr_log(GPR_INFO,
"clients=%lu, num chan args=%lu, remote IP=%s, test_dst_addrs=%d",
static_cast<unsigned long>(num_connects),
- (channel_args != nullptr ? channel_args->num_args : 0),
+ static_cast<unsigned long>(
+ channel_args != nullptr ? channel_args->num_args : 0),
dst_addrs != nullptr ? "<specific>" : "::", test_dst_addrs);
memset(&resolved_addr, 0, sizeof(resolved_addr));
memset(&resolved_addr1, 0, sizeof(resolved_addr1));