Re: [PATCH v2 18/43] refs-be-files.c: add a backend method structure with transaction functions
On Mon, 2015-10-05 at 10:25 -0700, Junio C Hamano wrote:
Show 22 quoted lines
> Michael Haggerty <mhagger@alum.mit.edu> writes:
>
> >> +/* refs backends */
> >> +typedef struct ref_transaction *(*ref_transaction_begin_fn)(struct strbuf *err);
> >
> > Hmmm, I thought our convention was to define typedefs for functions
> > themselves, not for the pointer-to-function; e.g.,
> >
> > typedef struct ref_transaction *ref_transaction_begin_fn(struct
> > strbuf *err);
> >
> > (which would require `struct ref_be` to be changed to
> >
> > ref_transaction_begin_fn *transaction_begin;
> >
> > etc.) But now as I grep through the code it looks like both conventions
> > are used. So never mind :-)
>
> Well spotted. My recollection is the same and we do prefer the
> latter (I think all early function typedefs by Linus were done that
> way). It would be better to correct existing mistakes we added over
> time and certainly not add more of them in new code.