From 0722de660fd7eca738bb7624a2b4446d0273ee96 Mon Sep 17 00:00:00 2001 From: dcvz Date: Tue, 14 May 2024 01:57:33 +0200 Subject: [PATCH] Add missing constructors to work on borked clang --- CMakeLists.txt | 1 - include/recomp_port.h | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7eab156..4c06943 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.20) -project(Zelda64Recompiled) set(CMAKE_C_STANDARD 17) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/include/recomp_port.h b/include/recomp_port.h index 0140d2f..13dfe92 100644 --- a/include/recomp_port.h +++ b/include/recomp_port.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,8 @@ namespace RecompPort { struct FunctionSize { std::string func_name; uint32_t size_bytes; + + FunctionSize(std::string func_name, uint32_t size_bytes) : func_name(std::move(func_name)), size_bytes(size_bytes) {} }; struct ManualFunction { @@ -49,6 +52,8 @@ namespace RecompPort { std::string section_name; uint32_t vram; uint32_t size; + + ManualFunction(std::string func_name, std::string section_name, uint32_t vram, uint32_t size) : func_name(std::move(func_name)), section_name(std::move(section_name)), vram(vram), size(size) {} }; struct Config { @@ -82,11 +87,16 @@ namespace RecompPort { uint32_t addu_vram; uint32_t jr_vram; std::vector entries; + + JumpTable(uint32_t vram, uint32_t addend_reg, uint32_t rom, uint32_t lw_vram, uint32_t addu_vram, uint32_t jr_vram, std::vector entries) + : vram(vram), addend_reg(addend_reg), rom(rom), lw_vram(lw_vram), addu_vram(addu_vram), jr_vram(jr_vram), entries(std::move(entries)) {} }; struct AbsoluteJump { uint32_t jump_target; uint32_t instruction_vram; + + AbsoluteJump(uint32_t jump_target, uint32_t instruction_vram) : jump_target(jump_target), instruction_vram(instruction_vram) {} }; struct Function { @@ -98,6 +108,9 @@ namespace RecompPort { bool ignored; bool reimplemented; bool stubbed; + + Function(uint32_t vram, uint32_t rom, std::vector words, std::string name, ELFIO::Elf_Half section_index, bool ignored = false, bool reimplemented = false, bool stubbed = false) + : vram(vram), rom(rom), words(std::move(words)), name(std::move(name)), section_index(section_index), ignored(ignored), reimplemented(reimplemented), stubbed(stubbed) {} }; enum class RelocType : uint8_t {