Fixed compilation warnings (mostly size_t->int, signed/unsigned conversions).
This commit is contained in:
@@ -61,7 +61,7 @@ int CG_Text_Width(const char *text, float scale, int limit) {
|
||||
useScale = scale * font->glyphScale;
|
||||
out = 0;
|
||||
if (text) {
|
||||
len = strlen(text);
|
||||
len = (int)strlen(text);
|
||||
if (limit > 0 && len > limit) {
|
||||
len = limit;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ int CG_Text_Height(const char *text, float scale, int limit) {
|
||||
useScale = scale * font->glyphScale;
|
||||
max = 0;
|
||||
if (text) {
|
||||
len = strlen(text);
|
||||
len = (int)strlen(text);
|
||||
if (limit > 0 && len > limit) {
|
||||
len = limit;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void CG_Text_Paint(float x, float y, float scale, vec4_t color, const char *text
|
||||
const char *s = text;
|
||||
trap_R_SetColor( color );
|
||||
memcpy(&newColor[0], &color[0], sizeof(vec4_t));
|
||||
len = strlen(text);
|
||||
len = (int)strlen(text);
|
||||
if (limit > 0 && len > limit) {
|
||||
len = limit;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ static void CG_DrawField (int x, int y, int width, int value) {
|
||||
}
|
||||
|
||||
Com_sprintf (num, sizeof(num), "%i", value);
|
||||
l = strlen(num);
|
||||
l = (int)strlen(num);
|
||||
if (l > width)
|
||||
l = width;
|
||||
x += 2 + CHAR_WIDTH*(width - l);
|
||||
|
||||
@@ -1122,7 +1122,7 @@ void CG_BuildSpectatorString() {
|
||||
Q_strcat(cg.spectatorList, sizeof(cg.spectatorList), va("%s ", cgs.clientinfo[i].name));
|
||||
}
|
||||
}
|
||||
i = strlen(cg.spectatorList);
|
||||
i = (int)strlen(cg.spectatorList);
|
||||
if (i != cg.spectatorLen) {
|
||||
cg.spectatorLen = i;
|
||||
cg.spectatorWidth = -1;
|
||||
|
||||
@@ -502,13 +502,13 @@ void CG_DrawOldTourneyScoreboard( void ) {
|
||||
//
|
||||
CG_DrawStringExt( 8, y, "Red Team", color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
s = va("%i", cg.teamScores[0] );
|
||||
CG_DrawStringExt( 632 - GIANT_WIDTH * strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
CG_DrawStringExt( 632 - GIANT_WIDTH * (int)strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
|
||||
y += 64;
|
||||
|
||||
CG_DrawStringExt( 8, y, "Blue Team", color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
s = va("%i", cg.teamScores[1] );
|
||||
CG_DrawStringExt( 632 - GIANT_WIDTH * strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
CG_DrawStringExt( 632 - GIANT_WIDTH * (int)strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
} else {
|
||||
//
|
||||
// free for all scoreboard
|
||||
@@ -524,7 +524,7 @@ void CG_DrawOldTourneyScoreboard( void ) {
|
||||
|
||||
CG_DrawStringExt( 8, y, ci->name, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
s = va("%i", ci->score );
|
||||
CG_DrawStringExt( 632 - GIANT_WIDTH * strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
CG_DrawStringExt( 632 - GIANT_WIDTH * (int)strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
|
||||
y += 64;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user