From 2c99a09e527a6d58f61801bba5deddd2b9516c72 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Fri, 2 Nov 2012 17:50:55 +0000 Subject: [PATCH] sysctl: fix compiler warnings sysctl.c:293:5: warning: no previous declaration for 'is_deprecated' [-Wmissing-declarations] sysctl.c:472:58: warning: declaration of 'pattern' shadows a global declaration [-Wshadow] sysctl.c:67:14: warning: shadowed declaration is here [-Wshadow] sysctl.c:650:7: warning: variable 'SwitchesAllowed' set but not used [-Wunused-but-set-variable] Signed-off-by: Sami Kerola --- sysctl.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sysctl.c b/sysctl.c index cfe13985..07568788 100644 --- a/sysctl.c +++ b/sysctl.c @@ -67,7 +67,7 @@ static bool Quiet; static char *pattern; /* Function prototypes. */ -static int pattern_match(const char *string, const char *pattern); +static int pattern_match(const char *string, const char *pat); static int DisplayAll(const char *restrict const path); static void slashdot(char *restrict p, char old, char new) @@ -290,7 +290,7 @@ static int ReadSetting(const char *restrict const name) return rc; } -int is_deprecated(char *filename) +static int is_deprecated(char *filename) { int i; for (i = 0; strlen(DEPRECATED[i]); i++) { @@ -469,12 +469,12 @@ static int WriteSetting(const char *setting) return rc; } -static int pattern_match(const char *string, const char *pattern) +static int pattern_match(const char *string, const char *pat) { int status; regex_t re; - if (regcomp(&re, pattern, REG_EXTENDED | REG_NOSUB) != 0) + if (regcomp(&re, pat, REG_EXTENDED | REG_NOSUB) != 0) return (0); status = regexec(&re, string, (size_t) 0, NULL, 0); regfree(&re); @@ -647,7 +647,6 @@ static int PreloadSystem(void) */ int main(int argc, char *argv[]) { - bool SwitchesAllowed = true; bool WriteMode = false; bool DisplayAllOpt = false; bool preloadfileOpt = false; @@ -714,7 +713,6 @@ int main(int argc, char *argv[]) NameOnly = true; break; case 'w': - SwitchesAllowed = false; WriteMode = true; break; case 'f': /* the NetBSD way */ -- 2.40.0