From 34a187901f1ffdf5d29fd66ac6d3614431858148 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 25 Sep 2011 22:21:15 -0700 Subject: [PATCH] Yet more "signed vs. unsigned" warning fixes. This time I actually made the sub-module's Makefile use the more strict compilation flags. --- Makefile | 2 +- main.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 538b1db..e46402d 100644 --- 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 8198789..0002565 100644 --- 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; -- 2.43.0