mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-26 09:41:15 +00:00
Don't cast pointers to integers on non-32-bit architectures
This commit is contained in:
parent
a226f5d59e
commit
3aa22e2077
@ -7,17 +7,23 @@
|
|||||||
#include "mxstl/stlcompat.h"
|
#include "mxstl/stlcompat.h"
|
||||||
#include "mxtypes.h"
|
#include "mxtypes.h"
|
||||||
|
|
||||||
|
#if defined(_M_IX86) || defined(__i386__)
|
||||||
|
#define COMPARE_POINTER_TYPE MxS32
|
||||||
|
#else
|
||||||
|
#define COMPARE_POINTER_TYPE MxS32*
|
||||||
|
#endif
|
||||||
|
|
||||||
struct LegoPathActorSetCompare {
|
struct LegoPathActorSetCompare {
|
||||||
MxU32 operator()(const LegoPathActor* p_lhs, const LegoPathActor* p_rhs) const
|
MxU32 operator()(const LegoPathActor* p_lhs, const LegoPathActor* p_rhs) const
|
||||||
{
|
{
|
||||||
return (MxS32) p_lhs < (MxS32) p_rhs;
|
return (COMPARE_POINTER_TYPE) p_lhs < (COMPARE_POINTER_TYPE) p_rhs;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LegoAnimPresenterSetCompare {
|
struct LegoAnimPresenterSetCompare {
|
||||||
MxBool operator()(const LegoAnimPresenter* p_lhs, const LegoAnimPresenter* p_rhs) const
|
MxBool operator()(const LegoAnimPresenter* p_lhs, const LegoAnimPresenter* p_rhs) const
|
||||||
{
|
{
|
||||||
return (MxS32) p_lhs < (MxS32) p_rhs;
|
return (COMPARE_POINTER_TYPE) p_lhs < (COMPARE_POINTER_TYPE) p_rhs;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,12 @@ class LegoWorld;
|
|||||||
class MxAtomId;
|
class MxAtomId;
|
||||||
class Vector3;
|
class Vector3;
|
||||||
|
|
||||||
|
#if defined(_M_IX86) || defined(__i386__)
|
||||||
|
#define COMPARE_POINTER_TYPE MxS32
|
||||||
|
#else
|
||||||
|
#define COMPARE_POINTER_TYPE MxS32*
|
||||||
|
#endif
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d7da8
|
// VTABLE: LEGO1 0x100d7da8
|
||||||
// SIZE 0x40
|
// SIZE 0x40
|
||||||
struct LegoPathCtrlEdge : public LegoUnknown100db7f4 {};
|
struct LegoPathCtrlEdge : public LegoUnknown100db7f4 {};
|
||||||
@ -21,7 +27,7 @@ struct LegoPathCtrlEdge : public LegoUnknown100db7f4 {};
|
|||||||
struct LegoPathCtrlEdgeCompare {
|
struct LegoPathCtrlEdgeCompare {
|
||||||
MxU32 operator()(const LegoPathCtrlEdge* p_lhs, const LegoPathCtrlEdge* p_rhs) const
|
MxU32 operator()(const LegoPathCtrlEdge* p_lhs, const LegoPathCtrlEdge* p_rhs) const
|
||||||
{
|
{
|
||||||
return (MxS32) p_lhs < (MxS32) p_rhs;
|
return (COMPARE_POINTER_TYPE) p_lhs < (COMPARE_POINTER_TYPE) p_rhs;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -12,8 +12,17 @@ class LegoEntityList;
|
|||||||
class LegoPathBoundary;
|
class LegoPathBoundary;
|
||||||
class LegoHideAnimPresenter;
|
class LegoHideAnimPresenter;
|
||||||
|
|
||||||
|
#if defined(_M_IX86) || defined(__i386__)
|
||||||
|
#define COMPARE_POINTER_TYPE MxS32
|
||||||
|
#else
|
||||||
|
#define COMPARE_POINTER_TYPE MxS32*
|
||||||
|
#endif
|
||||||
|
|
||||||
struct CoreSetCompare {
|
struct CoreSetCompare {
|
||||||
MxS32 operator()(MxCore* const& p_a, MxCore* const& p_b) const { return (MxS32) p_a < (MxS32) p_b; }
|
MxS32 operator()(MxCore* const& p_a, MxCore* const& p_b) const
|
||||||
|
{
|
||||||
|
return (COMPARE_POINTER_TYPE) p_a < (COMPARE_POINTER_TYPE) p_b;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef set<MxCore*, CoreSetCompare> MxCoreSet;
|
typedef set<MxCore*, CoreSetCompare> MxCoreSet;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user