Go to file
dyoung 3ea78c91dc Use TAILQ_FOREACH() instead of open-coding it.
I applied this patch with Coccinelle's semantic patch tool, spatch(1).
I installed Coccinelle from pkgsrc: devel/coccinelle/.  I wrote
tailq.spatch and kdefs.h (see below) and ran this command,

spatch -debug -macro_file_builtins ./kdefs.h -outplace \
    -sp_file sys/kern/tailq.spatch sys/kern/subr_autoconf.c

which wrote the transformed source file to /tmp/subr_autoconf.c.  Then I
used indent(1) to fix the indentation.

::::::::::::::::::::
::: tailq.spatch :::
::::::::::::::::::::

@@
identifier I, N;
expression H;
statement S;
iterator name TAILQ_FOREACH;
@@

- for (I = TAILQ_FIRST(H); I != NULL; I = TAILQ_NEXT(I, N)) S
+ TAILQ_FOREACH(I, H, N) S

:::::::::::::::
::: kdefs.h :::
:::::::::::::::

#define MAXUSERS 64
#define _KERNEL
#define _KERNEL_OPT
#define i386

/*
 * Tail queue definitions.
 */
#define	_TAILQ_HEAD(name, type, qual)					\
struct name {								\
	qual type *tqh_first;		/* first element */		\
	qual type *qual *tqh_last;	/* addr of last next element */	\
}
#define TAILQ_HEAD(name, type)	_TAILQ_HEAD(name, struct type,)

#define	TAILQ_HEAD_INITIALIZER(head)					\
	{ NULL, &(head).tqh_first }

#define	_TAILQ_ENTRY(type, qual)					\
struct {								\
	qual type *tqe_next;		/* next element */		\
	qual type *qual *tqe_prev;	/* address of previous next element */\
}
#define TAILQ_ENTRY(type)	_TAILQ_ENTRY(struct type,)

#define	PMF_FN_PROTO1	pmf_qual_t
#define	PMF_FN_ARGS1	pmf_qual_t qual
#define	PMF_FN_CALL1	qual

#define	PMF_FN_PROTO	, pmf_qual_t
#define	PMF_FN_ARGS	, pmf_qual_t qual
#define	PMF_FN_CALL	, qual

#define __KERNEL_RCSID(a, b)
2009-11-12 23:16:28 +00:00
bin Correct usage for parentheses, and mark up "expression" in more places. 2009-11-10 18:19:46 +00:00
common New binutils seems to want end of functions marked. 2009-11-09 14:22:02 +00:00
compat Regen for NOLINKLIB. 2009-11-09 15:49:35 +00:00
crypto use %option instead of #define YY_NO_... 2009-10-29 14:49:02 +00:00
dist Drop 3rd and 4th clauses, as the copyright holder (Michael Shalayeff) did 2009-11-03 01:13:38 +00:00
distrib Use proper tag ".man" for man files. 2009-11-12 13:17:46 +00:00
doc update libevent version information 2009-11-11 15:35:57 +00:00
etc Install a.out version of INSTALL kernel in release. Slightly modified 2009-11-06 12:31:44 +00:00
external build the igs driver on shark 2009-11-10 23:14:04 +00:00
games use %option noinput nounput 2009-10-29 14:27:26 +00:00
gnu Add the -iremap option to gcc(1) and cpp(1). This option specifies a 2009-11-11 19:03:52 +00:00
include typedef struct link_map as Link_map (for solaris-compat) 2009-11-04 19:28:03 +00:00
lib Do not use \." for comments, always use .\". Discussed with uwe@. 2009-11-12 00:43:52 +00:00
libexec Add RCSID 2009-11-11 14:15:41 +00:00
regress remove libevent (uses ATF tests now) 2009-11-02 15:44:12 +00:00
rescue kill ldd_aout. it didn't work anyway...not since i don't know when. 2009-08-22 06:52:15 +00:00
sbin Allow MB, GB and CYL (not just M, G and C) and lower case. 2009-11-04 22:25:56 +00:00
share Remove "USE_SSP_DEFAULT". 2009-11-12 14:46:37 +00:00
sys Use TAILQ_FOREACH() instead of open-coding it. 2009-11-12 23:16:28 +00:00
tests WARNS=4 2009-11-06 15:26:54 +00:00
tools Revert most of revision 1.73: 2009-11-11 21:53:46 +00:00
usr.bin Don't assume that "id_t", "gid_t" and "uid_t" use the same underlying type 2009-11-12 10:10:49 +00:00
usr.sbin Update date. 2009-11-06 20:51:43 +00:00
x11 add -n to gzip invocation 2009-03-31 21:12:51 +00:00
build.sh If do_expertmode is false, then add DESTDIR and RELEASEDIR to makeenv. 2009-11-04 12:58:01 +00:00
BUILDING If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value 2009-10-10 19:05:28 +00:00
Makefile build & install librumpdev_netsmb and librumpfs_smbfs components 2009-09-04 17:21:33 +00:00
Makefile.inc
UPDATING Mention that 'build.sh -u' may also break while building lex. 2009-11-02 01:11:31 +00:00