aboutsummaryrefslogtreecommitdiff
path: root/galaxies.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-02-18 07:14:05 +0000
committerSimon Tatham <anakin@pobox.com>2023-02-18 08:55:13 +0000
commit873d613dd597f550b1b64946c4577b012d61d1c9 (patch)
treee6c458a8dfc349ca4be8755f3bcc26658e0958d7 /galaxies.c
parentdbced097ac16973f648ad2f024cc2302fa187578 (diff)
downloadpuzzles-873d613dd597f550b1b64946c4577b012d61d1c9.zip
puzzles-873d613dd597f550b1b64946c4577b012d61d1c9.tar.gz
puzzles-873d613dd597f550b1b64946c4577b012d61d1c9.tar.bz2
puzzles-873d613dd597f550b1b64946c4577b012d61d1c9.tar.xz
Fix missing statics and #includes on variables.
After Ben fixed all the unwanted global functions by using gcc's -Wmissing-declarations to spot any that were not predeclared, I remembered that clang has -Wmissing-variable-declarations, which does the same job for global objects. Enabled it in -DSTRICT=ON, and made the code clean under it. Mostly this was just a matter of sticking 'static' on the front of things. One variable was outright removed ('verbose' in signpost.c) because after I made it static clang was then able to spot that it was also unused. The more interesting cases were the ones where declarations had to be _added_ to header files. In particular, in COMBINED builds, puzzles.h now arranges to have predeclared each 'game' structure defined by a puzzle backend. Also there's a new tiny header file gtk.h, containing the declarations of xpm_icons and n_xpm_icons which are exported by each puzzle's autogenerated icon source file and by no-icon.c. Happily even the real XPM icon files were generated by our own Perl script rather than being raw xpm output from ImageMagick, so there was no difficulty adding the corresponding #include in there.
Diffstat (limited to 'galaxies.c')
-rw-r--r--galaxies.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/galaxies.c b/galaxies.c
index d69ed84..a789349 100644
--- a/galaxies.c
+++ b/galaxies.c
@@ -1278,7 +1278,7 @@ static bool generate_try_block(game_state *state, random_state *rs,
}
#ifdef STANDALONE_SOLVER
-int maxtries;
+static int maxtries;
#define MAXTRIES maxtries
#else
#define MAXTRIES 50
@@ -3869,7 +3869,7 @@ const struct game thegame = {
#ifdef STANDALONE_SOLVER
-const char *quis;
+static const char *quis;
#include <time.h>