Skip to content

Commit a542cd4

Browse files
authored
Fix some W4146 issues that snuck in (#8002)
Some W4146 warnings were missed in LongVectors.cpp that cause failures in other pipelines where these are enabled as errors.
1 parent d1e69c7 commit a542cd4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/clang/unittests/HLSLExec/LongVectors.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -714,15 +714,15 @@ template <typename T> uint32_t CountBits(T A) {
714714
// returns the index of the first high/low bit found.
715715
template <typename T> uint32_t ScanFromMSB(T A, bool LookingForZero) {
716716
if (A == 0)
717-
return ~0;
717+
return std::numeric_limits<uint32_t>::max();
718718

719719
constexpr uint32_t NumBits = sizeof(T) * 8;
720720
for (int32_t I = NumBits - 1; I >= 0; --I) {
721721
bool BitSet = (A & (static_cast<T>(1) << I)) != 0;
722722
if (BitSet != LookingForZero)
723723
return static_cast<uint32_t>(I);
724724
}
725-
return ~0;
725+
return std::numeric_limits<uint32_t>::max();
726726
}
727727

728728
template <typename T>
@@ -742,14 +742,14 @@ template <typename T> uint32_t FirstBitLow(T A) {
742742
const uint32_t NumBits = sizeof(T) * 8;
743743

744744
if (A == 0)
745-
return ~0;
745+
return std::numeric_limits<uint32_t>::max();
746746

747747
for (uint32_t I = 0; I < NumBits; ++I) {
748748
if (A & (static_cast<T>(1) << I))
749749
return static_cast<T>(I);
750750
}
751751

752-
return ~0;
752+
return std::numeric_limits<uint32_t>::max();
753753
}
754754

755755
DEFAULT_OP_2(OpType::And, (A & B));

0 commit comments

Comments
 (0)