Commit graph

4874 commits

Author SHA1 Message Date
58a6e7270f info: Fix option NOMOBCOST misinformation
The cost of firing naval guns is 15 mobility with option NOMOBCOST
disabled.  Mobility.t is correct.

Fix Options.t not to claim submarines pay half the sector movement
cost when NOMOBCOST is enabled.

Fix fire.t not to claim ships pay half the sector movement cost when
NOMOBCOST is disabled.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:41:15 +01:00
00abc9616d info/Options: Nicer markup, more consistent format
Don't list options separately for major server versions.  It's only of
historical interest, which "info History" satisfies.

Make it a list (.L) instead of preformatted text (.nf).

Fix up so the option explanations are full sentences, starting with a
capital letter and ending with a period.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:41:15 +01:00
b1525ef272 info/Options: Belatedly remove SAIL
Missed in commit dc73207.

Reported-by: Harald Katzer
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:41:15 +01:00
6986ac4778 lwp: Rename LwpSigCatched to LwpSigCaught
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:41:15 +01:00
6b6708a01b docs/coding: Explain function/struct/union comment conventions
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:41:15 +01:00
eba87789ab Fix and clean up some comments
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:31:08 +01:00
9f25de3dce Change comment style to use @foo rather than FOO
... when referring to a function's parameter or a struct/union's
member.

The idea of using FOO comes from the GNU coding standards:

    The comment on a function is much clearer if you use the argument
    names to speak about the argument values.  The variable name
    itself should be lower case, but write it in upper case when you
    are speaking about the value rather than the variable itself.
    Thus, "the inode number NODE_NUM" rather than "an inode".

Upcasing names is problematic for a case-sensitive language like C,
because it can create ambiguity.  Moreover, it's too much shouting for
my taste.

GTK-Doc's convention to prefix the identifier with @ makes references
to variables stand out nicely.  The rest of the GTK-Doc conventions
make no sense for us, however.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:13:17 +01:00
5cff5022a9 configure: Suppress Clang warning on carg()
Renaming carg() would be smarter, but I'd rather do that as part of a
consistent renaming of all command functions, and I'm not up to that
right now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:11:37 +01:00
b824134240 configure: Enable -Wformat-security
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:11:37 +01:00
b34cbad683 pr: Make prdate() more obviously correct
Using ctime() as pr()'s first argument is safe, because its value
never contains '%'.  Clean it up anyway, so we can enable
-Wformat-security.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:11:37 +01:00
d9837728c2 configure: Enable more gcc warnings
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:11:37 +01:00
23373d01d9 configure: Test compiler flags
When AC_PROG_CC detects GCC, Make.mk adds a bunch of flags to CFLAGS.
Works only for flags that any version of gcc in use accepts.

Instead, make configure add the flags that actually work to CFLAGS.
This will let us add flags that work only for some compilers.

The new autoconf macros are from autoconf-archive v2015.02.24.

Unfortunately, AX_APPEND_COMPILE_FLAGS doesn't work reliably for
-Wno-*: gcc complains about unknown -Wno-foo only when other
diagnostics are being produced.  Test -Wfoo instead of -Wno-foo, and
rename to MY_APPEND_COMPILE_FLAGS.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-11-22 10:23:54 +01:00
35f34581be configure: Drop unused AC_C_CHAR_UNSIGNED test
Unused since commit 0c8c169. v4.3.3.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-06-06 15:49:28 +02:00
87d08a4584 Bump version to 4.3.34
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-06-04 10:52:11 +02:00
00985535de Update change log timestamp for 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-20 20:20:40 +02:00
fff177be2f Revert "commands: Always put ship or land unit before retreating it"
This reverts commit f4d8d64bb3.

Breaks retreat after ship got sunk by bombs or missile.

ship_bomb() and launch_missile() pass .shp_own to retreat_ship().
Wrong after putship(), because putship() resets the owner when the
ship got sunk.  retreat_ship() then oopses and fails to retreat the
surviving members of the group.

Other callers save the owner before putting the ship, and pass that.
We could change these two to do the same.  But since we're trying to
get a release out, simply revert the broken commit instead.
2015-05-17 18:11:20 +02:00
1c9fb831ed Tidy up some comments
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-17 18:08:45 +02:00
5b9b4c3c89 Update change log again for 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:49:12 +02:00
341b1b4d15 Improve portability to really outmoded compilers
A few modernisms have crept in:

* Trailing comma in enum definition (commit 71320ed, v4.3.10)

* // comment (commit 265e71e, v4.3.11)

* <stdint.h> (commit 9102ecc, v4.3.31)

  MSC actually chokes on this one.

Avoid them.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:48:57 +02:00
7f68f37433 xundump: Pass unsigned * for scanf directive %3o, not int *
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:48:57 +02:00
a96c43c723 rdsched: Pass unsigned * for scanf directive %u, not int *
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:48:57 +02:00
05fe8b771c info/History: Cover removal of Autonav, SAIL and TREATIES
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:48:35 +02:00
a455169edd w32/strptime: Fix for 64 bit pointers
The __UNCONST() stolen from NetBSD assumes unsigned long can hold a
pointer.  Not true with Win64's LLP64 data model.  There, we cast the
64 bit pointer to 32 bits and back.  Works only because Windows puts
the stack at a very low address, and the casts don't actually change
the pointer.

