diff --git a/src/AbstractTexture.cpp b/src/AbstractTexture.cpp index 8012626b7..b5624a0ac 100644 --- a/src/AbstractTexture.cpp +++ b/src/AbstractTexture.cpp @@ -85,8 +85,9 @@ GLfloat AbstractTexture::maxSupportedAnisotropy() { AbstractTexture::~AbstractTexture() { /* Remove all bindings */ - for(GLuint& binding: Context::current()->state()->texture->bindings) - if(binding == _id) binding = 0; + std::vector& bindings = Context::current()->state()->texture->bindings; + for(auto it = Context::current()->state()->texture->bindings.begin(); it != bindings.end(); ++it) + if(*it == _id) *it = 0; glDeleteTextures(1, &_id); } diff --git a/src/Context.cpp b/src/Context.cpp index 3f6f11916..f4a2a2113 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -189,9 +189,11 @@ Context::Context() { previous versions should be supported automatically, so we don't need to check for them) */ unordered_map futureExtensions; - for(size_t i = future; i != versions.size(); ++i) - for(const Extension& extension: Extension::extensions(versions[i])) - futureExtensions.insert(make_pair(extension._string, extension)); + for(size_t i = future; i != versions.size(); ++i) { + const std::vector& extensions = Extension::extensions(versions[i]); + for(auto it = extensions.begin(); it != extensions.end(); ++it) + futureExtensions.insert(make_pair(it->_string, *it)); + } /* Check for presence of extensions in future versions */ #ifndef MAGNUM_TARGET_GLES @@ -217,8 +219,8 @@ Context::Context() { const char* e = reinterpret_cast(glGetString(GL_EXTENSIONS)); if(e) { vector extensions = Corrade::Utility::split(e, ' '); - for(const string& extension: extensions) { - auto found = futureExtensions.find(extension); + for(auto it = extensions.begin(); it != extensions.end(); ++it) { + auto found = futureExtensions.find(*it); if(found != futureExtensions.end()) { _supportedExtensions.push_back(found->second); extensionStatus.set(found->second._index); @@ -252,8 +254,8 @@ Context::~Context() { } Version Context::supportedVersion(initializer_list versions) const { - for(auto version: versions) - if(isVersionSupported(version)) return version; + for(auto it = versions.begin(); it != versions.end(); ++it) + if(isVersionSupported(*it)) return *it; #ifndef MAGNUM_TARGET_GLES return Version::GL210; diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 4cb19a549..c39cd5d46 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -228,16 +228,16 @@ void Mesh::attributePointerImplementationDSA(const LongAttribute& attribute) { #endif void Mesh::bindImplementationDefault() { - for(const Attribute& attribute: attributes) - vertexAttribPointer(attribute); + for(auto it = attributes.begin(); it != attributes.end(); ++it) + vertexAttribPointer(*it); #ifndef MAGNUM_TARGET_GLES2 - for(const IntegerAttribute& attribute: integerAttributes) - vertexAttribPointer(attribute); + for(auto it = integerAttributes.begin(); it != integerAttributes.end(); ++it) + vertexAttribPointer(*it); #ifndef MAGNUM_TARGET_GLES - for(const LongAttribute& attribute: longAttributes) - vertexAttribPointer(attribute); + for(auto it = longAttributes.begin(); it != longAttributes.end(); ++it) + vertexAttribPointer(*it); #endif #endif } @@ -247,16 +247,16 @@ void Mesh::bindImplementationVAO() { } void Mesh::unbindImplementationDefault() { - for(const Attribute& attribute: attributes) - glDisableVertexAttribArray(attribute.location); + for(auto it = attributes.begin(); it != attributes.end(); ++it) + glDisableVertexAttribArray(it->location); #ifndef MAGNUM_TARGET_GLES2 - for(const IntegerAttribute& attribute: integerAttributes) - glDisableVertexAttribArray(attribute.location); + for(auto it = integerAttributes.begin(); it != integerAttributes.end(); ++it) + glDisableVertexAttribArray(it->location); #ifndef MAGNUM_TARGET_GLES - for(const LongAttribute& attribute: longAttributes) - glDisableVertexAttribArray(attribute.location); + for(auto it = longAttributes.begin(); it != longAttributes.end(); ++it) + glDisableVertexAttribArray(it->location); #endif #endif } diff --git a/src/Physics/ShapedObjectGroup.cpp b/src/Physics/ShapedObjectGroup.cpp index ae02018f5..1dedcfe87 100644 --- a/src/Physics/ShapedObjectGroup.cpp +++ b/src/Physics/ShapedObjectGroup.cpp @@ -20,8 +20,8 @@ namespace Magnum { namespace Physics { template void ShapedObjectGroup::setClean() { - for(ShapedObject* object: objects) - if(object->isDirty()) object->setClean(); + for(auto it = objects.begin(); it != objects.end(); ++it) + if((*it)->isDirty()) (*it)->setClean(); dirty = false; } diff --git a/src/Physics/ShapedObjectGroup.h b/src/Physics/ShapedObjectGroup.h index 1934ef19c..5ebe7c37c 100644 --- a/src/Physics/ShapedObjectGroup.h +++ b/src/Physics/ShapedObjectGroup.h @@ -53,7 +53,8 @@ template class PHYSICS_EXPORT ShapedObjectGroup { * Deletes all objects belogning to the group. */ inline virtual ~ShapedObjectGroup() { - for(auto i: objects) delete i; + for(auto it = objects.begin(); it != objects.end(); ++it) + delete *it; } /** diff --git a/src/Trade/MeshData2D.cpp b/src/Trade/MeshData2D.cpp index 8fee8177d..67ff19c51 100644 --- a/src/Trade/MeshData2D.cpp +++ b/src/Trade/MeshData2D.cpp @@ -19,8 +19,8 @@ namespace Magnum { namespace Trade { MeshData2D::~MeshData2D() { delete _indices; - for(auto i: _positions) delete i; - for(auto i: _textureCoords2D) delete i; + for(auto it = _positions.begin(); it != _positions.end(); ++it) delete *it; + for(auto it = _textureCoords2D.begin(); it != _textureCoords2D.end(); ++it) delete *it; } }}