Skip to content

Commit

Permalink
Fixed various compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tobydox committed Sep 16, 2014
1 parent 9713973 commit 2145068
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/botai/ai_dmq3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2118,7 +2118,7 @@ int BotEntityToActivate( int entitynum ) {
return 0;
}
trap_AAS_ValueForBSPEpairKey( ent, "classname", classname, sizeof( classname ) );
if ( !classname ) {
if ( classname[0] == 0 ) {
BotAI_Print( PRT_ERROR, "BotEntityToActivate: entity with model %s has no classname\n", model );
return 0;
}
Expand Down
4 changes: 1 addition & 3 deletions src/cgame/cg_drawtools.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ void CG_FilledBar( float x, float y, float w, float h, const float *startColorIn
if ( endColor ) {
endColor[3] *= cg_hudAlpha.value;
}
if ( backgroundcolor ) {
backgroundcolor[3] *= cg_hudAlpha.value;
}
backgroundcolor[3] *= cg_hudAlpha.value;
}

if ( flags & BAR_LERP_COLOR ) {
Expand Down
6 changes: 3 additions & 3 deletions src/cgame/cg_servercmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ static void CG_ServerCommand( void ) {
int fadeTime = 0; // default to instant start

Q_strncpyz( text, CG_Argv( 2 ), MAX_SAY_TEXT );
if ( text && strlen( text ) ) {
if ( strlen( text ) ) {
fadeTime = atoi( text );
}

Expand All @@ -959,7 +959,7 @@ static void CG_ServerCommand( void ) {
int fadeTime = 0; // default to instant start

Q_strncpyz( text, CG_Argv( 2 ), MAX_SAY_TEXT );
if ( text && strlen( text ) ) {
if ( strlen( text ) ) {
fadeTime = atoi( text );
}

Expand All @@ -971,7 +971,7 @@ static void CG_ServerCommand( void ) {
int fadeTime = 0; // default to instant stop

Q_strncpyz( text, CG_Argv( 1 ), MAX_SAY_TEXT );
if ( text && strlen( text ) ) {
if ( strlen( text ) ) {
fadeTime = atoi( text );
}
trap_S_FadeBackgroundTrack( 0.0f, fadeTime, 0 );
Expand Down
2 changes: 1 addition & 1 deletion src/cgame/cg_weapons.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ void CG_RegisterWeapon( int weaponNum ) {
strcpy( comppath, item->world_model[W_TP_MODEL] ); // not there, use the standard view hand

}
if ( ( !comppath || !cg_drawFPGun.integer ) && // then if it didn't find the 1st person one or you are set to not use one
if ( ( !cg_drawFPGun.integer ) && // then if it didn't find the 1st person one or you are set to not use one
item->world_model[W_TP_MODEL] ) {
strcpy( comppath, item->world_model[W_TP_MODEL] ); // use the standard view hand

Expand Down
4 changes: 2 additions & 2 deletions src/game/ai_cast.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void AICast_Init( void ) {
aicast_skillscale = (float)trap_Cvar_VariableIntegerValue( "g_gameSkill" ) / (float)GSKILL_MAX;

caststates = G_Alloc( aicast_maxclients * sizeof( cast_state_t ) );
memset( caststates, 0, sizeof( caststates ) );
memset( caststates, 0, sizeof( *caststates ) );
for ( i = 0; i < MAX_CLIENTS; i++ ) {
caststates[i].entityNum = i;
}
Expand Down Expand Up @@ -1000,4 +1000,4 @@ void AICast_RegisterPain( int entnum ) {
if ( cs ) {
cs->lastPain = level.time;
}
}
}
2 changes: 1 addition & 1 deletion src/game/bg_animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ void BG_ParseCommands( char **input, animScriptItem_t *scriptItem, animModelInfo
BG_AnimParseError( "BG_ParseCommands: exceeded maximum number of animations (%i)", MAX_ANIMSCRIPT_ANIMCOMMANDS );
}
command = &scriptItem->commands[scriptItem->numCommands++];
memset( command, 0, sizeof( command ) );
memset( command, 0, sizeof( *command ) );
}

command->bodyPart[partIndex] = BG_IndexForString( token, animBodyPartsStr, qtrue );
Expand Down
6 changes: 2 additions & 4 deletions src/ui/ui_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ static void UI_DrawMapLevelshot( rectDef_t *rect ) {

DC->getCVarString( "mapname", levelname, sizeof( levelname ) );

if ( levelname && levelname[0] != 0 ) {
if ( levelname[0] != 0 ) {
levelshot = trap_R_RegisterShaderNoMip( va( "levelshots/%s.tga", levelname ) );
}

Expand Down Expand Up @@ -1539,9 +1539,7 @@ void UI_FilledBar( float x, float y, float w, float h, float *startColor, float
if ( endColor ) {
endColor[3] *= ui_hudAlpha.value;
}
if ( backgroundcolor ) {
backgroundcolor[3] *= ui_hudAlpha.value;
}
backgroundcolor[3] *= ui_hudAlpha.value;
}

if ( flags & BAR_LERP_COLOR ) {
Expand Down

0 comments on commit 2145068

Please sign in to comment.