From 2684d8fa635efee92c7d75f98a7d9052484a2a44 Mon Sep 17 00:00:00 2001 From: Thad Ward Date: Fri, 14 Jul 2006 07:49:59 +0000 Subject: [PATCH] revert. VC6 doesn't have auto_ptr::reset() --- stepmania/src/EnumHelper.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/stepmania/src/EnumHelper.h b/stepmania/src/EnumHelper.h index e4adf8b86c..5e4e3400b6 100644 --- a/stepmania/src/EnumHelper.h +++ b/stepmania/src/EnumHelper.h @@ -54,9 +54,13 @@ static const RString EMPTY_STRING; { \ Check##X##ToStringParamType( X##Names ); \ static auto_ptr 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 ) \ - as_##X##Name[i].reset( new RString(X##Names[i]) ); \ + { \ + auto_ptr ap( new RString( X##Names[i] ) ); \ + as_##X##Name[i] = ap; \ + } \ + } \ ASSERT( CNT == ARRAYSIZE(X##Names) ); \ if( x == CNT+1 ) \ return EMPTY_STRING; \ @@ -68,9 +72,13 @@ static const RString EMPTY_STRING; const RString &X##ToLocalizedString( X x ) \ { \ static auto_ptr 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 ) \ - g_##X##Name[i].reset( new LocalizedString(#X, X##ToString((X)i)) ); \ + { \ + auto_ptr ap( new LocalizedString(#X, X##ToString((X)i)) ); \ + g_##X##Name[i] = ap; \ + } \ + } \ return g_##X##Name[x]->GetValue(); \ }