Re: [PATCH v2 0/8] object_id part 4
- From
Jeff King <peff@peff.net>
- Date
- Jun 20, 2016, 10:05 UTC
- Message-ID
- <20160620100522.GB14058@sigill.intra.peff.net>
- In-Reply-To
- <alpine.DEB.2.20.1606200853580.22630@virtualbox>
On Mon, Jun 20, 2016 at 09:01:30AM +0200, Johannes Schindelin wrote:
Show 10 quoted lines
> On Sun, 19 Jun 2016, Jeff King wrote: > > > I think traditionally we've avoided struct assignment because some > > ancient compilers didn't do it. But it's in C89, and I suspect it's > > crept into the code base anyway over the years without anyone > > complaining. > > I fear that's my fault, at least partially, seeing as merge-recursive.c > even *returns* structs (see 6d297f81; I plan to fix that as part of the > cleaned-up am-3-merge-recursive-direct patch series).
Heh, that commit is quite old. If nobody has complained about it, then I think there is nothing to be sorry about. If struct assignment (and returns) work everywhere, and they make the code easier to read, we should be using them.
I am on the fence regarding oidcpy/oidclr. I agree they _could_ be struct assignments, but it is also convenient to have concept wrapped up in a function, in case we ever want to do anything more complicated.
-Peff