From 638b22362e1d8dbda5313af6377cb6d0bd70795f Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Thu, 22 May 2003 01:55:16 +0000 Subject: [PATCH] changed incorrect (int)char casts to (unsigned char)char casts. --- src/avp/win95/frontend/avp_menus.c | 6 +++--- src/opengl.c | 12 ++++++------ src/win95/io.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/avp/win95/frontend/avp_menus.c b/src/avp/win95/frontend/avp_menus.c index 7765a61..f63638b 100644 --- a/src/avp/win95/frontend/avp_menus.c +++ b/src/avp/win95/frontend/avp_menus.c @@ -2043,8 +2043,8 @@ static void ActUponUsersInput(void) { extern char AAFontWidths[256]; //using small font - if(AvPMenus.WidthLeftForTextc.TextPtr[AvPMenus.PositionInTextField++] = c; @@ -5305,7 +5305,7 @@ void RenderBriefingText(int centreY, int brightness) while(*ptr) { - length+=AAFontWidths[(int)(*ptr++)]; + length+=AAFontWidths[(unsigned char)(*ptr++)]; } } diff --git a/src/opengl.c b/src/opengl.c index 8eea18c..c5dbc5d 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -1643,7 +1643,7 @@ if (stringPtr == NULL) return; colour ); } - x += AAFontWidths[(int)c]; + x += AAFontWidths[(unsigned char)c]; } } @@ -1691,7 +1691,7 @@ if (stringPtr == NULL) return; colour ); } - x += AAFontWidths[(int)c]; + x += AAFontWidths[(unsigned char)c]; } } @@ -1705,7 +1705,7 @@ if (stringPtr == NULL) return; while(*ptr) { - length+=AAFontWidths[(int)*ptr++]; + length+=AAFontWidths[(unsigned char)*ptr++]; } length = MUL_FIXED(HUDScaleFactor,length); @@ -1747,7 +1747,7 @@ if (stringPtr == NULL) return; colour ); } - x += MUL_FIXED(HUDScaleFactor,AAFontWidths[(int)c]); + x += MUL_FIXED(HUDScaleFactor,AAFontWidths[(unsigned char)c]); } } @@ -1763,7 +1763,7 @@ void RenderStringCentred(char *stringPtr, int centreX, int y, int colour) while(*ptr) { - length+=AAFontWidths[(int)*ptr++]; + length+=AAFontWidths[(unsigned char)*ptr++]; } D3D_RenderHUDString(stringPtr,centreX-length/2,y,colour); } @@ -1808,7 +1808,7 @@ void RenderStringVertically(char *stringPtr, int centreX, int bottomY, int colou colour ); } - y -= AAFontWidths[(int)c]; + y -= AAFontWidths[(unsigned char)c]; } } diff --git a/src/win95/io.c b/src/win95/io.c index 1e5c2fa..67a3bfc 100644 --- a/src/win95/io.c +++ b/src/win95/io.c @@ -1151,7 +1151,7 @@ static int DHM_MoveBufferToQueue(int* pPosX,int* pPosY,int fZeroLeftMargin) /* It is a standard character or a space */ DHM_AddToQueue(*pPosX,(*pPosY)+textprint_Y_offset, *pCh); - (*pPosX)+=AAFontWidths[(int)*pCh];//CharWidthInPixels(*pCh); + (*pPosX)+=AAFontWidths[(unsigned char)*pCh];//CharWidthInPixels(*pCh); if ((*pPosX)>LastDisplayableXForChars()) {