De-__P(), remove trailing spaces, sprinkle a few const, WARNS=4.
This commit is contained in:
parent
ac02696458
commit
2eed134b40
@ -1,10 +1,11 @@
|
||||
# $NetBSD: Makefile,v 1.10 2006/08/26 18:17:42 christos Exp $
|
||||
# $NetBSD: Makefile,v 1.11 2006/10/11 19:51:10 apb Exp $
|
||||
# from: @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PROG= find
|
||||
SRCS= find.c function.c ls.c main.c misc.c operator.c option.c stat_flags.c
|
||||
WARNS= 4
|
||||
|
||||
CPPFLAGS+= -I${NETBSDSRCDIR}/bin/ls
|
||||
.PATH: ${NETBSDSRCDIR}/bin/ls
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: extern.h,v 1.25 2006/10/07 17:04:02 apb Exp $ */
|
||||
/* $NetBSD: extern.h,v 1.26 2006/10/11 19:51:10 apb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
@ -33,65 +33,65 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
void brace_subst __P((char *, char **, char *, int *));
|
||||
PLAN *find_create __P((char ***));
|
||||
int find_execute __P((PLAN *, char **));
|
||||
PLAN *find_formplan __P((char **));
|
||||
int find_traverse __P((PLAN *, int (*)(PLAN *, void *), void *));
|
||||
int f_expr __P((PLAN *, FTSENT *));
|
||||
PLAN *not_squish __P((PLAN *));
|
||||
PLAN *or_squish __P((PLAN *));
|
||||
PLAN *paren_squish __P((PLAN *));
|
||||
void brace_subst(char *, char **, char *, int *);
|
||||
PLAN *find_create(char ***);
|
||||
int find_execute(PLAN *, char **);
|
||||
PLAN *find_formplan(char **);
|
||||
int find_traverse(PLAN *, int (*)(PLAN *, void *), void *);
|
||||
int f_expr(PLAN *, FTSENT *);
|
||||
PLAN *not_squish(PLAN *);
|
||||
PLAN *or_squish(PLAN *);
|
||||
PLAN *paren_squish(PLAN *);
|
||||
int plan_cleanup(PLAN *, void *);
|
||||
void printlong __P((char *, char *, struct stat *));
|
||||
int queryuser __P((char **));
|
||||
void show_path __P((int));
|
||||
void printlong(char *, char *, struct stat *);
|
||||
int queryuser(char **);
|
||||
void show_path(int);
|
||||
|
||||
PLAN *c_amin __P((char ***, int));
|
||||
PLAN *c_anewer __P((char ***, int));
|
||||
PLAN *c_atime __P((char ***, int));
|
||||
PLAN *c_cmin __P((char ***, int));
|
||||
PLAN *c_cnewer __P((char ***, int));
|
||||
PLAN *c_ctime __P((char ***, int));
|
||||
PLAN *c_depth __P((char ***, int));
|
||||
PLAN *c_empty __P((char ***, int));
|
||||
PLAN *c_exec __P((char ***, int));
|
||||
PLAN *c_execdir __P((char ***, int));
|
||||
PLAN *c_exit __P((char ***, int));
|
||||
PLAN *c_false __P((char ***, int));
|
||||
PLAN *c_flags __P((char ***, int));
|
||||
PLAN *c_follow __P((char ***, int));
|
||||
PLAN *c_fprint __P((char ***, int));
|
||||
PLAN *c_fstype __P((char ***, int));
|
||||
PLAN *c_group __P((char ***, int));
|
||||
PLAN *c_iname __P((char ***, int));
|
||||
PLAN *c_inum __P((char ***, int));
|
||||
PLAN *c_iregex __P((char ***, int));
|
||||
PLAN *c_links __P((char ***, int));
|
||||
PLAN *c_ls __P((char ***, int));
|
||||
PLAN *c_maxdepth __P((char ***, int));
|
||||
PLAN *c_mindepth __P((char ***, int));
|
||||
PLAN *c_mmin __P((char ***, int));
|
||||
PLAN *c_mtime __P((char ***, int));
|
||||
PLAN *c_name __P((char ***, int));
|
||||
PLAN *c_newer __P((char ***, int));
|
||||
PLAN *c_nogroup __P((char ***, int));
|
||||
PLAN *c_nouser __P((char ***, int));
|
||||
PLAN *c_path __P((char ***, int));
|
||||
PLAN *c_perm __P((char ***, int));
|
||||
PLAN *c_print __P((char ***, int));
|
||||
PLAN *c_print0 __P((char ***, int));
|
||||
PLAN *c_printx __P((char ***, int));
|
||||
PLAN *c_prune __P((char ***, int));
|
||||
PLAN *c_regex __P((char ***, int));
|
||||
PLAN *c_size __P((char ***, int));
|
||||
PLAN *c_type __P((char ***, int));
|
||||
PLAN *c_user __P((char ***, int));
|
||||
PLAN *c_xdev __P((char ***, int));
|
||||
PLAN *c_openparen __P((char ***, int));
|
||||
PLAN *c_closeparen __P((char ***, int));
|
||||
PLAN *c_not __P((char ***, int));
|
||||
PLAN *c_or __P((char ***, int));
|
||||
PLAN *c_null __P((char ***, int));
|
||||
PLAN *c_amin(char ***, int);
|
||||
PLAN *c_anewer(char ***, int);
|
||||
PLAN *c_atime(char ***, int);
|
||||
PLAN *c_cmin(char ***, int);
|
||||
PLAN *c_cnewer(char ***, int);
|
||||
PLAN *c_ctime(char ***, int);
|
||||
PLAN *c_depth(char ***, int);
|
||||
PLAN *c_empty(char ***, int);
|
||||
PLAN *c_exec(char ***, int);
|
||||
PLAN *c_execdir(char ***, int);
|
||||
PLAN *c_exit(char ***, int);
|
||||
PLAN *c_false(char ***, int);
|
||||
PLAN *c_flags(char ***, int);
|
||||
PLAN *c_follow(char ***, int);
|
||||
PLAN *c_fprint(char ***, int);
|
||||
PLAN *c_fstype(char ***, int);
|
||||
PLAN *c_group(char ***, int);
|
||||
PLAN *c_iname(char ***, int);
|
||||
PLAN *c_inum(char ***, int);
|
||||
PLAN *c_iregex(char ***, int);
|
||||
PLAN *c_links(char ***, int);
|
||||
PLAN *c_ls(char ***, int);
|
||||
PLAN *c_maxdepth(char ***, int);
|
||||
PLAN *c_mindepth(char ***, int);
|
||||
PLAN *c_mmin(char ***, int);
|
||||
PLAN *c_mtime(char ***, int);
|
||||
PLAN *c_name(char ***, int);
|
||||
PLAN *c_newer(char ***, int);
|
||||
PLAN *c_nogroup(char ***, int);
|
||||
PLAN *c_nouser(char ***, int);
|
||||
PLAN *c_path(char ***, int);
|
||||
PLAN *c_perm(char ***, int);
|
||||
PLAN *c_print(char ***, int);
|
||||
PLAN *c_print0(char ***, int);
|
||||
PLAN *c_printx(char ***, int);
|
||||
PLAN *c_prune(char ***, int);
|
||||
PLAN *c_regex(char ***, int);
|
||||
PLAN *c_size(char ***, int);
|
||||
PLAN *c_type(char ***, int);
|
||||
PLAN *c_user(char ***, int);
|
||||
PLAN *c_xdev(char ***, int);
|
||||
PLAN *c_openparen(char ***, int);
|
||||
PLAN *c_closeparen(char ***, int);
|
||||
PLAN *c_not(char ***, int);
|
||||
PLAN *c_or(char ***, int);
|
||||
PLAN *c_null(char ***, int);
|
||||
|
||||
extern int ftsoptions, isdeprecated, isdepth, isoutput, issort, isxargs;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: find.c,v 1.22 2006/10/07 17:04:02 apb Exp $ */
|
||||
/* $NetBSD: find.c,v 1.23 2006/10/11 19:51:10 apb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
@ -37,7 +37,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "from: @(#)find.c 8.5 (Berkeley) 8/5/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: find.c,v 1.22 2006/10/07 17:04:02 apb Exp $");
|
||||
__RCSID("$NetBSD: find.c,v 1.23 2006/10/11 19:51:10 apb Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -54,10 +54,10 @@ __RCSID("$NetBSD: find.c,v 1.22 2006/10/07 17:04:02 apb Exp $");
|
||||
|
||||
#include "find.h"
|
||||
|
||||
static int ftscompare __P((const FTSENT **, const FTSENT **));
|
||||
static int ftscompare(const FTSENT **, const FTSENT **);
|
||||
|
||||
static void sig_lock __P((sigset_t *));
|
||||
static void sig_unlock __P((const sigset_t *));
|
||||
static void sig_lock(sigset_t *);
|
||||
static void sig_unlock(const sigset_t *);
|
||||
|
||||
/*
|
||||
* find_formplan --
|
||||
@ -65,8 +65,7 @@ static void sig_unlock __P((const sigset_t *));
|
||||
* command arguments.
|
||||
*/
|
||||
PLAN *
|
||||
find_formplan(argv)
|
||||
char **argv;
|
||||
find_formplan(char **argv)
|
||||
{
|
||||
PLAN *plan, *tail, *new;
|
||||
|
||||
@ -149,16 +148,14 @@ find_formplan(argv)
|
||||
}
|
||||
|
||||
static int
|
||||
ftscompare(e1, e2)
|
||||
const FTSENT **e1, **e2;
|
||||
ftscompare(const FTSENT **e1, const FTSENT **e2)
|
||||
{
|
||||
|
||||
return (strcoll((*e1)->fts_name, (*e2)->fts_name));
|
||||
}
|
||||
|
||||
static void
|
||||
sig_lock(s)
|
||||
sigset_t *s;
|
||||
sig_lock(sigset_t *s)
|
||||
{
|
||||
sigset_t new;
|
||||
|
||||
@ -168,8 +165,7 @@ sig_lock(s)
|
||||
}
|
||||
|
||||
static void
|
||||
sig_unlock(s)
|
||||
const sigset_t *s;
|
||||
sig_unlock(const sigset_t *s)
|
||||
{
|
||||
|
||||
sigprocmask(SIG_SETMASK, s, NULL);
|
||||
@ -184,9 +180,7 @@ FTSENT *g_entry; /* shared with SIGINFO handler */
|
||||
* over all FTSENT's returned for the given search paths.
|
||||
*/
|
||||
int
|
||||
find_execute(plan, paths)
|
||||
PLAN *plan; /* search plan */
|
||||
char **paths; /* array of pathnames to traverse */
|
||||
find_execute(PLAN *plan, char **paths)
|
||||
{
|
||||
PLAN *p;
|
||||
int r, rval, cval;
|
||||
@ -265,7 +259,7 @@ find_execute(plan, paths)
|
||||
int
|
||||
find_traverse(plan, func, arg)
|
||||
PLAN *plan;
|
||||
int (*func) __P((PLAN *, void *));
|
||||
int (*func)(PLAN *, void *);
|
||||
void *arg;
|
||||
{
|
||||
PLAN *p;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: find.h,v 1.22 2006/10/07 17:04:02 apb Exp $ */
|
||||
/* $NetBSD: find.h,v 1.23 2006/10/11 19:51:10 apb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
@ -51,8 +51,8 @@ enum ntype {
|
||||
/* node definition */
|
||||
typedef struct _plandata {
|
||||
struct _plandata *next; /* next node */
|
||||
int (*eval) /* node evaluation function */
|
||||
__P((struct _plandata *, FTSENT *));
|
||||
int (*eval)(struct _plandata *, FTSENT *);
|
||||
/* node evaluation function */
|
||||
#define F_EQUAL 1 /* [acm]time inum links size */
|
||||
#define F_LESSTHAN 2
|
||||
#define F_GREATER 3
|
||||
@ -126,10 +126,9 @@ typedef struct _plandata {
|
||||
#define fprint_file p_un._fprint_file
|
||||
|
||||
typedef struct _option {
|
||||
char *name; /* option name */
|
||||
const char *name; /* option name */
|
||||
enum ntype token; /* token type */
|
||||
PLAN *(*create) /* create function */
|
||||
__P((char ***, int));
|
||||
PLAN *(*create)(char ***, int); /* create function */
|
||||
int arg; /* function needs arg */
|
||||
} OPTION;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ls.c,v 1.18 2003/08/07 11:13:42 agc Exp $ */
|
||||
/* $NetBSD: ls.c,v 1.19 2006/10/11 19:51:10 apb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "from: @(#)ls.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: ls.c,v 1.18 2003/08/07 11:13:42 agc Exp $");
|
||||
__RCSID("$NetBSD: ls.c,v 1.19 2006/10/11 19:51:10 apb Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -57,14 +57,13 @@ __RCSID("$NetBSD: ls.c,v 1.18 2003/08/07 11:13:42 agc Exp $");
|
||||
|
||||
/* Derived from the print routines in the ls(1) source code. */
|
||||
|
||||
static void printlink __P((char *));
|
||||
static void printtime __P((time_t));
|
||||
static void printlink(char *);
|
||||
static void printtime(time_t);
|
||||
|
||||
void
|
||||
printlong(name, accpath, sb)
|
||||
char *name; /* filename to print */
|
||||
char *accpath; /* current valid path to filename */
|
||||
struct stat *sb; /* stat buffer */
|
||||
printlong(char *name, /* filename to print */
|
||||
char *accpath, /* current valid path to filename */
|
||||
struct stat *sb) /* stat buffer */
|
||||
{
|
||||
char modep[15];
|
||||
|
||||
@ -88,8 +87,7 @@ printlong(name, accpath, sb)
|
||||
}
|
||||
|
||||
static void
|
||||
printtime(ftime)
|
||||
time_t ftime;
|
||||
printtime(time_t ftime)
|
||||
{
|
||||
int i;
|
||||
char *longstring;
|
||||
@ -111,8 +109,7 @@ printtime(ftime)
|
||||
}
|
||||
|
||||
static void
|
||||
printlink(name)
|
||||
char *name;
|
||||
printlink(char *name)
|
||||
{
|
||||
int lnklen;
|
||||
char path[MAXPATHLEN + 1];
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.24 2005/10/19 12:25:51 elad Exp $ */
|
||||
/* $NetBSD: main.c,v 1.25 2006/10/11 19:51:10 apb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
@ -39,7 +39,7 @@ static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
|
||||
#else
|
||||
__COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n");
|
||||
__RCSID("$NetBSD: main.c,v 1.24 2005/10/19 12:25:51 elad Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.25 2006/10/11 19:51:10 apb Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -69,13 +69,11 @@ int isoutput; /* user specified output operator */
|
||||
int issort; /* sort directory entries */
|
||||
int isxargs; /* don't permit xargs delimiting chars */
|
||||
|
||||
int main __P((int, char **));
|
||||
static void usage __P((void));
|
||||
int main(int, char **);
|
||||
static void usage(void);
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct sigaction sa;
|
||||
char **p, **start;
|
||||
@ -160,7 +158,7 @@ main(argc, argv)
|
||||
}
|
||||
|
||||
static void
|
||||
usage()
|
||||
usage(void)
|
||||
{
|
||||
|
||||
(void)fprintf(stderr,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: misc.c,v 1.13 2006/08/26 18:17:42 christos Exp $ */
|
||||
/* $NetBSD: misc.c,v 1.14 2006/10/11 19:51:10 apb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
@ -37,7 +37,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "from: @(#)misc.c 8.2 (Berkeley) 4/1/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: misc.c,v 1.13 2006/08/26 18:17:42 christos Exp $");
|
||||
__RCSID("$NetBSD: misc.c,v 1.14 2006/10/11 19:51:10 apb Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -53,16 +53,14 @@ __RCSID("$NetBSD: misc.c,v 1.13 2006/08/26 18:17:42 christos Exp $");
|
||||
#include <unistd.h>
|
||||
|
||||
#include "find.h"
|
||||
|
||||
|
||||
/*
|
||||
* brace_subst --
|
||||
* Replace occurrences of {} in orig with path, and place it in a malloced
|
||||
* area of memory set in store.
|
||||
*/
|
||||
void
|
||||
brace_subst(orig, store, path, len)
|
||||
char *orig, **store, *path;
|
||||
int *len;
|
||||
brace_subst(char *orig, char **store, char *path, int *len)
|
||||
{
|
||||
int nlen, plen, rest;
|
||||
char ch, *p, *ostore;
|
||||
@ -98,8 +96,7 @@ brace_subst(orig, store, path, len)
|
||||
* input. If the input is 'y' then 1 is returned.
|
||||
*/
|
||||
int
|
||||
queryuser(argv)
|
||||
char **argv;
|
||||
queryuser(char **argv)
|
||||
{
|
||||
int ch, first, nl;
|
||||
|
||||
@ -126,15 +123,14 @@ queryuser(argv)
|
||||
}
|
||||
return (first == 'y');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* show_path --
|
||||
* called on SIGINFO
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
void
|
||||
show_path(sig)
|
||||
int sig;
|
||||
show_path(int sig)
|
||||
{
|
||||
extern FTSENT *g_entry;
|
||||
int errno_bak;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: operator.c,v 1.8 2003/08/07 11:13:43 agc Exp $ */
|
||||
/* $NetBSD: operator.c,v 1.9 2006/10/11 19:51:10 apb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
@ -37,7 +37,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "from: @(#)operator.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: operator.c,v 1.8 2003/08/07 11:13:43 agc Exp $");
|
||||
__RCSID("$NetBSD: operator.c,v 1.9 2006/10/11 19:51:10 apb Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -48,27 +48,26 @@ __RCSID("$NetBSD: operator.c,v 1.8 2003/08/07 11:13:43 agc Exp $");
|
||||
#include <stdio.h>
|
||||
|
||||
#include "find.h"
|
||||
|
||||
static PLAN *yanknode __P((PLAN **));
|
||||
static PLAN *yankexpr __P((PLAN **));
|
||||
|
||||
static PLAN *yanknode(PLAN **);
|
||||
static PLAN *yankexpr(PLAN **);
|
||||
|
||||
/*
|
||||
* yanknode --
|
||||
* destructively removes the top from the plan
|
||||
*/
|
||||
static PLAN *
|
||||
yanknode(planp)
|
||||
PLAN **planp; /* pointer to top of plan (modified) */
|
||||
yanknode(PLAN **planp) /* pointer to top of plan (modified) */
|
||||
{
|
||||
PLAN *node; /* top node removed from the plan */
|
||||
|
||||
|
||||
if ((node = (*planp)) == NULL)
|
||||
return (NULL);
|
||||
(*planp) = (*planp)->next;
|
||||
node->next = NULL;
|
||||
return (node);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* yankexpr --
|
||||
* Removes one expression from the plan. This is used mainly by
|
||||
@ -76,18 +75,17 @@ yanknode(planp)
|
||||
* simple node or a N_EXPR node containing a list of simple nodes.
|
||||
*/
|
||||
static PLAN *
|
||||
yankexpr(planp)
|
||||
PLAN **planp; /* pointer to top of plan (modified) */
|
||||
yankexpr(PLAN **planp) /* pointer to top of plan (modified) */
|
||||
{
|
||||
PLAN *next; /* temp node holding subexpression results */
|
||||
PLAN *node; /* pointer to returned node or expression */
|
||||
PLAN *tail; /* pointer to tail of subplan */
|
||||
PLAN *subplan; /* pointer to head of ( ) expression */
|
||||
|
||||
|
||||
/* first pull the top node from the plan */
|
||||
if ((node = yanknode(planp)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
|
||||
/*
|
||||
* If the node is an '(' then we recursively slurp up expressions
|
||||
* until we find its associated ')'. If it's a closing paren we
|
||||
@ -124,19 +122,18 @@ yankexpr(planp)
|
||||
}
|
||||
return (node);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* paren_squish --
|
||||
* replaces "parentheisized" plans in our search plan with "expr" nodes.
|
||||
*/
|
||||
PLAN *
|
||||
paren_squish(plan)
|
||||
PLAN *plan; /* plan with ( ) nodes */
|
||||
paren_squish(PLAN *plan) /* plan with ( ) nodes */
|
||||
{
|
||||
PLAN *expr; /* pointer to next expression */
|
||||
PLAN *tail; /* pointer to tail of result plan */
|
||||
PLAN *result; /* pointer to head of result plan */
|
||||
|
||||
|
||||
result = tail = NULL;
|
||||
|
||||
/*
|
||||
@ -162,22 +159,21 @@ paren_squish(plan)
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* not_squish --
|
||||
* compresses "!" expressions in our search plan.
|
||||
*/
|
||||
PLAN *
|
||||
not_squish(plan)
|
||||
PLAN *plan; /* plan to process */
|
||||
not_squish(PLAN *plan) /* plan to process */
|
||||
{
|
||||
PLAN *next; /* next node being processed */
|
||||
PLAN *node; /* temporary node used in N_NOT processing */
|
||||
PLAN *tail; /* pointer to tail of result plan */
|
||||
PLAN *result; /* pointer to head of result plan */
|
||||
|
||||
|
||||
tail = result = next = NULL;
|
||||
|
||||
|
||||
while ((next = yanknode(&plan)) != NULL) {
|
||||
/*
|
||||
* if we encounter a ( expression ) then look for nots in
|
||||
@ -222,21 +218,20 @@ not_squish(plan)
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* or_squish --
|
||||
* compresses -o expressions in our search plan.
|
||||
*/
|
||||
PLAN *
|
||||
or_squish(plan)
|
||||
PLAN *plan; /* plan with ors to be squished */
|
||||
or_squish(PLAN *plan) /* plan with ors to be squished */
|
||||
{
|
||||
PLAN *next; /* next node being processed */
|
||||
PLAN *tail; /* pointer to tail of result plan */
|
||||
PLAN *result; /* pointer to head of result plan */
|
||||
|
||||
|
||||
tail = result = next = NULL;
|
||||
|
||||
|
||||
while ((next = yanknode(&plan)) != NULL) {
|
||||
/*
|
||||
* if we encounter a ( expression ) then look for or's in
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: option.c,v 1.23 2006/02/20 16:31:03 jschauma Exp $ */
|
||||
/* $NetBSD: option.c,v 1.24 2006/10/11 19:51:10 apb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
@ -37,7 +37,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "from: @(#)option.c 8.2 (Berkeley) 4/16/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: option.c,v 1.23 2006/02/20 16:31:03 jschauma Exp $");
|
||||
__RCSID("$NetBSD: option.c,v 1.24 2006/10/11 19:51:10 apb Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -52,8 +52,8 @@ __RCSID("$NetBSD: option.c,v 1.23 2006/02/20 16:31:03 jschauma Exp $");
|
||||
|
||||
#include "find.h"
|
||||
|
||||
int typecompare __P((const void *, const void *));
|
||||
static OPTION *option __P((char *));
|
||||
int typecompare(const void *, const void *);
|
||||
static OPTION *option(char *);
|
||||
|
||||
/* NB: the following table must be sorted lexically. */
|
||||
static OPTION const options[] = {
|
||||
@ -117,8 +117,7 @@ static OPTION const options[] = {
|
||||
* this switch stuff.
|
||||
*/
|
||||
PLAN *
|
||||
find_create(argvp)
|
||||
char ***argvp;
|
||||
find_create(char ***argvp)
|
||||
{
|
||||
OPTION *p;
|
||||
PLAN *new;
|
||||
@ -139,8 +138,7 @@ find_create(argvp)
|
||||
}
|
||||
|
||||
static OPTION *
|
||||
option(name)
|
||||
char *name;
|
||||
option(char *name)
|
||||
{
|
||||
OPTION tmp;
|
||||
|
||||
@ -150,9 +148,8 @@ option(name)
|
||||
}
|
||||
|
||||
int
|
||||
typecompare(a, b)
|
||||
const void *a, *b;
|
||||
typecompare(const void *a, const void *b)
|
||||
{
|
||||
|
||||
return (strcmp(((OPTION *)a)->name, ((OPTION *)b)->name));
|
||||
return (strcmp(((const OPTION *)a)->name, ((const OPTION *)b)->name));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user