git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] merge-recursive.c: use QSORT macro
@ 2016-11-22 12:30 Nguyễn Thái Ngọc Duy
  2016-11-22 17:49 ` Jeff King
  2016-11-24 11:45 ` [PATCH v2] merge-recursive.c: use string_list_sort instead of qsort Nguyễn Thái Ngọc Duy
  0 siblings, 2 replies; 8+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-11-22 12:30 UTC (permalink / raw)
  To: git; +Cc: René Scharfe, Nguyễn Thái Ngọc Duy

This is the follow up of rs/qsort series, merged in b8688ad (Merge
branch 'rs/qsort' - 2016-10-10), where coccinelle was used to do
automatic transformation.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
  coccinelle missed this place, understandably, because it can't know
  that
  
      sizeof(*entries->items)
  
  is the same as
  
      sizeof(*df_name_compare.items)
  
  without some semantic analysis.

 merge-recursive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/merge-recursive.c b/merge-recursive.c
index 9041c2f..2d4dca9 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -451,7 +451,7 @@ static void record_df_conflict_files(struct merge_options *o,
 		string_list_append(&df_sorted_entries, next->string)->util =
 				   next->util;
 	}
-	qsort(df_sorted_entries.items, entries->nr, sizeof(*entries->items),
+	QSORT(df_sorted_entries.items, entries->nr,
 	      string_list_df_name_compare);
 
 	string_list_clear(&o->df_conflict_file_set, 1);
-- 
2.8.2.524.g6ff3d78


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-11-25 17:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22 12:30 [PATCH] merge-recursive.c: use QSORT macro Nguyễn Thái Ngọc Duy
2016-11-22 17:49 ` Jeff King
2016-11-23  9:43   ` Duy Nguyen
2016-11-23 17:21   ` Junio C Hamano
2016-11-24 11:45 ` [PATCH v2] merge-recursive.c: use string_list_sort instead of qsort Nguyễn Thái Ngọc Duy
2016-11-24 20:52   ` Jeff King
2016-11-25 12:15     ` Duy Nguyen
2016-11-25 17:15       ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).