don't allow StringToX for *_INVALID values

This commit is contained in:
Chris Danford
2005-03-05 21:50:33 +00:00
parent 2d2796148b
commit b60d135493
11 changed files with 30 additions and 30 deletions
+2 -2
View File
@@ -37,12 +37,12 @@ static inline void enum_add( T &val, int iAmt )
static const CString EMPTY_STRING;
#define XToString(X) \
#define XToString(X, CNT) \
const CString& X##ToString( X x ) \
{ \
if( x == ARRAYSIZE(X##Names)+1 ) \
return EMPTY_STRING; \
ASSERT(unsigned(x) < ARRAYSIZE(X##Names)); \
ASSERT(unsigned(x) < CNT); \
return X##Names[x]; \
}