From: Kefu Chai Date: Wed, 23 Nov 2016 06:08:10 +0000 (+0800) Subject: hobject: better left-shift an unsigned X-Git-Tag: v11.1.0~139^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a7a39a207f5c352c08ddb520db038c07a8cd8162;p=ceph.git hobject: better left-shift an unsigned this silences the warning of The result of the '<<' expression is undefined quote from n3337, ยง5.8 expr.shift: If E1 has an unsigned type, the value ... (is deterministic)... Otherwise, if E1 has a signed type and non-negative value, and E1 x 2^E2 is representable in the result type, then that is the resulting value; otherwise, the behavior is undefined. Signed-off-by: Kefu Chai --- diff --git a/src/common/hobject.cc b/src/common/hobject.cc index dc76e8b55243..e4586594246e 100644 --- a/src/common/hobject.cc +++ b/src/common/hobject.cc @@ -45,7 +45,7 @@ set hobject_t::get_prefixes( for (set::iterator j = from.begin(); j != from.end(); ++j) { - to.insert(*j | (1 << i)); + to.insert(*j | (1U << i)); to.insert(*j); } to.swap(from);