diff options
author | David Robillard <d@drobilla.net> | 2022-09-16 21:31:31 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-09-16 22:31:06 -0400 |
commit | 311c12ad2ef63109ff73c4dc8ccf6912eb41ba7b (patch) | |
tree | bdddcd2ff9bfbc6b5f1c02807e1b859c3c712844 | |
parent | 5cb9bad2fadd9bfb591efabd630a07e65f4b4cb3 (diff) | |
download | chilbert-311c12ad2ef63109ff73c4dc8ccf6912eb41ba7b.tar.gz chilbert-311c12ad2ef63109ff73c4dc8ccf6912eb41ba7b.tar.bz2 chilbert-311c12ad2ef63109ff73c4dc8ccf6912eb41ba7b.zip |
Avoid cast warnings
-rw-r--r-- | .clang-tidy | 1 | ||||
-rw-r--r-- | include/chilbert/BoundedBitVec.hpp | 2 | ||||
-rw-r--r-- | include/chilbert/DynamicBitVec.hpp | 2 | ||||
-rw-r--r-- | include/chilbert/StaticBitVec.hpp | 2 |
4 files changed, 3 insertions, 4 deletions
diff --git a/.clang-tidy b/.clang-tidy index 58b793d..b8924f8 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -15,7 +15,6 @@ Checks: > -fuchsia-default-arguments-calls, -fuchsia-default-arguments-declarations, -fuchsia-overloaded-operator, - -google-readability-casting, -google-runtime-int, -google-runtime-references, -llvmlibc-*, diff --git a/include/chilbert/BoundedBitVec.hpp b/include/chilbert/BoundedBitVec.hpp index 6fe5d2a..ad9b9da 100644 --- a/include/chilbert/BoundedBitVec.hpp +++ b/include/chilbert/BoundedBitVec.hpp @@ -112,7 +112,7 @@ public: private: static constexpr size_t calculate_num_racks(const size_t bits) { - return (std::max(bits, size_t(1)) + bits_per_rack - 1) / bits_per_rack; + return (std::max(bits, size_t{1}) + bits_per_rack - 1U) / bits_per_rack; } std::array<Rack, calculate_num_racks(MaxN)> m_racks{}; diff --git a/include/chilbert/DynamicBitVec.hpp b/include/chilbert/DynamicBitVec.hpp index 895860c..2134839 100644 --- a/include/chilbert/DynamicBitVec.hpp +++ b/include/chilbert/DynamicBitVec.hpp @@ -117,7 +117,7 @@ public: private: static size_t calculate_num_racks(const size_t bits) { - return (std::max(bits, size_t(1)) + bits_per_rack - 1) / bits_per_rack; + return (std::max(bits, size_t{1}) + bits_per_rack - 1U) / bits_per_rack; } static RacksPtr make_racks(const size_t n) diff --git a/include/chilbert/StaticBitVec.hpp b/include/chilbert/StaticBitVec.hpp index 1cd59b0..d1481cc 100644 --- a/include/chilbert/StaticBitVec.hpp +++ b/include/chilbert/StaticBitVec.hpp @@ -105,7 +105,7 @@ public: /// Return the number of racks static constexpr size_t num_racks() { - return (std::max(N, size_t(1)) + bits_per_rack - 1) / bits_per_rack; + return (std::max(N, size_t{1}) + bits_per_rack - 1U) / bits_per_rack; } private: |