diff --git a/src/t6/xsk/resolver.cpp b/src/t6/xsk/resolver.cpp index f95ee798..8031ed93 100644 --- a/src/t6/xsk/resolver.cpp +++ b/src/t6/xsk/resolver.cpp @@ -27,7 +27,7 @@ void resolver::cleanup() auto resolver::opcode_id(const std::string& name) -> std::uint8_t { - const auto itr = opcode_map_rev.find(name); + const auto& itr = opcode_map_rev.find(name); if (itr != opcode_map_rev.end()) { @@ -39,7 +39,7 @@ auto resolver::opcode_id(const std::string& name) -> std::uint8_t auto resolver::opcode_name(std::uint8_t id) -> std::string { - const auto itr = opcode_map.find(id); + const auto& itr = opcode_map.find(id); if (itr != opcode_map.end()) { diff --git a/src/utils/xsk/arc/nodetree.cpp b/src/utils/xsk/arc/nodetree.cpp index 815247b3..2b366b52 100644 --- a/src/utils/xsk/arc/nodetree.cpp +++ b/src/utils/xsk/arc/nodetree.cpp @@ -984,6 +984,7 @@ auto stmt_list::print() const -> std::string std::string data; bool last_special = false; + bool last_devblock = false; auto block_pad = indented(indent_); indent_ += 4; @@ -994,13 +995,19 @@ auto stmt_list::print() const -> std::string for (const auto& stmt : list) { - if (&stmt != &list.front() && stmt.as_node->is_special_stmt() || last_special) + if ((&stmt != &list.front() && stmt.as_node->is_special_stmt() || last_special) && stmt != kind::stmt_dev && !last_devblock) data += "\n"; if (stmt == kind::stmt_dev) + { data += stmt.print(); + last_devblock = true; + } else + { data += stmts_pad + stmt.print(); + last_devblock = false; + } if (&stmt != &list.back()) data += "\n"; @@ -1033,10 +1040,7 @@ auto stmt_dev::print() const -> std::string if (&stmt != &list->list.front() && stmt.as_node->is_special_stmt() || last_special) data += "\n"; - if (stmt == kind::stmt_dev) - data += stmt.print(); - else - data += stmts_pad + stmt.print(); + data += stmts_pad + stmt.print(); if (&stmt != &list->list.back()) data += "\n"; diff --git a/src/utils/xsk/utils/string.cpp b/src/utils/xsk/utils/string.cpp index e909a5cb..6159c000 100644 --- a/src/utils/xsk/utils/string.cpp +++ b/src/utils/xsk/utils/string.cpp @@ -249,7 +249,7 @@ auto string::float_string(float value) -> std::string std::string p_dec; std::string p_exp; - if(flags & integer) + if (flags & integer) { auto i = (flags & negative) ? 1 : 0; @@ -268,7 +268,7 @@ auto string::float_string(float value) -> std::string while (offset--) { - if((flags & exp_neg)) + if ((flags & exp_neg)) p_int.insert(p_int.begin(), '0'); else p_int.push_back('0'); @@ -299,7 +299,7 @@ auto string::float_string(float value) -> std::string while (offset--) { - if(flags & exp_neg) + if (flags & exp_neg) p_int.insert(p_int.begin(), '0'); else p_dec.push_back('0');