Fix order of operations warning in libui
The warnings were being hidden by the use of -isystem to include
frameworks/native/include.
Bug: 31752268
Test: m -j
Change-Id: I21f34567927125d3eeeecd8f00271a175f93af21
diff --git a/include/ui/Gralloc1On0Adapter.h b/include/ui/Gralloc1On0Adapter.h
index 33c2f87..d523c4f 100644
--- a/include/ui/Gralloc1On0Adapter.h
+++ b/include/ui/Gralloc1On0Adapter.h
@@ -416,10 +416,10 @@
if (!outData) {
const auto producerCpuUsage = GRALLOC1_PRODUCER_USAGE_CPU_READ |
GRALLOC1_PRODUCER_USAGE_CPU_WRITE;
- if (producerUsage & producerCpuUsage != 0) {
+ if ((producerUsage & producerCpuUsage) != 0) {
return static_cast<int32_t>(GRALLOC1_ERROR_BAD_VALUE);
}
- if (consumerUsage & GRALLOC1_CONSUMER_USAGE_CPU_READ != 0) {
+ if ((consumerUsage & GRALLOC1_CONSUMER_USAGE_CPU_READ) != 0) {
return static_cast<int32_t>(GRALLOC1_ERROR_BAD_VALUE);
}
}