Re: [PATCHv2 3/9] archive: refactor list of archive formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 23, 2011 at 02:05:35PM -0300, Thiago Farina wrote:

> > +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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]