aboutsummaryrefslogtreecommitdiff
path: root/unfinished/numgame.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-02-16 21:21:15 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-02-18 00:13:15 +0000
commit0186d78da9e83103eb80b3814d4de8031f29232f (patch)
tree26774b7be7540d980a1ee5cba5d83445a528bd5b /unfinished/numgame.c
parenta7e738aceb36e4a70d41cf09a74b2d7a3af6cbe0 (diff)
downloadpuzzles-0186d78da9e83103eb80b3814d4de8031f29232f.zip
puzzles-0186d78da9e83103eb80b3814d4de8031f29232f.tar.gz
puzzles-0186d78da9e83103eb80b3814d4de8031f29232f.tar.bz2
puzzles-0186d78da9e83103eb80b3814d4de8031f29232f.tar.xz
Mark many more function (and some objects) static
I noticed commit db3b531e2cab765a00475054d2e9046c9d0437d3 in the history where Simon added a bunch of "static" qualifiers. That suggested that consistently marking internal functions "static" is desirable, so I tried a build using GCC's -Wmissing-declarations, which requires prior declaration (presumed to be in a header file) of all global functions. This commit makes the GTK build clean under GCC's -Wmissing-declarations. I've also adding "static" to a few obviously internal objects, but GCC doesn't complain about those so I certainly haven't got them all.
Diffstat (limited to 'unfinished/numgame.c')
-rw-r--r--unfinished/numgame.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/unfinished/numgame.c b/unfinished/numgame.c
index e6dc03a..b819a93 100644
--- a/unfinished/numgame.c
+++ b/unfinished/numgame.c
@@ -987,11 +987,11 @@ static void free_sets(struct sets *s)
/*
* Print a text formula for producing a given output.
*/
-void print_recurse(struct sets *s, struct set *ss, int pathindex, int index,
- int priority, int assoc, int child);
-void print_recurse_inner(struct sets *s, struct set *ss,
- struct ancestor *a, int pathindex, int index,
- int priority, int assoc, int child)
+static void print_recurse(struct sets *s, struct set *ss, int pathindex,
+ int index, int priority, int assoc, int child);
+static void print_recurse_inner(struct sets *s, struct set *ss,
+ struct ancestor *a, int pathindex, int index,
+ int priority, int assoc, int child)
{
if (a->prev && index != a->pr) {
int pi;
@@ -1066,8 +1066,8 @@ void print_recurse_inner(struct sets *s, struct set *ss,
printf("/%d", ss->numbers[2*index+1]);
}
}
-void print_recurse(struct sets *s, struct set *ss, int pathindex, int index,
- int priority, int assoc, int child)
+static void print_recurse(struct sets *s, struct set *ss, int pathindex,
+ int index, int priority, int assoc, int child)
{
if (!ss->a.prev || pathindex < ss->a.prev->npaths) {
print_recurse_inner(s, ss, &ss->a, pathindex,
@@ -1085,7 +1085,7 @@ void print_recurse(struct sets *s, struct set *ss, int pathindex, int index,
}
}
}
-void print(int pathindex, struct sets *s, struct output *o)
+static void print(int pathindex, struct sets *s, struct output *o)
{
print_recurse(s, o->set, pathindex, o->index, 0, 0, 0);
}