Re: [RFC PATCH 0/2] Allow detached forms (--option arg) for git log options.
- From
Pierre Habouzit <madcoder@debian.org>
- Date
- Jul 29, 2010, 18:33 UTC
- Message-ID
- <20100729183310.GA3891@madism.org>
- In-Reply-To
- <201007291116.44859.jnareb@gmail.com>
On Thu, Jul 29, 2010 at 11:16:42AM +0200, Jakub Narebski wrote:
Show 32 quoted lines
> On Wed, 28 Jul 2010, Pierre Habouzit wrote:
>
> > you cannot take the address of a bit portably in C, so you can't let
> > parseopt set/clear bits through bitfields (as in unsigned field : 1 in a
> > struct in C I mean).
> >
> > So to use parseopt OPTION_BIT feature, you have to convert them to C
> > flags as in "unsigned flags" and explicit masks defines/enums.
> >
> > IOW:
> >
> > struct foo {
> > unsigned bar : 1,
> > ...
> > baz : 1;
> > };
> >
> > Must be converted into:
> >
> > struct foo {
> > #define FOO_FLAG_BAR (1U << 1)
> > ...
> > #define FOO_FLAG_BAZ (1U << 18)
> > unsigned flags;
> > }
> >
> > so that you can use parseopt. that's what I meant.
> >
> >
> > This was done for the rev-list parsing stuff e.g.
>
> e.g. what?err no, not rev-list, diff options: struct diff_options::flags and the DIFF_OPT_* defines
-- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org