summaryrefslogtreecommitdiffhomepage
path: root/dev/modules/CoreGfx/TextGfx.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-04-11 17:52:52 +0200
committerGitHub <noreply@github.com>2025-04-11 17:52:52 +0200
commitc1d9fbd3925d6e10919a7793fc214c9f1a01b2ab (patch)
treea74bdf6f87d07a24496effbc157f74d379d25007 /dev/modules/CoreGfx/TextGfx.h
parent8988b6f166d1087615b21229df651e0bcc0fa048 (diff)
parentc3856eddb5a8146751dac82ad1ba4433f5ca6d6d (diff)
Merge pull request #14 from amlel-el-mahrouss/dev
tweak kernel, boot: use -Wall, -Werror, -Wpedantic now
Diffstat (limited to 'dev/modules/CoreGfx/TextGfx.h')
-rw-r--r--dev/modules/CoreGfx/TextGfx.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/dev/modules/CoreGfx/TextGfx.h b/dev/modules/CoreGfx/TextGfx.h
index 13811d37..cbe62022 100644
--- a/dev/modules/CoreGfx/TextGfx.h
+++ b/dev/modules/CoreGfx/TextGfx.h
@@ -145,10 +145,10 @@ inline const Kernel::UInt8 kFontBitmap[kFontNOFChars][kFontSizeX] = {
};
-inline Kernel::Void fb_render_string_for_bitmap(const Kernel::UInt8* bitmap, const Kernel::SizeT& x_sz, const Kernel::SizeT& y_sz, Kernel::Int32& x_dst, Kernel::Int32& y_dst, Kernel::Int32& color)
+inline Kernel::Void fb_render_string_for_bitmap(const Kernel::UInt8* bitmap, const Kernel::SizeT x_sz, const Kernel::SizeT y_sz, Kernel::Int32& x_dst, Kernel::Int32& y_dst, Kernel::Int32& color)
{
- Kernel::Int32 x, y;
- Kernel::Int32 set;
+ Kernel::SizeT x, y;
+ Kernel::SizeT set;
x = 0;
y = 0;
@@ -170,9 +170,11 @@ inline Kernel::Void fb_render_string_for_bitmap(const Kernel::UInt8* bitmap, con
inline Kernel::Void fb_render_string(const Kernel::Char* text, Kernel::Int32 x_dst, Kernel::Int32 y_dst, Kernel::Int32 color)
{
- for (Kernel::SizeT i = 0; text[i] != 0; ++i)
+ auto len = Kernel::rt_string_len(text);
+
+ for (Kernel::SizeT i = 0; i < len; ++i)
{
- fb_render_string_for_bitmap(&kFontBitmap[text[i]][0], kFontSizeX, kFontSizeY, x_dst, y_dst, color);
+ fb_render_string_for_bitmap(&kFontBitmap[(Kernel::UInt8)text[i]][0], kFontSizeX, kFontSizeY, x_dst, y_dst, color);
y_dst += kFontSizeY;
}
}