Re: sizeof(var) vs sizeof(type), was Re: [PATCH] git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()

2019-09-26 Thread Derrick Stolee
On 9/26/2019 11:24 AM, Philip Oakley wrote: > On 26/09/2019 14:36, Derrick Stolee wrote: Another good reason to use "sizeof(var)" instead of sizeof(type)". :) >>> That is indeed a very good reason, in addition to getting the type right >>> automatically (by virtue of letting the compiler pick

Re: sizeof(var) vs sizeof(type), was Re: [PATCH] git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()

2019-09-26 Thread Philip Oakley
On 26/09/2019 14:36, Derrick Stolee wrote: Another good reason to use "sizeof(var)" instead of sizeof(type)". :) That is indeed a very good reason, in addition to getting the type right automatically (by virtue of letting the compiler pick it). Should we make this an explicit guideline in our d

Re: sizeof(var) vs sizeof(type), was Re: [PATCH] git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()

2019-09-26 Thread SZEDER Gábor
On Thu, Sep 26, 2019 at 09:36:44AM -0400, Derrick Stolee wrote: > On 9/26/2019 9:22 AM, Johannes Schindelin wrote: > > Hi Peff, > > > > On Mon, 23 Sep 2019, Jeff King wrote: > > > >> On Thu, Sep 19, 2019 at 10:48:30PM +0200, René Scharfe wrote: > >> > >>> Use the macro COPY_ARRAY to copy array el

Re: sizeof(var) vs sizeof(type), was Re: [PATCH] git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()

2019-09-26 Thread Derrick Stolee
On 9/26/2019 9:22 AM, Johannes Schindelin wrote: > Hi Peff, > > On Mon, 23 Sep 2019, Jeff King wrote: > >> On Thu, Sep 19, 2019 at 10:48:30PM +0200, René Scharfe wrote: >> >>> Use the macro COPY_ARRAY to copy array elements and MOVE_ARRAY to do the >>> same for moving them backwards in an array w

sizeof(var) vs sizeof(type), was Re: [PATCH] git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()

2019-09-26 Thread Johannes Schindelin
Hi Peff, On Mon, 23 Sep 2019, Jeff King wrote: > On Thu, Sep 19, 2019 at 10:48:30PM +0200, René Scharfe wrote: > > > Use the macro COPY_ARRAY to copy array elements and MOVE_ARRAY to do the > > same for moving them backwards in an array with potential overlap. The > > result is shorter and safer

Re: [PATCH] git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()

2019-09-23 Thread Jeff King
On Thu, Sep 19, 2019 at 10:48:30PM +0200, René Scharfe wrote: > Use the macro COPY_ARRAY to copy array elements and MOVE_ARRAY to do the > same for moving them backwards in an array with potential overlap. The > result is shorter and safer, as it infers the element type automatically > and does a