From 2fb6a8e46bbabe4bfab9da90d05a8d32ca2b9041 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Fri, 6 Jan 2023 11:37:52 -0800 Subject: [PATCH] Fix '-Wbitwise-instead-of-logical' in fbpcs/emp_games/lift/pcf2_calculator/input_processing/CompactionBasedInputProcessor_impl.h Summary: LLVM-15 requires that we differentiate between `&&` and `&` as well as `||` and `|`. Logical operations are done with `&&` and `||` and bitwise operations are done with `&` and `|`. Confusing the two makes code harder to read and may lead to subtle bugs. - If you approve of this diff, please use the "Accept & Ship" button :-) Reviewed By: dmm-fb Differential Revision: D42374520 fbshipit-source-id: 1b1427ebfe1ec2645ba06aec8fc955f46e13dfbc --- .../input_processing/CompactionBasedInputProcessor_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fbpcs/emp_games/lift/pcf2_calculator/input_processing/CompactionBasedInputProcessor_impl.h b/fbpcs/emp_games/lift/pcf2_calculator/input_processing/CompactionBasedInputProcessor_impl.h index 9a45137ce..29c32bf8f 100644 --- a/fbpcs/emp_games/lift/pcf2_calculator/input_processing/CompactionBasedInputProcessor_impl.h +++ b/fbpcs/emp_games/lift/pcf2_calculator/input_processing/CompactionBasedInputProcessor_impl.h @@ -158,11 +158,11 @@ CompactionBasedInputProcessor::preparePlaintextData( int inputIndex = reverseUnionMap[i]; bool isValidOpportunityTimestamp = - (opportunityTimestampsPadded.at(inputIndex) > 0) & - (controlPopulationPadded.at(inputIndex) | + (opportunityTimestampsPadded.at(inputIndex) > 0) && + (controlPopulationPadded.at(inputIndex) || testPopulationPadded.at(inputIndex)); - bool testReach = testPopulationPadded.at(inputIndex) & + bool testReach = testPopulationPadded.at(inputIndex) && (numImpressionsPadded.at(inputIndex) > 0); PublisherRow publisherRow{