Merge in Lite2: fix comment

optimize TAILQ_INSERT_HEAD
Reviewed by:	davidg & bde
This commit is contained in:
Jeffrey Hsu 1996-03-11 02:14:38 +00:00
parent d6c32e1b47
commit 83edfd3e32
1 changed files with 9 additions and 9 deletions

View File

@ -30,8 +30,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)queue.h 8.4 (Berkeley) 1/4/94 * @(#)queue.h 8.5 (Berkeley) 8/20/94
* $Id: queue.h,v 1.5 1996/01/29 03:20:41 gibbs Exp $ * $Id: queue.h,v 1.7 1996/02/24 10:58:08 hsu Exp $
*/ */
#ifndef _SYS_QUEUE_H_ #ifndef _SYS_QUEUE_H_
@ -44,16 +44,16 @@
* A list is headed by a single forward pointer (or an array of forward * A list is headed by a single forward pointer (or an array of forward
* pointers for a hash table header). The elements are doubly linked * pointers for a hash table header). The elements are doubly linked
* so that an arbitrary element can be removed without a need to * so that an arbitrary element can be removed without a need to
* traverse the list. New elements can be added to the list after * traverse the list. New elements can be added to the list before
* an existing element or at the head of the list. A list may only be * or after an existing element or at the head of the list. A list
* traversed in the forward direction. * may only be traversed in the forward direction.
* *
* A tail queue is headed by a pair of pointers, one to the head of the * A tail queue is headed by a pair of pointers, one to the head of the
* list and the other to the tail of the list. The elements are doubly * list and the other to the tail of the list. The elements are doubly
* linked so that an arbitrary element can be removed without a need to * linked so that an arbitrary element can be removed without a need to
* traverse the list. New elements can be added to the list after * traverse the list. New elements can be added to the list before or
* an existing element, at the head of the list, or at the end of the * after an existing element, at the head of the list, or at the end of
* list. A tail queue may only be traversed in the forward direction. * the list. A tail queue may only be traversed in the forward direction.
* *
* A circle queue is headed by a pair of pointers, one to the head of the * A circle queue is headed by a pair of pointers, one to the head of the
* list and the other to the tail of the list. The elements are doubly * list and the other to the tail of the list. The elements are doubly
@ -141,7 +141,7 @@ struct { \
#define TAILQ_INSERT_HEAD(head, elm, field) { \ #define TAILQ_INSERT_HEAD(head, elm, field) { \
if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
(elm)->field.tqe_next->field.tqe_prev = \ (head)->tqh_first->field.tqe_prev = \
&(elm)->field.tqe_next; \ &(elm)->field.tqe_next; \
else \ else \
(head)->tqh_last = &(elm)->field.tqe_next; \ (head)->tqh_last = &(elm)->field.tqe_next; \