Skip to content

Commit 09e0c04

Browse files
committed
Further C-style struct definitions fixes
1 parent def238f commit 09e0c04

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

Minecraft.Client/TextureHolder.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class TextureHolder //implements Comparable<TextureHolder> {
3030
int compareTo(const TextureHolder *other) const;
3131
};
3232

33-
typedef struct
33+
struct TextureHolderLessThan
3434
{
35-
bool operator() (const TextureHolder *first, const TextureHolder *second) const { return first->compareTo(second) >= 0; }
36-
} TextureHolderLessThan;
35+
inline bool operator()(const TextureHolder *first, const TextureHolder *second) const
36+
{ return first->compareTo(second) >= 0; }
37+
};

Minecraft.World/ChunkPos.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ class ChunkPos
2828
ChunkPos & operator= (const ChunkPos & other) { x = other.x; z = other.z; return *this; }
2929
};
3030

31-
typedef struct
31+
struct ChunkPosKeyHash
3232
{
33-
__int64 operator() (const ChunkPos &k) const { return ChunkPos::hash_fnct(k); }
34-
35-
} ChunkPosKeyHash;
33+
inline __int64 operator()(const ChunkPos &k) const
34+
{ return ChunkPos::hash_fnct(k); }
35+
};
3636

37-
typedef struct
37+
struct ChunkPosKeyEq
3838
{
39-
bool operator() (const ChunkPos &x, const ChunkPos &y) const { return ChunkPos::eq_test(x, y); }
40-
} ChunkPosKeyEq;
39+
inline bool operator()(const ChunkPos &x, const ChunkPos &y) const
40+
{ return ChunkPos::eq_test(x, y); }
41+
};

Minecraft.World/TilePos.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ class TilePos
1414
static bool eq_test(const TilePos &x, const TilePos &y);
1515
};
1616

17-
typedef struct
17+
struct TilePosKeyHash
1818
{
19-
int operator() (const TilePos &k) const { return TilePos::hash_fnct (k); }
20-
21-
} TilePosKeyHash;
19+
inline int operator()(const TilePos &k) const
20+
{ return TilePos::hash_fnct (k); }
21+
};
2222

23-
typedef struct
23+
struct TilePosKeyEq
2424
{
25-
bool operator() (const TilePos &x, const TilePos &y) const { return TilePos::eq_test (x, y); }
26-
} TilePosKeyEq;
25+
inline bool operator()(const TilePos &x, const TilePos &y) const
26+
{ return TilePos::eq_test (x, y); }
27+
};
2728

0 commit comments

Comments
 (0)