From: Jeff King <peff@peff.net>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>
Cc: Christian Couder <christian.couder@gmail.com>,
git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>,
Duy Nguyen <pclouds@gmail.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Stefan Beller <sbeller@google.com>,
Christian Couder <chriscool@tuxfamily.org>,
SZEDER Gabor <szeder.dev@gmail.com>
Subject: Re: [PATCH v4 1/7] Add delta-islands.{c,h}
Date: Mon, 13 Aug 2018 14:11:49 -0400 [thread overview]
Message-ID: <20180813181149.GA10013@sigill.intra.peff.net> (raw)
In-Reply-To: <7a780fe9-e8bf-804a-82e6-8df81cd5c41c@ramsayjones.plus.com>
On Mon, Aug 13, 2018 at 01:17:18PM +0100, Ramsay Jones wrote:
> >>> +struct island_bitmap {
> >>> + uint32_t refcount;
> >>> + uint32_t bits[];
> >>
> >> Use FLEX_ARRAY here? We are slowly moving toward requiring
> >> certain C99 features, but I can't remember a flex array
> >> weather-balloon patch.
> >
> > This was already discussed by Junio and Peff there:
> >
> > https://public-inbox.org/git/20180727130229.GB18599@sigill.intra.peff.net/
> >
>
> That is a fine discussion, without a firm conclusion, but I don't
> think you can simply do nothing here:
>
> $ cat -n junk.c
> 1 #include <stdint.h>
> 2
> 3 struct island_bitmap {
> 4 uint32_t refcount;
> 5 uint32_t bits[];
> 6 };
> 7
> $ gcc --std=c89 --pedantic -c junk.c
> junk.c:5:11: warning: ISO C90 does not support flexible array members [-Wpedantic]
> uint32_t bits[];
> ^~~~
> $ gcc --std=c99 --pedantic -c junk.c
Right, whether we use the FLEX_ALLOC macros or not, this needs to be
declared with FLEX_ARRAY, not an empty "[]".
I'm fine either way on using the FLEX_ALLOC macros.
> >> ... Ah, OK, trg_ => target.
> >
> > I am ok to replace "trg" with "target" (or maybe "dst"? or something
> > else) and "src" with "source" if you think it would make things
> > clearer.
>
> If it had been dst_ (or target), I would not have had a 'huh?'
> moment, but it is not all that important.
FWIW, these are all inherited from try_delta(), etc, in the existing
code. I'm fine with using another term, but we should probably do it
universally. And if we do, probably "base" is a better name than "src",
since the direction depends on which part of the relationship you are
considering. I'm not sure what that makes "dst".
-Peff
next prev parent reply other threads:[~2018-08-13 18:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-12 5:11 [PATCH v4 0/7] Add delta islands support Christian Couder
2018-08-12 5:11 ` [PATCH v4 1/7] Add delta-islands.{c,h} Christian Couder
2018-08-13 1:14 ` Ramsay Jones
2018-08-13 3:33 ` Christian Couder
2018-08-13 12:17 ` Ramsay Jones
2018-08-13 18:11 ` Jeff King [this message]
2018-08-16 6:02 ` Christian Couder
2018-08-13 19:00 ` Jeff King
2018-08-16 6:04 ` Christian Couder
2018-08-12 5:11 ` [PATCH v4 2/7] pack-objects: refactor code into compute_layer_order() Christian Couder
2018-08-12 5:11 ` [PATCH v4 3/7] pack-objects: add delta-islands support Christian Couder
2018-08-12 5:11 ` [PATCH v4 4/7] repack: " Christian Couder
2018-08-12 5:11 ` [PATCH v4 5/7] t: add t5319-delta-islands.sh Christian Couder
2018-08-12 5:11 ` [PATCH v4 6/7] pack-objects: move tree_depth into 'struct packing_data' Christian Couder
2018-08-12 5:11 ` [PATCH v4 7/7] pack-objects: move 'layer' " Christian Couder
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=20180813181149.GA10013@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=ramsay@ramsayjones.plus.com \
--cc=sbeller@google.com \
--cc=szeder.dev@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 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).