Skip to content

Commit cff473b

Browse files
committed
* Fixing warnings-as-errors on gcc/clang
1 parent f94954b commit cff473b

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎fuzzy/include/fuzzy/algorithm.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ namespace fuzzy
821821
auto calc_steps = [&](element_type lhs, element_type rhs) -> std::size_t
822822
{
823823
assert(rhs.value() > lhs.value());
824-
std::size_t const steps = std::min(static_cast<std::size_t>(rhs.value() - lhs.value()) - 1ull, step_count);
824+
std::size_t const steps = std::min(static_cast<std::size_t>(rhs.value() - lhs.value()) - static_cast<std::size_t>(1), step_count);
825825
return std::min(steps, buffer.size());
826826
};
827827

‎fuzzy/include/fuzzy/expressions.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ namespace fuzzy
122122
return itr;
123123
};
124124

125-
std::size_t const segment_count = static_cast<std::size_t>(variable.size() - 1u);
125+
key_type const segment_count = static_cast<key_type>(variable.size() - static_cast<std::size_t>(1));
126126
key_type const segment_ratio = static_cast<key_type>(1) / segment_count;
127127
for (basic_element<V, M> const& e : set)
128128
{
@@ -134,7 +134,7 @@ namespace fuzzy
134134
assert(itr_lower->value() <= e.value());
135135
assert(itr_upper != variable.end() && e.value() <= itr_upper->value());
136136

137-
key_type const offset = static_cast<key_type>(e.value()) - itr_lower->value();
137+
key_type const offset = static_cast<key_type>(e.value() - itr_lower->value());
138138
key_type const segment_range = static_cast<key_type>(itr_upper->value() - itr_lower->value());
139139
key_type const offset_ratio = offset / segment_range;
140140
assert(static_cast<key_type>(0) <= offset_ratio && offset_ratio <= static_cast<key_type>(1));

‎fuzzy/include/fuzzy/scaled_mapping.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace fuzzy
7272
{
7373
// Calcualte the index and get the matching itr in consequent/destination.
7474
key_type const offset = ele.value() / median_segment_ratio;
75-
std::size_t const index = static_cast<std::size_t>(offset);
75+
std::ptrdiff_t const index = static_cast<std::ptrdiff_t>(offset);
7676
auto itr = dst.cbegin() + index;
7777
key_type const remainder = offset - static_cast<key_type>(index);
7878
assert(static_cast<key_type>(0) <= remainder && remainder <= static_cast<key_type>(1));

0 commit comments

Comments
 (0)