From 88ffcab9a17ae9e9b6db451b34922a275f3e9935 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Tue, 10 Mar 2026 00:06:01 +1100 Subject: [PATCH] Remove Win32 types from WstringLookup --- Minecraft.Client/Utils/WstringLookup.cpp | 17 +++++++++-------- Minecraft.Client/Utils/WstringLookup.h | 12 ++++++------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Minecraft.Client/Utils/WstringLookup.cpp b/Minecraft.Client/Utils/WstringLookup.cpp index dfd3de37c..7f8fdaa70 100644 --- a/Minecraft.Client/Utils/WstringLookup.cpp +++ b/Minecraft.Client/Utils/WstringLookup.cpp @@ -8,7 +8,7 @@ WstringLookup::WstringLookup() numIDs = 0; } -std::wstring WstringLookup::lookup(UINT id) +std::wstring WstringLookup::lookup(unsigned int id) { // TODO //if (id > currentMaxID) @@ -17,12 +17,12 @@ std::wstring WstringLookup::lookup(UINT id) return int2str.at(id); } -UINT WstringLookup::lookup(std::wstring str) +unsigned int WstringLookup::lookup(std::wstring str) { if (str2int.find(str) == str2int.end()) { - std::pair p = - std::pair(str, numIDs); + std::pair p = + std::pair(str, numIDs); str2int.insert( p ); int2str.push_back( str ); @@ -35,14 +35,15 @@ UINT WstringLookup::lookup(std::wstring str) } } -VOID WstringLookup::getTable(std::wstring **lookup, UINT *len) +void WstringLookup::getTable(std::wstring **lookup, unsigned int *len) { // Outputs - std::wstring *out_lookup; UINT out_len; + std::wstring *out_lookup; + unsigned int out_len; // Fill lookup. out_lookup = new std::wstring[int2str.size()]; - for (UINT i = 0; i < numIDs; i++) + for (unsigned int i = 0; i < numIDs; i++) out_lookup[i] = int2str.at(i); out_len = numIDs; @@ -51,4 +52,4 @@ VOID WstringLookup::getTable(std::wstring **lookup, UINT *len) *lookup = out_lookup; *len = out_len; return; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Utils/WstringLookup.h b/Minecraft.Client/Utils/WstringLookup.h index a5247bc3f..8c531845b 100644 --- a/Minecraft.Client/Utils/WstringLookup.h +++ b/Minecraft.Client/Utils/WstringLookup.h @@ -5,16 +5,16 @@ class WstringLookup { private: - UINT numIDs; - std::unordered_map str2int; + unsigned int numIDs; + std::unordered_map str2int; std::vector int2str; public: WstringLookup(); - std::wstring lookup(UINT id); + std::wstring lookup(unsigned int id); - UINT lookup(std::wstring); + unsigned int lookup(std::wstring); - VOID getTable(std::wstring **lookup, UINT *len); -}; \ No newline at end of file + void getTable(std::wstring **lookup, unsigned int *len); +};