aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/transport
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-10-06 16:21:11 -0700
committerGravatar Yash Tibrewal <yashkt@google.com>2017-10-06 16:31:05 -0700
commit4b6af749e3cf8015065e3a3a66aab931acdc3296 (patch)
treec20bbe1710cea53b3b641b3517e6d02464f8245c /test/core/transport
parent412e7ca6e713cfbce3db09e22c3ca185f4f09460 (diff)
explicit type conversion
Diffstat (limited to 'test/core/transport')
-rw-r--r--test/core/transport/timeout_encoding_test.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/core/transport/timeout_encoding_test.c b/test/core/transport/timeout_encoding_test.c
index 3010c6d057..30357faed3 100644
--- a/test/core/transport/timeout_encoding_test.c
+++ b/test/core/transport/timeout_encoding_test.c
@@ -102,18 +102,20 @@ void decode_suite(char ext, grpc_millis (*answer)(int64_t x)) {
}
static grpc_millis millis_from_nanos(int64_t x) {
- return x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0);
+ return (grpc_millis)(x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0));
}
static grpc_millis millis_from_micros(int64_t x) {
- return x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0);
+ return (grpc_millis)(x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0));
+}
+static grpc_millis millis_from_millis(int64_t x) { return (grpc_millis)x; }
+static grpc_millis millis_from_seconds(int64_t x) {
+ return (grpc_millis)(x * GPR_MS_PER_SEC);
}
-static grpc_millis millis_from_millis(int64_t x) { return x; }
-static grpc_millis millis_from_seconds(int64_t x) { return x * GPR_MS_PER_SEC; }
static grpc_millis millis_from_minutes(int64_t x) {
- return x * 60 * GPR_MS_PER_SEC;
+ return (grpc_millis)(x * 60 * GPR_MS_PER_SEC);
}
static grpc_millis millis_from_hours(int64_t x) {
- return x * 3600 * GPR_MS_PER_SEC;
+ return (grpc_millis)(x * 3600 * GPR_MS_PER_SEC);
}
void test_decoding(void) {