Simplify.
This commit is contained in:
@@ -54,13 +54,9 @@ static const RString EMPTY_STRING;
|
|||||||
{ \
|
{ \
|
||||||
Check##X##ToStringParamType( X##Names ); \
|
Check##X##ToStringParamType( X##Names ); \
|
||||||
static auto_ptr<RString> as_##X##Name[CNT]; \
|
static auto_ptr<RString> as_##X##Name[CNT]; \
|
||||||
if( as_##X##Name[0].get() == NULL ) { \
|
if( as_##X##Name[0].get() == NULL ) \
|
||||||
for( unsigned i = 0; i < CNT; ++i ) \
|
for( unsigned i = 0; i < CNT; ++i ) \
|
||||||
{ \
|
as_##X##Name[i].reset( new RString(X##Names[i]) ); \
|
||||||
auto_ptr<RString> ap( new RString( X##Names[i] ) ); \
|
|
||||||
as_##X##Name[i] = ap; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
ASSERT( CNT == ARRAYSIZE(X##Names) ); \
|
ASSERT( CNT == ARRAYSIZE(X##Names) ); \
|
||||||
if( x == CNT+1 ) \
|
if( x == CNT+1 ) \
|
||||||
return EMPTY_STRING; \
|
return EMPTY_STRING; \
|
||||||
@@ -72,13 +68,9 @@ static const RString EMPTY_STRING;
|
|||||||
const RString &X##ToLocalizedString( X x ) \
|
const RString &X##ToLocalizedString( X x ) \
|
||||||
{ \
|
{ \
|
||||||
static auto_ptr<LocalizedString> g_##X##Name[NUM_##X]; \
|
static auto_ptr<LocalizedString> g_##X##Name[NUM_##X]; \
|
||||||
if( g_##X##Name[0].get() == NULL ) { \
|
if( g_##X##Name[0].get() == NULL ) \
|
||||||
for( unsigned i = 0; i < NUM_##X; ++i ) \
|
for( unsigned i = 0; i < NUM_##X; ++i ) \
|
||||||
{ \
|
g_##X##Name[i].reset( new LocalizedString(#X, X##ToString((X)i)) ); \
|
||||||
auto_ptr<LocalizedString> ap( new LocalizedString(#X, X##ToString((X)i)) ); \
|
|
||||||
g_##X##Name[i] = ap; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
return g_##X##Name[x]->GetValue(); \
|
return g_##X##Name[x]->GetValue(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user