Commit graph

58 commits

Author SHA1 Message Date
cd73a47dfa Remove superflous casts and parenthesis. 2006-05-21 12:24:30 +00:00
16b9c41b39 (shp_mobcost): New.
(use_ammo, eta_calc, torp, fire_torp, perform_mission, retreat_ship1)
(shp_sweep, shp_nav_one_sector, cost_ship): Use it.

(perform_mission): Fix mobility cost of torpedo: charged full sector
cost instead of half.
2006-05-20 19:28:29 +00:00
2cd8e99f49 (oprange): Fix for non-missile planes: round pln_range/2 down, not up.
Planes didn't actually fly to the incorrect range, but mission showed
it.
2006-05-20 17:34:32 +00:00
2732ac5d1d (lnd_getmil, total_mil): Trivial, inline into callers and remove. The
abstraction from actual land unit mil encoding provided by them was
too leaky to be relied upon anyway.
2006-05-20 16:39:58 +00:00
a50ae4a3d8 (effrange, torprange, fortrange): New.
(multifire, quiet_bigdef, torp, anti_torp, sd, sb)
(lnd_fort_interdiction, lnd_support, perform_mission, oprange)
(shp_fort_interdiction): Use them.  This fixes forts shooting below
FORTEFF in quiet_bigdef(), lnd_fort_interdiction() and
shp_fort_interdiction().  Change variables for rounded ranges to int.

(quiet_bigdef, sd): Don't scale ship firing range by efficiency.

(dd, sb): Simplify.

(sb): Internal linkage.

(perform_mission): Rename range2 to vrange.
2006-05-14 14:06:00 +00:00
5b4b3a13cb Break lines more tastefully. 2006-05-14 07:52:20 +00:00
7ed308526c Remove redundant casts of argument to (prototyped) double parameter. 2006-05-01 12:34:16 +00:00
5f94d9a651 (find_escorts, perform_mission): Simplify. 2006-04-30 18:31:13 +00:00
e28851b8e9 Normalize unsigned int to just unsigned. 2006-04-30 12:26:07 +00:00
e09e6e587b Normalize long int and short int to just long and short. 2006-04-30 12:05:23 +00:00
0c8c169f88 (s_char): Remove. Use signed char for small integers, plain char for
characters.
2006-04-29 16:25:17 +00:00
a988b907fc s_char purge directed by compiler warnings. 2006-04-29 06:41:45 +00:00
9c27a771b3 (BestAirPath): Some callers assumed non-null return value must be the
first argument.  Fix them.  Simplify bestownedpath().
2006-04-05 09:13:03 +00:00
4895745773 (build_mission_list_type): Simplify.
(show_mission): Plug memory leak.
2006-03-29 19:46:39 +00:00
9847e27a2f (genlist): Move from include/mission.h to src/lib/subs/mission.c.
(genlist): Remove unused members x, y.

(genlist): Use void * for generic pointer members cp, thing.  Change
users not to cast.

