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:
@@ -244,8 +244,8 @@ savegamestate(NHFILE* nhfp)
|
||||
bwrite(nhfp->fd, (genericptr_t) &flags, sizeof flags);
|
||||
}
|
||||
urealtime.finish_time = getnow();
|
||||
urealtime.realtime += (long) (urealtime.finish_time
|
||||
- urealtime.start_timing);
|
||||
urealtime.realtime += timet_delta(urealtime.finish_time,
|
||||
urealtime.start_timing);
|
||||
if (nhfp->structlevel) {
|
||||
bwrite(nhfp->fd, (genericptr_t) &u, sizeof u);
|
||||
bwrite(nhfp->fd, yyyymmddhhmmss(ubirthday), 14);
|
||||
|
||||
Reference in New Issue
Block a user