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 `&` when both arguments are of type bool.
In the one case where this fires in webrtc, it isn't important if we
evaluate both branches, so I went with `&&`.

Bug: chromium:1255745
Change-Id: I7fd215778fca62e0d5ca64ab0cf1142942eb7304
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234600
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#35181}
This commit is contained in:
Nico Weber
2021-10-08 10:56:51 -04:00
committed by WebRTC LUCI CQ
parent f17d9a39d5
commit 70fa689fb6

View File

@ -923,7 +923,7 @@ VideoEncoder::EncoderInfo SimulcastEncoderAdapter::GetEncoderInfo() const {
// Treat QP from frame/slice/tile header as average QP only if all // Treat QP from frame/slice/tile header as average QP only if all
// encoders report it as average QP. // encoders report it as average QP.
encoder_info.is_qp_trusted = encoder_info.is_qp_trusted =
encoder_info.is_qp_trusted.value_or(true) & encoder_info.is_qp_trusted.value_or(true) &&
encoder_impl_info.is_qp_trusted.value_or(true); encoder_impl_info.is_qp_trusted.value_or(true);
} }
encoder_info.fps_allocation[i] = encoder_impl_info.fps_allocation[0]; encoder_info.fps_allocation[i] = encoder_impl_info.fps_allocation[0];