aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/max_age
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-07-19 20:20:35 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-07-19 20:20:35 -0700
commitf7c7e14438315442df818cb0c350e7d88657e1ce (patch)
tree91effc31b60c049cbe69c67c83fb73020eaf64e8 /src/core/ext/filters/max_age
parent6b7c1fbe3e1bcc8f5e20a72acdfec501ac837133 (diff)
Casting
Diffstat (limited to 'src/core/ext/filters/max_age')
-rw-r--r--src/core/ext/filters/max_age/max_age_filter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/ext/filters/max_age/max_age_filter.c b/src/core/ext/filters/max_age/max_age_filter.c
index 2a785efc04..62b28d7cc9 100644
--- a/src/core/ext/filters/max_age/max_age_filter.c
+++ b/src/core/ext/filters/max_age/max_age_filter.c
@@ -254,8 +254,9 @@ 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 > GRPC_MILLIS_INF_FUTURE - 0.5 ? GRPC_MILLIS_INF_FUTURE
- : (int)result;
+ return result > ((double)GRPC_MILLIS_INF_FUTURE) - 0.5
+ ? GRPC_MILLIS_INF_FUTURE
+ : (grpc_millis)result;
}
/* Constructor for call_data. */