Commit graph

1174 commits

Author SHA1 Message Date
95ef2b139d (ITEM_MAX): New, value 9999.
(give, deliver_it): Use it instead of 9990.
(load_comm_ship, load_comm_land, rese): Use it instead of 9999.
(thre): Use it instead of 10000.
(check_market, explore, move, pln_dropoff): Use it instead of 32767.
(unload_it): Use it instead of 99999 (which couldn't possibly work,
but what do you expect from the autonav code).
2004-03-05 06:34:34 +00:00
abd1fd2c1e (FALLOUT_MAX): New.
(doland, detonate, spread_fallout): Use it.  With variables, fallout
beyond the capacity of variables (65535) was ignored, except in
doland(), where it saturated at 9999, and spread_fallout, where it
could overflow.  Now it always saturates at FALLOUT_MAX.
2004-03-04 16:19:50 +00:00
828b84d840 (MINES_MAX): New.
(doland, mine, landmine, setsector, pln_dropoff): Use it.  With
variables, mining beyond the capacity of variables (65535) was
ignored.  Now the mines saturate at MINES_MAX.
2004-03-04 15:54:46 +00:00
7cd66c0f70 (pln_dropoff): Restructure for clarity and to avoid `might be used
uninitialized' warning.
2004-03-04 15:45:34 +00:00
5bad9875a5 (sctstr): Member sct_che encoded number of che and their target.
Simplify.  Split into member sct_che (number) and sct_che_target.
Users changed.
(get_che_cnum, set_che_cnum, get_che_value, get_che_value): Che
encoding/decoding functions; remove.
(CHE_MAX): Move from var.h to sect.h.
(prsect, doland): Print / edit the new field.
2004-03-04 13:49:25 +00:00
eccc5cb7d7 Sectors need space for items, deliveries and distribution thresholds.
To save space, the ancients invented `variables': a collection of
key-value pairs, missing means zero value, space for `enough' keys.
This complicates the code, as assigning to a `variable' can fail for
lack of space.  Over time, `enough' increased, and for quite some time
now `variables' have been *wasting* space.  This changeset replaces
them, except in struct mchrstr, struct lchrstr and struct pchrstr,
where they are read-only, and will be replaced later.  It is only a
first step; further cleanup is required.  To simplify and minimize
this necessarily huge changeset, the new item[] arrays have an unused
slot 0, and the old variable types V_CIVIL, ... are still defined, but
must have the same values as the item types I_CIVIL, ...
2004-03-03 16:54:22 +00:00
c530a3b980 (genobject, genchrstr): Unused, remove. 2004-03-03 10:23:07 +00:00
08e182e132 (fileinit): Invalid cast sct_init(); a call couldn't possibly work.
Luckily, it isn't called.  Remove.
(ef_fileinit): Unused, remove.
2004-03-03 10:17:53 +00:00
42290db8c8 (nameofitem, produce, check, fire_dchrg, send_reacting_units_home,
do_map_set, upd_land, nav_check_atdest, produce, upd_ship): Remove
unused parameters.  Callers changed.
2004-03-03 09:39:50 +00:00
19acc1cd07 (diss, player_coms): Command `dissolve' has been disabled at least
since the days of Chainsaw (early '90s), and the code smells bad.
Bury it.
2004-03-03 08:20:45 +00:00
bb811df758 (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".
2004-03-01 17:21:40 +00:00
98b392d72c (CHE_MAX): Don't define twice, define once in a header.
(get_che_cnum, set_che_cnum, get_che_value, set_che_value): Remove
redundant definitions.
2004-03-01 13:32:06 +00:00
0c19d70c74 (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.
2004-03-01 09:04:02 +00:00
d500806bc8 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.
2004-02-29 11:41:08 +00:00
97e221baae Remove some unused stuff, mostly Empire 3 leftovers. 2004-02-28 09:45:10 +00:00
3d0178b994 (NSC_OPMASK, NSC_ISNUM1, NSC_ISNUM2, nscstr, nstr_comp, nstr_exec):
Simplify encoding of struct ncstr member oper.
2004-02-28 08:49:39 +00:00
bd54488715 (NSC_ROUND): No effect, remove. 2004-02-28 08:40:53 +00:00
d2e0c8224b Delete dead code, fix indentation, spelling, obvious warning
avoidance, doc fixes.  No functional changes.
2004-02-27 20:13:28 +00:00
f5e49a830c (sct_typematch): New. Use it instead of typematch() where
appropriate.
(typematch): Prefer exact match to partial match.  Use plain char
instead of s_char.
2004-02-27 19:53:02 +00:00
844b654d44 (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.
2004-02-27 19:38:38 +00:00
aafc693026 Remove junk at end of #endif. 2004-02-24 18:26:34 +00:00
c53438e7a0 (ef_ensure_space): New.
(edit): Use it to to fix copying to virgin unit slot.  Closes #896475.
From Ron Koenderink.
2004-02-24 18:19:57 +00:00
c1be5d8657 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.
2004-02-20 20:45:18 +00:00
46da1aec7a deity.h is redundant, remove it. 2004-02-20 20:34:43 +00:00
b6c67c884f Fix the previous rev. 2004-02-20 19:24:43 +00:00
4a3f0b8146 Add some missing declarations to headers. Remove some redundant
declarations elsewhere.  Change linkage of some functions to static.
2004-02-20 10:51:03 +00:00
8d438a4601 (loginit, main): Pass log file basename as parameter.
(logerror): Require prior call of loginit().
(empth_exit) [_EMPTH_WIN32]: Don't print the log file name here, it's
not modular.
(program, getlogfile): Unused, remove.
2004-02-19 21:15:16 +00:00
6482ed03d1 (player_coms): Declaration in com.h was misspelled. Remove redundant
declarations elsewhere.
2004-02-19 20:38:02 +00:00
c28f377fe9 (bitinit2): Move from common/maps.c to getbit.c, external linkage.
(bitmap0, bitmap1, bitmap2, bitmap3, bitmap4, bitmaps): Static
linkage.
2004-02-19 19:59:45 +00:00
c8bb4d9b87 (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.
2004-02-19 19:14:29 +00:00
22a356b1e1 New server.h for server startup, control and shutdown, i.e. stuff in
src/server.  Use it.
2004-02-19 19:02:30 +00:00
9491e2e7fc Remove useless user.h. 2004-02-19 18:10:27 +00:00
2c5a4b4563 Declare update related variables in budg.h. Remove some redundant
declarations elsewhere.
2004-02-19 17:28:03 +00:00
966eb40899 Declare all configuration parameters in optlist.h. Remove some
redundant declarations elsewhere.
2004-02-19 16:46:18 +00:00
bfcfaf08c2 Properly declare stuff in headers; remove redundant declarations. 2004-02-19 16:25:14 +00:00
21f4dc4f0f Declare command functions in commands.h. Delete their declarations in
empmod.c
2004-02-18 19:35:49 +00:00
d2244b6c24 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.
2004-02-18 19:04:01 +00:00
7aafe31f70 (count_planes): Remove declaration. A prototype would need struct
shpstr, but not struct plnstr, which is a strong sign it doesn't
belong here.
2004-02-18 11:35:25 +00:00
97843dfdf6 [_EMPTH_WIN32]: Previous rev. didn't even compile, fix. 2004-02-18 07:12:51 +00:00
8cd0160176 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.

(set_option, delete_option, optstrset, intset, floatset, doubleset,
longset, optionset, optiondel, worldxset): Change linkage to static.
2004-02-17 22:58:04 +00:00
e446bfd904 (empth_t, empth_sem_t) [_EMPTH_WIN32]: Use incomplete types, not void for
abstract data types.
2004-02-17 18:05:23 +00:00
237baffca9 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.
2004-02-17 17:59:30 +00:00
cc5d78c2f0 (move_ground): Remove superflous parameter `mobility'. Callers
changed.  Edit for clarity.  No functional changes.
2004-02-15 21:27:41 +00:00
4fa84b5cb1 (emp_sig_t): Pre-ISO C compatibility cruft. Just use void. 2004-02-15 21:00:27 +00:00
cbf9d68372 Don't fool around with obsolete strings.h, just include standard
string.h.
2004-02-10 18:17:34 +00:00
fa3675836a Fix the previous revision. 2004-02-10 13:57:23 +00:00
ffcf6bff0f (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.
2004-02-07 02:01:47 +00:00
024fa262f7 Update for 4.2.13. 2004-02-07 01:22:53 +00:00
d8983db308 (show, show_item): No new `show' features without matching machine
readable dumps.  Back out `show item' for 4.2.13.
2004-02-07 00:27:45 +00:00
32fac041b2 (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.
2004-02-06 23:42:36 +00:00