All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Michal Marek <mmarek@suse.cz>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Benjamin Poirier <bpoirier@suse.de>,
	"Yann E. MORIN" <yann.morin.1998@free.fr>,
	Yaakov Selkowitz <yselkowitz@gmail.com>
Subject: [PATCH] kconfig/menuconfig: use TAILQ instead of CIRCLEQ
Date: Thu, 18 Oct 2012 19:33:45 +0200	[thread overview]
Message-ID: <1350581625-23153-1-git-send-email-yann.morin.1998@free.fr> (raw)

Some systems (eg. Cygwin, FreeBSD) are missing the CIRCLEQ macros.
They were removed in Y2000 from FreeBSD:
    http://svnweb.freebsd.org/base?view=revision&revision=70469

The reason was that TAILQ are perfectly capable of doing the exact
same things:
    http://www.mavetju.org/mail/view_thread.php?list=freebsd-arch&id=915145&thread=yes

(Thank Yaakov for the pointers!)

So, switch to using TAILQ instead, which are more portable.

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Reported-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Yaakov Selkowitz <yselkowitz@gmail.com>
---
 scripts/kconfig/expr.h  |    4 ++--
 scripts/kconfig/mconf.c |    4 ++--
 scripts/kconfig/menu.c  |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index bd2e098..c6a8b99 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -175,12 +175,12 @@ struct menu {
 #define MENU_ROOT		0x0002
 
 struct jump_key {
-	CIRCLEQ_ENTRY(jump_key) entries;
+	TAILQ_ENTRY(jump_key) entries;
 	size_t offset;
 	struct menu *target;
 	int index;
 };
-CIRCLEQ_HEAD(jk_head, jump_key);
+TAILQ_HEAD(jk_head, jump_key);
 
 #define JUMP_NB			9
 
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 48f6744..f1ee1c9 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -323,7 +323,7 @@ static void update_text(char *buf, size_t start, size_t end, void *_data)
 	struct jump_key *pos;
 	int k = 0;
 
-	CIRCLEQ_FOREACH(pos, data->head, entries) {
+	TAILQ_FOREACH(pos, data->head, entries) {
 		if (pos->offset >= start && pos->offset < end) {
 			char header[4];
 
@@ -375,7 +375,7 @@ again:
 
 	sym_arr = sym_re_search(dialog_input);
 	do {
-		struct jk_head head = CIRCLEQ_HEAD_INITIALIZER(head);
+		struct jk_head head = TAILQ_HEAD_INITIALIZER(head);
 		struct menu *targets[JUMP_NB];
 		int keys[JUMP_NB + 1], i;
 		struct search_data data = {
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index a3cade6..9eff451 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -544,12 +544,12 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
 		} else
 			jump->target = location;
 
-		if (CIRCLEQ_EMPTY(head))
+		if (TAILQ_EMPTY(head))
 			jump->index = 0;
 		else
-			jump->index = CIRCLEQ_LAST(head)->index + 1;
+			jump->index = TAILQ_LAST(head, jk_head)->index + 1;
 
-		CIRCLEQ_INSERT_TAIL(head, jump, entries);
+		TAILQ_INSERT_TAIL(head, jump, entries);
 	}
 
 	if (i > 0) {
-- 
1.7.2.5


             reply	other threads:[~2012-10-18 17:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18 17:33 Yann E. MORIN [this message]
2012-10-18 17:55 ` [PATCH] kconfig/menuconfig: use TAILQ instead of CIRCLEQ Yaakov (Cygwin/X)
2012-10-18 18:59   ` Yann E. MORIN
2012-10-19  8:59     ` Yaakov (Cygwin/X)
2012-10-19 12:10 ` Tetsuo Handa
2012-10-19 14:54   ` Michal Marek
2012-10-20 14:43     ` Tetsuo Handa
2012-10-20 16:58       ` Yann E. MORIN
2012-10-19 22:52   ` Yann E. MORIN
2012-10-20 17:56 ` [PATCH] menuconfig: Replace CIRCLEQ by list_head-style lists Benjamin Poirier
2012-10-20 21:22   ` Yann E. MORIN
2012-10-21  1:21     ` Tetsuo Handa
2012-10-20 22:19   ` Yann E. MORIN
2012-10-21  1:54   ` Yaakov (Cygwin/X)
2012-10-23 13:12 ` [PATCH] kconfig/menuconfig: use TAILQ instead of CIRCLEQ Christoph Hellwig
2012-10-23 17:04   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350581625-23153-1-git-send-email-yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=bpoirier@suse.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=yselkowitz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.