From 3cb72dd57f901f400d19022269fb098c06318d6b Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 9 Jun 2015 14:57:54 +0200 Subject: [PATCH] mon/OSDMonitor.cc: fix UNINTENDED_INTEGER_DIVISION Fix for: CID 1297885 (#1 of 2): Result is not floating-point (UNINTENDED_INTEGER_DIVISION) integer_division: Dividing integer expressions g_conf->mon_pool_quota_warn_threshold and 100, and then converting the integer quotient to type float. Any remainder, or fractional part of the quotient, is ignored. CID 1297885 (#2 of 2): Result is not floating-point (UNINTENDED_INTEGER_DIVISION) integer_division: Dividing integer expressions g_conf->mon_pool_quota_crit_threshold and 100, and then converting the integer quotient to type float. Any remainder, or fractional part of the quotient, is ignored. Signed-off-by: Danny Al-Gaaf (cherry picked from commit be7e07a52871e16e8a46accde6171077cca8db5a) --- src/mon/OSDMonitor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 8eadf0afe71e..3c22b4a92977 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3638,8 +3638,8 @@ void OSDMonitor::get_pools_health( detail->push_back(make_pair(HEALTH_WARN, ss.str())); } - float warn_threshold = g_conf->mon_pool_quota_warn_threshold/100; - float crit_threshold = g_conf->mon_pool_quota_crit_threshold/100; + float warn_threshold = (float)g_conf->mon_pool_quota_warn_threshold/100; + float crit_threshold = (float)g_conf->mon_pool_quota_crit_threshold/100; if (pool.quota_max_objects > 0) { stringstream ss; -- 2.47.3