Re: [PATCH 19/22] sequencer: support cleaning up commit messages
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 1, 2016, 13:56 UTC
- Message-ID
- <alpine.DEB.2.20.1609011543290.129229@virtualbox>
- In-Reply-To
- <9f2cbc74-3e4d-e7f1-d2dd-e85e0b9168b1@gmail.com>
Hi Kuba,
On Thu, 1 Sep 2016, Jakub Narębski wrote:
Show 13 quoted lines
> W dniu 29.08.2016 o 10:06, Johannes Schindelin pisze:
>
> > @@ -781,7 +785,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
> > }
> > if (!opts->no_commit)
> > res = sequencer_commit(opts->edit ? NULL : git_path_merge_msg(),
> > - opts, allow, opts->edit, 0);
> > + opts, allow, opts->edit, 0, 0);
>
> The calling convention begins to look unwieldy, but we have only
> a single such callsite, and there are quite a bit callsites in
> Git code that have similar API ("git grep ', 0, 0' -- '*.c'").
> So we don't need to think about alternatives. Yet.Right.
Please note that it will make much more sense in the end, too, as the 0s will be replaced by appropriate variables.
Show 16 quoted lines
> It's a pity that emulation of named parameters in C requires
> relying on designated inits from C99
>
> typedef struct {
> double pressure, moles, temp;
> } ideal_struct;
>
> #define ideal_pressure(...) ideal_pressure_base((ideal_struct){.pressure=1, \
> .moles=1, .temp=273.15, __VA_ARGS__})
>
> double ideal_pressure_base(ideal_struct in)
> {
> return 8.314 * in.moles*in.temp/in.pressure;
> }
>
> ... ideal_pressure(.moles=2, .temp=373.15) ...Yeah, that looks unwieldy ;-)
Thanks for the review, Dscho