From 09e0c04f7b9d2d357715dc908ff0094dcf3e4fcc Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 15:11:05 +0700 Subject: [PATCH] Further C-style struct definitions fixes --- Minecraft.Client/TextureHolder.h | 7 ++++--- Minecraft.World/ChunkPos.h | 15 ++++++++------- Minecraft.World/TilePos.h | 15 ++++++++------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Minecraft.Client/TextureHolder.h b/Minecraft.Client/TextureHolder.h index 304d03e7..6c600d63 100644 --- a/Minecraft.Client/TextureHolder.h +++ b/Minecraft.Client/TextureHolder.h @@ -30,7 +30,8 @@ public: int compareTo(const TextureHolder *other) const; }; -typedef struct +struct TextureHolderLessThan { - bool operator() (const TextureHolder *first, const TextureHolder *second) const { return first->compareTo(second) >= 0; } -} TextureHolderLessThan; \ No newline at end of file + inline bool operator()(const TextureHolder *first, const TextureHolder *second) const + { return first->compareTo(second) >= 0; } +}; \ No newline at end of file diff --git a/Minecraft.World/ChunkPos.h b/Minecraft.World/ChunkPos.h index f1d483c7..2a3fda02 100644 --- a/Minecraft.World/ChunkPos.h +++ b/Minecraft.World/ChunkPos.h @@ -28,13 +28,14 @@ public: ChunkPos & operator= (const ChunkPos & other) { x = other.x; z = other.z; return *this; } }; -typedef struct +struct ChunkPosKeyHash { - __int64 operator() (const ChunkPos &k) const { return ChunkPos::hash_fnct(k); } + inline __int64 operator()(const ChunkPos &k) const + { return ChunkPos::hash_fnct(k); } +}; -} ChunkPosKeyHash; - -typedef struct +struct ChunkPosKeyEq { - bool operator() (const ChunkPos &x, const ChunkPos &y) const { return ChunkPos::eq_test(x, y); } -} ChunkPosKeyEq; \ No newline at end of file + inline bool operator()(const ChunkPos &x, const ChunkPos &y) const + { return ChunkPos::eq_test(x, y); } +}; \ No newline at end of file diff --git a/Minecraft.World/TilePos.h b/Minecraft.World/TilePos.h index d4a3e84e..04804066 100644 --- a/Minecraft.World/TilePos.h +++ b/Minecraft.World/TilePos.h @@ -14,14 +14,15 @@ public: static bool eq_test(const TilePos &x, const TilePos &y); }; -typedef struct +struct TilePosKeyHash { - int operator() (const TilePos &k) const { return TilePos::hash_fnct (k); } + inline int operator()(const TilePos &k) const + { return TilePos::hash_fnct (k); } +}; -} TilePosKeyHash; - -typedef struct +struct TilePosKeyEq { - bool operator() (const TilePos &x, const TilePos &y) const { return TilePos::eq_test (x, y); } -} TilePosKeyEq; + inline bool operator()(const TilePos &x, const TilePos &y) const + { return TilePos::eq_test (x, y); } +};