From 9a8099eb8bee6f7e01435ee9850885560f1d0460 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 8 Oct 2021 14:39:39 +0000 Subject: [PATCH] Fix Wbitwise-instead-of-logical warnings `a && b` only evaluates b if a is true. `a & b` always evaluates both a and b. If a and b are of type bool, `&&` is usually what you want, so clang now warns on `&` where both arguments are of type bool. From what I can tell, in Dawn it wasn't important if we evaluate both branches or not in the places where this fired, so I went with `&&` everywhere. Bug: chromium:1255745 Change-Id: Ifa196a7150d5bdfb8527fe8b6f40d7e2e957d609 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66200 Auto-Submit: Nico Weber Reviewed-by: Corentin Wallez Commit-Queue: Nico Weber --- src/tests/end2end/QueryTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/end2end/QueryTests.cpp b/src/tests/end2end/QueryTests.cpp index 347ef04fde..20bd3929a4 100644 --- a/src/tests/end2end/QueryTests.cpp +++ b/src/tests/end2end/QueryTests.cpp @@ -310,7 +310,7 @@ TEST_P(OcclusionQueryTests, ResolveSparseQueries) { // TODO(hao.x.li@intel.com): Investigate why it's failed on D3D12 on Nvidia when running with // the previous occlusion tests. Expect resolve to 0 for these unwritten queries but the // occlusion result of the previous tests is got. - DAWN_SUPPRESS_TEST_IF(IsD3D12() & IsNvidia()); + DAWN_SUPPRESS_TEST_IF(IsD3D12() && IsNvidia()); constexpr uint32_t kQueryCount = 7; @@ -370,7 +370,7 @@ TEST_P(OcclusionQueryTests, ResolveWithoutWritten) { // TODO(hao.x.li@intel.com): Investigate why it's failed on D3D12 on Nvidia when running with // the previous occlusion tests. Expect resolve to 0 but the occlusion result of the previous // tests is got. - DAWN_SUPPRESS_TEST_IF(IsD3D12() & IsNvidia()); + DAWN_SUPPRESS_TEST_IF(IsD3D12() && IsNvidia()); constexpr uint32_t kQueryCount = 1;