]> git.cworth.org Git - mnemon/commitdiff
Yet more "signed vs. unsigned" warning fixes.
authorCarl Worth <cworth@cworth.org>
Mon, 26 Sep 2011 05:21:15 +0000 (22:21 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 26 Sep 2011 05:21:15 +0000 (22:21 -0700)
This time I actually made the sub-module's Makefile use the more strict
compilation flags.

Makefile
main.c

index 538b1db6eba89dcbdab1e5fa052c03c271030b2a..e46402d3e37d8d5e2dc16d9188a77239fda72ae5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-MY_CFLAGS=-Wall -Wextra -Wmissing-prototypes -Wno-unused-parameter -Wno-sign-compare
+MY_CFLAGS=-Wall -Wextra -Wmissing-prototypes
 MY_LDFLAGS=-lreadline -lm
 
 PROGRAMS=mnemon
diff --git a/main.c b/main.c
index 819878919690335901fa2b9d58d9e02a74d55fe8..0002565d6fdb65a4bdb9a411bd68efc32e47e5b5 100644 (file)
--- a/main.c
+++ b/main.c
@@ -148,7 +148,7 @@ bin_num_items_matching (bin_t                       *bin,
                        item_match_predicate_t  *predicate,
                        void                    *closure)
 {
-    int i, num_items = 0;
+    unsigned int i, num_items = 0;
 
     if (predicate == NULL)
        return bin->num_items;
@@ -262,10 +262,11 @@ print_histogram (mnemon_t    *mnemon,
                 const char  *category_name,
                 int         length)
 {
-    int i, last_score, max;
+    unsigned int i, max;
+    int last_score;
     category_t *category = NULL;
     bin_t *bin;
-    int num_items;
+    unsigned int num_items;
     item_match_predicate_t *predicate = NULL;
     void *closure = NULL;
     item_in_category_closure_t item_in_category;
@@ -478,7 +479,7 @@ _do_challenges (mnemon_t *mnemon, progress_t *progress)
     item_t *item;
     category_t *category;
     char *response;
-    int i;
+    unsigned int i;
 
     /* Count the number of items with negative scores. */
     progress->unlearned = 0;