From fa49ecfc17492a538bb5073a96afa73c66569d4a Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Thu, 22 Dec 2022 01:26:49 -0300 Subject: [PATCH] Fixing build Former-commit-id: f8e02c251c84d7e17b8c43b79b0d51a59b21c61f --- include/Kyoto/Alloc/CMemory.hpp | 4 ++-- include/Kyoto/TOneStatic.hpp | 1 + include/Kyoto/TToken.hpp | 4 ++-- include/dolphin/os/OSFastCast.h | 16 ---------------- include/rstl/algorithm.hpp | 6 +++--- include/rstl/red_black_tree.hpp | 6 +++--- src/Kyoto/Basics/RAssertDolphin.cpp | 8 ++++---- src/MetroidPrime/CMainFlow.cpp | 2 -- src/MetroidPrime/CMapArea.cpp | 1 + 9 files changed, 16 insertions(+), 32 deletions(-) diff --git a/include/Kyoto/Alloc/CMemory.hpp b/include/Kyoto/Alloc/CMemory.hpp index 59ae5678..ba4a3b89 100644 --- a/include/Kyoto/Alloc/CMemory.hpp +++ b/include/Kyoto/Alloc/CMemory.hpp @@ -42,11 +42,11 @@ inline void* operator new(size_t n, void* ptr) { return ptr; }; #ifdef __MWERKS__ inline void operator delete(void* ptr) { CMemory::Free(ptr); } inline void operator delete[](void* ptr) { CMemory::Free(ptr); } +#define NEW new ("??(??)", nullptr) #else __attribute__((weak)) void operator delete(void* ptr) { CMemory::Free(ptr); } __attribute__((weak)) void operator delete[](void* ptr) { CMemory::Free(ptr); } +#define NEW new #endif -#define NEW new ("??(??)", nullptr) - #endif // _CMEMORY diff --git a/include/Kyoto/TOneStatic.hpp b/include/Kyoto/TOneStatic.hpp index f7e35127..54e67587 100644 --- a/include/Kyoto/TOneStatic.hpp +++ b/include/Kyoto/TOneStatic.hpp @@ -2,6 +2,7 @@ #define _TONESTATIC #include "types.h" +#include "stdio.h" template < typename T > class TOneStatic { diff --git a/include/Kyoto/TToken.hpp b/include/Kyoto/TToken.hpp index c2078260..e1766255 100644 --- a/include/Kyoto/TToken.hpp +++ b/include/Kyoto/TToken.hpp @@ -39,8 +39,8 @@ public: if (x8_item != nullptr) { return true; } - if (HasLock() && CToken::IsLoaded()) { - x8_item = TToken::GetT(); + if (CToken::HasLock() && CToken::IsLoaded()) { + x8_item = TToken< T >::GetT(); return true; } else { return false; diff --git a/include/dolphin/os/OSFastCast.h b/include/dolphin/os/OSFastCast.h index d615bb8a..b6ca50d1 100644 --- a/include/dolphin/os/OSFastCast.h +++ b/include/dolphin/os/OSFastCast.h @@ -36,23 +36,7 @@ static inline void OSInitFastCast(void) { mtspr GQR5, r3 } #else - asm volatile (" - li 3, 0x0004 - oris 3, 3, 0x0004 - mtspr GQR2, 3 - li 3, 0x0005 - oris 3, 3, 0x0005 - mtspr GQR3, 3 - - li 3, 0x0006 - oris 3, 3, 0x0006 - mtspr GQR4, 3 - - li 3, 0x0007 - oris 3, 3, 0x0007 - mtspr GQR5, 3 - " : : : "r3" ); #endif } // clang-format off diff --git a/include/rstl/algorithm.hpp b/include/rstl/algorithm.hpp index 86017aae..3d159822 100644 --- a/include/rstl/algorithm.hpp +++ b/include/rstl/algorithm.hpp @@ -146,10 +146,10 @@ public: }; template -inline pair_sorter_finder< T::value_type, less< select1st< typename T::value_type >::value_type > > default_pair_sorter_finder() +inline pair_sorter_finder< typename T::value_type, less< typename select1st< typename T::value_type >::value_type > > default_pair_sorter_finder() { - less< select1st< typename T::value_type >::value_type > l; - pair_sorter_finder< T::value_type, less< select1st< typename T::value_type >::value_type > > a(l); + less< typename select1st< typename T::value_type >::value_type > l; + pair_sorter_finder< typename T::value_type, less< typename select1st< typename T::value_type >::value_type > > a(l); return a; } diff --git a/include/rstl/red_black_tree.hpp b/include/rstl/red_black_tree.hpp index aa80521f..a355cf7d 100644 --- a/include/rstl/red_black_tree.hpp +++ b/include/rstl/red_black_tree.hpp @@ -101,9 +101,9 @@ public: struct iterator : public const_iterator { iterator(node* node, const header* header, bool b) : const_iterator(node, header, b) {} - P* operator->() { return mNode->get_value(); } - P* operator*() { return mNode->get_value(); } - node* get_node() { return mNode; } + P* operator->() { return const_iterator::mNode->get_value(); } + P* operator*() { return const_iterator::mNode->get_value(); } + node* get_node() { return const_iterator::mNode; } }; red_black_tree() : x0_(0), x1_(0), x4_count(0) {} diff --git a/src/Kyoto/Basics/RAssertDolphin.cpp b/src/Kyoto/Basics/RAssertDolphin.cpp index d10aeba5..ece4629a 100644 --- a/src/Kyoto/Basics/RAssertDolphin.cpp +++ b/src/Kyoto/Basics/RAssertDolphin.cpp @@ -111,10 +111,10 @@ void ErrorHandler(OSError code, OSContext* context, int arg1, int arg2) { } void SetErrorHandlers() { - OSSetErrorHandler(2, (OSErrorHandler*)ErrorHandler); - OSSetErrorHandler(3, (OSErrorHandler*)ErrorHandler); - OSSetErrorHandler(5, (OSErrorHandler*)ErrorHandler); - OSSetErrorHandler(15, (OSErrorHandler*)ErrorHandler); + OSSetErrorHandler(2, (OSErrorHandler)ErrorHandler); + OSSetErrorHandler(3, (OSErrorHandler)ErrorHandler); + OSSetErrorHandler(5, (OSErrorHandler)ErrorHandler); + OSSetErrorHandler(15, (OSErrorHandler)ErrorHandler); } void rs_debugger_printf(const char* format, ...) { diff --git a/src/MetroidPrime/CMainFlow.cpp b/src/MetroidPrime/CMainFlow.cpp index 4549f2da..391dd128 100644 --- a/src/MetroidPrime/CMainFlow.cpp +++ b/src/MetroidPrime/CMainFlow.cpp @@ -85,8 +85,6 @@ void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue) break; } break; - default: - break; } break; } diff --git a/src/MetroidPrime/CMapArea.cpp b/src/MetroidPrime/CMapArea.cpp index 22e0ce46..33c988b6 100644 --- a/src/MetroidPrime/CMapArea.cpp +++ b/src/MetroidPrime/CMapArea.cpp @@ -13,6 +13,7 @@ #include "dolphin/os.h" #include "limits.h" +#include "stdint.h" static const CVector3f MinesPostTransforms[3] = { CVector3f(0.f, 0.f, 200.f),