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 <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-11-02 17:50:55 +00:00 committed by Craig Small
parent c8554e6c0f
commit 2c99a09e52

View File

@ -67,7 +67,7 @@ static bool Quiet;
static char *pattern; static char *pattern;
/* Function prototypes. */ /* 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 int DisplayAll(const char *restrict const path);
static void slashdot(char *restrict p, char old, char new) static void slashdot(char *restrict p, char old, char new)
@ -290,7 +290,7 @@ static int ReadSetting(const char *restrict const name)
return rc; return rc;
} }
int is_deprecated(char *filename) static int is_deprecated(char *filename)
{ {
int i; int i;
for (i = 0; strlen(DEPRECATED[i]); i++) { for (i = 0; strlen(DEPRECATED[i]); i++) {
@ -469,12 +469,12 @@ static int WriteSetting(const char *setting)
return rc; return rc;
} }
static int pattern_match(const char *string, const char *pattern) static int pattern_match(const char *string, const char *pat)
{ {
int status; int status;
regex_t re; regex_t re;
if (regcomp(&re, pattern, REG_EXTENDED | REG_NOSUB) != 0) if (regcomp(&re, pat, REG_EXTENDED | REG_NOSUB) != 0)
return (0); return (0);
status = regexec(&re, string, (size_t) 0, NULL, 0); status = regexec(&re, string, (size_t) 0, NULL, 0);
regfree(&re); regfree(&re);
@ -647,7 +647,6 @@ static int PreloadSystem(void)
*/ */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
bool SwitchesAllowed = true;
bool WriteMode = false; bool WriteMode = false;
bool DisplayAllOpt = false; bool DisplayAllOpt = false;
bool preloadfileOpt = false; bool preloadfileOpt = false;
@ -714,7 +713,6 @@ int main(int argc, char *argv[])
NameOnly = true; NameOnly = true;
break; break;
case 'w': case 'w':
SwitchesAllowed = false;
WriteMode = true; WriteMode = true;
break; break;
case 'f': /* the NetBSD way */ case 'f': /* the NetBSD way */