From db3a540585cae2c1f10e679ded30ddc2ad22ee32 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 13 Jun 2006 06:25:49 +0000 Subject: [PATCH] Fix warning (gcc was erroneously saying that it was reaching the end of a nonvoid function) and remove goto. --- stepmania/src/ThemeManager.cpp | 61 +++++++++++++++++----------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 435858d5d5..3bcaad3fea 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -762,38 +762,39 @@ RString ThemeManager::GetMetricRaw( const RString &sClassName_, const RString &s const RString sClassName = sClassName_; const RString sValueName = sValueName_; -try_metric_again: - - RString ret; - if( ThemeManager::GetMetricRawRecursive( sClassName, sValueName, ret ) ) - return ret; - - - RString sMessage = ssprintf( "The theme metric '%s' - '%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.c_str(),sValueName.c_str() ); - switch( Dialog::AbortRetryIgnore(sMessage) ) + while( true ) { - case Dialog::abort: - break; // fall through - case Dialog::retry: - FlushDirCache(); - ReloadMetrics(); - goto try_metric_again; - case Dialog::ignore: - return NULL; - default: - ASSERT(0); + RString ret; + if( ThemeManager::GetMetricRawRecursive( sClassName, sValueName, ret ) ) + return ret; + + + RString sMessage = ssprintf( "The theme metric '%s' - '%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.c_str(),sValueName.c_str() ); + switch( Dialog::AbortRetryIgnore(sMessage) ) + { + case Dialog::abort: + break; // fall through + case Dialog::retry: + FlushDirCache(); + ReloadMetrics(); + continue; + case Dialog::ignore: + return NULL; + default: + ASSERT(0); + } + + RString sCurMetricPath = GetMetricsIniPath(m_sCurThemeName); + RString sDefaultMetricPath = GetMetricsIniPath(SpecialFiles::BASE_THEME_NAME); + + RString sError = ssprintf( "Theme metric '%s : %s' could not be found in '%s' or '%s'.", + sClassName.c_str(), + sValueName.c_str(), + sCurMetricPath.c_str(), + sDefaultMetricPath.c_str() + ); + RageException::Throw( sError ); } - - RString sCurMetricPath = GetMetricsIniPath(m_sCurThemeName); - RString sDefaultMetricPath = GetMetricsIniPath(SpecialFiles::BASE_THEME_NAME); - - RString sError = ssprintf( "Theme metric '%s : %s' could not be found in '%s' or '%s'.", - sClassName.c_str(), - sValueName.c_str(), - sCurMetricPath.c_str(), - sDefaultMetricPath.c_str() - ); - RageException::Throw( sError ); } /* Get a string metric. */