move a pair of functions from save.c to restore.c

A utility that links only with restore.o needs to find them.
This commit is contained in:
nhmall
2026-04-13 09:08:53 -04:00
parent efaabc3203
commit 8c8121eb3c
5 changed files with 20 additions and 19 deletions

View File

@@ -2734,6 +2734,8 @@ boolean restgamestate(NHFILE *);
void restore_msghistory(NHFILE *); void restore_msghistory(NHFILE *);
#endif #endif
extern void rest_adjust_levelflags(void); extern void rest_adjust_levelflags(void);
extern void moves_to_relative_time(long *);
extern void relative_time_to_moves(long *);
/* ### rip.c ### */ /* ### rip.c ### */
@@ -2828,8 +2830,6 @@ extern void freedynamicdata(void);
extern void store_savefileinfo(NHFILE *) NONNULLARG1; extern void store_savefileinfo(NHFILE *) NONNULLARG1;
extern void store_savefileinfo(NHFILE *) NONNULLARG1; extern void store_savefileinfo(NHFILE *) NONNULLARG1;
extern int nhdatatypes_size(void); extern int nhdatatypes_size(void);
extern void moves_to_relative_time(long *);
extern void relative_time_to_moves(long *);
#if 0 #if 0
extern void assignlog(char *, char*, int); extern void assignlog(char *, char*, int);
extern FILE *getlog(NHFILE *); extern FILE *getlog(NHFILE *);

View File

@@ -1889,6 +1889,7 @@ vconfig_error_add(const char *str, va_list the_args)
config_erradd(buf); config_erradd(buf);
} }
#ifndef SFCTOOL
void void
rcfile(void) rcfile(void)
{ {
@@ -2022,6 +2023,7 @@ config_unmatched_ignored(void)
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
#endif /* SFCTOOL */
#ifdef SYSCF #ifdef SYSCF
#ifdef SYSCF_FILE #ifdef SYSCF_FILE

View File

@@ -1313,6 +1313,21 @@ rest_adjust_levelflags(void)
/* adjust timestamps */ /* adjust timestamps */
relative_time_to_moves(&svl.level.flags.stasis_until); relative_time_to_moves(&svl.level.flags.stasis_until);
} }
void
moves_to_relative_time(long *timestamp)
{
long prevts = *timestamp;
*timestamp = prevts - svm.moves;
}
void
relative_time_to_moves(long *timestamp)
{
long prevts = *timestamp;
*timestamp = svm.moves + prevts;
}
/* "name-role-race-gend-algn" occurs very early in a save file; sometimes we /* "name-role-race-gend-algn" occurs very early in a save file; sometimes we
want the whole thing, other times just "name" (for svp.plname[]) */ want the whole thing, other times just "name" (for svp.plname[]) */

View File

@@ -1052,22 +1052,6 @@ save_msghistory(NHFILE *nhfp)
/* note: we don't attempt to handle release_data() here */ /* note: we don't attempt to handle release_data() here */
} }
void
moves_to_relative_time(long *timestamp)
{
long prevts = *timestamp;
*timestamp = prevts - svm.moves;
}
void
relative_time_to_moves(long *timestamp)
{
long prevts = *timestamp;
*timestamp = svm.moves + prevts;
}
/* also called by prscore(); this probably belongs in dungeon.c... */ /* also called by prscore(); this probably belongs in dungeon.c... */
void void
free_dungeons(void) free_dungeons(void)

View File

@@ -96,7 +96,7 @@ int util_strncmpi(const char *s1, const char *s2, size_t sz);
#ifdef UNIX #ifdef UNIX
#define nethack_exit exit #define nethack_exit exit
ATTRNORETURN void nh_terminate(int) NORETURN; /* bwrite() calls this */ ATTRNORETURN void nh_terminate(int) NORETURN; /* bwrite() calls this */
static void chdirx(const char *, boolean); //static void chdirx(const char *, boolean);
#else #else
ATTRNORETURN extern void nethack_exit(int) NORETURN; ATTRNORETURN extern void nethack_exit(int) NORETURN;
#ifdef WIN32 #ifdef WIN32