Date: Thu, 3 Jan 2002 12:42:02 +0100 (CET) From: Harti Brandt <brandt@fokus.gmd.de> To: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: Julian Elischer <julian@elischer.org>, Stephen McKay <mckay@thehub.com.au>, John Baldwin <jhb@FreeBSD.ORG>, <cvs-all@FreeBSD.ORG>, <cvs-committers@FreeBSD.ORG>, Julian Elischer <julian@FreeBSD.ORG>, Greg Lehey <grog@FreeBSD.ORG> Subject: Re: cvs commit: src/share/man/man3 queue.3 Message-ID: <20020103124044.C7957-100000@beagle.fokus.gmd.de> In-Reply-To: <951.1010057694@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 3 Jan 2002, Poul-Henning Kamp wrote: PK>In message <Pine.BSF.4.21.0201030044520.22265-100000@InterJet.elischer.org>, Ju PK>lian Elischer writes: PK> PK>>> >how about explicitly detailing that it's NULL at the end? PK>>> >Doesn't that also work? PK>>> PK>>> I don't think we should document that. PK>>> PK>>> There are types of lists/queues which doesn't naturally end with PK>>> that condition. That is why we have the FOO_EMPTY() clause, although PK>>> people tend to also rely on PK>>> PK>>> if (FOO_FIRST(...) == NULL) PK>>> /* nothing to do */ PK>> PK>>Since TAILQ_FIRST== NULL is a termination (it's empty) PK>>condition (as is TAILQ_NEXT() == NULL) PK>>it makes PERFECT sense that a completed set of iterations ends up PK>>with the pointer being NULL. PK> PK>If for instance we (re)introduce CIRCLEQ or certain other queue PK>types, it is by no means obvious that the continuation clause PK>of the FOREACH() will be "!= NULL". That means, that the "== NULL" should be documented exactly for those queue types for which this is true. harti -- harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fhg.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020103124044.C7957-100000>