Thread (1 message) 1 message, 1 author, 2017-10-31

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

From: Junio C Hamano <hidden>
Date: 2017-10-31 04:41:17

Brandon Williams [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help