- Fixed variableScope and unreadVariable style warnings in UI module

- also removed my test file

Signed-off-by: Harry Young <hendrik.gerritzen@googlemail.com>
This commit is contained in:
Harry Young 2013-08-12 23:53:39 +02:00
parent d85e61ae76
commit 390e597c43
7 changed files with 10 additions and 15 deletions

View File

@ -1716,7 +1716,6 @@ rankset to that new data
void UI_InitRanksData( char* ranksName ) {
char filePath[MAX_QPATH];
int i;
if ( !Q_stricmp( uis.rankSet.rankSetName, ranksName ) )
goto refreshRank;
@ -1745,7 +1744,8 @@ void UI_InitRanksData( char* ranksName ) {
refreshRank:
/* using our current cvar'd rank, do a compare. if we find a match, set our player to that rank in the menu */
for ( i=0, uis.currentRank=0; i < MAX_RANKS; i++ ) {
int i;
for ( int i=0, uis.currentRank=0; i < MAX_RANKS; i++ ) {
if ( !Q_stricmp( uis.rankSet.rankNames[i].consoleName, UI_Cvar_VariableString( "ui_playerRank" ) ) ) {
uis.currentRank = i;
break;
@ -2929,7 +2929,6 @@ void UI_SecurityCodeSetup ( void )
int fileLen;
rpgxSecurityFile_t *code;
rpgxSecurityFile_t wCode;
unsigned long bit=0;
static qboolean ui_SecuritySetup=qfalse;
/* QVM Hack */
@ -2997,6 +2996,7 @@ void UI_SecurityCodeSetup ( void )
/* generate our player hash */
while ( code->hash == 0 || code->hash == SECURITY_HASH )
{
unsigned long bit=0;
/* set a pretty good random seed */
srand( trap_Milliseconds() );
/*code->hash = (int)(rand() / (((double)RAND_MAX + 1)/ SECURITY_HASH));*/

View File

@ -129,7 +129,6 @@ static void UI_CDKeyMenu_DrawKey( void *self )
menufield_s *f;
qboolean focus;
int style;
char c;
float *color;
int x, y;
@ -157,6 +156,7 @@ static void UI_CDKeyMenu_DrawKey( void *self )
// draw cursor if we have focus
if( focus )
{
char c;
if ( trap_Key_GetOverstrikeMode() )
{
c = 11;

View File

@ -63,7 +63,6 @@ static void UI_DisplayDownloadInfo( const char *downloadName ) {
int downloadSize, downloadCount, downloadTime;
char dlSizeBuf[64], totalSizeBuf[64], xferRateBuf[64], dlTimeBuf[64];
int xferRate;
int width, leftWidth;
int style = UI_LEFT|UI_SMALLFONT|UI_DROPSHADOW;
const char *s;
@ -100,6 +99,7 @@ static void UI_DisplayDownloadInfo( const char *downloadName ) {
UI_DrawProportionalString( leftWidth, etaYpos, estimating, style, color_white );
UI_DrawProportionalString( leftWidth, copiedYpos, va(XofXcopied, dlSizeBuf, totalSizeBuf), style, color_white );
} else {
int xferRate;
if ((uis.realtime - downloadTime) / 1000) {
xferRate = downloadCount / ((uis.realtime - downloadTime) / 1000);
} else {

View File

@ -942,7 +942,6 @@ static void Controls_DrawKeyBinding( void *self )
int x,bindingX;
int y;
int b1;
int b2;
qboolean c;
char name[32];
char name2[32];
@ -970,7 +969,7 @@ static void Controls_DrawKeyBinding( void *self )
trap_Key_KeynumToStringBuf( b1, name, 32 );
Q_strupr(name);
b2 = g_bindings[a->generic.id].bind2;
int b2 = g_bindings[a->generic.id].bind2;
if (b2 != -1)
{
trap_Key_KeynumToStringBuf( b2, name2, 32 );

View File

@ -1065,7 +1065,6 @@ static sfxHandle_t PlayerEmotes_KeyEvent ( int key ) {
menucommon_s *s;
int i;
char command[256];
int emoteId;
s = (menucommon_s *)Menu_ItemAtCursor( &s_playerEmotes.menu );
@ -1134,7 +1133,7 @@ static sfxHandle_t PlayerEmotes_KeyEvent ( int key ) {
if ( key == K_MOUSE2 && ( s->id >= ID_EMOTELIST1 && s->id <= ID_EMOTELIST12 ) ) {
PlayerEmotes_ExecuteOffset();
emoteId = s_playerEmotes.mainEmotesList[ ((s->id - 100)-1)+s_playerEmotes.emoteListOffset ];
int emoteId = s_playerEmotes.mainEmotesList[ ((s->id - 100)-1)+s_playerEmotes.emoteListOffset ];
if ( emoteId >= 0 && emoteId < bg_numEmotes ) {
trap_Cmd_ExecuteText( EXEC_APPEND, va( "wait 5;emote %s\n", bg_emoteList[emoteId].name ) );

View File

@ -39,13 +39,13 @@ M_GridFont_Graphics
*/
void M_GridFont_Graphics (void)
{
int x,y,color;
int x,y;
int i,i2,xInc;
char character[2];
character[1] = 0;
y = 190;
color = CT_LTORANGE;
int color = CT_LTORANGE;
for (i=32;i<256;)
{
x = 100;
@ -236,12 +236,10 @@ Fonts_MenuEvent
*/
static void Fonts_MenuEvent( void* ptr, int notification )
{
menuframework_s* m;
if (notification != QM_ACTIVATED)
return;
m = ((menucommon_s*)ptr)->parent;
menuframework_s* m = ((menucommon_s*)ptr)->parent;
switch (((menucommon_s*)ptr)->id)
{

View File

@ -1 +0,0 @@
Just a test file to make sure I understand the branching in git