Fix warning (gcc was erroneously saying that it was reaching the end of a nonvoid function) and remove goto.

This commit is contained in:
Steve Checkoway
2006-06-13 06:25:49 +00:00
parent 66546ec087
commit db3a540585
+31 -30
View File
@@ -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. */