commit cfaae7739779fbefc10dd0fd1b73d30e6f6b2c1f
Author: Turo Lamminen <turol@iki.fi>
AuthorDate: Tue Nov 8 20:49:56 2022 +0200
Commit: Turo Lamminen <turol@iki.fi>
CommitDate: Tue Nov 8 22:19:34 2022 +0200
hexen: Improve thinkInfo_t restoreFunc type correctnes
---
src/hexen/sv_save.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/hexen/sv_save.c b/src/hexen/sv_save.c
index 7d404d43..2311964c 100644
--- a/src/hexen/sv_save.c
+++ b/src/hexen/sv_save.c
@@ -74,7 +74,7 @@ typedef struct
think_t thinkerFunc;
void (*writeFunc)(thinker_t *thinker);
void (*readFunc)(thinker_t *thinker);
- void (*restoreFunc) ();
+ void (*restoreFunc)(thinker_t *thinker);
size_t size;
} thinkInfo_t;
@@ -112,9 +112,9 @@ static void SetMobjArchiveNums(void);
static void RemoveAllThinkers(void);
static int GetMobjNum(mobj_t * mobj);
static void SetMobjPtr(mobj_t **ptr, unsigned int archiveNum);
-static void RestoreSSThinker(ssthinker_t * sst);
-static void RestorePlatRaise(plat_t * plat);
-static void RestoreMoveCeiling(ceiling_t * ceiling);
+static void RestoreSSThinker(thinker_t *sst);
+static void RestorePlatRaise(thinker_t *thinker);
+static void RestoreMoveCeiling(thinker_t *thinker);
static void AssertSegment(gameArchiveSegment_t segType);
static void ClearSaveSlot(int slot);
static void CopySaveSlot(int sourceSlot, int destSlot);
@@ -2927,8 +2927,9 @@ static void UnarchiveThinkers(void)
//
//==========================================================================
-static void RestoreSSThinker(ssthinker_t *sst)
+static void RestoreSSThinker(thinker_t *thinker)
{
+ ssthinker_t *sst = (ssthinker_t *) thinker;
sst->sector->specialdata = sst->thinker.function;
}
@@ -2938,8 +2939,9 @@ static void RestoreSSThinker(ssthinker_t *sst)
//
//==========================================================================
-static void RestorePlatRaise(plat_t *plat)
+static void RestorePlatRaise(thinker_t *thinker)
{
+ plat_t *plat = (plat_t *) thinker;
plat->sector->specialdata = T_PlatRaise;
P_AddActivePlat(plat);
}
@@ -2950,8 +2952,9 @@ static void RestorePlatRaise(plat_t *plat)
//
//==========================================================================
-static void RestoreMoveCeiling(ceiling_t *ceiling)
+static void RestoreMoveCeiling(thinker_t *thinker)
{
+ ceiling_t *ceiling = (ceiling_t *) thinker;
ceiling->sector->specialdata = T_MoveCeiling;
P_AddActiveCeiling(ceiling);
}