(grow_islands, set_coastal, update_coastal_flag, coast_sea_to_land)
(coast_land_to_sea): Determine sct_coastal flag when the sector type
is set. Old method only updated the sct_coastal flag when doing
cens() or a dump(). Other uses of sct_coastal could get stale values,
including selector coastal. Rework set_coastal() into NEW functions
update_coastal_flag(), coast_sea_to_land(), coast_land_to_sea() and
set_coastal(). Fix a bug where the deity designation would not
properly set the coastal flag. Fix a bug where the one sector lake
would not properly compute coastal flag. Fix a bug that makes
fairland treat the last sector it adds to an island as non-coastal.
(xdump, main): Use it.
(EF_MAX): Change to largest table ID + 1. This is now possible
because the changes above get rid of the assumption that
empfile[0..EF_MAX-1] is only game state. Code can now work on any
table using the advertized empfile interface, not just on game state.
(my_ef_byname): Remove, use ef_byname().
(really open flags, not mode) by new flags EFF_RDONLY, EFF_CREATE.
Open flags were needlessly general. Callers changed.
(empfile): Member mode now unused, remove.
when files can't be opened.
(logerror): The version from libcommon.a does the right thing since
log.c rev. 1.17. Use it, remove local version.
(log_last_commands): No longer referenced by library code, remove.
(banfil, authfil, timestampfil): Make file names relative to DATADIR.
(main): emp_server and files change to the data directory. fairland
has to write newcap_script to the initial current directory, so it
keeps it and makes file names relative to DATADIR absolute.
(fixup_files): Nothing to do, remove. This fixes the following bug:
fixup_files() formed file names by appending ep->name instead of the
base name of ep->file to datadir. Thus, fixup_files() changed file
names even when datadir had the compiled-in value. When emp_config()
couldn't open econfig, it failed to call fixup_files(), and different
file names got used. Note that with this revision the file names
revert to the names used before fixup_files() was introduced. Closes
#1146080.
(print_config): Printing file names as comments is not really useful,
remove.
(otherfiles, ofiles): Unused, remove.
(emp_config, main): Previously, pconfig had to call emp_config() even
when it didn't want to read econfig, just to run fixup_files(). This
is no longer necessary. Simplify.
(emp_config): Use it when argument is NULL. This simplifies callers
except pconfig's main(), which now has to suppress reading the default
file. Also fix callers to check the return value. Previously, a typo
could easily start a grossly misconfigured program, with potentially
disastrous results.
upda,ef_open,logerror,emp_config,match_user,show_motd,gamedown,
typed_wu,delete_old_announcements,mobility_check,mobility_init,
allocate_memory,write_newcap_script,main,files,fairland,doconfig,)
[_WIN32]: Switchback to default mode of text.
"t" (text) is not included the ISO/ANSI C standard but "b" (binary)
is included.
PRI_LBUILD): Turn macros into enumeration constants. Value
SCT_MAXDEF+1 was previously unused; use it.
(PRI_MAX): New; replacing the horrible SCT_MAXDEF+8.
(show_sect_build): Simply examine all sector types, don't skip the
first five. The code ignores them just fine.
(show_sect_build, show_sect_stats, show_sect_capab): Don't try to show
sector types beyond SCT_MAXDEF. The table has some empty extra slots,
for whatever reasons; no use examining them.
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.
(set_option, delete_option, optstrset, intset, floatset, doubleset,
longset, optionset, optiondel, worldxset): Change linkage to static.
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.
effect. Replace calls by struct assignment where possible. Replace
clear buffer, copy string to buffer by strncpy(). Use assignment to
clear when that's clearer. Replace overlapping copy through bounce
buffer by memmove(). Replace rest by standard memset() and memcpy().
Also use sizeof() instead of literal array sizes for robustness, and
instead of symbolic array sizes for clarity.