From: Sami Kerola Date: Sat, 1 Dec 2012 17:02:08 +0000 (+0000) Subject: compile: fix signed and unsigned warnings X-Git-Tag: cronie1.4.11~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd2541ff36b92b9fee4d84960cd1e297b1f10b42;p=cronie compile: fix signed and unsigned warnings cron.c:100:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] cron.c:108:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] cron.c:125:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Sami Kerola --- diff --git a/src/cron.c b/src/cron.c index 3c7e0c3..a79806e 100644 --- a/src/cron.c +++ b/src/cron.c @@ -95,7 +95,7 @@ const char *watchpaths[NUM_WATCHES] = {SPOOL_DIR, SYS_CROND_DIR}; # endif static void reset_watches(void) { - int i; + size_t i; for (i = 0; i < sizeof (wd) / sizeof (wd[0]); ++i) { wd[i] = -2; @@ -103,7 +103,7 @@ static void reset_watches(void) { } void set_cron_unwatched(int fd) { - int i; + size_t i; for (i = 0; i < sizeof (wd) / sizeof (wd[0]); ++i) { if (wd[i] > 0) { @@ -115,7 +115,7 @@ void set_cron_unwatched(int fd) { void set_cron_watched(int fd) { pid_t pid = getpid(); - int i; + size_t i; if (fd < 0) { inotify_enabled = 0;