diff --git a/src/save.c b/src/save.c index 43097f022..c62fc51c8 100644 --- a/src/save.c +++ b/src/save.c @@ -437,7 +437,6 @@ void savestateinlock() { int hpid = 0; - static boolean havestate = TRUE; char whynot[BUFSZ]; NHFILE *nhfp; @@ -448,7 +447,7 @@ savestateinlock() * a game, however, the file has to be rewritten once to truncate * it and avoid restoring from outdated information. * - * Restricting havestate to this routine means that an additional + * Restricting g.havestate to this routine means that an additional * noop pid rewriting will take place on the first "checkpoint" after * the game is started or restored, if checkpointing is off. */ diff --git a/src/sfascii.c b/src/sfascii.c index 31e943846..029118b94 100644 --- a/src/sfascii.c +++ b/src/sfascii.c @@ -81,11 +81,11 @@ void ascii_sfo_any(nhfp, d_any, myparent, myname, cnt) NHFILE *nhfp; union any *d_any; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { - char *parent = "any"; + const char *parent = "any"; Sprintf(outbuf, "%llx", (unsigned long long) d_any->a_void); put_savefield(nhfp, outbuf, BUFSZ); @@ -129,8 +129,8 @@ void ascii_sfo_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) NHFILE *nhfp; aligntyp *d_aligntyp; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int itmp; @@ -145,8 +145,8 @@ void ascii_sfo_bitfield(nhfp, d_bitfield, myparent, myname, cnt) NHFILE *nhfp; uint8_t *d_bitfield; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { const char *parent = "bitfield"; @@ -160,8 +160,8 @@ void ascii_sfo_boolean(nhfp, d_boolean, myparent, myname, cnt) NHFILE *nhfp; boolean *d_boolean; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -180,8 +180,8 @@ void ascii_sfo_char(nhfp, d_char, myparent, myname, cnt) NHFILE *nhfp; char *d_char; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i = cnt; @@ -200,8 +200,8 @@ void ascii_sfo_genericptr(nhfp, d_genericptr, myparent, myname, cnt) NHFILE *nhfp; genericptr_t *d_genericptr; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -231,8 +231,8 @@ void ascii_sfo_int(nhfp, d_int, myparent, myname, cnt) NHFILE *nhfp; int *d_int; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -249,8 +249,8 @@ void ascii_sfo_long(nhfp, d_long, myparent, myname, cnt) NHFILE *nhfp; long *d_long; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -267,8 +267,8 @@ void ascii_sfo_schar(nhfp, d_schar, myparent, myname, cnt) NHFILE *nhfp; schar *d_schar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i, itmp; @@ -286,8 +286,8 @@ void ascii_sfo_short(nhfp, d_short, myparent, myname, cnt) NHFILE *nhfp; short *d_short; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -304,8 +304,8 @@ void ascii_sfo_size_t(nhfp, d_size_t, myparent, myname, cnt) NHFILE *nhfp; size_t *d_size_t; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -324,9 +324,9 @@ void ascii_sfo_time_t(nhfp, d_time_t, myparent, myname, cnt) NHFILE *nhfp; time_t *d_time_t; -const char *myparent; -const char *myname; -int cnt; +const char *myparent UNUSED; +const char *myname UNUSED; +int cnt UNUSED; { const char *parent = "time_t"; @@ -349,8 +349,8 @@ void ascii_sfo_uchar(nhfp, d_uchar, myparent, myname, cnt) NHFILE *nhfp; unsigned char *d_uchar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -369,8 +369,8 @@ void ascii_sfo_uint(nhfp, d_uint, myparent, myname, cnt) NHFILE *nhfp; unsigned int *d_uint; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -387,8 +387,8 @@ void ascii_sfo_ulong(nhfp, d_ulong, myparent, myname, cnt) NHFILE *nhfp; unsigned long *d_ulong; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -405,8 +405,8 @@ void ascii_sfo_ushort(nhfp, d_ushort, myparent, myname, cnt) NHFILE *nhfp; unsigned short *d_ushort; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -423,8 +423,8 @@ void ascii_sfo_xchar(nhfp, d_xchar, myparent, myname, cnt) NHFILE *nhfp; xchar *d_xchar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -446,8 +446,8 @@ void ascii_sfo_str(nhfp, d_str, myparent, myname, cnt) NHFILE *nhfp; char *d_str; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i, j, intval; @@ -499,8 +499,8 @@ void ascii_sfi_any(nhfp, d_any, myparent, myname, cnt) NHFILE *nhfp; union any *d_any; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { char *rstr; @@ -552,8 +552,8 @@ void ascii_sfi_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) NHFILE *nhfp; aligntyp *d_aligntyp; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { char *rstr; @@ -576,8 +576,8 @@ void ascii_sfi_bitfield(nhfp, d_bitfield, myparent, myname, cnt) NHFILE *nhfp; uint8_t *d_bitfield; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { char *rstr; @@ -599,8 +599,8 @@ void ascii_sfi_boolean(nhfp, d_boolean, myparent, myname, cnt) NHFILE *nhfp; boolean *d_boolean; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { char *rstr; @@ -627,8 +627,8 @@ void ascii_sfi_char(nhfp, d_char, myparent, myname, cnt) NHFILE *nhfp; char *d_char; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { char *rstr; @@ -653,8 +653,8 @@ void ascii_sfi_genericptr(nhfp, d_genericptr, myparent, myname, cnt) NHFILE *nhfp; genericptr_t *d_genericptr; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -688,8 +688,8 @@ void ascii_sfi_int(nhfp, d_int, myparent, myname, cnt) NHFILE *nhfp; int *d_int; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i, tmp; @@ -715,8 +715,8 @@ void ascii_sfi_long(nhfp, d_long, myparent, myname, cnt) NHFILE *nhfp; long *d_long; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -743,8 +743,8 @@ void ascii_sfi_schar(nhfp, d_schar, myparent, myname, cnt) NHFILE *nhfp; schar *d_schar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -769,8 +769,8 @@ void ascii_sfi_short(nhfp, d_short, myparent, myname, cnt) NHFILE *nhfp; short *d_short; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -795,8 +795,8 @@ void ascii_sfi_size_t(nhfp, d_size_t, myparent, myname, cnt) NHFILE *nhfp; size_t *d_size_t; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -821,9 +821,9 @@ void ascii_sfi_time_t(nhfp, d_time_t, myparent, myname, cnt) NHFILE *nhfp; time_t *d_time_t; -const char *myparent; -const char *myname; -int cnt; +const char *myparent UNUSED; +const char *myname UNUSED; +int cnt UNUSED; { int i; time_t tmp; @@ -859,8 +859,8 @@ void ascii_sfi_uchar(nhfp, d_uchar, myparent, myname, cnt) NHFILE *nhfp; unsigned char *d_uchar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { uchar tmp; @@ -886,8 +886,8 @@ void ascii_sfi_uint(nhfp, d_uint, myparent, myname, cnt) NHFILE *nhfp; unsigned int *d_uint; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -914,8 +914,8 @@ void ascii_sfi_ulong(nhfp, d_ulong, myparent, myname, cnt) NHFILE *nhfp; unsigned long *d_ulong; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -942,8 +942,8 @@ void ascii_sfi_ushort(nhfp, d_ushort, myparent, myname, cnt) NHFILE *nhfp; unsigned short *d_ushort; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -970,8 +970,8 @@ void ascii_sfi_xchar(nhfp, d_xchar, myparent, myname, cnt) NHFILE *nhfp; xchar *d_xchar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { xchar tmp; @@ -999,8 +999,8 @@ void ascii_sfi_str(nhfp, d_str, myparent, myname, cnt) NHFILE *nhfp; char *d_str; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i, j, sval; diff --git a/src/sflendian.c b/src/sflendian.c index 617176de3..6f4fc9c8c 100644 --- a/src/sflendian.c +++ b/src/sflendian.c @@ -134,11 +134,11 @@ void lendian_sfo_any(nhfp, d_any, myparent, myname, cnt) NHFILE *nhfp; union any *d_any; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { - char *parent = "any"; + const char *parent = "any"; int i; uint64_t ui64; int64_t i64; @@ -187,8 +187,8 @@ void lendian_sfo_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) NHFILE *nhfp; aligntyp *d_aligntyp; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { const char *parent = "aligntyp"; @@ -211,8 +211,8 @@ void lendian_sfo_bitfield(nhfp, d_bitfield, myparent, myname, cnt) NHFILE *nhfp; uint8_t *d_bitfield; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { const char *parent = "bitfield"; @@ -230,8 +230,8 @@ void lendian_sfo_boolean(nhfp, d_boolean, myparent, myname, cnt) NHFILE *nhfp; boolean *d_boolean; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { const char *parent = "boolean"; @@ -254,8 +254,8 @@ void lendian_sfo_char(nhfp, d_char, myparent, myname, cnt) NHFILE *nhfp; char *d_char; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -278,8 +278,8 @@ void lendian_sfo_genericptr(nhfp, d_genericptr, myparent, myname, cnt) NHFILE *nhfp; genericptr_t *d_genericptr; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -314,8 +314,8 @@ void lendian_sfo_int(nhfp, d_int, myparent, myname, cnt) NHFILE *nhfp; int *d_int; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -339,8 +339,8 @@ void lendian_sfo_long(nhfp, d_long, myparent, myname, cnt) NHFILE *nhfp; long *d_long; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -364,8 +364,8 @@ void lendian_sfo_schar(nhfp, d_schar, myparent, myname, cnt) NHFILE *nhfp; schar *d_schar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -388,8 +388,8 @@ void lendian_sfo_short(nhfp, d_short, myparent, myname, cnt) NHFILE *nhfp; short *d_short; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -412,8 +412,8 @@ void lendian_sfo_size_t(nhfp, d_size_t, myparent, myname, cnt) NHFILE *nhfp; size_t *d_size_t; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -437,9 +437,9 @@ void lendian_sfo_time_t(nhfp, d_time_t, myparent, myname, cnt) NHFILE *nhfp; time_t *d_time_t; -const char *myparent; -const char *myname; -int cnt; +const char *myparent UNUSED; +const char *myname UNUSED; +int cnt UNUSED; { char buf[BUFSZ]; const char *parent = "time_t"; @@ -457,8 +457,8 @@ void lendian_sfo_unsigned(nhfp, d_unsigned, myparent, myname, cnt) NHFILE *nhfp; unsigned *d_unsigned; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { lendian_sfo_uint(nhfp, d_unsigned, myparent, myname, cnt); @@ -468,8 +468,8 @@ void lendian_sfo_uchar(nhfp, d_uchar, myparent, myname, cnt) NHFILE *nhfp; unsigned char *d_uchar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -491,8 +491,8 @@ void lendian_sfo_uint(nhfp, d_uint, myparent, myname, cnt) NHFILE *nhfp; unsigned int *d_uint; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -516,8 +516,8 @@ void lendian_sfo_ulong(nhfp, d_ulong, myparent, myname, cnt) NHFILE *nhfp; unsigned long *d_ulong; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -541,8 +541,8 @@ void lendian_sfo_ushort(nhfp, d_ushort, myparent, myname, cnt) NHFILE *nhfp; unsigned short *d_ushort; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -566,8 +566,8 @@ void lendian_sfo_xchar(nhfp, d_xchar, myparent, myname, cnt) NHFILE *nhfp; xchar *d_xchar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -593,8 +593,8 @@ void lendian_sfo_str(nhfp, d_str, myparent, myname, cnt) NHFILE *nhfp; char *d_str; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i, j, intval; @@ -654,8 +654,8 @@ void lendian_sfi_any(nhfp, d_any, myparent, myname, cnt) NHFILE *nhfp; union any *d_any; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { const char *parent = "any"; @@ -730,8 +730,8 @@ void lendian_sfi_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) NHFILE *nhfp; aligntyp *d_aligntyp; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { const char *parent = "aligntyp"; @@ -762,8 +762,8 @@ void lendian_sfi_bitfield(nhfp, d_bitfield, myparent, myname, cnt) NHFILE *nhfp; uint8_t *d_bitfield; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { const char *parent = "bitfield"; @@ -787,8 +787,8 @@ void lendian_sfi_boolean(nhfp, d_boolean, myparent, myname, cnt) NHFILE *nhfp; boolean *d_boolean; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -818,8 +818,8 @@ void lendian_sfi_char(nhfp, d_char, myparent, myname, cnt) NHFILE *nhfp; char *d_char; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -849,8 +849,8 @@ void lendian_sfi_genericptr(nhfp, d_genericptr, myparent, myname, cnt) NHFILE *nhfp; genericptr_t *d_genericptr; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -880,8 +880,8 @@ void lendian_sfi_int(nhfp, d_int, myparent, myname, cnt) NHFILE *nhfp; int *d_int; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -911,8 +911,8 @@ void lendian_sfi_long(nhfp, d_long, myparent, myname, cnt) NHFILE *nhfp; long *d_long; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -942,8 +942,8 @@ void lendian_sfi_schar(nhfp, d_schar, myparent, myname, cnt) NHFILE *nhfp; schar *d_schar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -972,8 +972,8 @@ void lendian_sfi_short(nhfp, d_short, myparent, myname, cnt) NHFILE *nhfp; short *d_short; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -1003,8 +1003,8 @@ void lendian_sfi_size_t(nhfp, d_size_t, myparent, myname, cnt) NHFILE *nhfp; size_t *d_size_t; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -1035,9 +1035,9 @@ void lendian_sfi_time_t(nhfp, d_time_t, myparent, myname, cnt) NHFILE *nhfp; time_t *d_time_t; -const char *myparent; -const char *myname; -int cnt; +const char *myparent UNUSED; +const char *myname UNUSED; +int cnt UNUSED; { time_t tmp; char buf[BUFSZ]; @@ -1064,8 +1064,8 @@ void lendian_sfi_unsigned(nhfp, d_unsigned, myparent, myname, cnt) NHFILE *nhfp; unsigned *d_unsigned; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { /* deferal */ @@ -1076,8 +1076,8 @@ void lendian_sfi_uchar(nhfp, d_uchar, myparent, myname, cnt) NHFILE *nhfp; unsigned char *d_uchar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -1106,8 +1106,8 @@ void lendian_sfi_uint(nhfp, d_uint, myparent, myname, cnt) NHFILE *nhfp; unsigned int *d_uint; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -1137,8 +1137,8 @@ void lendian_sfi_ulong(nhfp, d_ulong, myparent, myname, cnt) NHFILE *nhfp; unsigned long *d_ulong; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -1168,8 +1168,8 @@ void lendian_sfi_ushort(nhfp, d_ushort, myparent, myname, cnt) NHFILE *nhfp; unsigned short *d_ushort; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -1199,8 +1199,8 @@ void lendian_sfi_xchar(nhfp, d_xchar, myparent, myname, cnt) NHFILE *nhfp; xchar *d_xchar; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { int i; @@ -1232,8 +1232,8 @@ void lendian_sfi_str(nhfp, d_str, myparent, myname, cnt) NHFILE *nhfp; char *d_str; -const char *myparent; -const char *myname; +const char *myparent UNUSED; +const char *myname UNUSED; int cnt; { #ifdef SAVEFILE_DEBUGGING