aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-09-16 21:12:27 -0400
committerDavid Robillard <d@drobilla.net>2022-09-16 22:31:06 -0400
commitbf05ef949750cfca6e001b0f767cd2173441fc8c (patch)
tree3eee7c9f1b2172e075546e773510ebadde0516d4
parentcad9fff2ac4c18051a7013c8854598112853c0b4 (diff)
downloadchilbert-bf05ef949750cfca6e001b0f767cd2173441fc8c.tar.gz
chilbert-bf05ef949750cfca6e001b0f767cd2173441fc8c.tar.bz2
chilbert-bf05ef949750cfca6e001b0f767cd2173441fc8c.zip
Make single-argument constructors explicit
-rw-r--r--.clang-tidy2
-rw-r--r--include/chilbert/SmallBitVec.hpp2
-rw-r--r--include/chilbert/detail/BitVecIndex.hpp2
-rw-r--r--include/chilbert/detail/BitVecMask.hpp2
4 files changed, 3 insertions, 5 deletions
diff --git a/.clang-tidy b/.clang-tidy
index a6f9e1a..fd24a1a 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -15,11 +15,9 @@ Checks: >
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
- -google-explicit-constructor,
-google-readability-casting,
-google-runtime-int,
-google-runtime-references,
- -hicpp-explicit-conversions,
-llvmlibc-*,
-modernize-use-trailing-return-type,
-readability-avoid-const-params-in-decls,
diff --git a/include/chilbert/SmallBitVec.hpp b/include/chilbert/SmallBitVec.hpp
index d9256c6..6f04965 100644
--- a/include/chilbert/SmallBitVec.hpp
+++ b/include/chilbert/SmallBitVec.hpp
@@ -61,7 +61,7 @@ public:
private:
friend class SmallBitVec;
- Mask(const size_t index)
+ explicit Mask(const size_t index)
: m_mask{index < bits_per_rack ? Rack{1} << index : 0}
{
}
diff --git a/include/chilbert/detail/BitVecIndex.hpp b/include/chilbert/detail/BitVecIndex.hpp
index 0998968..c8d0469 100644
--- a/include/chilbert/detail/BitVecIndex.hpp
+++ b/include/chilbert/detail/BitVecIndex.hpp
@@ -34,7 +34,7 @@ struct BitVecIndex
static constexpr size_t bits_per_rack = sizeof(Rack) * CHAR_BIT;
- BitVecIndex(const size_t bits)
+ explicit BitVecIndex(const size_t bits)
: rack{bits / bits_per_rack}
, bit{bits - rack * bits_per_rack}
{
diff --git a/include/chilbert/detail/BitVecMask.hpp b/include/chilbert/detail/BitVecMask.hpp
index f015d63..5674114 100644
--- a/include/chilbert/detail/BitVecMask.hpp
+++ b/include/chilbert/detail/BitVecMask.hpp
@@ -35,7 +35,7 @@ struct BitVecMask
{
static constexpr size_t bits_per_rack = sizeof(Rack) * CHAR_BIT;
- BitVecMask(const size_t index)
+ explicit BitVecMask(const size_t index)
: rack{index / bits_per_rack}
, mask{Rack{1} << (index - rack * bits_per_rack)}
{