From c9204f2a9b7aa07b58ea9d70b73fec39a5c247c8 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Sun, 2 Jan 2022 23:02:10 +0000 Subject: [PATCH] Fix Windows asserts (#1045) * fix release mode asserts * clang * dummy --- common/custom_data/Tfrag3Data.h | 4 +- common/dma/dma.h | 4 +- common/goos/Interpreter.cpp | 2 +- common/goos/Object.h | 2 +- common/goos/PrettyPrinter.cpp | 2 +- common/goos/PrettyPrinter2.cpp | 2 +- common/goos/Reader.h | 3 +- common/log/log.cpp | 2 +- common/type_system/Type.cpp | 4 +- common/type_system/Type.h | 2 +- common/type_system/TypeSpec.h | 2 +- common/type_system/TypeSystem.cpp | 6 +- common/util/BinaryReader.h | 4 +- common/util/BinaryWriter.h | 2 +- common/util/BitUtils.h | 4 +- common/util/FileUtil.cpp | 2 +- common/util/Serializer.h | 4 +- common/util/SmallVector.h | 2 +- common/util/Timer.h | 7 +- common/util/Trie.h | 4 +- common/util/assert.h | 11 +- common/util/dgo_util.cpp | 4 +- common/util/json_util.cpp | 4 +- decompiler/Disasm/InstructionDecode.cpp | 2 +- decompiler/Disasm/InstructionMatching.cpp | 2 +- decompiler/Disasm/InstructionParser.cpp | 4 +- decompiler/Disasm/Register.cpp | 2 +- decompiler/Disasm/Register.h | 2 +- decompiler/Function/BasicBlocks.cpp | 2 +- decompiler/Function/CfgVtx.cpp | 2 +- decompiler/Function/CfgVtx.h | 4 - decompiler/Function/Function.cpp | 4 +- decompiler/Function/Warnings.h | 5 +- decompiler/IR/IR.h | 4 +- decompiler/IR2/AtomicOp.cpp | 2 +- decompiler/IR2/AtomicOp.h | 2 +- decompiler/IR2/Env.cpp | 2 +- decompiler/IR2/Env.h | 6 +- decompiler/IR2/OpenGoalMapping.h | 2 +- decompiler/IR2/bitfields.h | 3 +- decompiler/ObjectFile/LinkedObjectFile.cpp | 2 +- .../ObjectFile/LinkedObjectFileCreation.cpp | 2 +- decompiler/ObjectFile/LinkedWord.h | 2 +- decompiler/ObjectFile/ObjectFileDB.h | 2 +- decompiler/VuDisasm/VuDisassembler.cpp | 4 +- decompiler/VuDisasm/VuInstruction.cpp | 5 +- decompiler/analysis/variable_naming.h | 3 +- decompiler/data/LinkedWordReader.h | 4 +- decompiler/data/StrFileReader.cpp | 4 +- decompiler/data/TextureDB.cpp | 4 +- decompiler/data/tpage.cpp | 4 +- decompiler/level_extractor/extract_tfrag.cpp | 2 +- decompiler/util/DataParser.cpp | 2 +- decompiler/util/TP_Type.h | 2 +- game/graphics/opengl_renderer/Shader.cpp | 4 +- game/graphics/sceGraphicsInterface.cpp | 3 +- game/graphics/texture/TextureConverter.cpp | 4 +- game/graphics/texture/TexturePool.cpp | 4 +- game/kernel/Ptr.h | 2 +- game/kernel/fileio.cpp | 4 +- game/kernel/kdsnetm.cpp | 2 +- game/kernel/klink.cpp | 4 +- game/kernel/kmachine.cpp | 2 +- game/kernel/kprint.cpp | 2 +- game/kernel/kscheme.cpp | 2 +- game/mips2c/mips2c_private.h | 4 +- game/overlord/fake_iso.cpp | 2 +- game/overlord/iso.cpp | 2 +- game/overlord/iso_api.cpp | 4 +- game/overlord/iso_queue.cpp | 2 +- game/overlord/isocommon.cpp | 4 +- game/overlord/ramdisk.cpp | 4 +- game/overlord/soundcommon.cpp | 4 +- game/overlord/srpc.cpp | 4 +- game/overlord/stream.cpp | 2 +- game/runtime.cpp | 2 +- game/sce/deci2.cpp | 2 +- game/sce/iop.cpp | 2 +- game/sce/libcdvd_ee.cpp | 4 +- game/sce/libpad.cpp | 2 +- game/sce/sif_ee.cpp | 2 +- game/sce/stubs.cpp | 2 +- game/system/Deci2Server.cpp | 2 +- game/system/IOP_Kernel.cpp | 4 +- game/system/IOP_Kernel.h | 2 +- goal_src/build/game_dgos.gc | 1 + goal_src/engine/pc/pckernel.gc | 134 +++++++++--------- goal_src/goal-lib.gc | 12 +- goalc/compiler/ConstantValue.h | 4 +- goalc/compiler/SymbolInfo.h | 4 +- goalc/data_compiler/DataObjectGenerator.cpp | 4 +- goalc/debugger/DebugInfo.h | 2 +- goalc/debugger/Debugger.cpp | 2 +- goalc/emitter/CallingConvention.cpp | 5 +- goalc/emitter/CodeTester.cpp | 4 +- goalc/emitter/IGen.h | 2 +- goalc/emitter/Instruction.h | 2 +- goalc/emitter/Register.h | 2 +- goalc/listener/Listener.cpp | 2 +- goalc/listener/MemoryMap.cpp | 4 +- goalc/regalloc/IRegSet.h | 4 +- goalc/regalloc/IRegister.cpp | 4 +- test/goalc/test_arithmetic.cpp | 2 +- test/goalc/test_collections.cpp | 2 +- test/goalc/test_control_statements.cpp | 2 +- test/goalc/test_variables.cpp | 2 +- test/goalc/test_with_game.cpp | 2 +- tools/MemoryDumpTool/main.cpp | 2 +- 108 files changed, 230 insertions(+), 238 deletions(-) diff --git a/common/custom_data/Tfrag3Data.h b/common/custom_data/Tfrag3Data.h index ceca48701b..c523556d01 100644 --- a/common/custom_data/Tfrag3Data.h +++ b/common/custom_data/Tfrag3Data.h @@ -3,10 +3,10 @@ // Data format for the tfrag3 renderer. #include "common/common_types.h" -#include "common/util/assert.h" #include "common/dma/gs.h" #include "common/util/Serializer.h" #include "common/math/Vector.h" +#include "common/util/assert.h" namespace tfrag3 { @@ -136,4 +136,4 @@ struct Level { void serialize(Serializer& ser); }; -} // namespace tfrag3 \ No newline at end of file +} // namespace tfrag3 diff --git a/common/dma/dma.h b/common/dma/dma.h index a4ab7ba959..667c103470 100644 --- a/common/dma/dma.h +++ b/common/dma/dma.h @@ -7,8 +7,8 @@ #include #include -#include "common/util/assert.h" #include "common/common_types.h" +#include "common/util/assert.h" struct DmaStats { double sync_time_ms = 0; @@ -117,4 +117,4 @@ struct VifCodeUnpack { u16 addr_qw; bool is_unsigned; // only care for 8/16 bit data. bool use_tops_flag; // uses double buffering -}; \ No newline at end of file +}; diff --git a/common/goos/Interpreter.cpp b/common/goos/Interpreter.cpp index 62d7ee7a76..46886bc253 100644 --- a/common/goos/Interpreter.cpp +++ b/common/goos/Interpreter.cpp @@ -7,7 +7,7 @@ #include "Interpreter.h" #include "ParseHelpers.h" #include "common/util/FileUtil.h" -#include +#include "third-party/fmt/core.h" namespace goos { Interpreter::Interpreter(const std::string& username) { diff --git a/common/goos/Object.h b/common/goos/Object.h index 134901dc64..e799629005 100644 --- a/common/goos/Object.h +++ b/common/goos/Object.h @@ -41,7 +41,6 @@ */ #include -#include "common/util/assert.h" #include #include #include @@ -50,6 +49,7 @@ #include #include #include "common/common_types.h" +#include "common/util/assert.h" namespace goos { diff --git a/common/goos/PrettyPrinter.cpp b/common/goos/PrettyPrinter.cpp index d1fd9cbbc0..8933b24da7 100644 --- a/common/goos/PrettyPrinter.cpp +++ b/common/goos/PrettyPrinter.cpp @@ -4,7 +4,6 @@ * It is not very good, but significantly better than putting everything on one line */ -#include "common/util/assert.h" #include #include #include @@ -14,6 +13,7 @@ #include "common/log/log.h" #include "common/goos/PrettyPrinter2.h" +#include "common/util/assert.h" namespace pretty_print { diff --git a/common/goos/PrettyPrinter2.cpp b/common/goos/PrettyPrinter2.cpp index 102d790f10..0e27c22ec8 100644 --- a/common/goos/PrettyPrinter2.cpp +++ b/common/goos/PrettyPrinter2.cpp @@ -1,7 +1,7 @@ #include "PrettyPrinter2.h" #include "common/common_types.h" -#include "common/util/assert.h" #include "third-party/fmt/core.h" +#include "common/util/assert.h" namespace pretty_print { diff --git a/common/goos/Reader.h b/common/goos/Reader.h index 2578fb76ea..e4ff1eacb7 100644 --- a/common/goos/Reader.h +++ b/common/goos/Reader.h @@ -12,7 +12,6 @@ */ #include -#include "common/util/assert.h" #include #include #include @@ -22,6 +21,8 @@ #include "ReplUtils.h" +#include "common/util/assert.h" + namespace goos { /*! diff --git a/common/log/log.cpp b/common/log/log.cpp index dc49353510..5845efb98f 100644 --- a/common/log/log.cpp +++ b/common/log/log.cpp @@ -1,12 +1,12 @@ #include #include -#include "common/util/assert.h" #include #include "third-party/fmt/color.h" #include "log.h" #ifdef _WIN32 // see lg::initialize #include #endif +#include "common/util/assert.h" namespace lg { struct Logger { diff --git a/common/type_system/Type.cpp b/common/type_system/Type.cpp index 1e9f52f83c..ee330803c5 100644 --- a/common/type_system/Type.cpp +++ b/common/type_system/Type.cpp @@ -4,9 +4,9 @@ */ #include -#include "common/util/assert.h" -#include +#include "third-party/fmt/core.h" #include "Type.h" +#include "common/util/assert.h" namespace { std::string reg_kind_to_string(RegClass kind) { diff --git a/common/type_system/Type.h b/common/type_system/Type.h index 2ff45f4b4d..800ecbcb41 100644 --- a/common/type_system/Type.h +++ b/common/type_system/Type.h @@ -7,10 +7,10 @@ #include #include -#include "common/util/assert.h" #include #include "common/goal_constants.h" #include "TypeSpec.h" +#include "common/util/assert.h" class TypeSystem; diff --git a/common/type_system/TypeSpec.h b/common/type_system/TypeSpec.h index 0aa5043972..7b2edbad44 100644 --- a/common/type_system/TypeSpec.h +++ b/common/type_system/TypeSpec.h @@ -8,8 +8,8 @@ #include #include #include -#include "common/util/assert.h" #include "common/util/SmallVector.h" +#include "common/util/assert.h" /*! * A :name value modifier to apply to a type. diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index d5aec965fc..7d1bfe7405 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -5,12 +5,12 @@ * access types, and reverse type lookups. */ -#include "common/util/assert.h" +#include "third-party/fmt/core.h" +#include "third-party/fmt/color.h" #include -#include #include "TypeSystem.h" #include "common/util/math_util.h" -#include "third-party/fmt/color.h" +#include "common/util/assert.h" namespace { template diff --git a/common/util/BinaryReader.h b/common/util/BinaryReader.h index d6d43b0aae..18ce2be386 100644 --- a/common/util/BinaryReader.h +++ b/common/util/BinaryReader.h @@ -7,9 +7,9 @@ #include #include -#include "common/util/assert.h" -#include "common/common_types.h" #include +#include "common/common_types.h" +#include "common/util/assert.h" class BinaryReader { public: diff --git a/common/util/BinaryWriter.h b/common/util/BinaryWriter.h index 7ab17d7106..498aaec9bc 100644 --- a/common/util/BinaryWriter.h +++ b/common/util/BinaryWriter.h @@ -5,11 +5,11 @@ * Write raw data like a stream. */ -#include "common/util/assert.h" #include #include #include #include +#include "common/util/assert.h" struct BinaryWriterRef { size_t offset; diff --git a/common/util/BitUtils.h b/common/util/BitUtils.h index 4d493143a8..88eb015d45 100644 --- a/common/util/BitUtils.h +++ b/common/util/BitUtils.h @@ -1,9 +1,9 @@ #pragma once #include -#include "common/util/assert.h" #include "common/util/Range.h" #include "common/common_types.h" +#include "common/util/assert.h" constexpr int BITS_PER_BYTE = 8; template @@ -93,4 +93,4 @@ inline u32 count_leading_zeros_u32(u32 in) { _BitScanReverse(&result, in); return result; #endif -} \ No newline at end of file +} diff --git a/common/util/FileUtil.cpp b/common/util/FileUtil.cpp index 7a9398e928..5a3004cad3 100644 --- a/common/util/FileUtil.cpp +++ b/common/util/FileUtil.cpp @@ -9,7 +9,6 @@ #include /* defines FILENAME_MAX */ #include #include -#include "common/util/assert.h" #include #include "common/util/BinaryReader.h" #include "BinaryWriter.h" @@ -24,6 +23,7 @@ #include #include #endif +#include "common/util/assert.h" namespace file_util { std::filesystem::path get_user_home_dir() { diff --git a/common/util/Serializer.h b/common/util/Serializer.h index c1b78a6da8..6c72bf848f 100644 --- a/common/util/Serializer.h +++ b/common/util/Serializer.h @@ -1,9 +1,9 @@ #pragma once -#include "common/util/assert.h" #include #include #include +#include "common/util/assert.h" /*! * The Serializer is a tool to load or save data from a buffer. @@ -216,4 +216,4 @@ class Serializer { size_t m_size = 0; size_t m_offset = 0; bool m_writing = false; -}; \ No newline at end of file +}; diff --git a/common/util/SmallVector.h b/common/util/SmallVector.h index f3dffb4831..ab18cfa89e 100644 --- a/common/util/SmallVector.h +++ b/common/util/SmallVector.h @@ -1,11 +1,11 @@ #pragma once -#include #include #include #include #include #include +#include "assert.h" namespace cu { // This might seem stupid, but compiling an empty file with #include takes 0.5 seconds. diff --git a/common/util/Timer.h b/common/util/Timer.h index 3df3830fd3..62fa58d7e0 100644 --- a/common/util/Timer.h +++ b/common/util/Timer.h @@ -1,11 +1,8 @@ #pragma once -#ifndef JAK_V2_TIMER_H -#define JAK_V2_TIMER_H - -#include "common/util/assert.h" #include #include +#include "common/util/assert.h" /*! * Timer for measuring time elapsed with clock_monotonic @@ -45,5 +42,3 @@ class Timer { struct timespec _startTime = {}; }; - -#endif // JAK_V2_TIMER_H diff --git a/common/util/Trie.h b/common/util/Trie.h index 4e633e26e7..f4cf65cc75 100644 --- a/common/util/Trie.h +++ b/common/util/Trie.h @@ -1,8 +1,8 @@ #pragma once -#include "common/util/assert.h" #include #include +#include "common/util/assert.h" /*! * A simple prefix tree. It works similarly to a map, but also supports fast lookups by prefix with @@ -182,4 +182,4 @@ T* Trie::operator[](const std::string& str) { template std::vector Trie::lookup_prefix(const std::string& str) const { return m_root.lookup_prefix(str.c_str()); -} \ No newline at end of file +} diff --git a/common/util/assert.h b/common/util/assert.h index 90a0044c0b..684234a032 100644 --- a/common/util/assert.h +++ b/common/util/assert.h @@ -1,24 +1,19 @@ -#pragma once - /*! * @file assert.h * Wrapper around . + * Make sure this file is always the last one included. */ -#if defined NDEBUG && defined _WIN32 - -#pragma push_macro("NDEBUG") +#if defined NDEBUG #undef NDEBUG #undef assert #include -#pragma pop_macro("NDEBUG") +#define NDEBUG 1 #else #include #endif - -#define ASSERT assert diff --git a/common/util/dgo_util.cpp b/common/util/dgo_util.cpp index b9f73be792..ab68bd5bda 100644 --- a/common/util/dgo_util.cpp +++ b/common/util/dgo_util.cpp @@ -1,8 +1,8 @@ -#include "common/util/assert.h" #include #include "dgo_util.h" #include "common/versions.h" #include "third-party/fmt/core.h" +#include "common/util/assert.h" /*! * Assert false if the char[] has non-null data after the null terminated string. @@ -50,4 +50,4 @@ std::string get_object_file_name(const std::string& original_name, u8* data, int } return original_name; -} \ No newline at end of file +} diff --git a/common/util/json_util.cpp b/common/util/json_util.cpp index a1edd3a499..d5eae65c7a 100644 --- a/common/util/json_util.cpp +++ b/common/util/json_util.cpp @@ -1,6 +1,6 @@ #include "common/log/log.h" -#include "common/util/assert.h" #include "json_util.h" +#include "common/util/assert.h" /*! * Strip out // and / * comments @@ -107,4 +107,4 @@ Range parse_json_optional_integer_range(const nlohmann::json& json) { } else { throw std::runtime_error("Invalid json as input to parse_json_optional_integer_range"); } -} \ No newline at end of file +} diff --git a/decompiler/Disasm/InstructionDecode.cpp b/decompiler/Disasm/InstructionDecode.cpp index 66448fedd1..e530bcedd0 100644 --- a/decompiler/Disasm/InstructionDecode.cpp +++ b/decompiler/Disasm/InstructionDecode.cpp @@ -5,8 +5,8 @@ */ #include "InstructionDecode.h" -#include "common/util/assert.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "common/util/assert.h" namespace decompiler { // utility class to extract fields of an opcode. diff --git a/decompiler/Disasm/InstructionMatching.cpp b/decompiler/Disasm/InstructionMatching.cpp index 21eee843fe..c51da30c6b 100644 --- a/decompiler/Disasm/InstructionMatching.cpp +++ b/decompiler/Disasm/InstructionMatching.cpp @@ -3,8 +3,8 @@ * Utilities for checking if an instruction matches some criteria. */ -#include "common/util/assert.h" #include "InstructionMatching.h" +#include "common/util/assert.h" namespace decompiler { /*! diff --git a/decompiler/Disasm/InstructionParser.cpp b/decompiler/Disasm/InstructionParser.cpp index 7bf85de01c..4ef1610408 100644 --- a/decompiler/Disasm/InstructionParser.cpp +++ b/decompiler/Disasm/InstructionParser.cpp @@ -1,9 +1,9 @@ -#include "common/util/assert.h" #include #include #include #include "common/common_types.h" #include "InstructionParser.h" +#include "common/util/assert.h" namespace decompiler { InstructionParser::InstructionParser() { @@ -487,4 +487,4 @@ std::string ParsedProgram::print() { } return result; } -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/Disasm/Register.cpp b/decompiler/Disasm/Register.cpp index b7af3c1d0c..fb4df68673 100644 --- a/decompiler/Disasm/Register.cpp +++ b/decompiler/Disasm/Register.cpp @@ -4,9 +4,9 @@ */ #include "Register.h" -#include "common/util/assert.h" #include #include "third-party/fmt/core.h" +#include "common/util/assert.h" namespace decompiler { namespace Reg { diff --git a/decompiler/Disasm/Register.h b/decompiler/Disasm/Register.h index 7cc7b50862..ee8c48a18f 100644 --- a/decompiler/Disasm/Register.h +++ b/decompiler/Disasm/Register.h @@ -6,8 +6,8 @@ */ #include -#include "common/util/assert.h" #include +#include "common/util/assert.h" namespace decompiler { // Namespace for register name constants diff --git a/decompiler/Function/BasicBlocks.cpp b/decompiler/Function/BasicBlocks.cpp index afb107ccbb..9e9095a949 100644 --- a/decompiler/Function/BasicBlocks.cpp +++ b/decompiler/Function/BasicBlocks.cpp @@ -1,8 +1,8 @@ #include -#include "common/util/assert.h" #include "BasicBlocks.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/Disasm/InstructionMatching.h" +#include "common/util/assert.h" namespace decompiler { /*! diff --git a/decompiler/Function/CfgVtx.cpp b/decompiler/Function/CfgVtx.cpp index 14c650d739..ed72173990 100644 --- a/decompiler/Function/CfgVtx.cpp +++ b/decompiler/Function/CfgVtx.cpp @@ -1,9 +1,9 @@ -#include "common/util/assert.h" #include "common/goos/PrettyPrinter.h" #include "decompiler/Disasm/InstructionMatching.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" #include "CfgVtx.h" #include "Function.h" +#include "common/util/assert.h" namespace decompiler { ///////////////////////////////////////// diff --git a/decompiler/Function/CfgVtx.h b/decompiler/Function/CfgVtx.h index 0e5d981194..bc2563e3fd 100644 --- a/decompiler/Function/CfgVtx.h +++ b/decompiler/Function/CfgVtx.h @@ -1,8 +1,5 @@ #pragma once -#ifndef JAK_DISASSEMBLER_CFGVTX_H -#define JAK_DISASSEMBLER_CFGVTX_H - #include #include #include "common/util/assert.h" @@ -394,4 +391,3 @@ std::shared_ptr build_cfg(const LinkedObjectFile& file, const CondWithElseLengthHack& cond_with_else_hack, const std::unordered_set& blocks_ending_in_asm_br); } // namespace decompiler -#endif // JAK_DISASSEMBLER_CFGVTX_H diff --git a/decompiler/Function/Function.cpp b/decompiler/Function/Function.cpp index c85c39fd45..27da6147f3 100644 --- a/decompiler/Function/Function.cpp +++ b/decompiler/Function/Function.cpp @@ -1,4 +1,3 @@ -#include "common/util/assert.h" #include #include "Function.h" #include "common/log/log.h" @@ -9,6 +8,7 @@ #include "decompiler/IR/IR.h" #include "decompiler/IR2/Form.h" #include "common/util/BitUtils.h" +#include "common/util/assert.h" namespace decompiler { namespace { @@ -765,4 +765,4 @@ BlockTopologicalSort Function::bb_topo_sort() { std::string Function::name() const { return guessed_name.to_string(); } -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/Function/Warnings.h b/decompiler/Function/Warnings.h index 4bc5d7bfcf..8e4b65dbd8 100644 --- a/decompiler/Function/Warnings.h +++ b/decompiler/Function/Warnings.h @@ -2,9 +2,8 @@ #include #include #include -#include "common/util/assert.h" - #include "third-party/fmt/core.h" +#include "common/util/assert.h" namespace decompiler { class DecompWarnings { @@ -110,4 +109,4 @@ class DecompWarnings { std::vector m_warnings; bool m_used_lq_sq = false; }; -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/IR/IR.h b/decompiler/IR/IR.h index bfee70afb2..ff6588f06c 100644 --- a/decompiler/IR/IR.h +++ b/decompiler/IR/IR.h @@ -1,7 +1,8 @@ +#pragma once + #ifndef JAK_IR_H #define JAK_IR_H -#include "common/util/assert.h" #include #include #include @@ -10,6 +11,7 @@ #include "common/type_system/TypeSpec.h" #include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/util/TP_Type.h" +#include "common/util/assert.h" namespace goos { class Object; diff --git a/decompiler/IR2/AtomicOp.cpp b/decompiler/IR2/AtomicOp.cpp index 62ce19abc0..8deeb63dd6 100644 --- a/decompiler/IR2/AtomicOp.cpp +++ b/decompiler/IR2/AtomicOp.cpp @@ -1,4 +1,3 @@ -#include "common/util/assert.h" #include #include #include "common/goal_constants.h" @@ -8,6 +7,7 @@ #include "AtomicOp.h" #include "OpenGoalMapping.h" #include "Form.h" +#include "common/util/assert.h" namespace decompiler { ///////////////////////////// diff --git a/decompiler/IR2/AtomicOp.h b/decompiler/IR2/AtomicOp.h index 1b1ad95036..e8c36ffc0e 100644 --- a/decompiler/IR2/AtomicOp.h +++ b/decompiler/IR2/AtomicOp.h @@ -2,13 +2,13 @@ #include #include -#include "common/util/assert.h" #include #include "common/goos/Object.h" #include "decompiler/Disasm/Register.h" #include "decompiler/Disasm/Instruction.h" #include "decompiler/IR2/IR2_common.h" #include "Env.h" +#include "common/util/assert.h" namespace decompiler { class FormElement; diff --git a/decompiler/IR2/Env.cpp b/decompiler/IR2/Env.cpp index aecab89250..1c6ad9b379 100644 --- a/decompiler/IR2/Env.cpp +++ b/decompiler/IR2/Env.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include "decompiler/util/DecompilerTypeSystem.h" #include "Env.h" #include "Form.h" #include "decompiler/analysis/atomic_op_builder.h" diff --git a/decompiler/IR2/Env.h b/decompiler/IR2/Env.h index 541ecfa895..be8d55b5fc 100644 --- a/decompiler/IR2/Env.h +++ b/decompiler/IR2/Env.h @@ -2,14 +2,14 @@ #include #include -#include "common/util/assert.h" -#include +#include "common/goos/Object.h" #include "decompiler/util/TP_Type.h" #include "decompiler/util/StackSpillMap.h" #include "decompiler/Disasm/Register.h" #include "decompiler/IR2/IR2_common.h" #include "decompiler/analysis/reg_usage.h" #include "decompiler/config.h" +#include "common/util/assert.h" namespace decompiler { class LinkedObjectFile; @@ -234,4 +234,4 @@ class Env { StackSpillMap m_stack_spill_map; }; -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/IR2/OpenGoalMapping.h b/decompiler/IR2/OpenGoalMapping.h index 9f2a671020..0b633da20d 100644 --- a/decompiler/IR2/OpenGoalMapping.h +++ b/decompiler/IR2/OpenGoalMapping.h @@ -2,7 +2,6 @@ #include #include -#include "common/util/assert.h" #include #include #include "common/goos/Object.h" @@ -11,6 +10,7 @@ #include "decompiler/IR2/IR2_common.h" #include "Env.h" #include "AtomicOp.h" +#include "common/util/assert.h" namespace decompiler { diff --git a/decompiler/IR2/bitfields.h b/decompiler/IR2/bitfields.h index b384d02cbc..79fd4015cb 100644 --- a/decompiler/IR2/bitfields.h +++ b/decompiler/IR2/bitfields.h @@ -1,10 +1,9 @@ #pragma once -#include "common/util/assert.h" - #include "common/common_types.h" #include "decompiler/IR2/Form.h" #include "decompiler/util/data_decompile.h" +#include "common/util/assert.h" namespace decompiler { struct BitfieldManip { diff --git a/decompiler/ObjectFile/LinkedObjectFile.cpp b/decompiler/ObjectFile/LinkedObjectFile.cpp index d00cdf36b1..ed935d025c 100644 --- a/decompiler/ObjectFile/LinkedObjectFile.cpp +++ b/decompiler/ObjectFile/LinkedObjectFile.cpp @@ -4,7 +4,6 @@ */ #include -#include "common/util/assert.h" #include #include #include "decompiler/IR/IR.h" @@ -15,6 +14,7 @@ #include "third-party/json.hpp" #include "common/log/log.h" #include "common/goos/PrettyPrinter.h" +#include "common/util/assert.h" namespace decompiler { /*! diff --git a/decompiler/ObjectFile/LinkedObjectFileCreation.cpp b/decompiler/ObjectFile/LinkedObjectFileCreation.cpp index 2a4454b4cb..58925b0682 100644 --- a/decompiler/ObjectFile/LinkedObjectFileCreation.cpp +++ b/decompiler/ObjectFile/LinkedObjectFileCreation.cpp @@ -4,13 +4,13 @@ * This implements a decoder for the GOAL linking format. */ -#include "common/util/assert.h" #include #include "LinkedObjectFileCreation.h" #include "decompiler/config.h" #include "decompiler/util/DecompilerTypeSystem.h" #include "common/link_types.h" #include "common/util/BitUtils.h" +#include "common/util/assert.h" namespace decompiler { // There are three link versions: diff --git a/decompiler/ObjectFile/LinkedWord.h b/decompiler/ObjectFile/LinkedWord.h index e48d18bd2c..188a99fce8 100644 --- a/decompiler/ObjectFile/LinkedWord.h +++ b/decompiler/ObjectFile/LinkedWord.h @@ -8,8 +8,8 @@ #include #include #include -#include "common/util/assert.h" #include "common/common_types.h" +#include "common/util/assert.h" namespace decompiler { class LinkedWord { diff --git a/decompiler/ObjectFile/ObjectFileDB.h b/decompiler/ObjectFile/ObjectFileDB.h index eb6e75ce63..092ce0b793 100644 --- a/decompiler/ObjectFile/ObjectFileDB.h +++ b/decompiler/ObjectFile/ObjectFileDB.h @@ -7,7 +7,6 @@ * (there may be different object files with the same name sometimes) */ -#include "common/util/assert.h" #include #include #include @@ -16,6 +15,7 @@ #include "common/common_types.h" #include "decompiler/data/TextureDB.h" #include "decompiler/analysis/symbol_def_map.h" +#include "common/util/assert.h" namespace decompiler { /*! diff --git a/decompiler/VuDisasm/VuDisassembler.cpp b/decompiler/VuDisasm/VuDisassembler.cpp index 65e08df739..55f849de02 100644 --- a/decompiler/VuDisasm/VuDisassembler.cpp +++ b/decompiler/VuDisasm/VuDisassembler.cpp @@ -3,8 +3,8 @@ #include "VuDisassembler.h" #include "third-party/fmt/core.h" -#include "common/util/assert.h" #include "common/util/print_float.h" +#include "common/util/assert.h" namespace decompiler { @@ -733,4 +733,4 @@ void VuDisassembler::name_labels() { m_label_names.at(label_idx) = fmt::format("L{}", idx++); } } -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/VuDisasm/VuInstruction.cpp b/decompiler/VuDisasm/VuInstruction.cpp index 931c5c2b06..30e8f34f60 100644 --- a/decompiler/VuDisasm/VuInstruction.cpp +++ b/decompiler/VuDisasm/VuInstruction.cpp @@ -1,7 +1,6 @@ -#include "common/util/assert.h" #include "third-party/fmt/core.h" - #include "VuInstruction.h" +#include "common/util/assert.h" namespace decompiler { VuInstructionAtom VuInstructionAtom::make_vf(int idx) { @@ -89,4 +88,4 @@ VuInstruction VuInstruction::make_fp_constant(u32 value) { result.kind = VuInstrK::FP_CONSTANT; return result; } -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/analysis/variable_naming.h b/decompiler/analysis/variable_naming.h index cb1a6d5af1..ff4c22c224 100644 --- a/decompiler/analysis/variable_naming.h +++ b/decompiler/analysis/variable_naming.h @@ -20,11 +20,12 @@ #include #include -#include "common/util/assert.h" #include "decompiler/Disasm/Register.h" #include "decompiler/IR2/IR2_common.h" #include "decompiler/util/TP_Type.h" +#include "common/util/assert.h" + namespace decompiler { class Function; diff --git a/decompiler/data/LinkedWordReader.h b/decompiler/data/LinkedWordReader.h index 6fadcee561..88df49ce92 100644 --- a/decompiler/data/LinkedWordReader.h +++ b/decompiler/data/LinkedWordReader.h @@ -1,11 +1,11 @@ #pragma once -#include "common/util/assert.h" #include #include #include #include #include "common/common_types.h" #include "decompiler/ObjectFile/LinkedWord.h" +#include "common/util/assert.h" namespace decompiler { class LinkedWordReader { @@ -41,4 +41,4 @@ class LinkedWordReader { const std::vector* m_words = nullptr; u32 m_offset = 0; }; -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/data/StrFileReader.cpp b/decompiler/data/StrFileReader.cpp index e90c5beb05..3bbfd07eb0 100644 --- a/decompiler/data/StrFileReader.cpp +++ b/decompiler/data/StrFileReader.cpp @@ -3,12 +3,12 @@ * Utility class to read a .STR file and extract the full file name. */ -#include "common/util/assert.h" #include #include "common/util/FileUtil.h" #include "game/common/overlord_common.h" #include "game/common/str_rpc_types.h" #include "StrFileReader.h" +#include "common/util/assert.h" namespace decompiler { StrFileReader::StrFileReader(const std::string& file_path) { @@ -180,4 +180,4 @@ std::string StrFileReader::get_full_name(const std::string& short_name) const { return result; } -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/data/TextureDB.cpp b/decompiler/data/TextureDB.cpp index 5e69b5050f..6cda1fa408 100644 --- a/decompiler/data/TextureDB.cpp +++ b/decompiler/data/TextureDB.cpp @@ -1,7 +1,7 @@ #include "TextureDB.h" -#include "common/util/assert.h" #include "third-party/fmt/core.h" +#include "common/util/assert.h" namespace decompiler { @@ -37,4 +37,4 @@ void TextureDB::add_texture(u32 tpage, } } -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/data/tpage.cpp b/decompiler/data/tpage.cpp index 70b8e5b3fa..21523e5cf0 100644 --- a/decompiler/data/tpage.cpp +++ b/decompiler/data/tpage.cpp @@ -14,7 +14,7 @@ * check duplicate names */ -#include +#include "common/util/FileUtil.h" #include "tpage.h" #include "common/versions.h" #include "decompiler/ObjectFile/ObjectFileDB.h" @@ -703,4 +703,4 @@ TPageResultStats process_tpage(ObjectFileData& data, TextureDB& texture_db) { } return stats; } -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/level_extractor/extract_tfrag.cpp b/decompiler/level_extractor/extract_tfrag.cpp index a05b5e9651..fbe1954728 100644 --- a/decompiler/level_extractor/extract_tfrag.cpp +++ b/decompiler/level_extractor/extract_tfrag.cpp @@ -1,10 +1,10 @@ #include "extract_tfrag.h" #include "common/dma/dma.h" -#include "common/util/assert.h" #include "decompiler/util/Error.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" #include "common/util/FileUtil.h" #include "common/dma/gs.h" +#include "common/util/assert.h" namespace decompiler { namespace { diff --git a/decompiler/util/DataParser.cpp b/decompiler/util/DataParser.cpp index e149307fb4..784848b5ec 100644 --- a/decompiler/util/DataParser.cpp +++ b/decompiler/util/DataParser.cpp @@ -1,7 +1,7 @@ #include -#include "common/util/assert.h" #include "DataParser.h" #include "third-party/fmt/core.h" +#include "common/util/assert.h" /* * Allowable lines: diff --git a/decompiler/util/TP_Type.h b/decompiler/util/TP_Type.h index fe8330a39a..961fbb3d3c 100644 --- a/decompiler/util/TP_Type.h +++ b/decompiler/util/TP_Type.h @@ -1,11 +1,11 @@ #pragma once #include -#include "common/util/assert.h" #include #include "common/log/log.h" #include "common/type_system/TypeSpec.h" #include "common/common_types.h" #include "decompiler/Disasm/Register.h" +#include "common/util/assert.h" namespace decompiler { /*! diff --git a/game/graphics/opengl_renderer/Shader.cpp b/game/graphics/opengl_renderer/Shader.cpp index d00504d1be..c72560cffb 100644 --- a/game/graphics/opengl_renderer/Shader.cpp +++ b/game/graphics/opengl_renderer/Shader.cpp @@ -1,8 +1,8 @@ #include "Shader.h" -#include "common/util/assert.h" #include "common/util/FileUtil.h" #include "common/log/log.h" #include "game/graphics/pipelines/opengl.h" +#include "common/util/assert.h" Shader::Shader(const std::string& shader_name) { // read the shader source @@ -79,4 +79,4 @@ ShaderLibrary::ShaderLibrary() { at(ShaderId::BUFFERED_TCC1) = {"buffered_tcc1"}; at(ShaderId::TFRAG3) = {"tfrag3"}; at(ShaderId::TFRAG3_NO_TEX) = {"tfrag3_no_tex"}; -} \ No newline at end of file +} diff --git a/game/graphics/sceGraphicsInterface.cpp b/game/graphics/sceGraphicsInterface.cpp index 1f6e80b7a0..26b07e1d6f 100644 --- a/game/graphics/sceGraphicsInterface.cpp +++ b/game/graphics/sceGraphicsInterface.cpp @@ -1,8 +1,7 @@ #include "game/graphics/sceGraphicsInterface.h" -#include "common/util/assert.h" #include "game/graphics/gfx.h" - #include +#include "common/util/assert.h" /*! * Wait for rendering to complete. diff --git a/game/graphics/texture/TextureConverter.cpp b/game/graphics/texture/TextureConverter.cpp index 4dd389e84a..644baf2c34 100644 --- a/game/graphics/texture/TextureConverter.cpp +++ b/game/graphics/texture/TextureConverter.cpp @@ -1,8 +1,8 @@ #include "TextureConverter.h" -#include "common/util/assert.h" #include "third-party/fmt/core.h" #include "common/util/FileUtil.h" #include "common/texture/texture_conversion.h" +#include "common/util/assert.h" TextureConverter::TextureConverter() { m_vram.resize(4 * 1024 * 1024); @@ -200,4 +200,4 @@ void TextureConverter::download_rgba8888(u8* result, void TextureConverter::serialize(Serializer& ser) { ser.from_pod_vector(&m_vram); -} \ No newline at end of file +} diff --git a/game/graphics/texture/TexturePool.cpp b/game/graphics/texture/TexturePool.cpp index 7f625e3983..eb5133c9c5 100644 --- a/game/graphics/texture/TexturePool.cpp +++ b/game/graphics/texture/TexturePool.cpp @@ -4,11 +4,11 @@ #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "common/util/assert.h" #include "common/util/FileUtil.h" #include "common/util/Timer.h" #include "common/log/log.h" #include "game/graphics/pipelines/opengl.h" +#include "common/util/assert.h" //////////////////////////////// // Extraction of textures @@ -443,4 +443,4 @@ TextureRecord* TexturePool::get_random_texture() { } } return nullptr; -} \ No newline at end of file +} diff --git a/game/kernel/Ptr.h b/game/kernel/Ptr.h index 4bbb19793f..3883affa72 100644 --- a/game/kernel/Ptr.h +++ b/game/kernel/Ptr.h @@ -5,9 +5,9 @@ * Representation of a GOAL pointer which can be converted to/from a C pointer. */ -#include "common/util/assert.h" #include "game/runtime.h" #include "common/common_types.h" +#include "common/util/assert.h" /*! * GOAL pointer to a T. Represented as a 32-bit unsigned offset from g_ee_main_mem. diff --git a/game/kernel/fileio.cpp b/game/kernel/fileio.cpp index 0b695d947a..a0c44ba144 100644 --- a/game/kernel/fileio.cpp +++ b/game/kernel/fileio.cpp @@ -4,13 +4,13 @@ * DONE! */ -#include "common/util/assert.h" #include #include #include "game/sce/sif_ee.h" #include "fileio.h" #include "kprint.h" #include "common/versions.h" +#include "common/util/assert.h" namespace { // buffer for file paths. This might be static char buffer[512]. Maybe 633 is the line number? @@ -518,4 +518,4 @@ s32 FileSave(char* name, u8* data, s32 size) { sceClose(fd); return 0; -} \ No newline at end of file +} diff --git a/game/kernel/kdsnetm.cpp b/game/kernel/kdsnetm.cpp index bcfdc8eadc..77bcfaf84a 100644 --- a/game/kernel/kdsnetm.cpp +++ b/game/kernel/kdsnetm.cpp @@ -6,11 +6,11 @@ #include #include -#include "common/util/assert.h" #include "game/sce/deci2.h" #include "game/system/deci_common.h" // todo, reorganize to avoid this include #include "kdsnetm.h" #include "kprint.h" +#include "common/util/assert.h" using namespace ee; diff --git a/game/kernel/klink.cpp b/game/kernel/klink.cpp index d3fc69de67..009810d7e4 100644 --- a/game/kernel/klink.cpp +++ b/game/kernel/klink.cpp @@ -7,7 +7,6 @@ */ #include -#include "common/util/assert.h" #include #include #include "klink.h" @@ -18,6 +17,7 @@ #include "common/symbols.h" #include "common/goal_constants.h" #include "game/mips2c/mips2c_table.h" +#include "common/util/assert.h" namespace { // turn on printf's for debugging linking issues. @@ -912,4 +912,4 @@ c_rellink3__FPvP12link_segmentPUc c_symlink2__FPvUiPUc c_symlink3__FPvUiPUc update_goal_fns__Fv - */ \ No newline at end of file + */ diff --git a/game/kernel/kmachine.cpp b/game/kernel/kmachine.cpp index 36108d5159..eb3e93c4ad 100644 --- a/game/kernel/kmachine.cpp +++ b/game/kernel/kmachine.cpp @@ -7,7 +7,6 @@ #include #include -#include "common/util/assert.h" #include "kmachine.h" #include "kboot.h" #include "kprint.h" @@ -38,6 +37,7 @@ #include "game/system/vm/vm.h" #include "game/system/newpad.h" #include "game/sce/libscf.h" +#include "common/util/assert.h" using namespace ee; /*! diff --git a/game/kernel/kprint.cpp b/game/kernel/kprint.cpp index 354970835e..9f9ce2337e 100644 --- a/game/kernel/kprint.cpp +++ b/game/kernel/kprint.cpp @@ -7,7 +7,6 @@ #include #include #include -#include "common/util/assert.h" #include "common/goal_constants.h" #include "common/common_types.h" @@ -23,6 +22,7 @@ #include "klisten.h" #include "klink.h" #include "common/symbols.h" +#include "common/util/assert.h" /////////// // SDATA diff --git a/game/kernel/kscheme.cpp b/game/kernel/kscheme.cpp index 6ef870a0a4..48a9dc4508 100644 --- a/game/kernel/kscheme.cpp +++ b/game/kernel/kscheme.cpp @@ -4,7 +4,6 @@ */ #include -#include "common/util/assert.h" #include "kscheme.h" #include "common/common_types.h" #include "common/goal_constants.h" @@ -24,6 +23,7 @@ #include "common/log/log.h" #include "common/util/Timer.h" #include "game/mips2c/mips2c_table.h" +#include "common/util/assert.h" //! Controls link mode when EnableMethodSet = 0, MasterDebug = 1, DiskBoot = 0. Will enable a //! warning message if EnableMethodSet = 1 diff --git a/game/mips2c/mips2c_private.h b/game/mips2c/mips2c_private.h index 1765940af4..583fd4caa5 100644 --- a/game/mips2c/mips2c_private.h +++ b/game/mips2c/mips2c_private.h @@ -5,9 +5,9 @@ #include "common/common_types.h" #include "game/mips2c/mips2c_table.h" -#include "common/util/assert.h" #include "common/util/BitUtils.h" #include "third-party/fmt/core.h" +#include "common/util/assert.h" // This file contains utility functions for code generated by the mips2c pass. // This is only useful for @@ -1050,4 +1050,4 @@ inline void load_vfs_from_tf_regs(const void* tf_regs_sym, ExecutionContext* c) u8* c_addr_of_vf1 = g_ee_main_mem + goal_addr_of_vf1; memcpy(&c->vfs[1], c_addr_of_vf1, 31 * 16); } -} // namespace Mips2C \ No newline at end of file +} // namespace Mips2C diff --git a/game/overlord/fake_iso.cpp b/game/overlord/fake_iso.cpp index f05a51dbb4..f9ea510b56 100644 --- a/game/overlord/fake_iso.cpp +++ b/game/overlord/fake_iso.cpp @@ -10,13 +10,13 @@ */ #include -#include "common/util/assert.h" #include "fake_iso.h" #include "game/sce/iop.h" #include "isocommon.h" #include "overlord.h" #include "common/util/FileUtil.h" #include "common/log/log.h" +#include "common/util/assert.h" using namespace iop; diff --git a/game/overlord/iso.cpp b/game/overlord/iso.cpp index 797408f223..dab3ba86e1 100644 --- a/game/overlord/iso.cpp +++ b/game/overlord/iso.cpp @@ -5,7 +5,6 @@ */ #include "common/log/log.h" -#include #include #include #include "iso.h" @@ -17,6 +16,7 @@ #include "dma.h" #include "fake_iso.h" #include "game/common/dgo_rpc_types.h" +#include "common/util/assert.h" using namespace iop; diff --git a/game/overlord/iso_api.cpp b/game/overlord/iso_api.cpp index 339febedd5..d1b19c3c2b 100644 --- a/game/overlord/iso_api.cpp +++ b/game/overlord/iso_api.cpp @@ -1,8 +1,8 @@ #include "iso_api.h" #include "game/sce/iop.h" #include "common/log/log.h" -#include "common/util/assert.h" #include "sbank.h" +#include "common/util/assert.h" using namespace iop; @@ -83,4 +83,4 @@ void LoadSoundBank(const char* bank_name, SoundBank* bank) { cmd.bank = bank; SendMbx(iso_mbx, &cmd); SleepThread(); // wait for finish. -} \ No newline at end of file +} diff --git a/game/overlord/iso_queue.cpp b/game/overlord/iso_queue.cpp index 3eeb79e09c..d1bd2da27d 100644 --- a/game/overlord/iso_queue.cpp +++ b/game/overlord/iso_queue.cpp @@ -1,10 +1,10 @@ #include #include -#include "common/util/assert.h" #include "common/log/log.h" #include "game/sce/iop.h" #include "iso_queue.h" #include "isocommon.h" +#include "common/util/assert.h" using namespace iop; diff --git a/game/overlord/isocommon.cpp b/game/overlord/isocommon.cpp index 01d7f046d5..2e2911d048 100644 --- a/game/overlord/isocommon.cpp +++ b/game/overlord/isocommon.cpp @@ -3,10 +3,10 @@ * Common ISO utilities. */ -#include #include "common/common_types.h" #include #include "isocommon.h" +#include "common/util/assert.h" /*! * Convert file name to "ISO Name" @@ -193,4 +193,4 @@ void ISONameFromAnimationName(char* dst, const char* src) { // append file extension strcpy(dst + 8, "STR"); -} \ No newline at end of file +} diff --git a/game/overlord/ramdisk.cpp b/game/overlord/ramdisk.cpp index f78182577c..c3a7794c69 100644 --- a/game/overlord/ramdisk.cpp +++ b/game/overlord/ramdisk.cpp @@ -5,7 +5,6 @@ */ #include -#include "common/util/assert.h" #include #include "common/common_types.h" #include "game/common/ramdisk_rpc_types.h" @@ -13,6 +12,7 @@ #include "iso.h" #include "iso_api.h" #include "game/sce/iop.h" +#include "common/util/assert.h" // Note - the RAMDISK code supports having multiple files, but it appears only one file can ever be // used at a time. @@ -185,4 +185,4 @@ void* RPC_Ramdisk(unsigned int fno, void* data, int size) { printf("[OVERLORD RAMDISK] Unsupported fno\n"); // ADDED } return nullptr; -} \ No newline at end of file +} diff --git a/game/overlord/soundcommon.cpp b/game/overlord/soundcommon.cpp index 8c153b309c..11456cd27c 100644 --- a/game/overlord/soundcommon.cpp +++ b/game/overlord/soundcommon.cpp @@ -1,7 +1,7 @@ -#include #include "soundcommon.h" +#include "common/util/assert.h" void PrintBankInfo(void* buffer) { (void)buffer; assert(false); -} \ No newline at end of file +} diff --git a/game/overlord/srpc.cpp b/game/overlord/srpc.cpp index 18e22ccefd..22fd395251 100644 --- a/game/overlord/srpc.cpp +++ b/game/overlord/srpc.cpp @@ -1,6 +1,5 @@ #include #include -#include "common/util/assert.h" #include "srpc.h" #include "game/sce/iop.h" #include "game/common/loader_rpc_types.h" @@ -8,6 +7,7 @@ #include "common/versions.h" #include "sbank.h" #include "iso_api.h" +#include "common/util/assert.h" using namespace iop; @@ -94,4 +94,4 @@ void* RPC_Loader(unsigned int /*fno*/, void* data, int size) { } } return nullptr; -} \ No newline at end of file +} diff --git a/game/overlord/stream.cpp b/game/overlord/stream.cpp index be40655c1a..b18e4ad6d0 100644 --- a/game/overlord/stream.cpp +++ b/game/overlord/stream.cpp @@ -4,7 +4,6 @@ * Supports loading a file directly to the EE, or loading chunks of a chunked file. */ -#include "common/util/assert.h" #include #include "stream.h" #include "game/sce/iop.h" @@ -12,6 +11,7 @@ #include "game/common/play_rpc_types.h" #include "game/overlord/isocommon.h" #include "game/overlord/iso_api.h" +#include "common/util/assert.h" using namespace iop; diff --git a/game/runtime.cpp b/game/runtime.cpp index 534616170f..9e093fcbdf 100644 --- a/game/runtime.cpp +++ b/game/runtime.cpp @@ -8,7 +8,7 @@ #include #elif _WIN32 #include -#include +#include "third-party/mman/mman.h" #include #endif diff --git a/game/sce/deci2.cpp b/game/sce/deci2.cpp index ac34e9dd0f..8e99207135 100644 --- a/game/sce/deci2.cpp +++ b/game/sce/deci2.cpp @@ -3,12 +3,12 @@ * Implementation of SCE DECI2 library. */ -#include "common/util/assert.h" #include #include #include "common/log/log.h" #include "deci2.h" #include "game/system/Deci2Server.h" +#include "common/util/assert.h" namespace ee { diff --git a/game/sce/iop.cpp b/game/sce/iop.cpp index 3c6db56b0e..b4c1c82f6a 100644 --- a/game/sce/iop.cpp +++ b/game/sce/iop.cpp @@ -1,7 +1,7 @@ -#include "common/util/assert.h" #include #include "iop.h" #include "game/system/iop_thread.h" +#include "common/util/assert.h" namespace iop { /*! diff --git a/game/sce/libcdvd_ee.cpp b/game/sce/libcdvd_ee.cpp index a38e57b990..defd226a58 100644 --- a/game/sce/libcdvd_ee.cpp +++ b/game/sce/libcdvd_ee.cpp @@ -3,8 +3,8 @@ * Stub implementation of the EE CD/DVD library */ -#include "common/util/assert.h" #include "libcdvd_ee.h" +#include "common/util/assert.h" namespace ee { @@ -59,4 +59,4 @@ int sceCdGetDiskType() { return SCECdIllegalMedia; } } -} // namespace ee \ No newline at end of file +} // namespace ee diff --git a/game/sce/libpad.cpp b/game/sce/libpad.cpp index e083fc085a..a80deea8e5 100644 --- a/game/sce/libpad.cpp +++ b/game/sce/libpad.cpp @@ -1,8 +1,8 @@ -#include "common/util/assert.h" #include "libpad.h" #include "game/kernel/kmachine.h" #include "game/graphics/gfx.h" +#include "common/util/assert.h" /*! * @file libpad.cpp diff --git a/game/sce/sif_ee.cpp b/game/sce/sif_ee.cpp index fd2f056043..a9fdef0ea1 100644 --- a/game/sce/sif_ee.cpp +++ b/game/sce/sif_ee.cpp @@ -1,11 +1,11 @@ #include -#include "common/util/assert.h" #include #include #include "common/util/FileUtil.h" #include "sif_ee.h" #include "game/system/iop_thread.h" #include "game/runtime.h" +#include "common/util/assert.h" namespace ee { diff --git a/game/sce/stubs.cpp b/game/sce/stubs.cpp index f52c04a631..164d72e21d 100644 --- a/game/sce/stubs.cpp +++ b/game/sce/stubs.cpp @@ -1,6 +1,6 @@ #include -#include "common/util/assert.h" #include "stubs.h" +#include "common/util/assert.h" namespace ee { diff --git a/game/system/Deci2Server.cpp b/game/system/Deci2Server.cpp index 8cb4826e5b..49b19b5426 100644 --- a/game/system/Deci2Server.cpp +++ b/game/system/Deci2Server.cpp @@ -5,7 +5,6 @@ */ #include -#include "common/util/assert.h" #include // TODO - i think im not including the dependency right..? @@ -24,6 +23,7 @@ #include "common/listener_common.h" #include "common/versions.h" #include "Deci2Server.h" +#include "common/util/assert.h" Deci2Server::Deci2Server(std::function shutdown_callback) { buffer = new char[BUFFER_SIZE]; diff --git a/game/system/IOP_Kernel.cpp b/game/system/IOP_Kernel.cpp index b44759f333..b4f878d403 100644 --- a/game/system/IOP_Kernel.cpp +++ b/game/system/IOP_Kernel.cpp @@ -1,7 +1,7 @@ -#include "common/util/assert.h" #include #include "IOP_Kernel.h" #include "game/sce/iop.h" +#include "common/util/assert.h" /*! * Create a new thread. Will not run the thread. @@ -316,4 +316,4 @@ IOP_Kernel::~IOP_Kernel() { if (iso_disc_file) { fclose(iso_disc_file); } -} \ No newline at end of file +} diff --git a/game/system/IOP_Kernel.h b/game/system/IOP_Kernel.h index 7613684531..2eb586a311 100644 --- a/game/system/IOP_Kernel.h +++ b/game/system/IOP_Kernel.h @@ -10,8 +10,8 @@ #include #include #include -#include "common/util/assert.h" #include "common/common_types.h" +#include "common/util/assert.h" class IOP_Kernel; namespace iop { diff --git a/goal_src/build/game_dgos.gc b/goal_src/build/game_dgos.gc index c0382731c5..ee3cb31769 100644 --- a/goal_src/build/game_dgos.gc +++ b/goal_src/build/game_dgos.gc @@ -1904,3 +1904,4 @@ ("water-anim.o" "water-anim") ("lava.o" "lava") ) + diff --git a/goal_src/engine/pc/pckernel.gc b/goal_src/engine/pc/pckernel.gc index 4f9ef1deee..caa7615c5d 100644 --- a/goal_src/engine/pc/pckernel.gc +++ b/goal_src/engine/pc/pckernel.gc @@ -254,12 +254,12 @@ (defun file-stream-read-symbol ((file file-stream)) (file-stream-seek-past-whitespace file) (file-stream-read-word file) - (cond - ((string= *pc-temp-string* "#f") #f) - ((string= *pc-temp-string* "#t") #t) - ((string= *pc-temp-string* "aspect4x3") 'aspect4x3) - ((string= *pc-temp-string* "aspect16x9") 'aspect16x9) - ((string= *pc-temp-string* "borderless") 'borderless) + (case-str *pc-temp-string* + (("#f") #f) + (("#t") #t) + (("aspect4x3") 'aspect4x3) + (("aspect16x9") 'aspect16x9) + (("borderless") 'borderless) (else #t) ) ) @@ -326,85 +326,85 @@ (let ((version PC_KERNEL_VERSION)) (with-settings-scope (file) (file-stream-read-word file) - (cond - ((string= *pc-temp-string* "settings") + (case-str *pc-temp-string* + (("settings") (set! version (file-stream-read-int file)) (dosettings (file) - (cond - ((string= *pc-temp-string* "fps") (set! (-> obj target-fps) (file-stream-read-int file))) - ((string= *pc-temp-string* "size") + (case-str *pc-temp-string* + (("fps") (set! (-> obj target-fps) (file-stream-read-int file))) + (("size") (set! (-> obj width) (file-stream-read-int file)) (set! (-> obj height) (file-stream-read-int file)) (set-size! obj (-> obj width) (-> obj height)) (set-aspect! obj (-> obj width) (-> obj height)) ) - ((string= *pc-temp-string* "aspect") + (("aspect") (set! (-> obj aspect-custom-x) (file-stream-read-int file)) (set! (-> obj aspect-custom-y) (file-stream-read-int file)) ) - ((string= *pc-temp-string* "aspect-auto") (set! (-> obj aspect-ratio-auto?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "aspect-game") (set! (-> *setting-control* default aspect-ratio) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "fullscreen") (set-fullscreen! obj (file-stream-read-symbol file))) - ((string= *pc-temp-string* "letterbox") (set! (-> obj letterbox?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "vsync") (set! (-> obj vsync?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "font-scale") (set! (-> obj font-scale) (file-stream-read-float file))) - ((string= *pc-temp-string* "audio-latency-ms") (set! (-> obj audio-latency-ms) (file-stream-read-int file))) - ((string= *pc-temp-string* "audio-pan-override") (set! (-> obj audio-pan-override) (file-stream-read-float file))) - ((string= *pc-temp-string* "audio-volume-override") (set! (-> obj audio-volume-override) (file-stream-read-float file))) - ((string= *pc-temp-string* "audio-channel-nb") (set! (-> obj audio-channel-nb) (file-stream-read-int file))) - ((string= *pc-temp-string* "gfx-renderer") (set! (-> obj gfx-renderer) (the-as pc-gfx-renderer (file-stream-read-int file)))) - ((string= *pc-temp-string* "gfx-resolution") (set! (-> obj gfx-resolution) (file-stream-read-float file))) - ((string= *pc-temp-string* "gfx-anisotropy") (set! (-> obj gfx-anisotropy) (file-stream-read-float file))) - ((string= *pc-temp-string* "shrub-dist-mod") (set! (-> obj shrub-dist-mod) (file-stream-read-float file))) - ((string= *pc-temp-string* "lod-dist-mod") (set! (-> obj lod-dist-mod) (file-stream-read-float file))) - ((string= *pc-temp-string* "lod-force-tfrag") (set! (-> obj lod-force-tfrag) (file-stream-read-int file))) - ((string= *pc-temp-string* "lod-force-tie") (set! (-> obj lod-force-tie) (file-stream-read-int file))) - ((string= *pc-temp-string* "lod-force-ocean") (set! (-> obj lod-force-ocean) (file-stream-read-int file))) - ((string= *pc-temp-string* "lod-force-actor") (set! (-> obj lod-force-actor) (file-stream-read-int file))) - ((string= *pc-temp-string* "subtitle-language") (set! (-> obj subtitle-language) (the-as pc-subtitle-lang (file-stream-read-int file)))) - ((string= *pc-temp-string* "stick-deadzone") (set! (-> obj stick-deadzone) (file-stream-read-float file))) - ((string= *pc-temp-string* "ps2-read-speed?") (set! (-> obj ps2-read-speed?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "ps2-parts?") (set! (-> obj ps2-parts?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "ps2-music?") (set! (-> obj ps2-music?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "ps2-se?") (set! (-> obj ps2-se?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "ps2-hints?") (set! (-> obj ps2-hints?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "ps2-lod-dist?") (set! (-> obj ps2-lod-dist?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "music-fade?") (set! (-> obj music-fade?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "use-vis?") (set! (-> obj use-vis?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "skip-movies?") (set! (-> obj skip-movies?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "subtitles?") (set! (-> obj subtitles?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "hinttitles?") (set! (-> obj hinttitles?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "scenes-seen") + (("aspect-auto") (set! (-> obj aspect-ratio-auto?) (file-stream-read-symbol file))) + (("aspect-game") (set! (-> *setting-control* default aspect-ratio) (file-stream-read-symbol file))) + (("fullscreen") (set-fullscreen! obj (file-stream-read-symbol file))) + (("letterbox") (set! (-> obj letterbox?) (file-stream-read-symbol file))) + (("vsync") (set! (-> obj vsync?) (file-stream-read-symbol file))) + (("font-scale") (set! (-> obj font-scale) (file-stream-read-float file))) + (("audio-latency-ms") (set! (-> obj audio-latency-ms) (file-stream-read-int file))) + (("audio-pan-override") (set! (-> obj audio-pan-override) (file-stream-read-float file))) + (("audio-volume-override") (set! (-> obj audio-volume-override) (file-stream-read-float file))) + (("audio-channel-nb") (set! (-> obj audio-channel-nb) (file-stream-read-int file))) + (("gfx-renderer") (set! (-> obj gfx-renderer) (the-as pc-gfx-renderer (file-stream-read-int file)))) + (("gfx-resolution") (set! (-> obj gfx-resolution) (file-stream-read-float file))) + (("gfx-anisotropy") (set! (-> obj gfx-anisotropy) (file-stream-read-float file))) + (("shrub-dist-mod") (set! (-> obj shrub-dist-mod) (file-stream-read-float file))) + (("lod-dist-mod") (set! (-> obj lod-dist-mod) (file-stream-read-float file))) + (("lod-force-tfrag") (set! (-> obj lod-force-tfrag) (file-stream-read-int file))) + (("lod-force-tie") (set! (-> obj lod-force-tie) (file-stream-read-int file))) + (("lod-force-ocean") (set! (-> obj lod-force-ocean) (file-stream-read-int file))) + (("lod-force-actor") (set! (-> obj lod-force-actor) (file-stream-read-int file))) + (("subtitle-language") (set! (-> obj subtitle-language) (the-as pc-subtitle-lang (file-stream-read-int file)))) + (("stick-deadzone") (set! (-> obj stick-deadzone) (file-stream-read-float file))) + (("ps2-read-speed?") (set! (-> obj ps2-read-speed?) (file-stream-read-symbol file))) + (("ps2-parts?") (set! (-> obj ps2-parts?) (file-stream-read-symbol file))) + (("ps2-music?") (set! (-> obj ps2-music?) (file-stream-read-symbol file))) + (("ps2-se?") (set! (-> obj ps2-se?) (file-stream-read-symbol file))) + (("ps2-hints?") (set! (-> obj ps2-hints?) (file-stream-read-symbol file))) + (("ps2-lod-dist?") (set! (-> obj ps2-lod-dist?) (file-stream-read-symbol file))) + (("music-fade?") (set! (-> obj music-fade?) (file-stream-read-symbol file))) + (("use-vis?") (set! (-> obj use-vis?) (file-stream-read-symbol file))) + (("skip-movies?") (set! (-> obj skip-movies?) (file-stream-read-symbol file))) + (("subtitles?") (set! (-> obj subtitles?) (file-stream-read-symbol file))) + (("hinttitles?") (set! (-> obj hinttitles?) (file-stream-read-symbol file))) + (("scenes-seen") (dotimes (i 197) (set! (-> obj scenes-seen i) (file-stream-read-int file)) ) ) - ((string= *pc-temp-string* "fixes") + (("fixes") (dosettings (file) - (cond - ((string= *pc-temp-string* "crash-sagecage") (set! (-> obj fixes crash-sagecage) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "crash-dma") (set! (-> obj fixes crash-dma) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "crash-light-eco") (set! (-> obj fixes crash-light-eco) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "lockout-pelican") (set! (-> obj fixes lockout-pelican) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "lockout-pipegame") (set! (-> obj fixes lockout-pipegame) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "lockout-gambler") (set! (-> obj fixes lockout-gambler) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "fix-movies") (set! (-> obj fixes fix-movies) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "fix-credits") (set! (-> obj fixes fix-credits) (file-stream-read-symbol file))) + (case-str *pc-temp-string* + (("crash-sagecage") (set! (-> obj fixes crash-sagecage) (file-stream-read-symbol file))) + (("crash-dma") (set! (-> obj fixes crash-dma) (file-stream-read-symbol file))) + (("crash-light-eco") (set! (-> obj fixes crash-light-eco) (file-stream-read-symbol file))) + (("lockout-pelican") (set! (-> obj fixes lockout-pelican) (file-stream-read-symbol file))) + (("lockout-pipegame") (set! (-> obj fixes lockout-pipegame) (file-stream-read-symbol file))) + (("lockout-gambler") (set! (-> obj fixes lockout-gambler) (file-stream-read-symbol file))) + (("fix-movies") (set! (-> obj fixes fix-movies) (file-stream-read-symbol file))) + (("fix-credits") (set! (-> obj fixes fix-credits) (file-stream-read-symbol file))) ) ) ) - ((string= *pc-temp-string* "secrets") + (("secrets") (dosettings (file) - (cond - ((string= *pc-temp-string* "hard-rats?") (set! (-> obj secrets hard-rats?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "hero-mode?") (set! (-> obj secrets hero-mode?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "hud-map?") (set! (-> obj secrets hud-map?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "hud-counters?") (set! (-> obj secrets hud-counters?) (file-stream-read-symbol file))) - ((string= *pc-temp-string* "art") (set! (-> obj secrets art) (the-as pc-jak1-concept-art (file-stream-read-int file)))) - ((string= *pc-temp-string* "hard-fish-hiscore") (set! (-> obj secrets hard-fish-hiscore) (file-stream-read-int file))) - ((string= *pc-temp-string* "hard-rats-hiscore") (set! (-> obj secrets hard-rats-hiscore) (file-stream-read-int file))) - ((string= *pc-temp-string* "hard-rats-hiwave") (set! (-> obj secrets hard-rats-hiwave) (file-stream-read-int file))) - ((string= *pc-temp-string* "music") + (case-str *pc-temp-string* + (("hard-rats?") (set! (-> obj secrets hard-rats?) (file-stream-read-symbol file))) + (("hero-mode?") (set! (-> obj secrets hero-mode?) (file-stream-read-symbol file))) + (("hud-map?") (set! (-> obj secrets hud-map?) (file-stream-read-symbol file))) + (("hud-counters?") (set! (-> obj secrets hud-counters?) (file-stream-read-symbol file))) + (("art") (set! (-> obj secrets art) (the-as pc-jak1-concept-art (file-stream-read-int file)))) + (("hard-fish-hiscore") (set! (-> obj secrets hard-fish-hiscore) (file-stream-read-int file))) + (("hard-rats-hiscore") (set! (-> obj secrets hard-rats-hiscore) (file-stream-read-int file))) + (("hard-rats-hiwave") (set! (-> obj secrets hard-rats-hiwave) (file-stream-read-int file))) + (("music") (dotimes (i 30) (set! (-> obj secrets music i) (file-stream-read-int file)) ) @@ -412,7 +412,7 @@ ) ) ) - ((string= *pc-temp-string* "panic") + (("panic") (when (file-stream-read-symbol file) (file-stream-close file) (reset obj) diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index 20ada7482c..6261d18d34 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -423,7 +423,7 @@ `(none) ) -(defmacro case (switch &rest cases) +(defmacro case (switch &key (comp =) &rest cases) "A switch-case construct. switch is saved onto a local variable and compared against each case, sequentially. else can be used like the 'default' case, but it must be the last one." @@ -444,11 +444,11 @@ ) ;; if the list is made up of a single condition ( (= (length conditions) 1) - `((= sw ,(first conditions)) ,@body) + `((,comp sw ,(first conditions)) ,@body) ) ;; otherwise it is made up of multiple conditions, or them together! (#t - `((or ,@(apply (lambda (c) `(= sw ,c)) conditions)) ,@body) + `((or ,@(apply (lambda (c) `(,comp sw ,c)) conditions)) ,@body) ) ) @@ -461,6 +461,12 @@ ) ) +(defmacro case-str (switch &rest cases) + "Same as case, but for string comparisons instead." + + `(case ,switch ,@cases :comp string=) + ) + ;;;;;;;;;;;;;;;;;;; ;; Math Macros ;;;;;;;;;;;;;;;;;;; diff --git a/goalc/compiler/ConstantValue.h b/goalc/compiler/ConstantValue.h index c945ffd77a..4402014d96 100644 --- a/goalc/compiler/ConstantValue.h +++ b/goalc/compiler/ConstantValue.h @@ -1,10 +1,10 @@ #pragma once #include -#include "common/util/assert.h" #include "common/common_types.h" #include "common/util/BitUtils.h" #include "third-party/fmt/core.h" +#include "common/util/assert.h" struct U128 { U128() = default; @@ -84,4 +84,4 @@ class ConstantValue { protected: u8 m_value[16] = {0}; int m_size; -}; \ No newline at end of file +}; diff --git a/goalc/compiler/SymbolInfo.h b/goalc/compiler/SymbolInfo.h index 997bae7727..86f61d4ead 100644 --- a/goalc/compiler/SymbolInfo.h +++ b/goalc/compiler/SymbolInfo.h @@ -1,11 +1,11 @@ #pragma once -#include "common/util/assert.h" #include #include #include #include "common/util/Trie.h" #include "common/goos/Object.h" +#include "common/util/assert.h" /*! * Info about a single symbol, representing one of: @@ -169,4 +169,4 @@ class SymbolInfoMap { private: Trie> m_map; -}; \ No newline at end of file +}; diff --git a/goalc/data_compiler/DataObjectGenerator.cpp b/goalc/data_compiler/DataObjectGenerator.cpp index 9d5545d4ec..ac3db7681b 100644 --- a/goalc/data_compiler/DataObjectGenerator.cpp +++ b/goalc/data_compiler/DataObjectGenerator.cpp @@ -1,8 +1,8 @@ #include #include -#include "common/util/assert.h" #include "DataObjectGenerator.h" #include "common/link_types.h" +#include "common/util/assert.h" namespace { template @@ -265,4 +265,4 @@ void DataObjectGenerator::add_strings() { link_word_to_word(source, target_word); } } -} \ No newline at end of file +} diff --git a/goalc/debugger/DebugInfo.h b/goalc/debugger/DebugInfo.h index c1502fa204..7524ed32e7 100644 --- a/goalc/debugger/DebugInfo.h +++ b/goalc/debugger/DebugInfo.h @@ -5,10 +5,10 @@ #include #include #include -#include "common/util/assert.h" #include "common/common_types.h" #include "goalc/emitter/Instruction.h" #include "goalc/debugger/disassemble.h" +#include "common/util/assert.h" class FunctionEnv; diff --git a/goalc/debugger/Debugger.cpp b/goalc/debugger/Debugger.cpp index a91778c11c..9a1b504bf5 100644 --- a/goalc/debugger/Debugger.cpp +++ b/goalc/debugger/Debugger.cpp @@ -8,11 +8,11 @@ #include "common/goal_constants.h" #include "common/symbols.h" #include "common/util/Timer.h" -#include "common/util/assert.h" #include "goalc/debugger/disassemble.h" #include "goalc/emitter/Register.h" #include "goalc/listener/Listener.h" #include "third-party/fmt/core.h" +#include "common/util/assert.h" /*! * Is the target halted? If we don't know or aren't connected, returns false. diff --git a/goalc/emitter/CallingConvention.cpp b/goalc/emitter/CallingConvention.cpp index 9cdd56316b..b9013a6493 100644 --- a/goalc/emitter/CallingConvention.cpp +++ b/goalc/emitter/CallingConvention.cpp @@ -1,6 +1,5 @@ -#include "common/util/assert.h" - #include "CallingConvention.h" +#include "common/util/assert.h" CallingConvention get_function_calling_convention(const TypeSpec& function_type, const TypeSystem& type_system) { @@ -54,4 +53,4 @@ std::vector get_arg_registers(const TypeSystem& type_system, } } return result; -} \ No newline at end of file +} diff --git a/goalc/emitter/CodeTester.cpp b/goalc/emitter/CodeTester.cpp index 920c86605e..d88288e697 100644 --- a/goalc/emitter/CodeTester.cpp +++ b/goalc/emitter/CodeTester.cpp @@ -9,7 +9,7 @@ #ifdef __linux__ #include #elif _WIN32 -#include +#include "third-party/mman/mman.h" #endif #include @@ -146,4 +146,4 @@ CodeTester::~CodeTester() { munmap(code_buffer, code_buffer_capacity); } } -} // namespace emitter \ No newline at end of file +} // namespace emitter diff --git a/goalc/emitter/IGen.h b/goalc/emitter/IGen.h index 60eec7dc44..5a5ba36282 100644 --- a/goalc/emitter/IGen.h +++ b/goalc/emitter/IGen.h @@ -1,9 +1,9 @@ #pragma once -#include "common/util/assert.h" #include "Register.h" #include "Instruction.h" #include +#include "common/util/assert.h" namespace emitter { class IGen { diff --git a/goalc/emitter/Instruction.h b/goalc/emitter/Instruction.h index d6f12811f7..9c00f26887 100644 --- a/goalc/emitter/Instruction.h +++ b/goalc/emitter/Instruction.h @@ -3,8 +3,8 @@ #ifndef JAK_INSTRUCTION_H #define JAK_INSTRUCTION_H -#include "common/util/assert.h" #include "common/common_types.h" +#include "common/util/assert.h" namespace emitter { /*! diff --git a/goalc/emitter/Register.h b/goalc/emitter/Register.h index c7f0f09e43..6baa2a33da 100644 --- a/goalc/emitter/Register.h +++ b/goalc/emitter/Register.h @@ -5,12 +5,12 @@ * Representation of an x86-64 Register. */ -#include "common/util/assert.h" #include #include #include #include "common/common_types.h" #include "common/goal_constants.h" +#include "common/util/assert.h" namespace emitter { diff --git a/goalc/listener/Listener.cpp b/goalc/listener/Listener.cpp index 0d75f558ef..89d6294fe5 100644 --- a/goalc/listener/Listener.cpp +++ b/goalc/listener/Listener.cpp @@ -21,7 +21,6 @@ #include "common/cross_sockets/xsocket.h" #include -#include "common/util/assert.h" #include #include #include @@ -30,6 +29,7 @@ #include "common/versions.h" #include "third-party/fmt/core.h" +#include "common/util/assert.h" using namespace versions; constexpr bool debug_listener = false; diff --git a/goalc/listener/MemoryMap.cpp b/goalc/listener/MemoryMap.cpp index 1c5197b7f1..8732a13415 100644 --- a/goalc/listener/MemoryMap.cpp +++ b/goalc/listener/MemoryMap.cpp @@ -1,10 +1,10 @@ -#include "common/util/assert.h" #include #include #include "MemoryMap.h" #include "third-party/fmt/core.h" #include "common/link_types.h" #include "common/util/BitUtils.h" +#include "common/util/assert.h" namespace listener { std::string LoadEntry::print() const { @@ -120,4 +120,4 @@ bool MemoryMap::lookup(const std::string& obj_name, u8 seg_id, MemoryMapEntry* o } return false; } -} // namespace listener \ No newline at end of file +} // namespace listener diff --git a/goalc/regalloc/IRegSet.h b/goalc/regalloc/IRegSet.h index e808928c79..1f7d692d20 100644 --- a/goalc/regalloc/IRegSet.h +++ b/goalc/regalloc/IRegSet.h @@ -14,8 +14,8 @@ * The space used is (highest_set_reg + 63) / 64 + constant overhead (vector + int) */ #include -#include "common/util/assert.h" #include "common/common_types.h" +#include "common/util/assert.h" class IRegSet { public: @@ -131,4 +131,4 @@ class IRegSet { private: std::vector m_data; int m_bits = 0; -}; \ No newline at end of file +}; diff --git a/goalc/regalloc/IRegister.cpp b/goalc/regalloc/IRegister.cpp index 54cdd1ccbe..3750465456 100644 --- a/goalc/regalloc/IRegister.cpp +++ b/goalc/regalloc/IRegister.cpp @@ -1,6 +1,6 @@ -#include "common/util/assert.h" #include "third-party/fmt/core.h" #include "IRegister.h" +#include "common/util/assert.h" std::string IRegister::to_string() const { // if (with_constraints) { @@ -32,4 +32,4 @@ std::string IRegConstraint::to_string() const { } else { return fmt::format("[{:3d}] {} in {}", instr_idx, ireg.to_string(), desired_register.print()); } -} \ No newline at end of file +} diff --git a/test/goalc/test_arithmetic.cpp b/test/goalc/test_arithmetic.cpp index 7489448e93..d40bb7e844 100644 --- a/test/goalc/test_arithmetic.cpp +++ b/test/goalc/test_arithmetic.cpp @@ -11,7 +11,7 @@ #include "inja.hpp" #include "third-party/json.hpp" -#include +#include "test/goalc/framework/test_runner.h" #include #include diff --git a/test/goalc/test_collections.cpp b/test/goalc/test_collections.cpp index 64776de847..fcbf5b8c68 100644 --- a/test/goalc/test_collections.cpp +++ b/test/goalc/test_collections.cpp @@ -8,7 +8,7 @@ #include "inja.hpp" #include "third-party/json.hpp" -#include +#include "test/goalc/framework/test_runner.h" #include #include diff --git a/test/goalc/test_control_statements.cpp b/test/goalc/test_control_statements.cpp index 817c0c41ae..fc89fdb757 100644 --- a/test/goalc/test_control_statements.cpp +++ b/test/goalc/test_control_statements.cpp @@ -8,7 +8,7 @@ #include "inja.hpp" #include "third-party/json.hpp" -#include +#include "test/goalc/framework/test_runner.h" #include #include diff --git a/test/goalc/test_variables.cpp b/test/goalc/test_variables.cpp index c993117246..e01423f34a 100644 --- a/test/goalc/test_variables.cpp +++ b/test/goalc/test_variables.cpp @@ -8,7 +8,7 @@ #include "inja.hpp" #include "third-party/json.hpp" -#include +#include "test/goalc/framework/test_runner.h" #include #include diff --git a/test/goalc/test_with_game.cpp b/test/goalc/test_with_game.cpp index c411ed9cf9..5119abc527 100644 --- a/test/goalc/test_with_game.cpp +++ b/test/goalc/test_with_game.cpp @@ -10,7 +10,7 @@ #include "inja.hpp" #include "third-party/json.hpp" #include "common/util/FileUtil.h" -#include +#include "test/goalc/framework/test_runner.h" #include "third-party/fmt/core.h" #include diff --git a/tools/MemoryDumpTool/main.cpp b/tools/MemoryDumpTool/main.cpp index f7ad61fce2..51ef20ca39 100644 --- a/tools/MemoryDumpTool/main.cpp +++ b/tools/MemoryDumpTool/main.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include "third-party/fmt/core.h" @@ -12,6 +11,7 @@ #include "common/type_system/TypeSystem.h" #include "decompiler/util/DecompilerTypeSystem.h" +#include "common/util/assert.h" struct Ram { const u8* data = nullptr;