From bc3e6949e53598ce6a98274b64b0d9c51469e503 Mon Sep 17 00:00:00 2001 From: Jacob Garby Date: Wed, 25 Oct 2023 21:54:09 +0000 Subject: [PATCH] Remove redundant kernel floor function --- Kernel/include/Math.h | 1 - Kernel/src/Math.cpp | 5 ----- Kernel/src/Video/Video.cpp | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Kernel/include/Math.h b/Kernel/include/Math.h index 6a54ef16..81ce7e6e 100755 --- a/Kernel/include/Math.h +++ b/Kernel/include/Math.h @@ -4,5 +4,4 @@ #define MIN(x, y) ((x > y) ? y : x) unsigned int rand(); -int floor(int num); int abs(int num); \ No newline at end of file diff --git a/Kernel/src/Math.cpp b/Kernel/src/Math.cpp index c26682fc..c718db26 100755 --- a/Kernel/src/Math.cpp +++ b/Kernel/src/Math.cpp @@ -5,9 +5,4 @@ unsigned int rand() { return ((unsigned int)(rand_next / 65536) % 32768); } -int floor(int num) { - int x = (int)num; - return num < x ? x - 1 : x; -} - int abs(int num) { return num < 0 ? -num : num; } \ No newline at end of file diff --git a/Kernel/src/Video/Video.cpp b/Kernel/src/Video/Video.cpp index ff306ccf..c48ececc 100755 --- a/Kernel/src/Video/Video.cpp +++ b/Kernel/src/Video/Video.cpp @@ -231,7 +231,7 @@ void DrawBitmapImage(unsigned int x, unsigned int y, unsigned int w, unsigned in data += bmpHeader.offset; uint8_t bmpBpp = 24; - uint32_t rowSize = floor((bmpBpp * w + 31) / 32) * 4; + uint32_t rowSize = ((bmpBpp * w + 31) / 32) * 4; uint32_t bmpOffset = rowSize * (h - 1); uint32_t pixelSize = 4;