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;