Split ef_init() into two functions: empfile_init() for initialization,
and empfile_fixup() to fix it up for configuration. Put them next to
empfile[]. Move the call to empfile_init() from behind emp_config()
to before it.
(isok, ef_init, bmaps_intersect, bp_init, player_accept)
(finish_sects, main): Use it.
(bp_neighbors, bp_lbcost, pathcost): Use XYOFFSET(). No
functional change.
separate the MinGW environment from the MSVC environment and
WIN32 environment. Reorganize the order of the includes so
the system files are always loaded first to prevent with misc.h defines.
Remove system file includes from misc.h.
other. Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special). New header types.h to
help avoid inclusion cycles. Sort include directives. Remove some
superflous includes.
(ltend, multifire, quite_bigdef, mine, landmine)
(do_loan, prod, printdiff, sell, sona, stre)
(tend, fire_dchrg, vers, work, ac_planedamage)
(ac_shipflak, ask_off, get_mine_dsupport, att_fight)
(ask_move_in_off, detonate, sd, land_gun)
(land_unitgun, lnd_fort_interdiction, lnd_fortify)
(perform_mission, pln_mine, pln_mobcost)
(retreat_ship1, retreat_land1, shp_sweep)
(shp_fort_interdiction, shp_missle_defense)
(new_work, growfood, upd_land, land_repair)
(get_materials, do_mob_ship, do_mob_land)
(load_it, unload_it, prod_plane, produce)
(guerrilla, upd_buildeff, spread_fallout)
(upd_ship, ship_repair, min, dmin, MIN):
Remove min() and dmin() functions and replace
with a MIN macro in misc.h. Remove local MIN
macros and use the new one in misc.h. This
change removes the need for the special
case for _WIN32.
(fuel, look_ship, multifire, mission, sona)
(plane_sona, ef_open, player_accept, player_main)
(ac_dog, att_get_combat, calc_mobcost)
(ask_move_in_off, intelligence_report)
(build_mission_list_type, perform_mission)
(show_mission, use_supply, dodistribute)
(allocate_memory, max, dmax, MAX):
Remove max() and dmax() functions and replace
with a MAX macro in misc.h. Remove local MAX
macros and use the new one in misc.h. This
change removes the need for the special
case for _WIN32.
check both EAGAIN and EWOULDBLOCK. These are distinct on some
systems, e.g. HP-UX.
(io_output) [hpux]: Used to treat all errors as EWOULDBLOCK. This
looks like a inept attempt to `fix' the above. Remove.
(PTR_CACHE): Rename.
(ARRAY_CACHE): New.
(empfile): Use it to set csize of elements EF_SHIP_CHR, EF_PLANE_CHR,
EF_LAND_CHR, EF_NUKE_CHR.
(ef_init_chr): Now that empfile[]'s initializer sets csize, remove the
temporary csize initialization here. The value wasn't correct, but
better than nothing.
members.
(empfile): Reorder members for clearer documentation.
(EFF_IMMUTABLE): New.
(EFF_OPEN): Remove, use ~EFF_IMMUTABLE.
(empfile): Don't initialize member size to a useless value for EF_MAP
and EF_BMAP. ef_init() writes the real value.
one of its prefixes. src/lib/global/file.c rev. 1.18 added such table
entries, and file.h rev. 1.34 made them visible to ef_byname().
Simply use stmtch(). This also rejects ambiguous abbreviations: "s"
used to return EF_SECTOR, it now returns M_NOTUNIQUE.
(set, mission, multifire, fuel, cons_choose, cede): Use it instead of
ef_byname(). Remove the hacks to map unwanted results to wanted
results. The hacks in set() were broken: bad input made the code cast
arbitrary items to union trdgenstr, with potentially disastrous
consequences. Closes#906483 and #906486.
(set): Less cryptic prompt and diagnostics.
(ef_read): Used to get the file size again some circumstances; doesn't
make sense, as no other process may be writing this file.
(ef_write): Don't refuse to write beyond record 65536. This module
can cope with that. Some users have trouble long before that (short
record numbers), but that should be handled there.
(ef_write): Catch table not file-backed.
Catch negative count; used to have no effect with EFF_MEM, and
confusion otherwise. Try to recover from partially successful
extension. Need help from ef_write() to do a better job; to be done.