Fix -Wunused-value warnings

value computed is not used
left operand of comma operator has no effect
right operand of comma operator has no effect
This commit is contained in:
dhewg 2011-12-02 20:55:32 +01:00
parent 3f5c14ef5f
commit ee0996e380
4 changed files with 11 additions and 10 deletions

View file

@ -7154,15 +7154,16 @@ void idPlayer::UpdateHud( void ) {
if ( inventory.nextItemPickup && gameLocal.time - inventory.nextItemPickup > 2000 ) {
inventory.nextItemNum = 1;
}
int i;
int i, count = 5;
#ifdef _D3XP
int count = 5;
if(gameLocal.isMultiplayer) {
count = 3;
}
if (count < c)
c = count;
#endif
for ( i = 0; i < count, i < c; i++ ) { //_D3XP
for ( i = 0; i < c; i++ ) { //_D3XP
hud->SetStateString( va( "itemtext%i", inventory.nextItemNum ), inventory.pickupItemNames[0].name );
hud->SetStateString( va( "itemicon%i", inventory.nextItemNum ), inventory.pickupItemNames[0].icon );
hud->HandleNamedEvent( va( "itemPickup%i", inventory.nextItemNum++ ) );

View file

@ -6057,7 +6057,7 @@ void idPlayer::UpdateHud( void ) {
inventory.nextItemNum = 1;
}
int i;
for ( i = 0; i < 5, i < c; i++ ) {
for ( i = 0; i < 5 && i < c; i++ ) {
hud->SetStateString( va( "itemtext%i", inventory.nextItemNum ), inventory.pickupItemNames[0].name );
hud->SetStateString( va( "itemicon%i", inventory.nextItemNum ), inventory.pickupItemNames[0].icon );
hud->HandleNamedEvent( va( "itemPickup%i", inventory.nextItemNum++ ) );

View file

@ -7088,7 +7088,7 @@ void idMatX::Eigen_SortIncreasing( idVecX &eigenValues ) {
int i, j, k;
float min;
for ( i = 0, j; i <= numRows - 2; i++ ) {
for ( i = 0; i <= numRows - 2; i++ ) {
j = i;
min = eigenValues[j];
for ( k = i + 1; k < numRows; k++ ) {
@ -7113,7 +7113,7 @@ void idMatX::Eigen_SortDecreasing( idVecX &eigenValues ) {
int i, j, k;
float max;
for ( i = 0, j; i <= numRows - 2; i++ ) {
for ( i = 0; i <= numRows - 2; i++ ) {
j = i;
max = eigenValues[j];
for ( k = i + 1; k < numRows; k++ ) {

View file

@ -1248,7 +1248,7 @@ int sgetI1( unsigned char **bp )
i = **bp;
if ( i > 127 ) i -= 256;
flen += 1;
*bp++;
*bp += 1;
return i;
}
@ -1286,7 +1286,7 @@ unsigned char sgetU1( unsigned char **bp )
if ( flen == FLEN_ERROR ) return 0;
c = **bp;
flen += 1;
*bp++;
*bp += 1;
return c;
}
@ -1714,7 +1714,7 @@ static int add_clip( char *s, lwClip **clist, int *nclips )
clip->source.still.name = s;
}
*nclips++;
*nclips += 1;
clip->index = *nclips;
lwListAdd( (void**)clist, clip );