From 6c914e0700131d11c3eccfa865124fa65b414ea3 Mon Sep 17 00:00:00 2001 From: disinvite Date: Sun, 12 Nov 2023 19:13:47 -0500 Subject: [PATCH] Use MxS8 for Compare return type --- LEGO1/mxcollection.h | 2 +- LEGO1/mxhashtable.h | 8 ++++---- LEGO1/mxstring.h | 2 +- LEGO1/mxvariabletable.cpp | 2 +- LEGO1/mxvariabletable.h | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/LEGO1/mxcollection.h b/LEGO1/mxcollection.h index a9433f13..0f32a064 100644 --- a/LEGO1/mxcollection.h +++ b/LEGO1/mxcollection.h @@ -15,7 +15,7 @@ class MxCollection : public MxCore { virtual ~MxCollection() {} static void Destroy(T){}; - virtual MxBool Compare(T, T) { return 0; } + virtual MxS8 Compare(T, T) { return 0; } protected: MxU32 m_count; // +0x8 diff --git a/LEGO1/mxhashtable.h b/LEGO1/mxhashtable.h index 64fb1533..16275358 100644 --- a/LEGO1/mxhashtable.h +++ b/LEGO1/mxhashtable.h @@ -61,14 +61,14 @@ class MxHashTable : protected MxCollection { MxHashTableNode** m_slots; // +0x10 MxU32 m_numSlots; // +0x14 - MxU32 m_autoResizeRatio; - HashTableOpt m_resizeOption; // +0x1c + MxU32 m_autoResizeRatio; // +0x18 + HashTableOpt m_resizeOption; // +0x1c // FIXME: or FIXME? This qword is used as an integer or double depending // on the value of m_resizeOption. Hard to say whether this is how the devs // did it, but a simple cast in either direction doesn't match. union { - MxU32 m_increaseAmount; - double m_increaseFactor; + MxU32 m_increaseAmount; // +0x20 + double m_increaseFactor; // +0x20 }; }; diff --git a/LEGO1/mxstring.h b/LEGO1/mxstring.h index 78c8526c..3984f428 100644 --- a/LEGO1/mxstring.h +++ b/LEGO1/mxstring.h @@ -18,7 +18,7 @@ class MxString : public MxCore { MxString operator+(const char*); MxString& operator+=(const char*); - inline MxBool Compare(const MxString& p_str) const { return strcmp(m_data, p_str.m_data); } + inline MxS8 Compare(const MxString& p_str) const { return strcmp(m_data, p_str.m_data); } inline const char* GetData() const { return m_data; } private: diff --git a/LEGO1/mxvariabletable.cpp b/LEGO1/mxvariabletable.cpp index 4e1a5039..0faa2b7b 100644 --- a/LEGO1/mxvariabletable.cpp +++ b/LEGO1/mxvariabletable.cpp @@ -1,7 +1,7 @@ #include "mxvariabletable.h" // OFFSET: LEGO1 0x100b7330 -MxBool MxVariableTable::Compare(MxVariable* p_var0, MxVariable* p_var1) +MxS8 MxVariableTable::Compare(MxVariable* p_var0, MxVariable* p_var1) { return p_var0->GetKey()->Compare(*p_var1->GetKey()); } diff --git a/LEGO1/mxvariabletable.h b/LEGO1/mxvariabletable.h index 21d5eaea..872aa49f 100644 --- a/LEGO1/mxvariabletable.h +++ b/LEGO1/mxvariabletable.h @@ -17,8 +17,8 @@ class MxVariableTable : public MxHashTable { // OFFSET: LEGO1 0x100afdb0 static void Destroy(MxVariable* p_obj) { p_obj->Destroy(); } - virtual MxBool Compare(MxVariable*, MxVariable*) override; // +0x14 - virtual MxU32 Hash(MxVariable*) override; // +0x18 + virtual MxS8 Compare(MxVariable*, MxVariable*) override; // +0x14 + virtual MxU32 Hash(MxVariable*) override; // +0x18 }; // OFFSET: LEGO1 0x100afcd0 TEMPLATE