aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/gpr/sync_test.cc
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:16:55 -0800
committerGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:16:55 -0800
commitbe82e64b3debcdb1d9ec6a149fc85af0d46bfb7e (patch)
treecc5e1234073eb250a2c319b5a4db2919fce060ea /test/core/gpr/sync_test.cc
parent194436342137924b4fb7429bede037a4b5ec7edb (diff)
Autofix c casts to c++ casts
Diffstat (limited to 'test/core/gpr/sync_test.cc')
-rw-r--r--test/core/gpr/sync_test.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/core/gpr/sync_test.cc b/test/core/gpr/sync_test.cc
index 768f96d093..abad930ce6 100644
--- a/test/core/gpr/sync_test.cc
+++ b/test/core/gpr/sync_test.cc
@@ -236,11 +236,11 @@ static void test(const char* name, void (*body)(void* m),
gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME);
gpr_timespec time_taken;
gpr_timespec deadline = gpr_time_add(
- start, gpr_time_from_micros((int64_t)timeout_s * 1000000, GPR_TIMESPAN));
+ start, gpr_time_from_micros(static_cast<int64_t>(timeout_s) * 1000000, GPR_TIMESPAN));
fprintf(stderr, "%s:", name);
fflush(stderr);
while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) {
- fprintf(stderr, " %ld", (long)iterations);
+ fprintf(stderr, " %ld", static_cast<long>(iterations));
fflush(stderr);
m = test_new(10, iterations, incr_step);
if (extra != nullptr) {
@@ -252,7 +252,7 @@ static void test(const char* name, void (*body)(void* m),
test_wait(m);
if (m->counter != m->threads * m->iterations * m->incr_step) {
fprintf(stderr, "counter %ld threads %d iterations %ld\n",
- (long)m->counter, m->threads, (long)m->iterations);
+ static_cast<long>(m->counter), m->threads, static_cast<long>(m->iterations));
fflush(stderr);
GPR_ASSERT(0);
}
@@ -260,8 +260,8 @@ static void test(const char* name, void (*body)(void* m),
iterations <<= 1;
}
time_taken = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start);
- fprintf(stderr, " done %lld.%09d s\n", (long long)time_taken.tv_sec,
- (int)time_taken.tv_nsec);
+ fprintf(stderr, " done %lld.%09d s\n", static_cast<long long>(time_taken.tv_sec),
+ static_cast<int>(time_taken.tv_nsec));
fflush(stderr);
}