mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-11-22 19:05:41 +01:00
Fix "for" incosistencies
This commit is contained in:
parent
6a2d1da742
commit
8c1ab76ce5
@ -15,10 +15,10 @@ LiteralString::LiteralString(const std::string& string) : string(string) {
|
|||||||
LiteralString::~LiteralString() = default;
|
LiteralString::~LiteralString() = default;
|
||||||
|
|
||||||
void LiteralString::Fetch(Stream& stream) const {
|
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<u8>(string[i]));
|
stream.Write(static_cast<u8>(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<u8>(0));
|
stream.Write(static_cast<u8>(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ bool Op::operator==(const Operand& other) const {
|
|||||||
const Op& op = dynamic_cast<const Op&>(other);
|
const Op& op = dynamic_cast<const Op&>(other);
|
||||||
if (op.opcode == opcode && result_type == op.result_type &&
|
if (op.opcode == opcode && result_type == op.result_type &&
|
||||||
operands.size() == op.operands.size()) {
|
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]) {
|
if (*operands[i] != *op.operands[i]) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ void Op::Write(Stream& stream) const {
|
|||||||
if (id.has_value()) {
|
if (id.has_value()) {
|
||||||
stream.Write(id.value());
|
stream.Write(id.value());
|
||||||
}
|
}
|
||||||
for (const Operand* operand : operands) {
|
for (const auto* operand : operands) {
|
||||||
operand->Fetch(stream);
|
operand->Fetch(stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ void Op::Sink(Operand* operand) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Op::Sink(const std::vector<Operand*>& operands) {
|
void Op::Sink(const std::vector<Operand*>& operands) {
|
||||||
for (Operand* operand : operands) {
|
for (auto* operand : operands) {
|
||||||
Sink(operand);
|
Sink(operand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ std::vector<u8> Module::Assemble() const {
|
|||||||
stream.Write(bound);
|
stream.Write(bound);
|
||||||
stream.Write(static_cast<u32>(0));
|
stream.Write(static_cast<u32>(0));
|
||||||
|
|
||||||
for (auto capability : capabilities) {
|
for (const auto capability : capabilities) {
|
||||||
WriteEnum(stream, spv::Op::OpCapability, capability);
|
WriteEnum(stream, spv::Op::OpCapability, capability);
|
||||||
}
|
}
|
||||||
// TODO write extensions
|
// TODO write extensions
|
||||||
|
Loading…
Reference in New Issue
Block a user