diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp index 801f582201..d228b1f245 100644 --- a/Userland/Applets/ResourceGraph/main.cpp +++ b/Userland/Applets/ResourceGraph/main.cpp @@ -94,7 +94,7 @@ private: if (value >= 0) { painter.draw_line( { rect.x() + i, rect.bottom() }, - { rect.x() + i, rect.top() + (int)(round(rect.height() - (value * rect.height()))) }, + { rect.x() + i, rect.top() + (int)(roundf(rect.height() - (value * rect.height()))) }, m_graph_color); } else { painter.draw_line( diff --git a/Userland/Libraries/LibGfx/AffineTransform.cpp b/Userland/Libraries/LibGfx/AffineTransform.cpp index 2b02f1bac5..f0c9df2382 100644 --- a/Userland/Libraries/LibGfx/AffineTransform.cpp +++ b/Userland/Libraries/LibGfx/AffineTransform.cpp @@ -18,7 +18,7 @@ bool AffineTransform::is_identity() const static float hypotenuse(float x, float y) { // FIXME: This won't handle overflow :( - return sqrt(x * x + y * y); + return sqrtf(x * x + y * y); } float AffineTransform::x_scale() const diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp index ac86b6dd56..52d3b30900 100644 --- a/Userland/Libraries/LibGfx/Bitmap.cpp +++ b/Userland/Libraries/LibGfx/Bitmap.cpp @@ -420,8 +420,8 @@ RefPtr Bitmap::scaled(float sx, float sy) const auto p = static_cast(x) * static_cast(old_width - 1) / static_cast(new_width - 1); auto q = static_cast(y) * static_cast(old_height - 1) / static_cast(new_height - 1); - int i = floor(p); - int j = floor(q); + int i = floorf(p); + int j = floorf(q); float u = p - static_cast(i); float v = q - static_cast(j); @@ -443,7 +443,7 @@ RefPtr Bitmap::scaled(float sx, float sy) const for (int x = 0; x < new_width - 1; x++) { auto p = static_cast(x) * static_cast(old_width - 1) / static_cast(new_width - 1); - int i = floor(p); + int i = floorf(p); float u = p - static_cast(i); auto a = get_pixel(i, old_bottom_y); @@ -458,7 +458,7 @@ RefPtr Bitmap::scaled(float sx, float sy) const for (int y = 0; y < new_height - 1; y++) { auto q = static_cast(y) * static_cast(old_height - 1) / static_cast(new_height - 1); - int j = floor(q); + int j = floorf(q); float v = q - static_cast(j); auto c = get_pixel(old_right_x, j); diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index 5985a4aa3c..d3bf8cb921 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -1902,7 +1902,7 @@ void Painter::for_each_line_segment_on_elliptical_arc(const FloatPoint& p1, cons if (theta_delta < 0) { swap(start, end); theta_1 = theta_1 + theta_delta; - theta_delta = fabs(theta_delta); + theta_delta = fabsf(theta_delta); } auto relative_start = start - center; diff --git a/Userland/Libraries/LibTTF/Glyf.cpp b/Userland/Libraries/LibTTF/Glyf.cpp index 3d5dd7cbb6..5e3e859f32 100644 --- a/Userland/Libraries/LibTTF/Glyf.cpp +++ b/Userland/Libraries/LibTTF/Glyf.cpp @@ -270,8 +270,8 @@ void Rasterizer::draw_line(Gfx::FloatPoint p0, Gfx::FloatPoint p1) } float dxdy = (p1.x() - p0.x()) / (p1.y() - p0.y()); - u32 y0 = floor(p0.y()); - u32 y1 = ceil(p1.y()); + u32 y0 = floorf(p0.y()); + u32 y1 = ceilf(p1.y()); float x_cur = p0.x(); for (u32 y = y0; y < y1; y++) { @@ -289,8 +289,8 @@ void Rasterizer::draw_line(Gfx::FloatPoint p0, Gfx::FloatPoint p1) x1 = x_cur; x0 = x_next; } - float x0_floor = floor(x0); - float x1_ceil = ceil(x1); + float x0_floor = floorf(x0); + float x1_ceil = ceilf(x1); u32 x0i = x0_floor; if (x1_ceil <= x0_floor + 1.0f) { @@ -304,7 +304,7 @@ void Rasterizer::draw_line(Gfx::FloatPoint p0, Gfx::FloatPoint p1) dydx = -dydx; float x0_right = 1.0f - (x0 - x0_floor); - u32 x1_floor_i = floor(x1); + u32 x1_floor_i = floorf(x1); float area_upto_here = 0.5f * x0_right * x0_right * dydx; m_data[line_offset + x0i] += direction * area_upto_here; for (u32 x = x0i + 1; x < x1_floor_i; x++) { @@ -478,8 +478,8 @@ void Glyf::Glyph::raster_inner(Rasterizer& rasterizer, Gfx::AffineTransform& aff RefPtr Glyf::Glyph::raster_simple(float x_scale, float y_scale) const { - u32 width = (u32)(ceil((m_xmax - m_xmin) * x_scale)) + 2; - u32 height = (u32)(ceil((m_ymax - m_ymin) * y_scale)) + 2; + u32 width = (u32)(ceilf((m_xmax - m_xmin) * x_scale)) + 2; + u32 height = (u32)(ceilf((m_ymax - m_ymin) * y_scale)) + 2; Rasterizer rasterizer(Gfx::IntSize(width, height)); auto affine = Gfx::AffineTransform().scale(x_scale, -y_scale).translate(-m_xmin, -m_ymax); raster_inner(rasterizer, affine); diff --git a/Userland/Libraries/LibTTF/Glyf.h b/Userland/Libraries/LibTTF/Glyf.h index 0497bc7290..dbf76866a0 100644 --- a/Userland/Libraries/LibTTF/Glyf.h +++ b/Userland/Libraries/LibTTF/Glyf.h @@ -106,8 +106,8 @@ public: template RefPtr raster_composite(float x_scale, float y_scale, GlyphCb glyph_callback) const { - u32 width = (u32)(ceil((m_xmax - m_xmin) * x_scale)) + 1; - u32 height = (u32)(ceil((m_ymax - m_ymin) * y_scale)) + 1; + u32 width = (u32)(ceilf((m_xmax - m_xmin) * x_scale)) + 1; + u32 height = (u32)(ceilf((m_ymax - m_ymin) * y_scale)) + 1; Rasterizer rasterizer(Gfx::IntSize(width, height)); auto affine = Gfx::AffineTransform().scale(x_scale, -y_scale).translate(-m_xmin, -m_ymax); ComponentIterator component_iterator(m_slice);