From 3e079a96c84f5543e041f7059a997d7ef56c1d2f Mon Sep 17 00:00:00 2001 From: Jim Monte Date: Fri, 14 Feb 2020 15:20:28 -0500 Subject: [PATCH] Fixed compiler warnings related to const, unreachable code, and an empty translation unit. --- src/frontend/parser/glob.c | 2 +- src/winmain.c | 10 ++++++++++ src/xspice/mif/mifutil.c | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/frontend/parser/glob.c b/src/frontend/parser/glob.c index 469af46ee..ace328c34 100644 --- a/src/frontend/parser/glob.c +++ b/src/frontend/parser/glob.c @@ -412,7 +412,7 @@ char *cp_tildexpand(const char *string) /* MW. Now simply compare strings */ -bool cp_globmatch(char *p, char *s) +bool cp_globmatch(const char *p, const char *s) { return !(strcmp(p, s)); } /* end of function cp_globmatch */ diff --git a/src/winmain.c b/src/winmain.c index d22bde1a3..c1498dee7 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -1641,4 +1641,14 @@ winmessage(char *new_msg) } + +#else /* HAS_WINGUI not defined */ +/* Prevent warning regarding empty translation unit */ +static void dummy(void) +{ + return; +} /* end of function dummy */ + + + #endif /* HAS_WINGUI */ diff --git a/src/xspice/mif/mifutil.c b/src/xspice/mif/mifutil.c index 93e968acb..3f755a19a 100644 --- a/src/xspice/mif/mifutil.c +++ b/src/xspice/mif/mifutil.c @@ -142,7 +142,6 @@ char *MIFgettok(char **s) } break; } - return NULL; /* should not happen */ } #if 0