diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 01ef437248..dea8b01343 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -140,16 +140,16 @@ inline float froundf( const float f, const float fRoundInterval ) template 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. diff --git a/stepmania/src/ScreenSetTime.cpp b/stepmania/src/ScreenSetTime.cpp index 75092bfdc0..9e67e6ee6e 100644 --- a/stepmania/src/ScreenSetTime.cpp +++ b/stepmania/src/ScreenSetTime.cpp @@ -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( m_Selection, iDirection ); CLAMP( (int&)m_Selection, 0, NUM_SET_TIME_SELECTIONS-1 ); if( iDirection != 0 && m_Selection == OldSelection )