(oprange): Oops on bad argument.
2006-03-29 07:53:25 +00:00
b49bfd7814 (unit_interdict, knockdown): Simplify. No functional change. 2006-03-26 13:55:29 +00:00
0d0a305bf3 Remove silly superflous parenthesis. 2006-03-26 07:46:49 +00:00
79714720cc (ontradingblock, trdswitchown): Second parameter is a generic pointer,
change it from int * to void *.  Callers changed not to cast to int *.
2006-03-25 15:11:17 +00:00
783b00bbad (ichrstr): Rename member i_vtype to i_uid.
(ichr_ca): Rename selector vtype to uid.
2006-02-20 05:35:58 +00:00
Ron Koenderink
eca40469e7 (perform_mission): Disqualify land units from performing
missions when they are on ship or a train.
2006-02-12 20:37:27 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
21e3c9d55e Avoid compiler warnings triggered by the previous revision. 2006-01-14 16:13:30 +00:00
Ron Koenderink
04a8b84592 (ship_bomb, deli, do_demo, fuel, grin, look_ship)
(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.
2006-01-12 14:23:55 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
acd2c7c2a8 (cuto, show_mission): Fix justification of coordinate output. 2005-12-30 17:28:24 +00:00
aff6cfcafe src/lib/commands/sona.c rev. 1.6 changed first argument of
line_of_sight() to char *.  The changeset failed to change callers.
Fix.
2005-12-28 22:43:39 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
8e16ae9e43 Remove superflous #include "options.h". 2005-12-23 11:04:56 +00:00
Ron Koenderink
1b74e7ac42 (mission_short_name): Remove mission_short_name, not used. 2005-11-04 18:27:28 +00:00
d71ab5a3e5 (perform_mission): Do not pass the sub-owner to nreport(). News
doesn't show it, but selectors do.  Reported by Doug Wescott.

(nreport, ncache): Catch errors like the above.  Catch bad event
argument while we're at it.
2005-11-03 17:40:16 +00:00
f7b444721b (mission_pln_equip, pln_equip): Fix the previous rev. 2005-07-09 13:32:54 +00:00
Ron Koenderink
c0d009758c (show_sect_capab, mission_pln_equip, pln_equip): Change i_type
references to use I_NONE instead of zero.  Zero has been invalid since
item.h rev. 1.12, and was questionable style before.
2005-07-07 21:57:15 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
ce6c039519 Remove some redundant casts. 2005-05-28 08:37:52 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
Marc Olzheim
61cb34b7ef (ac_airtoair): No need to pass def_own, as the owner of the intercepting
planes is used anyway.  Clean up other unaccessed variables in the process.
No functional changes.
2004-12-14 17:21:05 +00:00
Marc Olzheim
c6ef918f3a Cleanup #includes of (mostly a long time) unused header files.
No functional changes.
2004-12-13 16:47:13 +00:00
Marc Olzheim
e9a040adb9 Do not include var.h where no longer needed. Clean up register keywords in these file at the same time. No functional changes. 2004-10-12 20:08:51 +00:00
Marc Olzheim
d30942632b (I_NONE, I_CIVIL, I_MILIT, I_SHELL, I_GUN, I_PETROL, I_IRON, I_DUST,
I_BAR, I_FOOD, I_OIL, I_LCM, I_HCM, I_UW, I_RAD, I_MAX): Turn macros
into enumeration constants.
(i_type): New.  Use where appropriate.  No functional changes, except
that I_NONE is now catched properly in a few places.
2004-09-16 21:18:01 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
e1ebe41686 (M_TORP_SHELLS, SHP_TORP_SHELLS): Rename. 2004-08-17 18:45:04 +00:00
4fd7da248a (SHP_AIROPS_EFF, LND_AIROPS_EFF): New. Use it instead of literal 50. 2004-08-17 18:31:32 +00:00
d7e697b1f9 (M_TORP_SHELLS): New.
(perform_mission, torp, fire_torp, quiet_bigdef, use_ammo): Use it.
Closes #917459.
2004-05-09 20:55:30 +00:00
5fb761ab45 (pln_equip, mission_pln_equip): Work directly on item arrays instead
of copies made by getvec().  This is safe, because the old code made
single copies and always flushed them back into the unit structures
before flushing those.  Simplify.
2004-03-10 13:35:54 +00:00
e3390b9e0d (pln_equip, mission_pln_equip): Rename item to itype. Use struct
ichrstr member i_vtype instead of pointer arithmetic to map from
`struct ichrstr *' to item type.  No functional changes.
2004-03-10 13:22:48 +00:00
e7d75b2279 Use gcc function attribute `format' to catch bad format strings. Fix
them.  From Marc Olzheim.
Type modifier 'l' was missing in many places, probably rendering the
server useless on 64-bit hosts.
(ef_flush, ef_write, ef_extend, lwpCreate, lwpDestroy): Use conversion
specifier 'p' to print pointers.
(check_market): Fix display of loan amount.
(doland): Fix unescaped '%' (undefined behavior).
(ldump, ndump, pdump, sdump): Don't use flag '0' with conversion
specifier 's' (undefined behavior).
(dump, ldump, lost, ndump, pdump, sdump, empth_create, update_sched):
Cast time_t and pthread_t to long for printing.
(lwpStackCheck, lwpStackCheckUsed, finish_sects): Insert cast to fix
argument type on all platforms.
(prod): Remove extra argument.
(perform_mission, airdamage, retreat_land1, lwpReschedule): Format
string missed arguments.
2004-03-09 12:27:40 +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
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
d0cf6a0a9b Clean up switch cases: proper fall through comments, no break after
return.
2004-03-01 14:03:29 +00:00
46da1aec7a deity.h is redundant, remove it. 2004-02-20 20:34:43 +00:00