summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-06-30 23:54:09 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-06-30 23:54:09 +0000
commit3ac414237561174ba770356efa635381e6bf20f9 (patch)
tree551b97e7863a52b2ce3614dcc03eaf6bba4e447e
parentd49b455c2791bed0d23046f0350db58b906ff660 (diff)
Some -Wall cleanliness.
-rw-r--r--usr.bin/find/find.c6
-rw-r--r--usr.bin/find/function.c21
-rw-r--r--usr.bin/find/misc.c8
3 files changed, 16 insertions, 19 deletions
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c
index 1e12e32fdf6..20efeaca741 100644
--- a/usr.bin/find/find.c
+++ b/usr.bin/find/find.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: find.c,v 1.4 1997/06/17 20:58:08 kstailey Exp $ */
+/* $OpenBSD: find.c,v 1.5 1997/06/30 23:54:07 millert Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)find.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: find.c,v 1.4 1997/06/17 20:58:08 kstailey Exp $";
+static char rcsid[] = "$OpenBSD: find.c,v 1.5 1997/06/30 23:54:07 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -162,7 +162,7 @@ find_execute(plan, paths)
if (!(tree = fts_open(paths, ftsoptions, NULL)))
err(1, "ftsopen");
- while (entry = fts_read(tree)) {
+ while ((entry = fts_read(tree))) {
switch(entry->fts_info) {
case FTS_D:
if (isdepth)
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index d1089935ba9..9f8bccd957c 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: function.c,v 1.8 1996/12/23 04:58:10 millert Exp $ */
+/* $OpenBSD: function.c,v 1.9 1997/06/30 23:54:07 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)function.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: function.c,v 1.8 1996/12/23 04:58:10 millert Exp $";
+static char rcsid[] = "$OpenBSD: function.c,v 1.9 1997/06/30 23:54:07 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -77,6 +77,10 @@ static char rcsid[] = "$OpenBSD: function.c,v 1.8 1996/12/23 04:58:10 millert Ex
static PLAN *palloc __P((enum ntype, int (*) __P((PLAN *, FTSENT *))));
+extern int dotfd;
+extern time_t now;
+extern FTS *tree;
+
/*
* find_parsenum --
* Parse a string of the form [+-]# and return the value.
@@ -141,7 +145,6 @@ f_atime(plan, entry)
PLAN *plan;
FTSENT *entry;
{
- extern time_t now;
COMPARE((now - entry->fts_statp->st_atime +
SECSPERDAY - 1) / SECSPERDAY, plan->t_data);
@@ -171,7 +174,6 @@ f_ctime(plan, entry)
PLAN *plan;
FTSENT *entry;
{
- extern time_t now;
COMPARE((now - entry->fts_statp->st_ctime +
SECSPERDAY - 1) / SECSPERDAY, plan->t_data);
@@ -273,7 +275,6 @@ f_exec(plan, entry)
register PLAN *plan;
FTSENT *entry;
{
- extern int dotfd;
register int cnt;
pid_t pid;
int status;
@@ -375,7 +376,6 @@ f_execdir(plan, entry)
register PLAN *plan;
FTSENT *entry;
{
- extern int dotfd;
register int cnt;
pid_t pid;
int status;
@@ -503,7 +503,7 @@ f_fstype(plan, entry)
*/
if (entry->fts_info == FTS_SL ||
entry->fts_info == FTS_SLNONE) {
- if (p = strrchr(entry->fts_accpath, '/'))
+ if ((p = strrchr(entry->fts_accpath, '/')))
++p;
else
p = entry->fts_accpath;
@@ -697,7 +697,6 @@ f_maxdepth(plan, entry)
PLAN *plan;
FTSENT *entry;
{
- extern FTS *tree;
if (entry->fts_level >= plan->max_data)
fts_set(tree, entry, FTS_SKIP);
@@ -726,7 +725,6 @@ f_mindepth(plan, entry)
PLAN *plan;
FTSENT *entry;
{
- extern FTS *tree;
return (entry->fts_level >= plan->min_data);
}
@@ -753,7 +751,6 @@ f_mtime(plan, entry)
PLAN *plan;
FTSENT *entry;
{
- extern time_t now;
COMPARE((now - entry->fts_statp->st_mtime + SECSPERDAY - 1) /
SECSPERDAY, plan->t_data);
@@ -964,6 +961,7 @@ f_print(plan, entry)
}
/* ARGSUSED */
+int
f_print0(plan, entry)
PLAN *plan;
FTSENT *entry;
@@ -999,7 +997,6 @@ f_prune(plan, entry)
PLAN *plan;
FTSENT *entry;
{
- extern FTS *tree;
if (fts_set(tree, entry, FTS_SKIP))
err(1, "%s", entry->fts_path);
@@ -1260,7 +1257,7 @@ palloc(t, f)
{
PLAN *new;
- if (new = malloc(sizeof(PLAN))) {
+ if ((new = malloc(sizeof(PLAN)))) {
new->type = t;
new->eval = f;
new->flags = 0;
diff --git a/usr.bin/find/misc.c b/usr.bin/find/misc.c
index d43be538341..6e71820b57c 100644
--- a/usr.bin/find/misc.c
+++ b/usr.bin/find/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.3 1996/10/24 03:46:05 tholo Exp $ */
+/* $OpenBSD: misc.c,v 1.4 1997/06/30 23:54:08 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)misc.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: misc.c,v 1.3 1996/10/24 03:46:05 tholo Exp $";
+static char rcsid[] = "$OpenBSD: misc.c,v 1.4 1997/06/30 23:54:08 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -67,7 +67,7 @@ brace_subst(orig, store, path, len)
register char ch, *p;
plen = strlen(path);
- for (p = *store; ch = *orig; ++orig)
+ for (p = *store; (ch = *orig); ++orig)
if (ch == '{' && orig[1] == '}') {
while ((p - *store) + plen > len)
if (!(*store = realloc(*store, len *= 2)))
@@ -125,7 +125,7 @@ emalloc(len)
{
void *p;
- if (p = malloc(len))
+ if ((p = malloc(len)))
return (p);
err(1, NULL);
}