From 1342fd3ecf27362857ed035585d710e36d0c0b57 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sun, 30 Oct 2022 08:45:04 +0300 Subject: [PATCH] Fix warning --- src/font_manager.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/font_manager.cc b/src/font_manager.cc index 67df34d..7a17baa 100644 --- a/src/font_manager.cc +++ b/src/font_manager.cc @@ -343,13 +343,13 @@ static void interfaceFontDrawImpl(unsigned char* buf, const char* string, int le unsigned char* ptr = buf; while (*string != '\0') { - char ch = *string++; + unsigned char ch = static_cast(*string++); int characterWidth; if (ch == ' ') { characterWidth = gCurrentInterfaceFontDescriptor->wordSpacing; } else { - characterWidth = gCurrentInterfaceFontDescriptor->glyphs[ch & 0xFF].width; + characterWidth = gCurrentInterfaceFontDescriptor->glyphs[ch].width; } unsigned char* end; @@ -364,7 +364,7 @@ static void interfaceFontDrawImpl(unsigned char* buf, const char* string, int le break; } - InterfaceFontGlyph* glyph = &(gCurrentInterfaceFontDescriptor->glyphs[ch & 0xFF]); + InterfaceFontGlyph* glyph = &(gCurrentInterfaceFontDescriptor->glyphs[ch]); unsigned char* glyphDataPtr = gCurrentInterfaceFontDescriptor->data + glyph->offset; // Skip blank pixels (difference between font's line height and glyph height).