From 7834874237b791abe04a1b22aff207cfa5293e34 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 29 Jul 2013 11:48:41 +0200 Subject: flowtop: Fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following compiler warnings that occur when building with "-W -Wall -Wextra": flowtop.c: In function ‘walk_process’: flowtop.c:417:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] flowtop.c: In function ‘presenter_screen_update’: flowtop.c:937:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] flowtop.c:938:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tobias Klauser --- flowtop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowtop.c b/flowtop.c index 884acd1..d0b9a80 100644 --- a/flowtop.c +++ b/flowtop.c @@ -414,7 +414,7 @@ static int walk_process(char *process, struct flow_entry *n) if (stat(path, &statbuf) < 0) continue; - if (S_ISSOCK(statbuf.st_mode) && n->inode == statbuf.st_ino) { + if (S_ISSOCK(statbuf.st_mode) && (ino_t) n->inode == statbuf.st_ino) { memset(n->cmdline, 0, sizeof(n->cmdline)); snprintf(path, sizeof(path), "/proc/%s/exe", process); @@ -883,7 +883,8 @@ static inline int presenter_flow_wrong_state(struct flow_entry *n, int state) static void presenter_screen_update(WINDOW *screen, struct flow_list *fl, int skip_lines) { - int i, j, maxy; + int maxy; + size_t i, j; unsigned int line = 3; struct flow_entry *n; uint8_t protocols[] = { -- cgit v1.2.3-54-g00ecf