From 781a332f463a38ecca637b7d55ecdcaed6fac9f9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 23 Jul 2008 09:41:51 -0700 Subject: [PATCH] mon: fix int overflow --- src/mon/PGMonitor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 656bbf30a02dc..3d4e139673439 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -45,11 +45,11 @@ struct kb_t { }; ostream& operator<<(ostream& out, const kb_t& kb) { - if (kb.v > 2048*1024*1024*1024ULL) + if (kb.v > 2048ull*1024ull*1024ull*1024ULL) return out << (kb.v >> 40) << " PB"; - if (kb.v > 2048*1024*1024ULL) + if (kb.v > 2048ull*1024ull*1024ULL) return out << (kb.v >> 30) << " TB"; - if (kb.v > 2048*1024ULL) + if (kb.v > 2048ull*1024ULL) return out << (kb.v >> 20) << " GB"; if (kb.v > 2048ULL) return out << (kb.v >> 10) << " MB"; -- 2.39.5