From 6d8bf34e9fb951f918a629ffbf55968eb1a569a9 Mon Sep 17 00:00:00 2001 From: Nick Patavalis Date: Fri, 9 Feb 2018 19:00:56 +0200 Subject: [PATCH] Silence compiler warnings - Comparisons between signed and unsigned - Unused parameter produced by gcc -Wall -Wextra --- picocom.c | 2 ++ term.c | 2 +- term.h | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/picocom.c b/picocom.c index c163d2e..7053d71 100644 --- a/picocom.c +++ b/picocom.c @@ -1558,6 +1558,8 @@ loop(void) void deadly_handler(int signum) { + (void)signum; /* silence unused warning */ + if ( ! sig_exit ) { sig_exit = 1; kill(0, SIGTERM); diff --git a/term.c b/term.c index 8024017..610725f 100644 --- a/term.c +++ b/term.c @@ -244,7 +244,7 @@ struct baud_codes { #endif /* of HIGH_BAUD */ }; -#define BAUD_TABLE_SZ (sizeof(baud_table) / sizeof(baud_table[0])) +#define BAUD_TABLE_SZ ((int)(sizeof(baud_table) / sizeof(baud_table[0]))) int term_baud_up (int baud) diff --git a/term.h b/term.h index ec5a550..4175144 100644 --- a/term.h +++ b/term.h @@ -167,7 +167,8 @@ enum parity_e { P_EVEN, P_ODD, P_MARK, - P_SPACE + P_SPACE, + P_ERROR = -1 }; /* @@ -184,7 +185,8 @@ enum flowcntrl_e { FC_NONE = 0, FC_RTSCTS, FC_XONXOFF, - FC_OTHER + FC_OTHER, + FC_ERROR = -1 }; /*