From 3eeda4afc622b0438fd745da754df119ef5fbc0f Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 16 Mar 1999 18:13:44 +0000 Subject: [PATCH] Fix gcc-2.8.1 warnings. --- lib/libc/gen/__fts13.c | 13 ++++++++----- lib/libc/gen/fnmatch.c | 8 ++++---- lib/libc/gen/getcap.c | 10 +++++----- lib/libc/gen/setmode.c | 6 +++--- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/lib/libc/gen/__fts13.c b/lib/libc/gen/__fts13.c index f05b060b2cb1..25ca337a449c 100644 --- a/lib/libc/gen/__fts13.c +++ b/lib/libc/gen/__fts13.c @@ -1,4 +1,4 @@ -/* $NetBSD: __fts13.c,v 1.14 1998/12/01 20:13:47 thorpej Exp $ */ +/* $NetBSD: __fts13.c,v 1.15 1999/03/16 18:13:44 christos Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #else -__RCSID("$NetBSD: __fts13.c,v 1.14 1998/12/01 20:13:47 thorpej Exp $"); +__RCSID("$NetBSD: __fts13.c,v 1.15 1999/03/16 18:13:44 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -602,7 +602,10 @@ fts_build(sp, type) FTSENT *cur, *tail; DIR *dirp; void *adjaddr; - int cderrno, descend, len, level, maxlen, nlinks, oflag, saved_errno; + int cderrno, descend, len, level, maxlen, nlinks, saved_errno; +#ifdef FTS_WHITEOUT + int oflag; +#endif char *cp = NULL; /* pacify gcc */ /* Set current node pointer. */ @@ -661,7 +664,7 @@ fts_build(sp, type) * checking FTS_NS on the returned nodes. */ cderrno = 0; - if (nlinks || type == BREAD) + if (nlinks || type == BREAD) { if (FCHDIR(sp, dirfd(dirp))) { if (nlinks && type == BREAD) cur->fts_errno = errno; @@ -670,7 +673,7 @@ fts_build(sp, type) cderrno = errno; } else descend = 1; - else + } else descend = 0; /* diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index 46fcf3631712..c4f65de228aa 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -1,4 +1,4 @@ -/* $NetBSD: fnmatch.c,v 1.13 1997/07/21 14:06:58 jtc Exp $ */ +/* $NetBSD: fnmatch.c,v 1.14 1999/03/16 18:13:45 christos Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; #else -__RCSID("$NetBSD: fnmatch.c,v 1.13 1997/07/21 14:06:58 jtc Exp $"); +__RCSID("$NetBSD: fnmatch.c,v 1.14 1999/03/16 18:13:45 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -97,13 +97,13 @@ fnmatch(pattern, string, flags) return (FNM_NOMATCH); /* Optimize for pattern with * at end or before /. */ - if (c == EOS) + if (c == EOS) { if (flags & FNM_PATHNAME) return (strchr(string, '/') == NULL ? 0 : FNM_NOMATCH); else return (0); - else if (c == '/' && flags & FNM_PATHNAME) { + } else if (c == '/' && flags & FNM_PATHNAME) { if ((string = strchr(string, '/')) == NULL) return (FNM_NOMATCH); break; diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c index a0811974b77e..ec735905de47 100644 --- a/lib/libc/gen/getcap.c +++ b/lib/libc/gen/getcap.c @@ -1,4 +1,4 @@ -/* $NetBSD: getcap.c,v 1.25 1998/11/13 08:25:17 christos Exp $ */ +/* $NetBSD: getcap.c,v 1.26 1999/03/16 18:13:45 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94"; #else -__RCSID("$NetBSD: getcap.c,v 1.25 1998/11/13 08:25:17 christos Exp $"); +__RCSID("$NetBSD: getcap.c,v 1.26 1999/03/16 18:13:45 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -639,12 +639,12 @@ cgetmatch(buf, name) */ np = name; for (;;) - if (*np == '\0') + if (*np == '\0') { if (*bp == '|' || *bp == ':' || *bp == '\0') return (0); else break; - else + } else if (*bp++ != *np++) break; @@ -737,7 +737,7 @@ cgetnext(bp, db_array) slash = 0; continue; } - if (isspace(*line) || + if (isspace((unsigned char)*line) || *line == ':' || *line == '#' || slash) { if (line[len - 2] == '\\') slash = 1; diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c index 6817180824bd..0cbf241fa647 100644 --- a/lib/libc/gen/setmode.c +++ b/lib/libc/gen/setmode.c @@ -1,4 +1,4 @@ -/* $NetBSD: setmode.c,v 1.20 1998/02/27 18:36:43 perry Exp $ */ +/* $NetBSD: setmode.c,v 1.21 1999/03/16 18:13:46 christos Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)setmode.c 8.2 (Berkeley) 3/25/94"; #else -__RCSID("$NetBSD: setmode.c,v 1.20 1998/02/27 18:36:43 perry Exp $"); +__RCSID("$NetBSD: setmode.c,v 1.21 1999/03/16 18:13:46 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -214,7 +214,7 @@ setmode(p) * If an absolute number, get it and return; disallow non-octal digits * or illegal bits. */ - if (isdigit(*p)) { + if (isdigit((unsigned char)*p)) { perm = (mode_t)strtol(p, NULL, 8); if (perm & ~(STANDARD_BITS|S_ISTXT)) { free(saveset);