[Scummvm-git-logs] scummvm master -> 14a1bb9ae39d8ef96e5622ff54d9e74c5d0c50a5

digitall noreply at scummvm.org
Wed Sep 10 22:54:24 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
14a1bb9ae3 GRAPHICS: FONTS: Fix Type Limits GCC Compiler Warning in BGI Font Class


Commit: 14a1bb9ae39d8ef96e5622ff54d9e74c5d0c50a5
    https://github.com/scummvm/scummvm/commit/14a1bb9ae39d8ef96e5622ff54d9e74c5d0c50a5
Author: D G Turner (digitall at scummvm.org)
Date: 2025-09-10T23:51:40+01:00

Commit Message:
GRAPHICS: FONTS: Fix Type Limits GCC Compiler Warning in BGI Font Class

Changed paths:
    graphics/fonts/bgifont.cpp


diff --git a/graphics/fonts/bgifont.cpp b/graphics/fonts/bgifont.cpp
index 56ca7ebb226..376c02aa300 100644
--- a/graphics/fonts/bgifont.cpp
+++ b/graphics/fonts/bgifont.cpp
@@ -142,7 +142,7 @@ BgiFont::CachedFont *BgiFont::drawCachedFont(int size) {
 		cachedFont->offsets[i] = offsetCount;
 		cachedFont->widths[i] = _glyphs[i].charWidth;
 
-		for (int j = 0; j < _glyphs[i].insts.size(); j++) {
+		for (uint j = 0; j < _glyphs[i].insts.size(); j++) {
 			int opCode = _glyphs[i].insts[j]->opCode;
 			// Need to normalize Y coord because the stroke instructions start at origin and extend upwards up to originAscender, downwards to originToDescender
 			int adjustedY = _originToAscender - _glyphs[i].insts[j]->yCoord;
@@ -201,10 +201,13 @@ void BgiFont::drawChar(Surface *dst, uint32 chr, int x, int y, uint32 color) con
 }
 
 uint16 BgiFont::characterToIndex(uint32 character) const {
-	if (character - _firstChar >= 0 && character - _firstChar < _charCount) {
-		return character - _firstChar;
-	} else
-		return _firstChar;
+	uint16 index = _firstChar;
+	if (character >= _firstChar) {
+		if ((character - _firstChar) < _charCount) {
+			index = character - _firstChar;
+		}
+	}
+	return index;
 }
 
 } // End of namespace Graphics




More information about the Scummvm-git-logs mailing list