1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:28:12 +00:00

Everywhere: Use AK/Math.h if applicable

AK's version should see better inlining behaviors, than the LibM one.
We avoid mixed usage for now though.

Also clean up some stale math includes and improper floatingpoint usage.
This commit is contained in:
Hendiadyoin1 2021-07-17 18:29:28 +02:00 committed by Ali Mohammad Pur
parent c5f6ba6e71
commit ed46d52252
40 changed files with 116 additions and 156 deletions

View file

@ -5,9 +5,9 @@
*/
#include "SampleWidget.h"
#include <AK/Math.h>
#include <LibAudio/Buffer.h>
#include <LibGUI/Painter.h>
#include <math.h>
SampleWidget::SampleWidget()
{
@ -34,7 +34,7 @@ void SampleWidget::paint_event(GUI::PaintEvent& event)
if (m_buffer) {
int samples_per_pixel = m_buffer->sample_count() / frame_inner_rect().width();
for (int sample_index = 0; sample_index < m_buffer->sample_count() && (x - x_offset) < frame_inner_rect().width(); ++sample_index) {
float sample = fabsf((float)m_buffer->samples()[sample_index].left);
float sample = AK::fabs((float)m_buffer->samples()[sample_index].left);
sample_max = max(sample, sample_max);
++count;