From commits-return-5941-archive-asf-public=cust-asf.ponee.io@kudu.apache.org Fri May 4 17:16:22 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C6692180677 for ; Fri, 4 May 2018 17:16:21 +0200 (CEST) Received: (qmail 76985 invoked by uid 500); 4 May 2018 15:16:20 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 76930 invoked by uid 99); 4 May 2018 15:16:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2018 15:16:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3506CF6981; Fri, 4 May 2018 15:16:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: todd@apache.org To: commits@kudu.apache.org Date: Fri, 04 May 2018 15:16:21 -0000 Message-Id: <07247685cab642869a78bb7b5f21a238@git.apache.org> In-Reply-To: <63bd61fdf7394bd784969fbb1182b5f4@git.apache.org> References: <63bd61fdf7394bd784969fbb1182b5f4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] kudu git commit: bitmap-test: fix dangling-else warnings bitmap-test: fix dangling-else warnings This squelches the following two warnings: [396/750] Building CXX object src/kudu/util/CMakeFiles/bitmap-test.dir/bitmap-test.cc.o ../../src/kudu/util/bitmap-test.cc: In member function ‘virtual void kudu::TestBitMap_TestFindBit_Test::TestBody()’: ../../src/kudu/util/bitmap-test.cc:187:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] if (expect_set_found) ASSERT_EQ(expected_set_idx, idx); ^ ../../src/kudu/util/bitmap-test.cc:194:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] if (expect_zero_found) ASSERT_EQ(expected_zero_idx, idx); ^ Change-Id: I0cf567b69c39958acb0c6fc7aa110d38f7b718ef Reviewed-on: http://gerrit.cloudera.org:8080/10305 Reviewed-by: Alexey Serbin Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/0061f32d Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/0061f32d Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/0061f32d Branch: refs/heads/master Commit: 0061f32d157dacd0cc1e6af341d6d5bf1e82378c Parents: ea28641 Author: Adar Dembo Authored: Thu May 3 15:40:38 2018 -0700 Committer: Todd Lipcon Committed: Fri May 4 15:16:03 2018 +0000 ---------------------------------------------------------------------- src/kudu/util/bitmap-test.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/0061f32d/src/kudu/util/bitmap-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/util/bitmap-test.cc b/src/kudu/util/bitmap-test.cc index ab79124..089ed3b 100644 --- a/src/kudu/util/bitmap-test.cc +++ b/src/kudu/util/bitmap-test.cc @@ -184,14 +184,18 @@ TEST(TestBitMap, TestFindBit) { size_t expected_set_idx = (offset + !(offset & 3)); bool expect_set_found = (expected_set_idx < num_bits); ASSERT_EQ(expect_set_found, res); - if (expect_set_found) ASSERT_EQ(expected_set_idx, idx); + if (expect_set_found) { + ASSERT_EQ(expected_set_idx, idx); + } // Find a zero bit res = BitmapFindFirstZero(bm, offset, num_bits, &idx); size_t expected_zero_idx = offset + ((offset & 3) ? (4 - (offset & 3)) : 0); bool expect_zero_found = (expected_zero_idx < num_bits); ASSERT_EQ(expect_zero_found, res); - if (expect_zero_found) ASSERT_EQ(expected_zero_idx, idx); + if (expect_zero_found) { + ASSERT_EQ(expected_zero_idx, idx); + } } } }