elapsed time handling

The code has been assuming that time_t is some number of seconds.
That's valid for traditional Unix systems and for Posix compliant
systems but is not something guaranteed by the C standard.  (We ran
into a long time ago when trying out an alternate way to calculate
phase of moon.  That code made a similar assumption and broke one
of the ports.)

'ubirthday' also warrants being re-done but I've run out of energy.
This commit is contained in:
PatR
2021-08-25 14:14:23 -07:00
parent 52f5e79790
commit b1f3d1f864
5 changed files with 28 additions and 7 deletions
+3 -2
View File
@@ -367,8 +367,9 @@ writexlentry(FILE* rfile, struct toptenentry* tt, int how)
Fprintf(rfile, "%cachieveX=%s", XLOG_SEP, encode_extended_achievements());
Fprintf(rfile, "%cconductX=%s", XLOG_SEP, encode_extended_conducts());
Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime=%ld", XLOG_SEP,
(long) urealtime.realtime, XLOG_SEP,
(long) ubirthday, XLOG_SEP, (long) urealtime.finish_time);
urealtime.realtime, XLOG_SEP,
timet_to_seconds(ubirthday), XLOG_SEP,
timet_to_seconds(urealtime.finish_time));
Fprintf(rfile, "%cgender0=%s%calign0=%s", XLOG_SEP,
genders[flags.initgend].filecode, XLOG_SEP,
aligns[1 - u.ualignbase[A_ORIGINAL]].filecode);