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>
static inline void enum_add( T &val, int iAmt )
{
union conv
{
T value;
int i;
conv( T v ):value(v) { }
};
union conv
{
T value;
int i;
};
conv c( val );
c.i += iAmt;
val = c.value;
conv c;
c.value = val;
c.i += iAmt;
val = c.value;
}
// 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
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 );
if( iDirection != 0 && m_Selection == OldSelection )