From 4382136d1895b6e87d1ae68baa41eba28a42c304 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 21 Oct 2019 11:15:36 +0200 Subject: [PATCH] Fix signed vs unsigned comparison warning from GCC Signed-off-by: Joachim Nilsson --- src/klogd.c | 2 +- src/ksym_mod.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/klogd.c b/src/klogd.c index 410cbd3..4edc032 100644 --- a/src/klogd.c +++ b/src/klogd.c @@ -807,7 +807,7 @@ static void LogLine(char *ptr, int len) ** verify there is room in the line buffer */ sym_space = space + (line - sym_start); - if (sym_space < strlen(symbol) + 30) { /*(30 should be overkill)*/ + if (sym_space < (int)strlen(symbol) + 30) { /*(30 should be overkill)*/ parse_state = PARSING_TEXT; /* not enough space */ break; } diff --git a/src/ksym_mod.c b/src/ksym_mod.c index 3807e17..92e6e9c 100644 --- a/src/ksym_mod.c +++ b/src/ksym_mod.c @@ -466,9 +466,9 @@ char *LookupModuleSymbol(unsigned long value, struct symbol *sym) ++nsym) { if (mp->sym_array[nsym].value > value) { if (sym->size == 0 || - (value - last->value) < sym->offset || - ((sym->offset == (value - last->value)) && - (mp->sym_array[nsym].value - last->value) < sym->size)) { + (value - last->value) < (unsigned long)sym->offset || + (((unsigned long)sym->offset == (value - last->value)) && + (mp->sym_array[nsym].value - last->value) < (unsigned long)sym->size)) { sym->offset = value - last->value; sym->size = mp->sym_array[nsym].value - last->value;