linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] queue.3: Remove wrong code from example
@ 2020-08-12  7:43 Alejandro Colomar
  2020-08-13  7:28 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Colomar @ 2020-08-12  7:43 UTC (permalink / raw)
  To: linux-man

There was code containing ``CIRCLEQ_*`` in the examples for ``TAILQ_*``. 
  It was introduced by accident in commit ``041abbe``.

 From 0c9dfbe9b1ce1130e9a92d1a16fbecd4a08bbe29 Mon Sep 17 00:00:00 2001
From: Alejandro Colomar <colomar.6.4.3@gmail.com>
Date: Wed, 12 Aug 2020 09:11:27 +0200
Subject: [PATCH] queue.3: Remove wrong code from example

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---
  man3/queue.3 | 12 ------------
  1 file changed, 12 deletions(-)

diff --git a/man3/queue.3 b/man3/queue.3
index ff1f42f3a..260a5b8a5 100644
--- a/man3/queue.3
+++ b/man3/queue.3
@@ -1219,18 +1219,6 @@ while (n1 != NULL) {
  }

  TAILQ_INIT(&head);
-n2 = malloc(sizeof(struct entry));  /* Insert before. */
-CIRCLEQ_INSERT_BEFORE(&head, n1, n2, entries);
-                                    /* Forward traversal. */
-for (np = head.cqh_first; np != (void *)&head;
-        np = np\->entries.cqe_next)
-    np\-> ...
-                                    /* Reverse traversal. */
-for (np = head.cqh_last; np != (void *)&head; np = np\->entries.cqe_prev)
-    np\-> ...
-                                    /* Delete. */
-while (head.cqh_first != (void *)&head)
-    CIRCLEQ_REMOVE(&head, head.cqh_first, entries);
  .Ed
  .Sh CONFORMING TO
  Not in POSIX.1, POSIX.1-2001 or POSIX.1-2008.
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] queue.3: Remove wrong code from example
  2020-08-12  7:43 [patch] queue.3: Remove wrong code from example Alejandro Colomar
@ 2020-08-13  7:28 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-08-13  7:28 UTC (permalink / raw)
  To: Alejandro Colomar, linux-man; +Cc: mtk.manpages

Hello Lejandro,

On 8/12/20 9:43 AM, Alejandro Colomar wrote:
> There was code containing ``CIRCLEQ_*`` in the examples for ``TAILQ_*``. 
>   It was introduced by accident in commit ``041abbe``.
> 
>  From 0c9dfbe9b1ce1130e9a92d1a16fbecd4a08bbe29 Mon Sep 17 00:00:00 2001
> From: Alejandro Colomar <colomar.6.4.3@gmail.com>
> Date: Wed, 12 Aug 2020 09:11:27 +0200
> Subject: [PATCH] queue.3: Remove wrong code from example
> 
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>

Thanks. Patch applied.

Cheers,

Michael


> ---
>   man3/queue.3 | 12 ------------
>   1 file changed, 12 deletions(-)
> 
> diff --git a/man3/queue.3 b/man3/queue.3
> index ff1f42f3a..260a5b8a5 100644
> --- a/man3/queue.3
> +++ b/man3/queue.3
> @@ -1219,18 +1219,6 @@ while (n1 != NULL) {
>   }
> 
>   TAILQ_INIT(&head);
> -n2 = malloc(sizeof(struct entry));  /* Insert before. */
> -CIRCLEQ_INSERT_BEFORE(&head, n1, n2, entries);
> -                                    /* Forward traversal. */
> -for (np = head.cqh_first; np != (void *)&head;
> -        np = np\->entries.cqe_next)
> -    np\-> ...
> -                                    /* Reverse traversal. */
> -for (np = head.cqh_last; np != (void *)&head; np = np\->entries.cqe_prev)
> -    np\-> ...
> -                                    /* Delete. */
> -while (head.cqh_first != (void *)&head)
> -    CIRCLEQ_REMOVE(&head, head.cqh_first, entries);
>   .Ed
>   .Sh CONFORMING TO
>   Not in POSIX.1, POSIX.1-2001 or POSIX.1-2008.
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-13  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12  7:43 [patch] queue.3: Remove wrong code from example Alejandro Colomar
2020-08-13  7:28 ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).