Re: [PATCH 3/5] use SWAP macro

2017-01-31 Thread René Scharfe
Am 30.01.2017 um 23:22 schrieb Junio C Hamano: René Scharfe writes: if (tree2->flags & UNINTERESTING) { - struct object *tmp = tree2; - tree2 = tree1; - tree1 = tmp; +

Re: [PATCH 3/5] use SWAP macro

2017-01-30 Thread Junio C Hamano
René Scharfe writes: > if (tree2->flags & UNINTERESTING) { > - struct object *tmp = tree2; > - tree2 = tree1; > - tree1 = tmp; > + SWAP(tree2, tree1); A human would have written this

Re: [PATCH 3/5] use SWAP macro

2017-01-30 Thread René Scharfe
Am 30.01.2017 um 17:03 schrieb Johannes Schindelin: Hi René, On Sat, 28 Jan 2017, René Scharfe wrote: diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c index 806dd7a885..8ce00480cd 100644 --- a/builtin/diff-tree.c +++ b/builtin/diff-tree.c @@ -147,9 +147,7 @@ int cmd_diff_tree(int argc,

Re: [PATCH 3/5] use SWAP macro

2017-01-30 Thread Johannes Schindelin
Hi René, On Sat, 28 Jan 2017, René Scharfe wrote: > diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c > index 806dd7a885..8ce00480cd 100644 > --- a/builtin/diff-tree.c > +++ b/builtin/diff-tree.c > @@ -147,9 +147,7 @@ int cmd_diff_tree(int argc, const char **argv, const char > *prefix) >

[PATCH 3/5] use SWAP macro

2017-01-28 Thread René Scharfe
Apply the semantic patch swap.cocci to convert hand-rolled swaps to use the macro SWAP. The resulting code is shorter and easier to read, the object code is effectively unchanged. The patch for object.c had to be hand-edited in order to preserve the comment before the change; Coccinelle tried to