Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 1997 17:39:39 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        wollman@khavrinen.lcs.mit.edu (Garrett Wollman)
Cc:        terry@lambert.org, current@FreeBSD.ORG
Subject:   Re: WHY? ...non-use of TAILQ macros...
Message-ID:  <199704110039.RAA10331@phaeton.artisoft.com>
In-Reply-To: <199704110021.UAA05660@khavrinen.lcs.mit.edu> from "Garrett Wollman" at Apr 10, 97 08:21:58 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > I'm wondering why the following aren't written using the macros (macro
> > versions are shown one line below):
> 
> > kern_lockf.c:				while (ltmp = overlap->lf_blkhd.tqh_first) {
> 
> 1.  Because they are a FreeBSD (actually Justin Gibbs) invention.
> Obviously, original Berkeley code will not use a macro that Berkeley
> didn't have.
> 
> 2.  Because they are unnecessary.

Well, that begs the question of qhy they are being used in declarations
and elsewhere, then, doesn't it?


> > #define	TAILQ_ENUM(elm,head,field)	\
> > 	for( elm = (head)->tqh_first; elm != NULL; elm = (elm)->field.tqe_next)
> 
> Go read style(9) and then say that with a straight face.

Well, *despite* the fact that there is still no style man page on
freefall...


If the tailq's are a FreeBSD invention, they should either be universally
applied, or not applied at all.  Style is quite binary about this kind
of thing.  And it's not like there is a CSRG any more.


I was interested in macro versions to allow conditional compilation
of locking code for mutex locking queue reference and modification
(the reasoning should be obvious).


					Regards,
					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704110039.RAA10331>