From 584bf9382ba95af852e01126718d2a3c7d24ac4c Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 9 Sep 2014 11:48:09 +0200 Subject: [PATCH] Fix compiler warnings on NetBSD --- cmdparse.c | 8 ++++---- getdate.c | 2 +- getdate.y | 2 +- logging.h | 2 ++ sys_netbsd.c | 1 - 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmdparse.c b/cmdparse.c index 437dfbd..a6f1efa 100644 --- a/cmdparse.c +++ b/cmdparse.c @@ -204,7 +204,7 @@ CPS_NormalizeLine(char *line) /* Remove white-space at beginning and replace white-spaces with space char */ for (p = q = line; *p; p++) { - if (isspace(*p)) { + if (isspace((unsigned char)*p)) { if (!space) *q++ = ' '; space = 1; @@ -234,15 +234,15 @@ CPS_SplitWord(char *line) char *p = line, *q = line; /* Skip white-space before the word */ - while (*q && isspace(*q)) + while (*q && isspace((unsigned char)*q)) q++; /* Move the word to the beginning */ - while (*q && !isspace(*q)) + while (*q && !isspace((unsigned char)*q)) *p++ = *q++; /* Find the next word */ - while (*q && isspace(*q)) + while (*q && isspace((unsigned char)*q)) q++; *p = '\0'; diff --git a/getdate.c b/getdate.c index 17c960a..48a3b12 100644 --- a/getdate.c +++ b/getdate.c @@ -2532,7 +2532,7 @@ LookupWord (buff) /* Make it lowercase. */ for (p = buff; *p; p++) if (ISUPPER ((unsigned char) *p)) - *p = tolower (*p); + *p = tolower ((unsigned char) *p); if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) { diff --git a/getdate.y b/getdate.y index 5318957..99de9b0 100644 --- a/getdate.y +++ b/getdate.y @@ -711,7 +711,7 @@ LookupWord (buff) /* Make it lowercase. */ for (p = buff; *p; p++) if (ISUPPER ((unsigned char) *p)) - *p = tolower (*p); + *p = tolower ((unsigned char) *p); if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) { diff --git a/logging.h b/logging.h index 898cde9..1b8236d 100644 --- a/logging.h +++ b/logging.h @@ -29,6 +29,8 @@ #ifndef GOT_LOGGING_H #define GOT_LOGGING_H +#include "sysincl.h" + /* Flag indicating whether debug messages are logged */ extern int log_debug_enabled; diff --git a/sys_netbsd.c b/sys_netbsd.c index c9a29b3..8c08d4e 100644 --- a/sys_netbsd.c +++ b/sys_netbsd.c @@ -281,7 +281,6 @@ SYS_NetBSD_Initialise(void) }; kvm_t *kt; - FILE *fp; kt = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kt) {