Simplified applyMask by consolidating common code for 32-bit and 64-bit builds.
Extend mask value to 64 bits before taking its complement.
Made 64-bit conversions explicit.
Differential D11890
Fixed Visual Studio warnings. jtouton on Aug 9 2015, 5:24 PM. Authored by
Details
Simplified applyMask by consolidating common code for 32-bit and 64-bit builds. Extend mask value to 64 bits before taking its complement. Made 64-bit conversions explicit.
Diff Detail Event Timeline
Comment Actions I am a big fan of compiler warnings but this one (1 << i) sounds bogus. (size_t)1 << i Comment Actions Fixed several ThreadSanitizer.cpp issues in r245167. I don't have VS2015 config to test the warning and the online compiler is out but const unsigned ByteSize = 1U << i; should be OK. Please update if it's still warning.
Comment Actions
Comment Actions Sorry for the long wait; my mail filters ate notifications about updates to this diff, and I'm very new to Phabricator. Comment Actions
Comment Actions The asserts on unit tests, BitVectorTest/1.PortableBitMask that calls TypeParam A; const uint32_t Mask1[] = { 0x80000000, 6, 5 }; A.resize(10); A.setBitsInMask(Mask1, 3); Now setBitsInMask is documented: /// setBitsInMask - Add '1' bits from Mask to this vector. Don't resize. /// This computes "*this |= Mask". and it can not | a small bit vector with a 3x32 bit mask without resizing. It is an error which should not go silent and the test should be modified. Jakob, do we miss something? |
What happens when MaskWords is 2 and we're running on a system where uintptr_t is 32 bits?