From d571048d2b1c0110237b187ae6b91d6839eeef22 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 1 Nov 2006 11:30:41 +0000 Subject: [PATCH] This is overkill for such a simple operation. Doing it this way should optimize to a single add and it doesn't have any of the problems associated with breaking aliasing rules. --- stepmania/src/RageUtil.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 33581af9e8..12966a2c28 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -165,14 +165,13 @@ ConvertValueHelper ConvertValue( FROM *pValue ) template static inline void enum_add( T &val, int iAmt ) { - *ConvertValue(&val) += iAmt; + val = static_cast( val + iAmt ); } template static inline T enum_add2( T val, int iAmt ) { - enum_add( val, iAmt ); - return val; + return static_cast( val + iAmt ); }