Commit graph

2596 commits

Author SHA1 Message Date
bfee6962fc Fix fields checks for split tables:
(caseen): Remove.
(xufldhdr, deffld): Record only fields in this part in caflds[].  This
fixes the check for duplicate fields in parts other than the first.
(cafldspp): New, to record fields in previous parts.
(xundump): Initialize and finalize it.
(xufooter): Update it.  Requires new parameter ca.  Caller changed.
(fldval_must_match): Use it to do the right thing for split arrays.
(chkflds): Adapt for changed caflds[].
(chkflds): The check for missing fields was skipped for all parts of a
split table instead of for all but the final part.
2007-08-05 18:38:37 +00:00
26d45adf8a (xufldhdr): ellipsis wasn't cleared for machine-readable input. This
broke reading machine-readable input after reading a split table
failed before seeing the last part.  Luckily, callers never tried
that.
2007-08-05 18:23:09 +00:00
6e2a666882 (xutail): Remove parameter type. Use cur_type instead. Caller
changed.
2007-08-05 17:36:01 +00:00
b8b231be42 (getobj, setnum): Move override of cur_id from getobj() to setnum().
Remove the now unused parameters of getobj().  Callers changed.
2007-08-05 17:34:24 +00:00
94324f7966 (xuheader1, xufldhdr, xutrailer, xufooter, xundump2, xutail)
(xundump1, xubody): Rename.
2007-08-05 17:25:01 +00:00
8fead20ac4 (xundump1, xundump2): Move call of xutrailer() from xundump1() to its
caller xundump2().  Make xundump1() return number of records read for
that.
2007-08-05 17:19:52 +00:00
5a8aea24f4 (xundump1): Remove parameter type. Use cur_type instead. Caller
changed.
2007-08-05 17:05:22 +00:00
b031e34738 (xuheader1, xutrailer, xundump1): Remove unused parameters. Callers
changed.
2007-08-05 17:03:07 +00:00
971515ccc9 (xundump): Count lines in a saner way: pass line number in and out.
Callers changed.
2007-08-05 16:22:41 +00:00
6498d66263 New home for stuff specific to Windows: src/lib/w32/
Move getopt.c getopt.h service.c from src/lib/gen/ there.
(lib/libw32.a): New.
(libs): Add it under Windows.
2007-08-04 05:23:39 +00:00
a1646c8aa7 (gamedir): Not all programs treat relative names the same. Document
the lossage.
2007-08-03 04:44:54 +00:00
f1094fbdc6 Doc fix. 2007-08-03 04:06:18 +00:00
1999751782 (bmaps_intersect): Simplify. No functional change. 2007-08-03 04:05:04 +00:00
Ron Koenderink
2270ea73d8 (fmttime2822) [_WIN32]: Replace localtime_s() with localtime().
Replace _snprintf_s() with _snprintf().  These secure functions are
not supported by MinGW yet.
2007-08-03 01:47:02 +00:00
5545eb4b0a (main): Use the same initial anchor as the server.
(main): Exit unsuccessfully when read_schedule() fails.
2007-08-01 18:23:51 +00:00
f2d96f466a Fix include missing since misc.h rev. 1.69. 2007-08-01 05:30:37 +00:00
e1926d9ce9 (ef_open): Leaked file descriptor when fcntl() failed. 2007-07-31 05:03:25 +00:00
0890911655 (new): Simplify. No functional change. 2007-07-31 05:01:46 +00:00
23aa13b2c7 Doc fix. 2007-07-31 04:57:07 +00:00
Ron Koenderink
4fdebd205e (upda): Remove unused local variable fp. 2007-07-29 16:57:36 +00:00
990eb46b91 (fl_sct_init, write_sects, file_sct_init, main): Do not initialize
sector and realm timestamps to current time.  It's not useful, and it
facilitates attacks against the PRNG.  This backs out fairland.c
rev. 1.27 and files.c rev. 1.31 and partly backs out files.c
rev. 1.38.
2007-07-29 13:40:47 +00:00
2c9b1ee80b (subst.in): Polish substitution of @configure_input@. 2007-07-28 19:33:35 +00:00
73e06535bf (disablefil): Remove, belatedly (unused since optlist.h rev. 1.46). 2007-07-28 19:31:30 +00:00
21946d0a63 (datarootdir): New; Autoconf 2.60 wants it. 2007-07-28 19:18:41 +00:00
62c8eea544 Remove the ancient, crufty non-UCONTEXT system-dependent LWP code.
Using it required manual hackery since 4.3.0, and it hasn't been
missed.
2007-07-28 13:58:58 +00:00
015d8d933b Update from http://autoconf-archive.cryp.to/ 2007-07-28 13:09:00 +00:00
8bd0a2cf81 (bp_ref): Use XYOFFSET(). Old code used only every other slot.
(bp_alloc): Use WORLD_SZ().  Allocates only half as much.
2007-07-28 12:16:50 +00:00
56de7a2151 (WORLD_SZ): New.
(isok, ef_init, bmaps_intersect, bp_init, player_accept)
(finish_sects, main): Use it.

