fix VC6 internal compiler error

This commit is contained in:
Chris Danford
2004-05-27 05:35:10 +00:00
parent b1a320fc95
commit a6ebc41e10
2 changed files with 10 additions and 10 deletions
+9 -9
View File
@@ -140,16 +140,16 @@ inline float froundf( const float f, const float fRoundInterval )
template<typename T> template<typename T>
static inline void enum_add( T &val, int iAmt ) static inline void enum_add( T &val, int iAmt )
{ {
union conv union conv
{ {
T value; T value;
int i; int i;
conv( T v ):value(v) { } };
};
conv c( val ); conv c;
c.i += iAmt; c.value = val;
val = c.value; c.i += iAmt;
val = c.value;
} }
// Move val toward other_val by to_move. // Move val toward other_val by to_move.
+1 -1
View File
@@ -163,7 +163,7 @@ void ScreenSetTime::ChangeSelection( int iDirection )
{ {
// set new value of m_Selection // set new value of m_Selection
SetTimeSelection OldSelection = m_Selection; SetTimeSelection OldSelection = m_Selection;
enum_add( m_Selection, iDirection ); enum_add<SetTimeSelection>( m_Selection, iDirection );
CLAMP( (int&)m_Selection, 0, NUM_SET_TIME_SELECTIONS-1 ); CLAMP( (int&)m_Selection, 0, NUM_SET_TIME_SELECTIONS-1 );
if( iDirection != 0 && m_Selection == OldSelection ) if( iDirection != 0 && m_Selection == OldSelection )