]> git.cworth.org Git - wordgame/commitdiff
Add -Wmissing-prototypes and add a bunch of missing static qualifiers.
authorCarl Worth <cworth@raht.cworth.org>
Thu, 21 Sep 2006 09:04:41 +0000 (02:04 -0700)
committerCarl Worth <cworth@raht.cworth.org>
Thu, 21 Sep 2006 09:04:41 +0000 (02:04 -0700)
Makefile
dict.c
grid.c

index 8d8e5a5e36dace4e4d7b619037d430184409adff..270b2ef3df53bbc84c3e42569f1469e8f0175964 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-WGCFLAGS=-Wall -Wextra -Wno-unused-parameter
+WGCFLAGS=-Wall -Wextra -Wmissing-prototypes -Wno-unused-parameter
 
 PROGRAMS=grid
 all: $(PROGRAMS)
diff --git a/dict.c b/dict.c
index f975829c1877c74e1b85001c571fcbccbd2d8ccc..50b741eb9cd5697e066d4df81e92f9c0ef6c9ef8 100644 (file)
--- a/dict.c
+++ b/dict.c
@@ -40,7 +40,7 @@ typedef bool_t
 #define TRIE_CHAR_TO_INDEX(c)  (tolower (c) - 'a')
 #define TRIE_INDEX_TO_CHAR(i)  (i + 'a')
 
-void *
+static void *
 xmalloc (size_t size)
 {
     void *res;
@@ -54,7 +54,7 @@ xmalloc (size_t size)
     return res;
 }
 
-void *
+static void *
 xrealloc (void *ptr, size_t size)
 {
     void *res;
@@ -68,7 +68,7 @@ xrealloc (void *ptr, size_t size)
     return res;
 }
 
-void
+static void
 chomp (char *s)
 {
     int len = strlen (s);
@@ -78,7 +78,7 @@ chomp (char *s)
        s[len - 1] = '\0';
 }
 
-void
+static void
 string_init (string_t *string)
 {
     string->size = 0;
@@ -86,7 +86,7 @@ string_init (string_t *string)
     string->len = 0;
 }
 
-void
+static void
 string_fini (string_t *string)
 {
     string->size = 0;
@@ -95,7 +95,7 @@ string_fini (string_t *string)
     string->len = 0;
 }
 
-void
+static void
 string_append_char (string_t *string, char c)
 {
     if (string->size == 0) {
@@ -114,7 +114,7 @@ string_append_char (string_t *string, char c)
     string->s[string->len] = '\0';
 }
 
-void
+static void
 string_chop (string_t *string)
 {
     if (string->len == 0)
@@ -145,7 +145,7 @@ trie_fini (trie_t *trie)
            trie_destroy (trie->next[i]);
 }
 
-trie_t *
+static trie_t *
 trie_create (void)
 {
     trie_t *trie;
@@ -165,7 +165,7 @@ trie_destroy (trie_t *trie)
     free (trie);
 }
 
-void
+static void
 trie_add (trie_t       *trie,
          const char    *word_chunk)
 {
@@ -184,7 +184,7 @@ trie_add (trie_t    *trie,
     trie_add (trie->next[i], word_chunk + 1);
 }
 
-trie_t *
+static trie_t *
 trie_find (trie_t      *trie,
           const char   *word_chunk)
 {
@@ -196,7 +196,7 @@ trie_find (trie_t   *trie,
     return trie;
 }
 
-int
+static int
 trie_count (trie_t             *trie,
            trie_predicate_t     predicate)
 {
@@ -216,7 +216,7 @@ trie_count (trie_t          *trie,
     return count;
 }
 
-int
+static int
 trie_print (trie_t             *trie,
            string_t            *string,
            trie_predicate_t     predicate,
diff --git a/grid.c b/grid.c
index 960b79626ebead506ffdc371b35375801d2a6634..97ba7d7f3c2306e8921bf81b6e97af18d939849d 100644 (file)
--- a/grid.c
+++ b/grid.c
@@ -45,13 +45,13 @@ typedef struct _board {
     dict_t *results;
 } board_t;
 
-int
+static int
 rand_within (int num_values)
 {
     return (int) ((double) num_values * (rand() / (RAND_MAX + 1.0)));
 }
 
-void
+static void
 shuffle (int *array, int length)
 {
     int i, r, tmp;
@@ -65,7 +65,7 @@ shuffle (int *array, int length)
     }
 }
 
-void
+static void
 board_init (board_t *board)
 {
     int i;
@@ -79,7 +79,7 @@ board_init (board_t *board)
        board->letters[i / 4][i % 4] = cube_faces[cubes[i]][rand_within(6)];
 }
 
-void
+static void
 board_print (board_t *board)
 {
     int x, y;
@@ -98,7 +98,7 @@ board_print (board_t *board)
 }
 
 #define SEEN_BIT(x, y) (1 << (4*(y)+(x)))
-void
+static void
 board_enumerate (board_t       *board,
                 int             x,
                 int             y,