]> granicus.if.org Git - nethack/commit
remove time_t from struct you (trunk only)
authornethack.allison <nethack.allison>
Wed, 19 Dec 2007 03:19:25 +0000 (03:19 +0000)
committernethack.allison <nethack.allison>
Wed, 19 Dec 2007 03:19:25 +0000 (03:19 +0000)
commitd430db0718871863338be262ceed70ad37d3864b
tree51d9dde7a98ddb4a8dbfb824d006b42ae729e0c0
parentfaa3543063276624844d0fac3005e62710e92a8b
remove time_t from struct you (trunk only)

There was an issue reported where save files between different
versions of a manufacturer's compiler were incompatible because the time_t
ubirthday field was changed from 32 bits to 64 bits.

32 bit time_t implementations will break at 19:14:07 on  January 18, 2038.
64 bit time_t implementations will break at 23:59:59 on December 31, 3000.

This removes the dependency on the size of time_t from the save file.
The ubirthday field is no longer embedded in struct you.
This also adds two general purpose routines to hacklib.c, one to convert a time
value to a 14 character char representation and the other to convert that
back to time_t. Those are used by the save/restore routines.

This is a savefile breaking change, so editlevel in patchlevel.h was
incremented.
15 files changed:
include/decl.h
include/extern.h
include/patchlevel.h
include/you.h
src/decl.c
src/hacklib.c
src/mkroom.c
src/read.c
src/restore.c
src/save.c
src/shk.c
src/shknam.c
src/topten.c
src/u_init.c
sys/winnt/Makefile.msc