From a7a39a207f5c352c08ddb520db038c07a8cd8162 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 23 Nov 2016 14:08:10 +0800 Subject: [PATCH] hobject: better left-shift an unsigned MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/hobject.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/hobject.cc b/src/common/hobject.cc index dc76e8b5524..e4586594246 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); -- 2.39.5