mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
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.
This commit is contained in:
@ -1075,7 +1075,7 @@ static int gg_best_clue(game_state *state, int *scratch, digit *latin)
|
||||
}
|
||||
|
||||
#ifdef STANDALONE_SOLVER
|
||||
int maxtries;
|
||||
static int maxtries;
|
||||
#define MAXTRIES maxtries
|
||||
#else
|
||||
#define MAXTRIES 50
|
||||
@ -2191,7 +2191,7 @@ const struct game thegame = {
|
||||
#include <time.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
const char *quis = NULL;
|
||||
static const char *quis = NULL;
|
||||
|
||||
#if 0 /* currently unused */
|
||||
|
||||
|
Reference in New Issue
Block a user