summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-01-01 22:01:45 +0100
committerGitHub <noreply@github.com>2024-01-01 22:01:45 +0100
commit370daaf26cdb9a71095d6201bf493499d548e569 (patch)
tree32f73cd185db299e60f19fa9013c1c04a92b570a /Source/Core
parent07df4ff16e134147dda36f41bb8a49022be1606b (diff)
parentabb484a1013c5042ff4029756dbbeeedce787457 (diff)
Merge pull request #12474 from Dentomologist/bitset_use_static_cast
BitSet: Use direct initialization instead of c-style casts
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/BitSet.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Common/BitSet.h b/Source/Core/Common/BitSet.h
index 5d2c88294d..cc658a19f7 100644
--- a/Source/Core/Common/BitSet.h
+++ b/Source/Core/Common/BitSet.h
@@ -98,15 +98,15 @@ public:
constexpr BitSet(std::initializer_list<int> init)
{
for (int bit : init)
- m_val |= (IntTy)1 << bit;
+ m_val |= IntTy{1} << bit;
}
constexpr static BitSet AllTrue(size_t count)
{
- return BitSet(count == sizeof(IntTy) * 8 ? ~(IntTy)0 : (((IntTy)1 << count) - 1));
+ return BitSet(count == sizeof(IntTy) * 8 ? ~IntTy{0} : ((IntTy{1} << count) - 1));
}
- Ref operator[](size_t bit) { return Ref(this, (IntTy)1 << bit); }
+ Ref operator[](size_t bit) { return Ref(this, IntTy{1} << bit); }
constexpr const Ref operator[](size_t bit) const { return (*const_cast<BitSet*>(this))[bit]; }
constexpr bool operator==(BitSet other) const { return m_val == other.m_val; }
constexpr bool operator!=(BitSet other) const { return m_val != other.m_val; }