shithub: choc

Download patch

ref: 62097ae43e5f2b713fe8911c538fb7d28d6fb90b
parent: d9f275813817870c9252ca5b370963a83d989488
author: Turo Lamminen <turol@iki.fi>
date: Tue Nov 8 15:29:24 EST 2022

hexen: Improve thinkInfo_t writeFunc type correctness

--- a/src/hexen/sv_save.c
+++ b/src/hexen/sv_save.c
@@ -72,7 +72,7 @@
 {
     thinkClass_t tClass;
     think_t thinkerFunc;
-    void (*writeFunc)();
+    void (*writeFunc)(thinker_t *thinker);
     void (*readFunc)();
     void (*restoreFunc) ();
     size_t size;
@@ -1166,8 +1166,10 @@
     str->textureChange = SV_ReadByte();
 }
 
-static void StreamOut_floormove_t(floormove_t *str)
+static void StreamOut_floormove_t(thinker_t *thinker)
 {
+    floormove_t *str = (floormove_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1267,8 +1269,10 @@
     str->type = SV_ReadLong();
 }
 
-static void StreamOut_plat_t(plat_t *str)
+static void StreamOut_plat_t(thinker_t *thinker)
 {
+    plat_t *str = (plat_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1345,8 +1349,10 @@
     str->olddirection = SV_ReadLong();
 }
 
-static void StreamOut_ceiling_t(ceiling_t *str)
+static void StreamOut_ceiling_t(thinker_t *thinker)
 {
+    ceiling_t *str = (ceiling_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1411,8 +1417,10 @@
     str->count = SV_ReadLong();
 }
 
-static void StreamOut_light_t(light_t *str)
+static void StreamOut_light_t(thinker_t *thinker)
 {
+    light_t *str = (light_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1473,8 +1481,10 @@
     str->topcountdown = SV_ReadLong();
 }
 
-static void StreamOut_vldoor_t(vldoor_t *str)
+static void StreamOut_vldoor_t(thinker_t *thinker)
 {
+    vldoor_t *str = (vldoor_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1523,8 +1533,10 @@
     str->base = SV_ReadLong();
 }
 
-static void StreamOut_phase_t(phase_t *str)
+static void StreamOut_phase_t(thinker_t *thinker)
 {
+    phase_t *str = (phase_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1596,8 +1608,10 @@
     str->ip = SV_ReadLong();
 }
 
-static void StreamOut_acs_t(acs_t *str)
+static void StreamOut_acs_t(thinker_t *thinker)
 {
+    acs_t *str = (acs_t *) thinker;
+
     int i;
 
     // thinker_t thinker;
@@ -1676,8 +1690,10 @@
     str->ySpeed = SV_ReadLong();
 }
 
-static void StreamOut_polyevent_t(polyevent_t *str)
+static void StreamOut_polyevent_t(thinker_t *thinker)
 {
+    polyevent_t *str = (polyevent_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1735,8 +1751,10 @@
     str->crush = SV_ReadLong();
 }
 
-static void StreamOut_pillar_t(pillar_t *str)
+static void StreamOut_pillar_t(thinker_t *thinker)
 {
+    pillar_t *str = (pillar_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1804,8 +1822,10 @@
     str->close = SV_ReadLong();
 }
 
-static void StreamOut_polydoor_t(polydoor_t *str)
+static void StreamOut_polydoor_t(thinker_t *thinker)
 {
+    polydoor_t *str = (polydoor_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);
 
@@ -1882,8 +1902,10 @@
     str->state = SV_ReadLong();
 }
 
-static void StreamOut_floorWaggle_t(floorWaggle_t *str)
+static void StreamOut_floorWaggle_t(thinker_t *thinker)
 {
+    floorWaggle_t *str = (floorWaggle_t *) thinker;
+
     // thinker_t thinker;
     StreamOut_thinker_t(&str->thinker);