mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 13:45:58 +01:00
hyprpm: cast std::clamp args to be of the same type (#4116)
hyprpm/src/progress/CProgressBar.cpp:50:27: error: no matching function for call to 'clamp' const auto BARWIDTH = std::clamp(w.ws_col - m_szCurrentMessage.length() - 2, 0UL, 50UL); ^~~~~~~~~~ /usr/include/c++/v1/__algorithm/clamp.h:38:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('size_type' (aka 'unsigned int') vs. 'unsigned long') clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi) ^ /usr/include/c++/v1/__algorithm/clamp.h:27:1: note: candidate function template not viable: requires 4 arguments, but 3 were provided clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp) ^
This commit is contained in:
parent
53ce7992be
commit
50648e6bae
1 changed files with 1 additions and 1 deletions
|
@ -47,7 +47,7 @@ void CProgressBar::print() {
|
||||||
else
|
else
|
||||||
percentDone = (float)m_iSteps / (float)m_iMaxSteps;
|
percentDone = (float)m_iSteps / (float)m_iMaxSteps;
|
||||||
|
|
||||||
const auto BARWIDTH = std::clamp(w.ws_col - m_szCurrentMessage.length() - 2, 0UL, 50UL);
|
const auto BARWIDTH = std::clamp(w.ws_col - static_cast<unsigned long>(m_szCurrentMessage.length()) - 2, 0UL, 50UL);
|
||||||
|
|
||||||
// draw bar
|
// draw bar
|
||||||
message += std::string{" "} + Colors::GREEN;
|
message += std::string{" "} + Colors::GREEN;
|
||||||
|
|
Loading…
Reference in a new issue