From 0897ce48e4b83f9a6c69c683a4b984758fc1b9af Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 30 Apr 2013 23:07:23 -0400 Subject: [PATCH] Another one similar. --- src/arch/Sound/RageSoundDriver.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/arch/Sound/RageSoundDriver.cpp b/src/arch/Sound/RageSoundDriver.cpp index a491a5096f..7b369c87f3 100644 --- a/src/arch/Sound/RageSoundDriver.cpp +++ b/src/arch/Sound/RageSoundDriver.cpp @@ -12,12 +12,13 @@ RageSoundDriver *RageSoundDriver::Create( const RString& sDrivers ) vector DriversToTry; split( sDrivers.empty()? DEFAULT_SOUND_DRIVER_LIST:sDrivers, ",", DriversToTry, true ); - FOREACH_CONST( RString, DriversToTry, Driver ) + for (RString const &Driver : DriversToTry) { - RageDriver *pDriver = m_pDriverList.Create( *Driver ); + RageDriver *pDriver = m_pDriverList.Create( Driver ); + char const * driverString = Driver.c_str(); if( pDriver == NULL ) { - LOG->Trace( "Unknown sound driver: %s", Driver->c_str() ); + LOG->Trace( "Unknown sound driver: %s", driverString ); continue; } @@ -27,10 +28,10 @@ RageSoundDriver *RageSoundDriver::Create( const RString& sDrivers ) const RString sError = pRet->Init(); if( sError.empty() ) { - LOG->Info( "Sound driver: %s", Driver->c_str() ); + LOG->Info( "Sound driver: %s", driverString ); return pRet; } - LOG->Info( "Couldn't load driver %s: %s", Driver->c_str(), sError.c_str() ); + LOG->Info( "Couldn't load driver %s: %s", driverString, sError.c_str() ); SAFE_DELETE( pRet ); } return NULL;