Dumb it down to a straight cast to void * for safety.

Thanks to Harald Katzer and Ron Koenderink for their help figuring out
the bug's impact.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:39:19 +02:00
953ff83fb1 Update change log again for 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-13 07:07:03 +01:00
884dd4d532 INSTALL: Refresh from automake 1.13
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 18:23:33 +01:00
64f32cde53 man: Get rid of unwanted space in SYNOPSIS
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 17:48:17 +01:00
Marisa Giancarla
0a6eb70b28 client: New option -r for restricted mode
Redirections and the execute command let the user read and write files
and run programs on the local system.

Restricted mode prevents such access.  This is useful when you want to
grant somebody access to just Empire, but not to the host system's
user account that runs the client.

Signed-off-by: Marisa Giancarla <fstltna@me.com>
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 17:30:46 +01:00
89b76644b2 torpedo mission: Print rounded, not truncated hit chance
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 14:58:04 +01:00
bfea5a2cf4 build: Fix inexact calculation of required materials
sector_can_build() computes mat[i] * (effic / 100.0).  The division is
inexact.  The result gets randomly rounded, so errors are vanishingly
unlikely to screw up material consumption.

However, we require the amount rounded up to be present since commit
1227d2c.  Errors *can* screw that up.  Fix by avoiding inexact
computation for that part.

We should probably review rounding of inexact values in general.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 14:06:02 +01:00
c869c868e2 tests/README: Cover info.ps and document .NA use for commands
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 12:44:02 +01:00
8ca51001f0 tests/README: Update for replacement of info/checklist.pl
Replaced by tests/info-test in commit 90eaf9d.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 12:42:00 +01:00
3f52b38294 build-aux: Refresh from automake 1.13
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-07 10:44:21 +01:00
9f1da0882e m4: Refresh from autoconf-archive v2015.02.24
commit dd946914edb9da25e2d8c8b2186fab5d8103f3d4
Author: Daniel Richard G <skunk@iSKUNK.ORG>
Date:   Thu Oct 3 18:56:24 2013 +0200

    AX_PTHREAD: add support for Clang

    Further details can be found at <http://savannah.gnu.org/patch/?8186>.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-04 20:10:13 +01:00
0748a74b5d tests: Rewrite the previous commit's sed_i helper
Last night's version looks unnecessarily ugly in the morning.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-04 08:15:13 +01:00
7d249141be tests: Avoid non-portable sed -i
Crept in in commit 7c3186f.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-03 20:45:07 +01:00
dc6cffa131 tests: Fix for builds outside git-controlled source tree
We run "git ls-files" in the build tree.  Doesn't work when the source
directory isn't a git repository, or the build directory is outside
the source directory.  Broken in commit 71cb2d8.

Find source files like Make.mk does: if the source tree is a git
repository, use git ls-files, else use sources.mk.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-03 20:18:38 +01:00
deabb8eda6 Belatedly bump version to 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 21:16:27 +01:00
0d99ced788 bridgefall: Clean up literal 20 to SCT_MINEFF
Messed up in commit 4824648.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
bb3618929a Update change log for 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
8cb0a7fa0f add: Drop syntax deprecated in 4.3.29
Deprecated in commit 373f20a: argument "new".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
5400fd87a5 subs/move: Drop syntax deprecated in 4.3.27
Deprecated in commit 28d4847: no space between 'm' and its first
argument.  Affects explore, move, test, transport.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
f374ef64dd maps: Drop bmap flags syntax deprecated in 4.3.27
Deprecated in commit a00f9e2: 'r' with flags, and bad flags after 't'.
Affects flags argument of bmap, sbmap, pbmap, lbmap, nbmap, and
navigate and march sub-command 'B'.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
f150d9cb9f info/fire: Drop misinformation on damage varying with gun size
Goes all the way back to Empire 1, and as far as I can tell was
misleading there already.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
51f101df21 info/fire info/torpedo: Purge references to option MULTIFIRE
MULTIFIRE became non-optional in Chainsaw 3, more than two decades
ago.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
e60f0be73f emp_config: Don't monkey-patch WORLD_X to be even
emp_config() silently truncates WORLD_X to even.  Drop that.  We could
flag odd WORLD_X as error, but we don't validate the other
configuration values, so why this one?  Instead document it needs to
be even.  WORLD_Y, too.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
ab82a804a6 ef_verify: Polish product error message
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
a4a25df2f4 init ef_verify: Don't monkey-patch capability VTOL, require it
A plane with capability missile must have capability VTOL.  When it's
missing, global_init() silently adds it.

Drop that.  Check for it in ef_verify_config() instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
c0c58222bc init ef_verify: Don't monkey-patch capability miss, require it
A ship with non-zero nplanes must have capability plane or miss.  When
one doesn't, global_init() silently adds capability miss.

Drop that.  Check for it in ef_verify_config() instead.  Fix up
ship.config accordingly.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
c3a26dc899 ef_verify: Require ship glim != 0 with capability dchrg
Because the fire command doesn't work with zero glim (commit a109de9).

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
0e24049ce4 torpedo: Suppress bulletin when player torpedoes his own ship
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00