From 35d803bc9a0d21c36b1381f6e42455beeb73b715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 28 Jan 2017 22:40:58 +0100 Subject: use SWAP macro 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 eat it for some reason. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff-no-index.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'diff-no-index.c') diff --git a/diff-no-index.c b/diff-no-index.c index f420786039..1ae09894d7 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -186,9 +186,8 @@ static int queue_diff(struct diff_options *o, if (DIFF_OPT_TST(o, REVERSE_DIFF)) { unsigned tmp; - const char *tmp_c; tmp = mode1; mode1 = mode2; mode2 = tmp; - tmp_c = name1; name1 = name2; name2 = tmp_c; + SWAP(name1, name2); } d1 = noindex_filespec(name1, mode1); -- cgit v1.2.3