linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Christopher Li" <sparse@chrisli.org>
To: Hannes Eder <hannes@hanneseder.net>
Cc: linux-sparse@vger.kernel.org,
	Alexey Zaytsev <alexey.zaytsev@gmail.com>,
	Junio C Hamano <junio@pobox.com>
Subject: Re: [PATCH v3] Add -ftabstop=WIDTH
Date: Thu, 8 Jan 2009 12:13:11 -0800	[thread overview]
Message-ID: <70318cbf0901081213i22dc8054yda4230e8a6375e9a@mail.gmail.com> (raw)
In-Reply-To: <20090108191748.10635.63257.stgit@vmbox.hanneseder.net>

On Thu, Jan 8, 2009 at 11:18 AM, Hannes Eder <hannes@hanneseder.net> wrote:

> +
> +       if (!strncmp(arg, "tabstop=", 8)) {
> +               char *end;
> +               unsigned long val;
> +               arg += 8;
> +
> +               if (*arg == '\0')
> +                       die("error: missing argument to \"-ftabstop=\"");
> +
> +               /* we silently ignore silly values */
> +               val = strtoul(arg, &end, 10);
> +               if (*end == '\0' && 1 <= val && val <= 100)
> +                       tabstop = val;
> +
> +               return next;
> +       }
> +
> +       /* handle switches w/ arguments above, boolean and only boolean below */
> +
>        if (!strncmp(arg, "no-", 3)) {
>                flag = 0;
>                arg += 3;

Is that the only portion that get changed between v2 and v3?
It took me a while to realized what really get changed here.

I suggest a new function: handle_switch_ftabstop() here.

Then we do:

        if (!strncmp(arg, "tabstop=", 8))
            return handle_switch_ftabstop(arg+8, next);

It will make handle_switch_f cleaner.

I already apply your V2 patch. Can you make this change
an incremental patch against my tree?

Thanks

Chris

  reply	other threads:[~2009-01-08 20:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-31 12:41 [PATCH] Add -ftabstop=WIDTH Hannes Eder
2008-12-31 15:29 ` Alexey Zaytsev
2008-12-31 20:26 ` Christopher Li
2009-01-02 14:22   ` [PATCH v2] " Hannes Eder
2009-01-03 12:01     ` Junio C Hamano
2009-01-03 23:19       ` Christopher Li
2009-01-04  9:05         ` Junio C Hamano
2009-01-07  0:37           ` Christopher Li
2009-01-08 19:18         ` [PATCH v3] " Hannes Eder
2009-01-08 20:13           ` Christopher Li [this message]
2009-01-08 20:50             ` [PATCH] refactor handle_switch_f Hannes Eder
2009-01-09  4:25               ` Christopher Li
2009-01-03 22:41     ` [PATCH v2] Add -ftabstop=WIDTH Christopher Li

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=70318cbf0901081213i22dc8054yda4230e8a6375e9a@mail.gmail.com \
    --to=sparse@chrisli.org \
    --cc=alexey.zaytsev@gmail.com \
    --cc=hannes@hanneseder.net \
    --cc=junio@pobox.com \
    --cc=linux-sparse@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).