Fix -Wchar-subscripts warnings

array subscript has type ‘char’
This commit is contained in:
dhewg 2011-11-30 21:22:05 +01:00
parent 79ad905e05
commit 14329d47d8
3 changed files with 5 additions and 3 deletions

View file

@ -1276,7 +1276,8 @@ PrintFloat
================== ==================
*/ */
static void PrintFloat( float f ) { static void PrintFloat( float f ) {
char buf[128], i; char buf[128];
int i;
for ( i = sprintf( buf, "%3.2f", f ); i < 7; i++ ) { for ( i = sprintf( buf, "%3.2f", f ); i < 7; i++ ) {
buf[i] = ' '; buf[i] = ' ';

View file

@ -1207,7 +1207,8 @@ PrintFloat
================== ==================
*/ */
static void PrintFloat( float f ) { static void PrintFloat( float f ) {
char buf[128], i; char buf[128];
int i;
for ( i = sprintf( buf, "%3.2f", f ); i < 7; i++ ) { for ( i = sprintf( buf, "%3.2f", f ); i < 7; i++ ) {
buf[i] = ' '; buf[i] = ' ';

View file

@ -929,7 +929,7 @@ void idDeviceContext::DrawEditCursor( float x, float y, float scale ) {
} }
SetFontByScale(scale); SetFontByScale(scale);
float useScale = scale * useFont->glyphScale; float useScale = scale * useFont->glyphScale;
const glyphInfo_t *glyph2 = &useFont->glyphs[(overStrikeMode) ? '_' : '|']; const glyphInfo_t *glyph2 = &useFont->glyphs[overStrikeMode ? int('_') : int('|')];
float yadj = useScale * glyph2->top; float yadj = useScale * glyph2->top;
PaintChar(x, y - yadj,glyph2->imageWidth,glyph2->imageHeight,useScale,glyph2->s,glyph2->t,glyph2->s2,glyph2->t2,glyph2->glyph); PaintChar(x, y - yadj,glyph2->imageWidth,glyph2->imageHeight,useScale,glyph2->s,glyph2->t,glyph2->s2,glyph2->t2,glyph2->glyph);
} }