diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-15 16:51:53 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-15 16:58:46 +0200 |
commit | 0e10673c5898a7c68f9e78ede3fe982d9ca7492d (patch) | |
tree | 76c1090d5983b9855f38fe62da9f606504de03a2 /Applications/Piano | |
parent | 9a5dba9e0992d1fe77af0b6ec61dee22e25b1f3e (diff) | |
download | serenity-0e10673c5898a7c68f9e78ede3fe982d9ca7492d.zip |
Piano: Use NumericLimits<T>
Diffstat (limited to 'Applications/Piano')
-rw-r--r-- | Applications/Piano/AudioEngine.cpp | 4 | ||||
-rw-r--r-- | Applications/Piano/WaveWidget.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Applications/Piano/AudioEngine.cpp b/Applications/Piano/AudioEngine.cpp index 39da5d9930..f4f6bb9560 100644 --- a/Applications/Piano/AudioEngine.cpp +++ b/Applications/Piano/AudioEngine.cpp @@ -26,8 +26,8 @@ */ #include "AudioEngine.h" +#include <AK/NumericLimits.h> #include <LibAudio/WavLoader.h> -#include <limits> #include <math.h> AudioEngine::AudioEngine() @@ -274,7 +274,7 @@ void AudioEngine::set_note(int note, Switch switch_note) } } - ASSERT(m_note_on[note] != std::numeric_limits<u8>::max()); + ASSERT(m_note_on[note] != NumericLimits<u8>::max()); ASSERT(m_power[note] >= 0); } diff --git a/Applications/Piano/WaveWidget.cpp b/Applications/Piano/WaveWidget.cpp index 5d8f3d72be..43fdf62d76 100644 --- a/Applications/Piano/WaveWidget.cpp +++ b/Applications/Piano/WaveWidget.cpp @@ -27,8 +27,8 @@ #include "WaveWidget.h" #include "AudioEngine.h" +#include <AK/NumericLimits.h> #include <LibGUI/Painter.h> -#include <limits> WaveWidget::WaveWidget(AudioEngine& audio_engine) : m_audio_engine(audio_engine) @@ -43,7 +43,7 @@ int WaveWidget::sample_to_y(int sample) const { constexpr int nice_scale_factor = 4; sample *= nice_scale_factor; - constexpr double sample_max = std::numeric_limits<i16>::max(); + constexpr double sample_max = NumericLimits<i16>::max(); double percentage = sample / sample_max; double portion_of_half_height = percentage * ((frame_inner_rect().height() - 1) / 2.0); double y = (frame_inner_rect().height() / 2.0) + portion_of_half_height; |