mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Petr Baudis <pasky@ucw.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [kconfig] Direct use of lxdialog routines by menuconfig (resent,v2)
Date: Sun, 24 Nov 2002 02:48:23 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.44.0211240159240.2113-100000@serv> (raw)
In-Reply-To: <20021123095040.GY25628@pasky.ji.cz>

Hi,

On Sat, 23 Nov 2002, Petr Baudis wrote:

>   this patch (against 2.5.49) cleans up interaction between kconfig's mconf
> (menuconfig frontend) and lxdialog. Its commandline interface (called
> imaginatively lxdialog) no longer exists, instead a huge .o is packed from the
> lxdialog objects and the relevant functions are called directly from mconf.

It didn't apply cleanly, I had one reject from menubox.c, which I had to 
apply manually.
Anyway, some minor comments about the code:

> +struct dialog_list_item *items[16384]; /* FIXME: This ought to be dynamic. */
> +int item_no;
> +

These should be static.

> -static void cprint_init(void)
> +static void cinit(void)

You can join this with cdone(), they are always called together.

> +	if (!item_no)
> +		cmake();

This could be "if (!items[item_no]) cmake()" to allocate the data as 
needed. Increment item_no after you done, this avoids also all the 
"item_no - 1" as index.

> -static int cprint(const char *fmt, ...)
> +static int cprint_tag(const char *fmt, ...)
>  {
>  	va_list ap;
>  	int res;
>  
> -	*argptr++ = bufptr;
> +	if (!item_no)
> +		cmake();
>  	va_start(ap, fmt);
> -	res = vsprintf(bufptr, fmt, ap);
> +	res = vsnprintf(items[item_no - 1]->tag, 32, fmt, ap);
>  	va_end(ap);
> -	bufptr += res;
> -	*bufptr++ = 0;
>  
>  	return res;
>  }

Could you change the tag field of dialog_list_item into a "char type" and 
a void pointer? I don't really see a reason to convert them from/into 
strings anymore.

> -	sa.sa_handler = winch_handler;
> -	sigemptyset(&sa.sa_mask);
> -	sa.sa_flags = SA_RESTART;
> -	sigaction(SIGWINCH, &sa, NULL);

Could you please add this one back and just reinitialize curses? (I 
actually liked the new resize feature. :) )

BTW just add the other patch to this one, it's not that important to keep 
it separate.

bye, Roman


  reply	other threads:[~2002-11-24  1:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-23  9:50 Petr Baudis
2002-11-24  1:48 ` Roman Zippel [this message]
2003-02-05  3:01   ` [PATCH] [kconfig] Direct use of lxdialog routines by menuconfig (v3) Petr Baudis
2003-02-09 22:53     ` Roman Zippel
2002-12-04 20:43 ` [PATCH] [kconfig] Direct use of lxdialog routines by menuconfig (resent,v2) Erik Andersen

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=Pine.LNX.4.44.0211240159240.2113-100000@serv \
    --to=zippel@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pasky@ucw.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®