From 8c1ab76ce590fc1c031773d0f25f79907de5ad1e Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 23 Oct 2018 05:09:17 -0300 Subject: [PATCH] Fix "for" incosistencies --- src/lstring.cpp | 4 ++-- src/op.cpp | 6 +++--- src/sirit.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lstring.cpp b/src/lstring.cpp index bad60e5..d12a55f 100644 --- a/src/lstring.cpp +++ b/src/lstring.cpp @@ -15,10 +15,10 @@ LiteralString::LiteralString(const std::string& string) : string(string) { LiteralString::~LiteralString() = default; void LiteralString::Fetch(Stream& stream) const { - for (std::size_t i{}; i < string.size(); i++) { + for (std::size_t i = 0; i < string.size(); i++) { stream.Write(static_cast(string[i])); } - for (std::size_t i{}; i < 4 - (string.size() % 4); i++) { + for (std::size_t i = 0; i < 4 - (string.size() % 4); i++) { stream.Write(static_cast(0)); } } diff --git a/src/op.cpp b/src/op.cpp index a6afe51..04f3d2e 100644 --- a/src/op.cpp +++ b/src/op.cpp @@ -35,7 +35,7 @@ bool Op::operator==(const Operand& other) const { const Op& op = dynamic_cast(other); if (op.opcode == opcode && result_type == op.result_type && operands.size() == op.operands.size()) { - for (std::size_t i{}; i < operands.size(); i++) { + for (std::size_t i = 0; i < operands.size(); i++) { if (*operands[i] != *op.operands[i]) { return false; } @@ -55,7 +55,7 @@ void Op::Write(Stream& stream) const { if (id.has_value()) { stream.Write(id.value()); } - for (const Operand* operand : operands) { + for (const auto* operand : operands) { operand->Fetch(stream); } } @@ -66,7 +66,7 @@ void Op::Sink(Operand* operand) { } void Op::Sink(const std::vector& operands) { - for (Operand* operand : operands) { + for (auto* operand : operands) { Sink(operand); } } diff --git a/src/sirit.cpp b/src/sirit.cpp index 816615a..7706e68 100644 --- a/src/sirit.cpp +++ b/src/sirit.cpp @@ -41,7 +41,7 @@ std::vector Module::Assemble() const { stream.Write(bound); stream.Write(static_cast(0)); - for (auto capability : capabilities) { + for (const auto capability : capabilities) { WriteEnum(stream, spv::Op::OpCapability, capability); } // TODO write extensions