Skip to contentSkip to conversation

queue.3: Remove wrong code from example

PATCH In review Alejandro Colomar 2 participants 2 messages Aug 12, 2020 – Aug 13, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 queue.3: Remove wrong code from example

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 <[email protected]>
Date: Wed, 12 Aug 2020 09:11:27 +0200
Subject: [PATCH] queue.3: Remove wrong code from example

---
 man3/queue.3 | 12 ------------
 1 file changed, 12 deletions(-)
man3/queue.3 +0 -12
index ff1f42f3a..260a5b8a5 100644
@@ -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.
Signature · 1 line
2.28.0
#1 lore raw

Hello Lejandro,

Quoted 9 lines · Alejandro Colomar

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 <[email protected]>
Date: Wed, 12 Aug 2020 09:11:27 +0200
Subject: [PATCH] queue.3: Remove wrong code from example

Thanks. Patch applied.

Cheers,

Michael

Quoted 28 lines
---
  man3/queue.3 | 12 ------------
  1 file changed, 12 deletions(-)
man3/queue.3 +0 -12
index ff1f42f3a..260a5b8a5 100644
@@ -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.
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/