Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Rename LIST_CONCAT() to LIST_MOVE() as that is what it actua...



details:   https://anonhg.NetBSD.org/src/rev/1d4fe8421988
branches:  trunk
changeset: 796037:1d4fe8421988
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat May 17 21:22:56 2014 +0000

description:
Rename LIST_CONCAT() to LIST_MOVE() as that is what it actually does (and
there is no point to implement LIST_CONCAT() which would iterate).  Update
the queue(3) manpage.

diffstat:

 share/man/man3/queue.3 |  14 ++++++++++++--
 sys/sys/queue.h        |  11 ++++++-----
 2 files changed, 18 insertions(+), 7 deletions(-)

diffs (74 lines):

diff -r 45be1d1ceb9f -r 1d4fe8421988 share/man/man3/queue.3
--- a/share/man/man3/queue.3    Sat May 17 21:00:33 2014 +0000
+++ b/share/man/man3/queue.3    Sat May 17 21:22:56 2014 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: queue.3,v 1.47 2013/11/28 16:45:36 wiz Exp $
+.\"    $NetBSD: queue.3,v 1.48 2014/05/17 21:22:56 rmind Exp $
 .\"
 .\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\"
 .\"    @(#)queue.3     8.1 (Berkeley) 12/13/93
 .\"
-.Dd November 27, 2013
+.Dd May 17, 2014
 .Dt QUEUE 3
 .Os
 .Sh NAME
@@ -85,6 +85,7 @@
 .Nm LIST_INSERT_HEAD ,
 .Nm LIST_REMOVE ,
 .Nm LIST_REPLACE ,
+.Nm LIST_MOVE ,
 .Nm SIMPLEQ_HEAD ,
 .Nm SIMPLEQ_HEAD_INITIALIZER ,
 .Nm SIMPLEQ_ENTRY ,
@@ -176,6 +177,7 @@
 .Fn LIST_INSERT_HEAD "LIST_HEAD *head" "TYPE *elm" "LIST_ENTRY NAME"
 .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
 .Fn LIST_REPLACE "TYPE *elm" "TYPE *new" "LIST_ENTRY NAME"
+.Fn LIST_MOVE "LIST_HEAD *head1" "LIST_HEAD *head2"
 .Pp
 .Fn SIMPLEQ_HEAD "HEADNAME" "TYPE"
 .Fn SIMPLEQ_HEAD_INITIALIZER "head"
@@ -661,6 +663,14 @@
 with
 .Fa new
 in the list.
+.Pp
+The macro
+.Nm LIST_MOVE
+moves the list headed by
+.Fa head1
+onto the list headed by
+.Fa head2 ,
+always making the former empty.
 .Sh LIST EXAMPLE
 .Bd -literal
 LIST_HEAD(listhead, entry) head;
diff -r 45be1d1ceb9f -r 1d4fe8421988 sys/sys/queue.h
--- a/sys/sys/queue.h   Sat May 17 21:00:33 2014 +0000
+++ b/sys/sys/queue.h   Sat May 17 21:22:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: queue.h,v 1.66 2014/05/17 20:34:49 rmind Exp $ */
+/*     $NetBSD: queue.h,v 1.67 2014/05/17 21:22:56 rmind Exp $ */
 
 /*
  * Copyright (c) 1991, 1993
@@ -211,10 +211,11 @@
            ((tvar) = LIST_NEXT((var), field), 1);                      \
            (var) = (tvar))
 
-#define        LIST_CONCAT(head1, head2) do {                                  \
-       if (!LIST_EMPTY((head2))) {                                     \
-               (head1)->lh_first = (head2)->lh_first;                  \
-               LIST_INIT((head2));                                     \
+#define        LIST_MOVE(head1, head2) do {                                    \
+       LIST_INIT((head2));                                             \
+       if (!LIST_EMPTY((head1))) {                                     \
+               (head2)->lh_first = (head1)->lh_first;                  \
+               LIST_INIT((head1));                                     \
        }                                                               \
 } while (/*CONSTCOND*/0)
 



Home | Main Index | Thread Index | Old Index