Commit graph

146 commits

Author SHA1 Message Date
5b4b3a13cb Break lines more tastefully. 2006-05-14 07:52:20 +00:00
7a99405942 Do not cast to float where usual arithmetic conversions obviously
convert the cast's result to double.  Such casts are ugly and may lose
precision.
2006-05-06 08:26:31 +00:00
5982d38248 (ask_olist, att_fight): Oops on bad combat mode. Fixes compiler
warnings.
2006-04-30 11:35:53 +00:00
67408f444e (att_ask_offense, ask_move_in): land_answer[] is indexed by army
character, reduce size accordingly.

(att_prompt, ask_move_in_off): Remove dead code.

(att_reacting_units): Simplify.
2006-04-30 08:53:22 +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
d852f05a2a (att_prompt): Do the right thing when player aborts. Simplify. 2006-04-17 17:53:16 +00:00
98d35dec3e Fix long lines. No functional changes. 2006-04-17 16:38:43 +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
21bf6b41d4 Use NULL instead of (FOO *)0, it's easier to read. 2006-03-23 20:48:49 +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
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
686eadad37 (att_mode, xyas, ownxy, prbuf): Get rid of s_char. Users changed.
(ATTRIBUTE): Don't disable use of gcc __attribute__ when s_char is
signed char.  All format strings are now char *.
2005-12-28 22:30:52 +00:00
24a07cd249 player.h rev. 1.9 changed struct player member argp to char *. The
changeset failed to adapt some s_char * operands.  Fix.
2005-12-28 22:21:42 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
687cacd887 (SNEAK_ATTACK, opt_SNEAK_ATTACK, Options, do_sneak, att_abort)
(att_fight): Remove option SNEAK_ATTACK.
2005-10-02 14:35:18 +00:00
0c8f779356 (att_get_combat): Fix test whether land unit exists. Closes #1034283.
(att_fight): Fix bad line break.
2005-10-01 16:39:41 +00:00
786b34c693 (SHIPNAMES, opt_SHIPNAMES, Options, carg, name, sorde, qorde)
(show_sail, shi, att_get_combat, pr_com, satdisp, satmap, prship):
Remove nooption SHIPNAMES.
2005-07-31 17:22:32 +00:00
380b063f9c Remove some redundant parenthesis; no functional change. 2005-07-23 19:48:35 +00:00
78e880a608 (att_move_in_off): When boarding from a sector, mil entering the ship
less one were not removed from the sector.  The problem is putsect()
overwriting data from prior put_combat() with old data.  Broken in
rev. 1.17.  Change lunchbox code to match that of 1.16.  Closes
#1219918, reported by Doug Wescott.
2005-06-18 16:52:17 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
2508364945 (lnd_support): New parameter defending, to report defensive support in
the news correctly, like dd() and sd() do.  Reported by Doug Wescott.
2005-05-24 18:38:36 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
7e402f062c Fix bad line break / whitespace. No functional changes. 2005-02-23 15:41:22 +00:00
Marc Olzheim
39facfbf53 (var.h, plague.h): Since all that was left in var.h were some plague
defines, import these defines into plague.h, drop var.h and include
plague.h where appropriate.
Remove some 'register' keywords at the same time.
No functional changes.
2004-10-12 20:25:33 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
8ef7f35a56 (V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_PETROL, V_IRON, V_DUST, V_BAR,
V_FOOD, V_OIL, V_LCM, V_HCM, V_UW, V_RAD, V_ITEM): Remove, use item
types instead.
2004-08-17 16:12:31 +00:00
8a0854b6b8 (mchrstr, lchrstr): Change from variable-style storage of load
capacities to straight arrays.  Users now subscript the array instead
of calling vl_find() or walking the variable data structure.
(mchr, lchr): Initializers adapted.
(vl_find): No longer used.  Remove file.
2004-08-17 14:09:04 +00:00
733aff63ed (att_move_in_off): Don't put more than ITEM_MAX food into the
assaulted sector.  Simplify some more.
2004-03-05 13:14:28 +00:00
ebb472ed58 (att_move_in_off): The lunchbox code was unnecessary general,
therefore had unreachable code.  Which was also buggy.  Simplify.
2004-03-05 13:04:12 +00:00
99bfa19a92 (getilist, att_get_combat): Simplify. No functional changes. 2004-03-05 08:05:58 +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
37ebd826c4 Fix the previous rev. 2004-02-28 19:11:24 +00:00
e67dca9d29 Indentation fixes; suspect indent-emp is to blame. 2004-02-28 18:06:11 +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
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
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
a52a09be1f (take_move_in_mob): Automatic fortification on excess mobility may
fortify units while they are `at the prompt'.  That's okay.  But
action that consumes mobility must zap the fortification again.
2004-01-29 11:55:26 +00:00
e50e1b4b35 (ask_olist): Fix reporting of mobility required for attack. Closes
#798045.
2004-01-12 20:13:28 +00:00
4ae9c417b3 (bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
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.
2004-01-08 17:54:28 +00:00
32c38f795c Spelling fix. 2003-11-09 10:46:32 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00