From 084fd12d0a847eecc9f39a1b148b7e5b9f227049 Mon Sep 17 00:00:00 2001 From: jiahuizeng Date: Mon, 30 Dec 2019 11:25:36 +0000 Subject: [PATCH] rgw: change the format of the cast Signed-off-by: jiahuizeng (cherry picked from commit c44a335aeae3f830ff70fe9b4ed04b53f32c07d6) Conflicts: src/rgw/rgw_lc.cc - make_timespan() call in s3_expiration_header is different in nautilus --- src/rgw/rgw_lc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 6ea4217730dfc..eeb14be1edf45 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -303,11 +303,11 @@ static bool obj_has_expired(CephContext *cct, ceph::real_time mtime, int days, c utime_t base_time; if (cct->_conf->rgw_lc_debug_interval <= 0) { /* Normal case, run properly */ - cmp = (double)days*24*60*60; + cmp = double(days)*24*60*60; base_time = ceph_clock_now().round_to_day(); } else { /* We're in debug mode; Treat each rgw_lc_debug_interval seconds as a day */ - cmp = (double)days*cct->_conf->rgw_lc_debug_interval; + cmp = double(days)*cct->_conf->rgw_lc_debug_interval; base_time = ceph_clock_now(); } timediff = base_time - ceph::real_clock::to_time_t(mtime); @@ -1640,7 +1640,7 @@ std::string s3_expiration_header( if (rule_expiration.has_days()) { rule_expiration_date = boost::optional( - mtime + make_timespan((double)rule_expiration.get_days()*24*60*60)); + mtime + make_timespan(double(rule_expiration.get_days())*24*60*60)); rule_id = id; } } -- 2.39.5