shithub: candycrisis

Download patch

ref: 0fa446614fc99ec40d3b6c269811f85c91188500
parent: 1f06890cbddd90bbf15ebffd16872570bf474b5b
author: Iliyas Jorio <iliyas@jor.io>
date: Wed Feb 2 19:07:45 EST 2022

Fix some GCC warnings

--- a/src/font.cpp
+++ b/src/font.cpp
@@ -112,7 +112,7 @@
 	int width = 0;
 	while( *text )
 	{
-		width += font->width[*text++];
+		width += font->width[(uint8_t) *text++];
 	}
 	
 	return width;
--- a/src/level.cpp
+++ b/src/level.cpp
@@ -1087,7 +1087,6 @@
 	MRect           bufferDstRect = { 0, 0, 480, 300 };
 	MPoint          dPoint = { 450, 50 }, lPoint, cPoint;
 	int             scroll, ticks, x, y;
-	int             delay = 2;
 	const char*     text;
 	int             thisFade;
 	const char fade[120] =   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0
--- a/src/pause.cpp
+++ b/src/pause.cpp
@@ -626,7 +626,7 @@
 	{
 		scan = line[index];
 		while( *scan )
-			dPoint[index].h -= smallFont->width[*scan++];
+			dPoint[index].h -= smallFont->width[(uint8_t) * scan++];
 		
 		dPoint[index].h /= 2;
 	}	
--- a/src/score.cpp
+++ b/src/score.cpp
@@ -130,7 +130,7 @@
 void DrawCharacter( char which, const MRect *myRect )
 {
 	MRect   srcRect;
-	char    count, result;
+	int     count, result;
 	
 	result = -1;
 	for( count = 0; count < arrsize(characterList); count++ )
--- a/src/tutorial.cpp
+++ b/src/tutorial.cpp
@@ -363,7 +363,7 @@
 				break;
 			
 			default:
-				currentWidth += balloonFont->width[in];
+				currentWidth += balloonFont->width[(uint8_t) in];
 				break;
 		}
 	}
--- a/src/zap.cpp
+++ b/src/zap.cpp
@@ -60,7 +60,7 @@
 
 		zapScoreWidth[player] = 0;
 		scan = zapScore[player];
-		while( *scan ) zapScoreWidth[player] += zapFont->width[*scan++];
+		while( *scan ) zapScoreWidth[player] += zapFont->width[(uint8_t) * scan++];
 		
 		if( (zapScorePt[player].h + zapScoreWidth[player] + 8) > (kGridAcross * kBlobHorizSize) )
 		{