Fix warning.

WRAP is only safe for the int range, since it needs to cast to int to
negate; so only allow int.

When possible, use a (possibly templated) inline function instead of
a #define.
This commit is contained in:
Glenn Maynard
2003-09-01 02:04:16 +00:00
parent 985a040f49
commit 5b17149520
2 changed files with 11 additions and 4 deletions
+3 -3
View File
@@ -250,13 +250,13 @@ void ScreenSelectCharacter::AfterValueChange( PlayerNumber pn )
for( int j=0; j<NUM_ATTACKS_PER_LEVEL; j++ )
m_AttackIcons[pnAffected][i][j].Load( pnAffected, pChar->m_sAttacks[i][j] );
unsigned c = m_iSelectedCharacter[pnAffected] - MAX_CHAR_ICONS_TO_SHOW/2;
WRAP( c, GAMESTATE->m_pCharacters.size() );
int c = m_iSelectedCharacter[pnAffected] - MAX_CHAR_ICONS_TO_SHOW/2;
wrap( c, GAMESTATE->m_pCharacters.size() );
for( unsigned i=0; i<MAX_CHAR_ICONS_TO_SHOW; i++ )
{
c++;
WRAP( c, GAMESTATE->m_pCharacters.size() );
wrap( c, GAMESTATE->m_pCharacters.size() );
Character* pCharacter = GAMESTATE->m_pCharacters[c];
Banner &banner = m_sprIcons[pnAffected][i];
banner.LoadIconFromCharacter( pCharacter );