(genitem, ship, plane, land): Remove unused member sell & equivalents.
(genitem_ca, ship_ca, plane_ca, land_ca): Remove selector "sell".
(comstr, trdstr): Members trd_price, com_price have no effect. Use
them instead of trd_maxprice, com_maxprice and remove the latter.
(commodity_ca, trade_ca): Remove selector "maxprice".
(mult, player_coms): Command `mult' is disabled since 4.0.0 ('96), and
its code is obviously not in working order. Remove.
(minmult, maxmult, configkeys): Unused configuration parameters,
remove.
(tradedesc): Remove code related to mult that had no effect.
(multread, commread, commwrite, commamt, commset, multset, commprice):
Dangerous, because code bypasses ef_read() & friends, remove.
(diss): Commodity cleanup uses the above, remove. Command is disabled
and unlikely to work anyway.
inet_ntoa() is available on all machines that matter, and defining it
ourselves without adequate auto-configuration creates more problems
than it solves. In particular since we defined it with the wrong
type.
(commodity_ca): "xloc", "yloc", "xsell", "ysel" and "price" weren't
NSC_DEITY. Wrong, but commodity_ca[] is currently unused. Also
rename "xloc", "yloc" to "xsell", "ysell".
(sect_ca, genitem_ca, ship_ca, plane_ca, land_ca, nuke_ca, treaty_ca,
loan_ca, news_ca, lost_ca, commodity_ca, trade_ca, nat_ca, map_ca):
NSC_OFF was lost during Empire3, rendering the codes confusing and
harder to use. Tack it back on.
(encode, code_char): No need to fool around with NSC_OFF anymore.
These files were split a long time ago, for technical reasons which
since vanished (linking into different programs). Undo the split,
because the stuff really belongs together.
(sct_typematch): New. Use it instead of typematch() where
appropriate.
(typematch): Prefer exact match to partial match. Use plain char
instead of s_char.
(stmtch, mineq): Document. Move declaration from prototypes.h to
match.h. Use plain char instead of s_char. The code has several
thousand type errors due to s_char vs plain char; s_char must go.
(stmtch): Rewrite for clarity.
Close #803753:
(map_char): New.
(draw_map): Use it. Wilderness and plains owned by other players are
now displayed as '?'.
(radmap2): Display wilderness and plains as '?'.
(satmap): Call satdisp() for all sectors owned by other players.
Don't declare things in more than one place. Move some declarations
between headers. Code is now fully prototyped and compiles cleanly
with gcc -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
-Wredundant-decls. Closes #723788.
Declare tags.c variables in tags.h. Declare stuff with external
linkage that is not in any other header in misc.h. Remove some
redundant declarations elsewhere.
(prompt, doredir, dopipe, doexecute, output, screen, parsedelay):
Static linkage.
(effadv_list, effadv, rejects, rejectname, telnames, rea, numnames,
tennames, numstr): Replace by static local variables in their only
user.
(relates): Move from global/misc.c to common/nat.c.
(att_mode): Move from global/misc.c to subs/attsub.c.
(deli): Partial rewrite for clarity, motivated by a `might be used
unitialized' warning. Funcional change: you can now change direction
without threshold (matches documentation, clarify it anyway). Change
prompt for the third argument to reflect that. Also provide context
when prompting for the fourth argument; this is sorely needed we
didn't prompt for the third argument.
Make users of struct cmdstr agree on prototype of member c_addr.
(player_login): Use player->argp[] to store arguments.
(client_cmd, user_cmd, sanc_cmd, coun_cmd, pass_cmd, play_cmd,
kill_cmd, list_cmd, quit_cmd): Remove parameters, fetch arguments from
player->argp[].
(cmdstr): Prototype member c_addr.
(play_cmd): Used to silently ignore up to two arguments if there
wasn't a third one. Don't.
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.