fixup for WARNS=4.

This commit is contained in:
Alfred Perlstein 2002-07-11 18:42:53 +00:00
parent d89167b4ea
commit 67d357f89b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99802
8 changed files with 23 additions and 19 deletions

View File

@ -7,6 +7,8 @@ PROG= mtree
MAN= mtree.8
SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c verify.c
WARNS?= 4
.if defined(BOOTSTRAPPING)
.PATH: ${.CURDIR}/../../lib/libc/gen
SRCS+= strtofflags.c

View File

@ -63,7 +63,7 @@ static const char rcsid[] =
extern int uflag;
extern int lineno;
static char *ftype(u_int);
static const char *ftype(u_int);
#define INDENTNAMELEN 8
#define LABEL \
@ -74,14 +74,15 @@ static char *ftype(u_int);
int
compare(name, s, p)
char *name;
char *name __unused;
register NODE *s;
register FTSENT *p;
{
extern int uflag;
u_long len, val;
int fd, label;
char *cp, *tab = "";
char *cp;
const char *tab = "";
char *fflags;
label = 0;
@ -304,7 +305,7 @@ typeerr: LABEL;
return (label);
}
char *
const char *
inotype(type)
u_int type;
{
@ -329,7 +330,7 @@ inotype(type)
/* NOTREACHED */
}
static char *
static const char *
ftype(type)
u_int type;
{

View File

@ -89,17 +89,18 @@ cwalk()
{
register FTS *t;
register FTSENT *p;
time_t clock;
time_t cl;
char *argv[2], host[MAXHOSTNAMELEN];
char dot[] = ".";
int indent = 0;
(void)time(&clock);
(void)time(&cl);
(void)gethostname(host, sizeof(host));
(void)printf(
"#\t user: %s\n#\tmachine: %s\n#\t tree: %s\n#\t date: %s",
getlogin(), host, fullpath, ctime(&clock));
getlogin(), host, fullpath, ctime(&cl));
argv[0] = ".";
argv[0] = dot;
argv[1] = NULL;
if ((t = fts_open(argv, ftsoptions, dsort)) == NULL)
err(1, "line %d: fts_open", lineno);
@ -208,7 +209,7 @@ statf(indent, p)
output(indent, &offset, "size=%qd", p->fts_statp->st_size);
if (keys & F_TIME)
output(indent, &offset, "time=%ld.%ld",
p->fts_statp->st_mtimespec.tv_sec,
(long)p->fts_statp->st_mtimespec.tv_sec,
p->fts_statp->st_mtimespec.tv_nsec);
if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) {
if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 ||

View File

@ -103,7 +103,7 @@ check_excludes(const char *fname, const char *path)
#define MATCH(g, n) (fnmatch((g), (n), FNM_PATHNAME) == 0)
LIST_FOREACH(e, &excludes, link) {
if (e->pathname && MATCH(e->glob, path)
if ((e->pathname && MATCH(e->glob, path))
|| MATCH(e->glob, fname))
return 1;
}

View File

@ -39,7 +39,7 @@ int crc(int, u_long *, u_long *);
void cwalk(void);
char *flags_to_string(u_long);
char *inotype(u_int);
const char *inotype(u_int);
u_int parsekey(char *, int *);
char *rlink(char *);
NODE *spec(void);

View File

@ -51,7 +51,7 @@ static const char rcsid[] =
extern int lineno;
typedef struct _key {
char *name; /* key name */
const char *name; /* key name */
u_int val; /* value */
#define NEEDVALUE 0x01
@ -85,13 +85,14 @@ static KEY keylist[] = {
{"uname", F_UNAME, NEEDVALUE},
};
int keycompare(const void *, const void *);
u_int
parsekey(name, needvaluep)
char *name;
int *needvaluep;
{
KEY *k, tmp;
int keycompare(const void *, const void *);
tmp.name = name;
k = (KEY *)bsearch(&tmp, keylist, sizeof(keylist) / sizeof(KEY),
@ -108,7 +109,7 @@ int
keycompare(a, b)
const void *a, *b;
{
return (strcmp(((KEY *)a)->name, ((KEY *)b)->name));
return (strcmp(((const KEY *)a)->name, ((const KEY *)b)->name));
}
char *

View File

@ -65,9 +65,7 @@ char fullpath[MAXPATHLEN];
static void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int ch;
char *dir, *p;

View File

@ -82,8 +82,9 @@ vwalk()
register NODE *ep, *level;
int specdepth, rval;
char *argv[2];
char dot[] = ".";
argv[0] = ".";
argv[0] = dot;
argv[1] = NULL;
if ((t = fts_open(argv, ftsoptions, NULL)) == NULL)
err(1, "line %d: fts_open", lineno);