Declare all configuration variables in optlist.h. Include that
instead of declaring them all over the place. This uncovered type
errors:
(s_p_etu, adj_update): Defined long, sometimes declared int. Kills
big endian machines where sizeof(long) != sizeof(int). Change to
int.
Supply prototypes where possible. This uncovered type errors with
thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.
Change linkage of functions without prototype declaration to static
where possible.
Remove some superflous declarations, replace others by suitable
includes.
Fix markup: bogus numerical arguments that were mapped to zero
silently (troff) or under protest (groff); table column width (also
fixed some .L arguments to match actual game output); spacing in
no-fill text; stray .FI, .in and .ce messing up indentation; stray .L;
misspelled request and escape names; escaping of control and escape
characters; properly ignore form-feed; argument quoting; extra
arguments to .NF. Still broken: .L abused for headings, which
triggers many groff warnings about negative indentation.
(main, USERNAME): Change Windows user name from win-empcl2.8 to nobody
to get rid of the version number. Keeping it up-to-date by hand is
too much work, but leaving it at 2.8 would be confusing.
(move_ground): explore() used endsect without initialized in certain
cases, e.g. `expl X,Y N X,Y'. Other callers might have had similar
problems. Fix: always assign to *END. Thanks to Marc Olzheim for
help with debugging and fixing this.
(iom, fdmax, newoutput): Serve no purpose since previous rev., remove
along with code to maintain them. This removes the last uses of
io_mask.c io_mask.h; remove them.
Creating make include files with make doesn't work with many makes out
there. Back out for 4.2.13. You have to create the make include
files by hand if they don't exist. That's the case for freshly
checked out trees.
(RESOLVE_IPADDRESS): gethostbyaddr() uses a lot of stack space on some
versions of GNU libc, which can lead to nasty heap smashes (observed
with 2.2.93). Don't define RESOLVE_IPADDRESS for now, until we
readjust thread stack sizes.
(OSXCFLAGS): Don't switch gcc to cruft mode.
(OSXLFLAGS): Don't sweep undefined references under the carpet; link
with the right libraries instead.
(LINUXCFLAGS, LINUXPTHCFLAGS): Compile with symbols.
Garbage collection to side-step sparse file descriptor problem.
(io_select, io_flush, io_iopfromfd): Unused, remove.
(io_open): Allow more than one open for the same file descriptor.
The check is the last remaining use of io_list[], and it's
unimportant.
(io_list, niop, io_init): io_list[] no longer serves any purpose,
remove. Sparse allocation of file descriptors (deplorable misfeature
of Winsock, at least some versions) is no longer a problem.
(getfdtablesize): Unused, remove. Was broken for Windows anyway.
(io_open, io_iopfromfd): Properly check argument FD to protect
io_list[] indexing.
(niop, io_init): Store length of io_list[] in new niop.
(player_accept): Checking the socket file descriptor here is now
redundant. Remove.
(landmine): Add a missing call of putland(). Closes #682570. Don't
complain about running out of things when the job actually completed
fine. From Marc Olzheim.
(map): Reject flags `t' and `r' unless it's a bmap command. Both used
to change the map command into the corresponding bmap command, which
was undocumented and didn't make sense. From Marc Olzheim.
(wrgamesdef): Generate EMPDIR instead of EMPPATH(). Change callers of
EMPPATH() to use EMPDIR. This avoids triggering MSVC bugs, and drops
support for traditional, pre-ISO cpp. Closes #753935.
(gamedir, lostfil, playerbin, updatebin): Unused, remove.
(file_lock, file_unlock, ef_lock, ef_unlock, commlock, communlock):
File locking doesn't make sense, must be a leftover from the distant
past. Remove. Callers changed.
(take_move_in_mob): Automatic fortification on excess mobility may
fortify units while they are `at the prompt'. That's okay. But
action that consumes mobility must zap the fortification again.
Use strict & warnings. Fix several minor bugs uncovered by it.
Semantics of assigning to $[ changed in Perl 5, and its use is `highly
discouraged'. Programs obviously assumed $[ affects all arrays, but
it doesn't in Perl 5. If these programs ever worked, then certainly
not with Perl 5. Remove the assignments and shift indexes
accordingly.
(guerrilla): Give wandering che inexact, somewhat randomized
information on military. Closes #750533. Why? Wandering che pick a
sector with minimal military from the adjacent sectors that can get
che. Ties are broken in favour of the first sector examined. Since
sectors are examined in the order given by by diroff[], che prefer
directions with low index in diroff[]. This tends to channel che
towards the northeast. But the change makes ties very unlikely.
(lnd_sweep, lnd_mar_one_sector): Automatic fortification on excess
mobility may fortify units while they are `at the march prompt'.
That's okay. But action that consumes mobility must zap the
fortification again.