From 873d613dd597f550b1b64946c4577b012d61d1c9 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 18 Feb 2023 07:14:05 +0000 Subject: 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. --- pattern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pattern.c') diff --git a/pattern.c b/pattern.c index 1342cb6..cdd8fe6 100644 --- a/pattern.c +++ b/pattern.c @@ -363,7 +363,7 @@ static int compute_rowdata(int *ret, unsigned char *start, int len, int step) #define STILL_UNKNOWN 3 #ifdef STANDALONE_SOLVER -bool verbose = false; +static bool verbose = false; #endif static bool do_recurse(unsigned char *known, unsigned char *deduced, @@ -724,7 +724,7 @@ static unsigned char *generate_soluble(random_state *rs, int w, int h) #endif #ifdef STANDALONE_PICTURE_GENERATOR -unsigned char *picture; +static unsigned char *picture; #endif static char *new_game_desc(const game_params *params, random_state *rs, -- cgit v1.1