From owner-freebsd-current Thu Apr 10 17:59:45 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id RAA15357 for current-outgoing; Thu, 10 Apr 1997 17:59:45 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id RAA15346 for ; Thu, 10 Apr 1997 17:59:40 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id RAA10331; Thu, 10 Apr 1997 17:39:39 -0700 From: Terry Lambert Message-Id: <199704110039.RAA10331@phaeton.artisoft.com> Subject: Re: WHY? ...non-use of TAILQ macros... To: wollman@khavrinen.lcs.mit.edu (Garrett Wollman) Date: Thu, 10 Apr 1997 17:39:39 -0700 (MST) Cc: terry@lambert.org, current@FreeBSD.ORG In-Reply-To: <199704110021.UAA05660@khavrinen.lcs.mit.edu> from "Garrett Wollman" at Apr 10, 97 08:21:58 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > 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.