From: Kefu Chai Date: Tue, 23 Aug 2022 15:38:39 +0000 (+0800) Subject: include/intarith: s/8/CHAR_BIT/ X-Git-Tag: v18.0.0~146^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8a8a6efcabc315880987c81afe69a90d738cc970;p=ceph.git include/intarith: s/8/CHAR_BIT/ less magic numbers Signed-off-by: Kefu Chai --- diff --git a/src/include/intarith.h b/src/include/intarith.h index 86002c312ba6..68b0345a457e 100644 --- a/src/include/intarith.h +++ b/src/include/intarith.h @@ -16,6 +16,7 @@ #define CEPH_INTARITH_H #include +#include #include #include @@ -86,7 +87,7 @@ constexpr inline T p2roundup(T x, T align) { // count bits (set + any 0's that follow) template unsigned cbits(T v) { - return (sizeof(v) * 8) - std::countl_zero(std::make_unsigned_t(v)); + return (sizeof(v) * CHAR_BIT) - std::countl_zero(std::make_unsigned_t(v)); } #endif