From 969c22291f986b4cae536fc41c14d45408e045ae Mon Sep 17 00:00:00 2001 From: xensik Date: Wed, 16 Mar 2022 16:13:33 +0100 Subject: [PATCH] fix warnings --- appveyor.yml | 2 +- premake5.lua | 6 ++++-- src/h1/stdafx.hpp | 7 +++++-- src/h1/xsk/assembler.cpp | 12 ++++++------ src/h1/xsk/compiler.cpp | 20 ++++++++++---------- src/h1/xsk/decompiler.cpp | 6 +++--- src/h2/stdafx.hpp | 7 +++++-- src/h2/xsk/assembler.cpp | 12 ++++++------ src/h2/xsk/compiler.cpp | 20 ++++++++++---------- src/h2/xsk/decompiler.cpp | 6 +++--- src/iw5/stdafx.hpp | 7 +++++-- src/iw5/xsk/assembler.cpp | 12 ++++++------ src/iw5/xsk/compiler.cpp | 20 ++++++++++---------- src/iw5/xsk/decompiler.cpp | 6 +++--- src/iw6/stdafx.hpp | 7 +++++-- src/iw6/xsk/assembler.cpp | 12 ++++++------ src/iw6/xsk/compiler.cpp | 20 ++++++++++---------- src/iw6/xsk/decompiler.cpp | 6 +++--- src/iw7/stdafx.hpp | 7 +++++-- src/iw7/xsk/assembler.cpp | 12 ++++++------ src/iw7/xsk/compiler.cpp | 20 ++++++++++---------- src/iw7/xsk/decompiler.cpp | 6 +++--- src/iw8/stdafx.hpp | 7 +++++-- src/iw8/xsk/assembler.cpp | 12 ++++++------ src/iw8/xsk/compiler.cpp | 20 ++++++++++---------- src/iw8/xsk/decompiler.cpp | 6 +++--- src/s1/stdafx.hpp | 7 +++++-- src/s1/xsk/assembler.cpp | 12 ++++++------ src/s1/xsk/compiler.cpp | 20 ++++++++++---------- src/s1/xsk/decompiler.cpp | 6 +++--- src/s2/stdafx.hpp | 7 +++++-- src/s2/xsk/assembler.cpp | 12 ++++++------ src/s2/xsk/compiler.cpp | 20 ++++++++++---------- src/s2/xsk/decompiler.cpp | 6 +++--- src/s4/stdafx.hpp | 7 +++++-- src/s4/xsk/assembler.cpp | 12 ++++++------ src/s4/xsk/compiler.cpp | 20 ++++++++++---------- src/s4/xsk/decompiler.cpp | 6 +++--- src/t6/stdafx.hpp | 7 +++++-- src/t6/xsk/assembler.cpp | 6 ++---- src/t6/xsk/compiler.cpp | 14 +++++++------- src/t6/xsk/disassembler.cpp | 1 - src/tool/stdafx.hpp | 7 +++++-- src/utils/stdafx.hpp | 7 +++++-- 44 files changed, 245 insertions(+), 210 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7c4b7d5e..fb84c1a4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: 1.0.{build} skip_tags: true image: Visual Studio 2019 -configuration: release +configuration: Release platform: x64 before_build: - git submodule update --init --recursive diff --git a/premake5.lua b/premake5.lua index 41188e45..74f761c9 100644 --- a/premake5.lua +++ b/premake5.lua @@ -17,10 +17,10 @@ workspace "gsc-tool" objdir "%{wks.location}/obj/%{cfg.buildcfg}/%{prj.name}" targetdir "%{wks.location}/bin/%{cfg.buildcfg}" targetname "%{prj.name}" - + staticruntime "On" language "C++" cppdialect "C++20" - architecture "x86_64" + architecture "x64" filter "action:vs*" buildoptions "/bigobj" @@ -30,10 +30,12 @@ workspace "gsc-tool" configurations { "Debug", "Release" } symbols "On" + warnings "Extra" filter "configurations:Release" optimize "Full" defines { "NDEBUG" } + flags { "FatalCompileWarnings" } filter {} filter "configurations:Debug" diff --git a/src/h1/stdafx.hpp b/src/h1/stdafx.hpp index c3b08391..1b6ccecf 100644 --- a/src/h1/stdafx.hpp +++ b/src/h1/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/h1/xsk/assembler.cpp b/src/h1/xsk/assembler.cpp index 271f8d3f..96524282 100644 --- a/src/h1/xsk/assembler.cpp +++ b/src/h1/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/h1/xsk/compiler.cpp b/src/h1/xsk/compiler.cpp index 496cd0f5..a2218635 100644 --- a/src/h1/xsk/compiler.cpp +++ b/src/h1/xsk/compiler.cpp @@ -858,12 +858,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -904,17 +904,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1547,7 +1547,7 @@ void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const b } } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2542,7 +2542,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2551,7 +2551,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2560,7 +2560,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2873,7 +2873,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/h1/xsk/decompiler.cpp b/src/h1/xsk/decompiler.cpp index 99bf0a9a..d87b9b04 100644 --- a/src/h1/xsk/decompiler.cpp +++ b/src/h1/xsk/decompiler.cpp @@ -2954,7 +2954,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2962,7 +2962,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3279,7 +3279,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/h2/stdafx.hpp b/src/h2/stdafx.hpp index 8a8255a0..f59191dd 100644 --- a/src/h2/stdafx.hpp +++ b/src/h2/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/h2/xsk/assembler.cpp b/src/h2/xsk/assembler.cpp index 083411a3..673badd1 100644 --- a/src/h2/xsk/assembler.cpp +++ b/src/h2/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/h2/xsk/compiler.cpp b/src/h2/xsk/compiler.cpp index 805c1355..840badf5 100644 --- a/src/h2/xsk/compiler.cpp +++ b/src/h2/xsk/compiler.cpp @@ -858,12 +858,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -904,17 +904,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1547,7 +1547,7 @@ void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const b } } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2541,7 +2541,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2550,7 +2550,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2559,7 +2559,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2872,7 +2872,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/h2/xsk/decompiler.cpp b/src/h2/xsk/decompiler.cpp index 8a2dac0d..d5b663f2 100644 --- a/src/h2/xsk/decompiler.cpp +++ b/src/h2/xsk/decompiler.cpp @@ -2954,7 +2954,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2962,7 +2962,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3279,7 +3279,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/iw5/stdafx.hpp b/src/iw5/stdafx.hpp index 00b73550..749be8fa 100644 --- a/src/iw5/stdafx.hpp +++ b/src/iw5/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/iw5/xsk/assembler.cpp b/src/iw5/xsk/assembler.cpp index a34e45ba..557340c1 100644 --- a/src/iw5/xsk/assembler.cpp +++ b/src/iw5/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/iw5/xsk/compiler.cpp b/src/iw5/xsk/compiler.cpp index 2364b575..00f6fc41 100644 --- a/src/iw5/xsk/compiler.cpp +++ b/src/iw5/xsk/compiler.cpp @@ -850,12 +850,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -896,17 +896,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1539,7 +1539,7 @@ void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const b } } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2532,7 +2532,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2541,7 +2541,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2550,7 +2550,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3478,7 +3478,7 @@ void compiler::print_debug_info() printf("----------------------------------\n"); } -void compiler::print_opcodes(std::uint32_t index, std::uint32_t size) +void compiler::print_opcodes(std::uint32_t, std::uint32_t) { printf(" "); } diff --git a/src/iw5/xsk/decompiler.cpp b/src/iw5/xsk/decompiler.cpp index 0030c212..27a0640b 100644 --- a/src/iw5/xsk/decompiler.cpp +++ b/src/iw5/xsk/decompiler.cpp @@ -2948,7 +2948,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2956,7 +2956,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3273,7 +3273,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/iw6/stdafx.hpp b/src/iw6/stdafx.hpp index 195f9c93..a322313e 100644 --- a/src/iw6/stdafx.hpp +++ b/src/iw6/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/iw6/xsk/assembler.cpp b/src/iw6/xsk/assembler.cpp index 57d46e15..b72aadff 100644 --- a/src/iw6/xsk/assembler.cpp +++ b/src/iw6/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/iw6/xsk/compiler.cpp b/src/iw6/xsk/compiler.cpp index 56a55a2a..be4d1330 100644 --- a/src/iw6/xsk/compiler.cpp +++ b/src/iw6/xsk/compiler.cpp @@ -850,12 +850,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -896,17 +896,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1539,7 +1539,7 @@ void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const b } } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2532,7 +2532,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2541,7 +2541,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2550,7 +2550,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2863,7 +2863,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/iw6/xsk/decompiler.cpp b/src/iw6/xsk/decompiler.cpp index 3c38b946..e5afecc6 100644 --- a/src/iw6/xsk/decompiler.cpp +++ b/src/iw6/xsk/decompiler.cpp @@ -2948,7 +2948,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2956,7 +2956,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3273,7 +3273,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/iw7/stdafx.hpp b/src/iw7/stdafx.hpp index de83a629..33293f2f 100644 --- a/src/iw7/stdafx.hpp +++ b/src/iw7/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/iw7/xsk/assembler.cpp b/src/iw7/xsk/assembler.cpp index 7932fcb0..800a58e6 100644 --- a/src/iw7/xsk/assembler.cpp +++ b/src/iw7/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/iw7/xsk/compiler.cpp b/src/iw7/xsk/compiler.cpp index e64e4a74..79f54cc0 100644 --- a/src/iw7/xsk/compiler.cpp +++ b/src/iw7/xsk/compiler.cpp @@ -850,12 +850,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -896,17 +896,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1539,7 +1539,7 @@ void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const b } } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2532,7 +2532,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2541,7 +2541,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2550,7 +2550,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2863,7 +2863,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/iw7/xsk/decompiler.cpp b/src/iw7/xsk/decompiler.cpp index a514f536..751ea2c3 100644 --- a/src/iw7/xsk/decompiler.cpp +++ b/src/iw7/xsk/decompiler.cpp @@ -2948,7 +2948,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2956,7 +2956,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3273,7 +3273,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/iw8/stdafx.hpp b/src/iw8/stdafx.hpp index f1ce5884..6ddb5069 100644 --- a/src/iw8/stdafx.hpp +++ b/src/iw8/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/iw8/xsk/assembler.cpp b/src/iw8/xsk/assembler.cpp index b096d81a..3f52100e 100644 --- a/src/iw8/xsk/assembler.cpp +++ b/src/iw8/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/iw8/xsk/compiler.cpp b/src/iw8/xsk/compiler.cpp index e4dfd467..9de2c7f3 100644 --- a/src/iw8/xsk/compiler.cpp +++ b/src/iw8/xsk/compiler.cpp @@ -858,12 +858,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -904,17 +904,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1598,7 +1598,7 @@ void compiler::emit_expr_istrue(const ast::expr_istrue::ptr& expr, const block:: emit_opcode(opcode::OP_IsTrue); } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2592,7 +2592,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2601,7 +2601,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2610,7 +2610,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2923,7 +2923,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/iw8/xsk/decompiler.cpp b/src/iw8/xsk/decompiler.cpp index 79c2e8ea..8aa2153d 100644 --- a/src/iw8/xsk/decompiler.cpp +++ b/src/iw8/xsk/decompiler.cpp @@ -2985,7 +2985,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2993,7 +2993,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3316,7 +3316,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/s1/stdafx.hpp b/src/s1/stdafx.hpp index 2dd3f882..0870d77e 100644 --- a/src/s1/stdafx.hpp +++ b/src/s1/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/s1/xsk/assembler.cpp b/src/s1/xsk/assembler.cpp index a08d54c2..e0b83c48 100644 --- a/src/s1/xsk/assembler.cpp +++ b/src/s1/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/s1/xsk/compiler.cpp b/src/s1/xsk/compiler.cpp index 79a2eabc..1f33c588 100644 --- a/src/s1/xsk/compiler.cpp +++ b/src/s1/xsk/compiler.cpp @@ -858,12 +858,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -904,17 +904,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1547,7 +1547,7 @@ void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const b } } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2541,7 +2541,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2550,7 +2550,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2559,7 +2559,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2872,7 +2872,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/s1/xsk/decompiler.cpp b/src/s1/xsk/decompiler.cpp index 0703315e..fd1a5aef 100644 --- a/src/s1/xsk/decompiler.cpp +++ b/src/s1/xsk/decompiler.cpp @@ -2954,7 +2954,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2962,7 +2962,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3279,7 +3279,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/s2/stdafx.hpp b/src/s2/stdafx.hpp index 6a27a863..36a732e0 100644 --- a/src/s2/stdafx.hpp +++ b/src/s2/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/s2/xsk/assembler.cpp b/src/s2/xsk/assembler.cpp index a97c3b55..20d3792a 100644 --- a/src/s2/xsk/assembler.cpp +++ b/src/s2/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/s2/xsk/compiler.cpp b/src/s2/xsk/compiler.cpp index b50a286f..c9b0dea4 100644 --- a/src/s2/xsk/compiler.cpp +++ b/src/s2/xsk/compiler.cpp @@ -858,12 +858,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -904,17 +904,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1547,7 +1547,7 @@ void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const b } } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2541,7 +2541,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2550,7 +2550,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2559,7 +2559,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2872,7 +2872,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/s2/xsk/decompiler.cpp b/src/s2/xsk/decompiler.cpp index 85d4dc62..6e20b7ea 100644 --- a/src/s2/xsk/decompiler.cpp +++ b/src/s2/xsk/decompiler.cpp @@ -2961,7 +2961,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2969,7 +2969,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3286,7 +3286,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/s4/stdafx.hpp b/src/s4/stdafx.hpp index dd33234d..b6d0451e 100644 --- a/src/s4/stdafx.hpp +++ b/src/s4/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/s4/xsk/assembler.cpp b/src/s4/xsk/assembler.cpp index 822c783c..f1213cba 100644 --- a/src/s4/xsk/assembler.cpp +++ b/src/s4/xsk/assembler.cpp @@ -67,13 +67,13 @@ void assembler::assemble(const std::string& file, std::vector& dat } else { - auto data = utils::string::parse_code(line); + auto opdata = utils::string::parse_code(line); if (switchnum) { - if (data[0] == "case" || data[0] == "default") + if (opdata[0] == "case" || opdata[0] == "default") { - for (auto& entry : data) + for (auto& entry : opdata) { func->instructions.back()->data.push_back(entry); } @@ -87,10 +87,10 @@ void assembler::assemble(const std::string& file, std::vector& dat { auto inst = std::make_unique(); inst->index = index; - inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->opcode = static_cast(resolver::opcode_id(opdata[0])); inst->size = opcode_size(inst->opcode); - data.erase(data.begin()); - inst->data = std::move(data); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); switch (opcode(inst->opcode)) { diff --git a/src/s4/xsk/compiler.cpp b/src/s4/xsk/compiler.cpp index 99a69f62..9e8d89b5 100644 --- a/src/s4/xsk/compiler.cpp +++ b/src/s4/xsk/compiler.cpp @@ -858,12 +858,12 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: break_blks_ = old_breaks; } -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal case statement"); } -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) { throw comp_error(stmt->loc(), "illegal default statement"); } @@ -904,17 +904,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block:: emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) { // TODO: } @@ -1598,7 +1598,7 @@ void compiler::emit_expr_istrue(const ast::expr_istrue::ptr& expr, const block:: emit_opcode(opcode::OP_IsTrue); } -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk) +void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) { bool method = false; auto type = resolve_reference_type(expr, method); @@ -2592,7 +2592,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const bloc break_blks_ = old_breaks; } -void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2601,7 +2601,7 @@ void compiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block: } } -void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2610,7 +2610,7 @@ void compiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const } } -void compiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) +void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2923,7 +2923,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/s4/xsk/decompiler.cpp b/src/s4/xsk/decompiler.cpp index 58df5660..25fab370 100644 --- a/src/s4/xsk/decompiler.cpp +++ b/src/s4/xsk/decompiler.cpp @@ -2985,7 +2985,7 @@ void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block } } -void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -2993,7 +2993,7 @@ void decompiler::process_stmt_break(const ast::stmt_break::ptr& stmt, const bloc } } -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) +void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) { if (blk->abort == abort_t::abort_none) { @@ -3316,7 +3316,7 @@ void decompiler::process_field_variable(const ast::expr_field::ptr& expr, const process_expr(expr->obj, blk); } -void decompiler::process_local_variable(const ast::expr_identifier::ptr& expr, const block::ptr& blk) +void decompiler::process_local_variable(const ast::expr_identifier::ptr&, const block::ptr&) { return; } diff --git a/src/t6/stdafx.hpp b/src/t6/stdafx.hpp index 083feb9d..cf2f3255 100644 --- a/src/t6/stdafx.hpp +++ b/src/t6/stdafx.hpp @@ -7,10 +7,13 @@ // Warnings #ifdef _WIN32 +#pragma warning(disable:4005) +#pragma warning(disable:4018) +#pragma warning(disable:4065) +#pragma warning(disable:4127) #pragma warning(disable:4244) #pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) +#pragma warning(disable:4389) #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/t6/xsk/assembler.cpp b/src/t6/xsk/assembler.cpp index 22384f21..f566f489 100644 --- a/src/t6/xsk/assembler.cpp +++ b/src/t6/xsk/assembler.cpp @@ -21,7 +21,7 @@ auto assembler::output() -> std::vector return output; } -void assembler::assemble(const std::string& file, std::vector& data) +void assembler::assemble(const std::string&, std::vector&) { throw error("assemble from source unimplemented!"); } @@ -429,7 +429,7 @@ void assembler::assemble_localvars(const instruction::ptr& inst) script_->write(static_cast(inst->opcode)); script_->write(static_cast(inst->data.size())); - for (const auto& entry : inst->data) + for (auto i = 0u; i < inst->data.size(); i++) { script_->align(2); script_->write(0); @@ -465,8 +465,6 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) script_->align(4); script_->write(count); - std::uint32_t index = inst->index + 3; - for (auto i = 0u; i < count; i++) { if (inst->data[1 + (3 * i)] == "case") diff --git a/src/t6/xsk/compiler.cpp b/src/t6/xsk/compiler.cpp index 19ce934e..f62db4ab 100644 --- a/src/t6/xsk/compiler.cpp +++ b/src/t6/xsk/compiler.cpp @@ -807,17 +807,17 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt) emit_opcode(opcode::OP_End); } -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt) +void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&) { // TODO: } -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt) +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&) { // TODO: } -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt) +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&) { // TODO: } @@ -1367,7 +1367,7 @@ void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, co } } -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr) +void compiler::emit_expr_parameters(const ast::expr_parameters::ptr&) { if (local_stack_.size() == 0) { @@ -1445,7 +1445,7 @@ void compiler::emit_expr_abs(const ast::expr_abs::ptr& expr) emit_opcode(opcode::OP_Abs); } -void compiler::emit_expr_gettime(const ast::expr_gettime::ptr& expr) +void compiler::emit_expr_gettime(const ast::expr_gettime::ptr&) { emit_opcode(opcode::OP_GetTime); } @@ -1795,7 +1795,7 @@ void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr) std::vector data; bool isexpr = false; - bool isconst = true; + //bool isconst = true; if (expr->x == ast::kind::expr_integer) data.push_back(expr->x.as_integer->value); @@ -2409,7 +2409,7 @@ void compiler::insert_label(const std::string& name) } } -auto compiler::map_known_includes(const std::string& include) -> bool +auto compiler::map_known_includes(const std::string&) -> bool { return false; } diff --git a/src/t6/xsk/disassembler.cpp b/src/t6/xsk/disassembler.cpp index 6cef012b..9a14b185 100644 --- a/src/t6/xsk/disassembler.cpp +++ b/src/t6/xsk/disassembler.cpp @@ -187,7 +187,6 @@ void disassembler::disassemble(const std::string& file, std::vector