Skip to content

Commit

Permalink
[ci] More C++20 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Oct 21, 2024
1 parent b6f124e commit 294eca4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/avnd/wrappers/controls_double.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <avnd/introspection/widgets.hpp>
#include <avnd/wrappers/avnd.hpp>
#include <cmath>
#include <halp/polyfill.hpp>

#include <string>

Expand Down Expand Up @@ -40,8 +41,8 @@ static constexpr auto map_control_from_double(std::floating_point auto v)
template <avnd::enum_parameter T>
static constexpr auto map_control_from_double(std::floating_point auto v)
{
static constexpr auto min_val = 0;
static constexpr auto max_val = avnd::get_enum_choices_count<T>() - 1;
static_constexpr auto min_val = 0;
static_constexpr auto max_val = avnd::get_enum_choices_count<T>() - 1;
int res = std::round(v);
res = res < min_val ? min_val : res;
res = res > max_val ? max_val : res;
Expand Down

0 comments on commit 294eca4

Please sign in to comment.