From a1c1dd3b80c7ef388065e0e8c0715bd84debf58a Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 25 Jun 2024 15:03:53 +0200 Subject: [PATCH] Don't cast pointers to integers before comparison --- LEGO1/lego/legoomni/include/legopathboundary.h | 4 ++-- LEGO1/lego/legoomni/include/legopathcontroller.h | 2 +- LEGO1/lego/legoomni/include/legoworld.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legopathboundary.h b/LEGO1/lego/legoomni/include/legopathboundary.h index 570b2ea2..db7c1366 100644 --- a/LEGO1/lego/legoomni/include/legopathboundary.h +++ b/LEGO1/lego/legoomni/include/legopathboundary.h @@ -10,14 +10,14 @@ struct LegoPathActorSetCompare { MxU32 operator()(const LegoPathActor* p_lhs, const LegoPathActor* p_rhs) const { - return (MxS32) p_lhs < (MxS32) p_rhs; + return (MxS32*) p_lhs < (MxS32*) p_rhs; } }; struct LegoAnimPresenterSetCompare { MxBool operator()(const LegoAnimPresenter* p_lhs, const LegoAnimPresenter* p_rhs) const { - return (MxS32) p_lhs < (MxS32) p_rhs; + return (MxS32*) p_lhs < (MxS32*) p_rhs; } }; diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index 7bb38b61..7f6b66db 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -21,7 +21,7 @@ struct LegoPathCtrlEdge : public LegoUnknown100db7f4 {}; struct LegoPathCtrlEdgeCompare { MxU32 operator()(const LegoPathCtrlEdge* p_lhs, const LegoPathCtrlEdge* p_rhs) const { - return (MxS32) p_lhs < (MxS32) p_rhs; + return (MxS32*) p_lhs < (MxS32*) p_rhs; } }; diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index f1de12c9..4c329e84 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -13,7 +13,7 @@ class LegoPathBoundary; class LegoHideAnimPresenter; 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 (MxS32*) p_a < (MxS32*) p_b; } }; typedef set MxCoreSet;