Re: [PATCHv2 3/9] archive: refactor list of archive formats
- From
Jeff King <peff@github.com>
- Date
- Jun 23, 2011, 17:30 UTC
- Message-ID
- <20110623173013.GA7364@sigill.intra.peff.net>
- In-Reply-To
- <BANLkTim7O3pcJAy4U1d6QiS6cvv2-Og21A@mail.gmail.com>
On Thu, Jun 23, 2011 at 02:05:35PM -0300, Thiago Farina wrote:
Show 7 quoted lines
> > +static struct archiver tar_archiver = {
> > + "tar",
> > + write_tar_archive,
> > + 0
> A named constant instead of 0, like you did with
> ARCHIVER_WANT_COMPRESSION_LEVELS, would be better? 0 here means the
> archiver does not want compression?It's actually a bit-wise flag, so it is not "no compression", but "no flags". So "0" is fairly idiomatic. Given that it's a static initializer that will default to 0, probably a more readable version would be:
static struct archiver tar_archiver = {
"tar",
write_tar_archive
};-Peff