Fix warning

This commit is contained in:
Alexander Batalov 2022-10-30 08:45:04 +03:00
parent 3015f39368
commit 1342fd3ecf
1 changed files with 3 additions and 3 deletions

View File

@ -343,13 +343,13 @@ static void interfaceFontDrawImpl(unsigned char* buf, const char* string, int le
unsigned char* ptr = buf; unsigned char* ptr = buf;
while (*string != '\0') { while (*string != '\0') {
char ch = *string++; unsigned char ch = static_cast<unsigned char>(*string++);
int characterWidth; int characterWidth;
if (ch == ' ') { if (ch == ' ') {
characterWidth = gCurrentInterfaceFontDescriptor->wordSpacing; characterWidth = gCurrentInterfaceFontDescriptor->wordSpacing;
} else { } else {
characterWidth = gCurrentInterfaceFontDescriptor->glyphs[ch & 0xFF].width; characterWidth = gCurrentInterfaceFontDescriptor->glyphs[ch].width;
} }
unsigned char* end; unsigned char* end;
@ -364,7 +364,7 @@ static void interfaceFontDrawImpl(unsigned char* buf, const char* string, int le
break; break;
} }
InterfaceFontGlyph* glyph = &(gCurrentInterfaceFontDescriptor->glyphs[ch & 0xFF]); InterfaceFontGlyph* glyph = &(gCurrentInterfaceFontDescriptor->glyphs[ch]);
unsigned char* glyphDataPtr = gCurrentInterfaceFontDescriptor->data + glyph->offset; unsigned char* glyphDataPtr = gCurrentInterfaceFontDescriptor->data + glyph->offset;
// Skip blank pixels (difference between font's line height and glyph height). // Skip blank pixels (difference between font's line height and glyph height).