Turn loops into range-based form

and some things suggested by cppcheck and compiler warnings.
This commit is contained in:
Tillmann Karras
2014-02-12 16:00:34 +01:00
parent 2ff794d299
commit 404624bf0b
52 changed files with 199 additions and 230 deletions

View File

@ -48,7 +48,7 @@ void VideoBackend::PopulateList()
#endif
g_available_video_backends.push_back(backends[3] = new SW::VideoSoftware);
for (auto& backend : backends)
for (VideoBackend* backend : backends)
{
if (backend)
{
@ -72,7 +72,7 @@ void VideoBackend::ActivateBackend(const std::string& name)
if (name.length() == 0) // If NULL, set it to the default backend (expected behavior)
g_video_backend = s_default_backend;
for (std::vector<VideoBackend*>::const_iterator it = g_available_video_backends.begin(); it != g_available_video_backends.end(); ++it)
if (name == (*it)->GetName())
g_video_backend = *it;
for (VideoBackend* backend : g_available_video_backends)
if (name == backend->GetName())
g_video_backend = backend;
}