diff --git a/src/Magnum/ShaderTools/shaderconverter.cpp b/src/Magnum/ShaderTools/shaderconverter.cpp index d414d7105..1e4ddc40b 100644 --- a/src/Magnum/ShaderTools/shaderconverter.cpp +++ b/src/Magnum/ShaderTools/shaderconverter.cpp @@ -430,15 +430,15 @@ see documentation of a particular converter for more information.)") Containers::Array> definitions; arrayReserve(definitions, args.arrayValueCount("define") + args.arrayValueCount("undefine")); - for(std::size_t i = 0; i != args.arrayValueCount("define"); ++i) { + for(std::size_t j = 0; j != args.arrayValueCount("define"); ++j) { const Containers::Array3 define = - args.arrayValue("define", i).partition('='); + args.arrayValue("define", j).partition('='); arrayAppend(definitions, InPlaceInit, define[0], define[2]); } - for(std::size_t i = 0; i != args.arrayValueCount("undefine"); ++i) { + for(std::size_t j = 0; j != args.arrayValueCount("undefine"); ++j) { arrayAppend(definitions, InPlaceInit, - args.arrayValue("undefine", i), nullptr); + args.arrayValue("undefine", j), nullptr); } converter->setDefinitions(definitions); @@ -464,9 +464,9 @@ see documentation of a particular converter for more information.)") if(args.isSet("link")) { arrayReserve(linkInputs, args.arrayValueCount("input")); - for(std::size_t i = 0; i != args.arrayValueCount("input"); ++i) + for(std::size_t j = 0; j != args.arrayValueCount("input"); ++j) arrayAppend(linkInputs, InPlaceInit, - ShaderTools::Stage::Unspecified, args.arrayValue("input", i)); + ShaderTools::Stage::Unspecified, args.arrayValue("input", j)); } } diff --git a/src/Magnum/Trade/MaterialData.cpp b/src/Magnum/Trade/MaterialData.cpp index 3ea199711..6ed6d1e54 100644 --- a/src/Magnum/Trade/MaterialData.cpp +++ b/src/Magnum/Trade/MaterialData.cpp @@ -230,8 +230,8 @@ MaterialData::MaterialData(const MaterialTypes types, Containers::Array 1) for(std::size_t i = begin + 1; i != end; ++i) { - if(_data[i - 1].name() < _data[i].name()) continue; + if(end - begin > 1) for(std::size_t j = begin + 1; j != end; ++j) { + if(_data[j - 1].name() < _data[j].name()) continue; std::sort(_data + begin, _data + end, [](const MaterialAttributeData& a, const MaterialAttributeData& b) { /* Need to check here (instead of in the outer for loop) as we diff --git a/src/Magnum/Trade/Test/MeshDataTest.cpp b/src/Magnum/Trade/Test/MeshDataTest.cpp index e3523f445..a5a26d8a6 100644 --- a/src/Magnum/Trade/Test/MeshDataTest.cpp +++ b/src/Magnum/Trade/Test/MeshDataTest.cpp @@ -545,12 +545,12 @@ void MeshDataTest::constructIndexStrided() { CORRADE_COMPARE(indices.data().stride(), sizeof(IndexStruct)); constexpr MeshIndexData cindices{Containers::stridedArrayView(IndexStructData, &IndexStructData[0].byteIndex, 3, sizeof(IndexStruct))}; - constexpr MeshIndexType type = cindices.type(); - constexpr Containers::StridedArrayView1D data = cindices.data(); - CORRADE_COMPARE(type, MeshIndexType::UnsignedByte); - CORRADE_COMPARE(data.data(), &IndexStructData[0].byteIndex); - CORRADE_COMPARE(data.size(), 3); - CORRADE_COMPARE(data.stride(), sizeof(IndexStruct)); + constexpr MeshIndexType ctype = cindices.type(); + constexpr Containers::StridedArrayView1D cdata = cindices.data(); + CORRADE_COMPARE(ctype, MeshIndexType::UnsignedByte); + CORRADE_COMPARE(cdata.data(), &IndexStructData[0].byteIndex); + CORRADE_COMPARE(cdata.size(), 3); + CORRADE_COMPARE(cdata.stride(), sizeof(IndexStruct)); } { MeshIndexData indices{view.slice(&IndexStruct::shortIndex)}; CORRADE_COMPARE(indices.type(), MeshIndexType::UnsignedShort); @@ -559,12 +559,12 @@ void MeshDataTest::constructIndexStrided() { CORRADE_COMPARE(indices.data().stride(), sizeof(IndexStruct)); constexpr MeshIndexData cindices{Containers::stridedArrayView(IndexStructData, &IndexStructData[0].shortIndex, 3, sizeof(IndexStruct))}; - constexpr MeshIndexType type = cindices.type(); - constexpr Containers::StridedArrayView1D data = cindices.data(); - CORRADE_COMPARE(type, MeshIndexType::UnsignedShort); - CORRADE_COMPARE(data.data(), &IndexStructData[0].shortIndex); - CORRADE_COMPARE(data.size(), 3); - CORRADE_COMPARE(data.stride(), sizeof(IndexStruct)); + constexpr MeshIndexType ctype = cindices.type(); + constexpr Containers::StridedArrayView1D cdata = cindices.data(); + CORRADE_COMPARE(ctype, MeshIndexType::UnsignedShort); + CORRADE_COMPARE(cdata.data(), &IndexStructData[0].shortIndex); + CORRADE_COMPARE(cdata.size(), 3); + CORRADE_COMPARE(cdata.stride(), sizeof(IndexStruct)); } { MeshIndexData indices{view.slice(&IndexStruct::intIndex)}; CORRADE_COMPARE(indices.type(), MeshIndexType::UnsignedInt); @@ -573,12 +573,12 @@ void MeshDataTest::constructIndexStrided() { CORRADE_COMPARE(indices.data().stride(), sizeof(IndexStruct)); constexpr MeshIndexData cindices{Containers::stridedArrayView(IndexStructData, &IndexStructData[0].intIndex, 3, sizeof(IndexStruct))}; - constexpr MeshIndexType type = cindices.type(); - constexpr Containers::StridedArrayView1D data = cindices.data(); - CORRADE_COMPARE(type, MeshIndexType::UnsignedInt); - CORRADE_COMPARE(data.data(), &IndexStructData[0].intIndex); - CORRADE_COMPARE(data.size(), 3); - CORRADE_COMPARE(data.stride(), sizeof(IndexStruct)); + constexpr MeshIndexType ctype = cindices.type(); + constexpr Containers::StridedArrayView1D cdata = cindices.data(); + CORRADE_COMPARE(ctype, MeshIndexType::UnsignedInt); + CORRADE_COMPARE(cdata.data(), &IndexStructData[0].intIndex); + CORRADE_COMPARE(cdata.size(), 3); + CORRADE_COMPARE(cdata.stride(), sizeof(IndexStruct)); } } diff --git a/src/Magnum/Vk/Device.cpp b/src/Magnum/Vk/Device.cpp index 5c4357e4a..9de74bf72 100644 --- a/src/Magnum/Vk/Device.cpp +++ b/src/Magnum/Vk/Device.cpp @@ -807,8 +807,8 @@ Result Device::tryCreateInternal(Instance& instance, const DeviceCreateInfo& inf if(missingExtensions.any()) { for(std::size_t i = 0; i != Implementation::ExtensionCount; ++i) { if(!missingExtensions[i]) continue; - for(const Version version: KnownVersionsForExtensions) { - for(const Extension extension: Extension::extensions(version)) { + for(const Version extensionVersion: KnownVersionsForExtensions) { + for(const Extension extension: Extension::extensions(extensionVersion)) { if(extension.index() != i) continue; CORRADE_ASSERT_UNREACHABLE("Vk::Device::tryCreate(): some enabled features need" << extension.string() << "enabled", {}); }