(bp_neighbors, bp_lbcost, pathcost): Use XYOFFSET().  No
functional change.
2007-07-28 12:12:17 +00:00
e24b608dc6 (nav_map): Remove unused bitmap and its initialization. 2007-07-28 07:23:59 +00:00
cc2629d6cf (sctoff): Oops on bad arguments. Recovery by returning -1 seems
dangerous.  Not touching that now.

(sctoff): Use XYOFFSET().  No functional change.
2007-07-28 07:08:45 +00:00
6d9e78af4c (XYOFFSET): Returned twice the value it should.
(finish_sects): Allocated twice as much space as needed, to make it
work with the broken XYOFFSET().
2007-07-28 07:06:55 +00:00
e09f50a7d3 (empth_wait_for_signal) [EMPTH_W32]: Fix to return SIGTERM. 2007-07-27 20:30:11 +00:00
e1cd0bdc21 (add): Plug file descriptor leak. 2007-07-27 20:23:47 +00:00
f915f91b47 Update known contributors comment. 2007-07-27 20:16:19 +00:00
d4573ea180 Spelling fix. 2007-07-27 19:13:13 +00:00
83acae02be Update AUTHORS. 2007-07-27 19:12:32 +00:00
1be2d7be4c Comment. 2007-07-27 19:10:39 +00:00
0eeed1c920 (main): Initialize game_turn to one instead of zero. 2007-07-27 18:23:03 +00:00
c329f882a2 (VIS, SANCT, NORM, GOD, CAP, MONEY): Move from nat.h to player.h.
(PS_LOGIN): Unused, remove.
2007-07-27 17:50:09 +00:00
78b7f3547c Fix the previous revision. 2007-07-27 17:43:13 +00:00
3935444408 updates_disabled() moved to game.h, include it. 2007-07-27 17:29:55 +00:00
286dda725e Store update disable flag in the game table to make it visible in
xdump:
(gamestr): New member game_upd_disable.
(game_ca): Update accordingly.
(game_ctrl_update): New.
(disa, enab): Use it.
(updates_disabled): Rewrite and move to game.c
(disablefil): Remove.
2007-07-27 05:58:40 +00:00
e7e8717e86 (parse_time): Fix for arguments describing a time when DST is in
effect.
2007-07-27 04:26:20 +00:00
Ron Koenderink
812eab5427 Fix the previous revision. 2007-07-26 02:00:49 +00:00
Ron Koenderink
ce6a691126 (fmttime2822): Changed return type for strftime() to size_t.
(fmttime2822) [_WIN32]: %T is not support option for strftime in WIN32
replaced with %H:%M:%S.  Replaced %z in with +/-???? format for WIN32
as the default for WIN32 is the text description for timezone.
2007-07-26 01:59:32 +00:00
f691a07814 Fix the previous revision. 2007-07-25 19:35:09 +00:00
043015e829 (player_kill_idle): Don't kill hung player threads. That code was
flawed.  Firstly, when player_kill_idle() ran before the player thread
could react to being aborted by update or shutdown, player_kill_idle()
incorrectly diagnosed it as hung.  Secondly, terminating hung threads
leaks resources and can leave a stale play_lock behind.  It could
perhaps even corrupt game state.  It might salvage some scenarios, but
makes others worse.  Not worth it.
2007-07-25 06:10:10 +00:00
d500a7071c Remove the concept of thread priorities from empthread.h. Only LWP
supports priorities.  Update synchronization used to rely on them,
which naturally worked only with LWP (#1504036).  With that fixed, no
uses of priorities remained, but a minor bug did: players could starve
out threads with priorities below PP_PLAYER, i.e. delete_lostitems()
and player_kill_idle().  Closes #1458175:
(empth_create): Remove parameter prio.  Callers changed.  Also gets
rid of misleading comments in pthread.c and ntthread.c.
(PP_MAIN, PP_UPDATE, PP_SHUTDOWN, PP_SCHED, PP_TIMESTAMP, PP_PLAYER)
(PP_ACCEPT, PP_KILLIDLE): Remove.
(empth_init, empth_create) [EMPTH_LWP]: Pass priority 1.
2007-07-24 05:13:31 +00:00
7536a38e95 Comment. 2007-07-24 04:10:44 +00:00
8fa3ba1b60 (dispatch): Set player->command before acquiring play_lock, to make
sure the command is reliably aborted on update and shutdown.  Before,
redirection output could block while player->command was still null,
letting players delay the update or shutdown indefinitely.
2007-07-22 17:23:34 +00:00