Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jan 2010 21:19:42 GMT
From:      Jeremy Huddleston <jeremyhu@apple.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/143033: _SWAP not listed in comment in sys/queue.h
Message-ID:  <201001202119.o0KLJg2t082705@www.freebsd.org>
Resent-Message-ID: <201001202120.o0KLK6Pw016992@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         143033
>Category:       misc
>Synopsis:       _SWAP not listed in comment in sys/queue.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 20 21:20:05 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Huddleston
>Release:        8.0
>Organization:
Apple
>Environment:
NA
>Description:
_SWAP is not listed in the list of macros in the documentation comment in queue.h

Also attaching a convenience fix which places STAILQ_REMOVE_HEAD correctly in alphabetical order.
>How-To-Repeat:

>Fix:
Index: queue.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/queue.h,v
retrieving revision 1.72
diff -u -p -r1.72 queue.h
--- queue.h	27 May 2009 19:28:04 -0000	1.72
+++ queue.h	20 Jan 2010 21:14:53 -0000
@@ -99,6 +99,7 @@
  * _REMOVE_AFTER		+	-	+	-
  * _REMOVE_HEAD			+	-	+	-
  * _REMOVE			+	+	+	+
+ * _SWAP			-	+	+	+
  *
  */
 #ifdef QUEUE_MACRO_DEBUG
@@ -297,18 +298,18 @@ struct {								\
 	TRASHIT((elm)->field.stqe_next);				\
 } while (0)
 
-#define	STAILQ_REMOVE_HEAD(head, field) do {				\
-	if ((STAILQ_FIRST((head)) =					\
-	     STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)		\
-		(head)->stqh_last = &STAILQ_FIRST((head));		\
-} while (0)
-
 #define STAILQ_REMOVE_AFTER(head, elm, field) do {			\
 	if ((STAILQ_NEXT(elm, field) =					\
 	     STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL)	\
 		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
 } while (0)
 
+#define	STAILQ_REMOVE_HEAD(head, field) do {				\
+	if ((STAILQ_FIRST((head)) =					\
+	     STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)		\
+		(head)->stqh_last = &STAILQ_FIRST((head));		\
+} while (0)
+
 #define STAILQ_SWAP(head1, head2, type) do {				\
 	struct type *swap_first = STAILQ_FIRST(head1);			\
 	struct type **swap_last = (head1)->stqh_last;			\


>Release-Note:
>Audit-Trail:
>Unformatted:



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