From: Danny Al-Gaaf Date: Tue, 9 Jun 2015 12:57:54 +0000 (+0200) Subject: mon/OSDMonitor.cc: fix UNINTENDED_INTEGER_DIVISION X-Git-Tag: v9.1.0~446^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=be7e07a52871e16e8a46accde6171077cca8db5a;p=ceph.git 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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a4bab5dd504..e6ab163eb36 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3896,8 +3896,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;