From 7d31a0b2bb9646a3e038dc8e2231f228fc884126 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 9 Apr 2005 09:51:42 +0000 Subject: [PATCH] Don't allow XToString for *_INVALID values. Nothing uses this and it makes the range assert not fire if the string array has one fewer entry than the enum. --- stepmania/src/EnumHelper.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stepmania/src/EnumHelper.h b/stepmania/src/EnumHelper.h index 8e28708fcf..11df78df40 100644 --- a/stepmania/src/EnumHelper.h +++ b/stepmania/src/EnumHelper.h @@ -35,13 +35,9 @@ static inline void enum_add( T &val, int iAmt ) #define FOREACH_ENUM( e, max, var ) for( e var=(e)0; var( var, +1 ) ) -static const CString EMPTY_STRING; - #define XToString(X, CNT) \ const CString& X##ToString( X x ) \ { \ - if( x == ARRAYSIZE(X##Names)+1 ) \ - return EMPTY_STRING; \ ASSERT(unsigned(x) < CNT); \ return X##Names[x]; \ }