mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
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.
This commit is contained in:
4
sort.c
4
sort.c
@ -93,14 +93,14 @@ void arraysort_fn(void *array, size_t nmemb, size_t size,
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
int testcmp(const void *av, const void *bv, void *ctx)
|
||||
static int testcmp(const void *av, const void *bv, void *ctx)
|
||||
{
|
||||
int a = *(const int *)av, b = *(const int *)bv;
|
||||
const int *keys = (const int *)ctx;
|
||||
return keys[a] < keys[b] ? -1 : keys[a] > keys[b] ? +1 : 0;
|
||||
}
|
||||
|
||||
int resetcmp(const void *av, const void *bv)
|
||||
static int resetcmp(const void *av, const void *bv)
|
||||
{
|
||||
int a = *(const int *)av, b = *(const int *)bv;
|
||||
return a < b ? -1 : a > b ? +1 : 0;
|
||||
|
Reference in New Issue
Block a user