aboutsummaryrefslogtreecommitdiffstats
path: root/include/chilbert/detail
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-02-10 19:35:43 -0500
committerDavid Robillard <d@drobilla.net>2025-02-10 19:35:43 -0500
commitd466d59fab9086bafeb8c5d3208580a639b6bdbf (patch)
tree4c34d574b29110c6dbe2e8e82e89e28d8bd8cc9d /include/chilbert/detail
parentd4d7c64a7b03093d62fca36a0b73c550d69d8a94 (diff)
downloadchilbert-d466d59fab9086bafeb8c5d3208580a639b6bdbf.tar.gz
chilbert-d466d59fab9086bafeb8c5d3208580a639b6bdbf.tar.bz2
chilbert-d466d59fab9086bafeb8c5d3208580a639b6bdbf.zip
Fully parenthesize expressions
Diffstat (limited to 'include/chilbert/detail')
-rw-r--r--include/chilbert/detail/BitVecIndex.hpp2
-rw-r--r--include/chilbert/detail/MultiBitVec.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/chilbert/detail/BitVecIndex.hpp b/include/chilbert/detail/BitVecIndex.hpp
index a514c21..7eb128d 100644
--- a/include/chilbert/detail/BitVecIndex.hpp
+++ b/include/chilbert/detail/BitVecIndex.hpp
@@ -21,7 +21,7 @@ struct BitVecIndex {
explicit BitVecIndex(const size_t bits)
: rack{bits / bits_per_rack}
- , bit{bits - rack * bits_per_rack}
+ , bit{bits - (rack * bits_per_rack)}
{
assert(bit < bits_per_rack);
}
diff --git a/include/chilbert/detail/MultiBitVec.hpp b/include/chilbert/detail/MultiBitVec.hpp
index e3a305d..1317d3b 100644
--- a/include/chilbert/detail/MultiBitVec.hpp
+++ b/include/chilbert/detail/MultiBitVec.hpp
@@ -111,7 +111,7 @@ public:
/// Clear any bits in storage outside the valid range if necessary
void truncate()
{
- if (const auto pad = num_racks() * bits_per_rack - size()) {
+ if (const auto pad = (num_racks() * bits_per_rack) - size()) {
rack(num_racks() - 1) &= ~Rack{0} >> pad;
}
}