Re: [PATCH v2 2/4] diff: convert flags to be stored in bitfields

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

 



Brandon Williams <bmwill@xxxxxxxxxx> writes:

> +	if (flags)
> +		rev.diffopt.flags = diff_flags_or(&rev.diffopt.flags, flags);

If we are avoiding from passing a struct (even if it is a small one)
by value, then returning a struct as value defeats the point of the
exercise, I would think.  If that will be the calling cconvention,
making diff_flags_or(&a, &b) to update &a by or'ing bits in &b would
be more natural.

Having said that, as I said in a separate message, as long as we
have this _or() thing, no sane person would add anything but
bitfields to the structure which will guarantee that it will stay to
be small set of flags and nothing else---so I personally am fine
with pass by value (which in turn makes it OK to return as a value,
too).

Other than that, this step looked reasonable to me.

Thanks.



[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]

  Powered by Linux