Fix gcc-2.8.1 warnings.

This commit is contained in:
christos 1999-03-16 18:13:44 +00:00
parent b34682dcab
commit 3eeda4afc6
4 changed files with 20 additions and 17 deletions

View File

@ -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;
/*

View File

@ -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;

View File

@ -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;

View File

@ -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);