Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-29 18:27:31 +0300
committerJunio C Hamano <gitster@pobox.com>2016-09-30 01:42:18 +0300
commit9ed0d8d6e6de7737fe9a658446318b86e57c6fad (patch)
tree82fdefc7bd543c99091f5b634947360f75100deb /string-list.c
parentdbc540c7a5827529a3f58befc9e5b81a31ec8fab (diff)
use QSORT
Apply the semantic patch contrib/coccinelle/qsort.cocci to the code base, replacing calls of qsort(3) with QSORT. The resulting code is shorter and supports empty arrays with NULL pointers. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'string-list.c')
-rw-r--r--string-list.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string-list.c b/string-list.c
index 62d20846cb..8c83cac189 100644
--- a/string-list.c
+++ b/string-list.c
@@ -225,7 +225,7 @@ static int cmp_items(const void *a, const void *b)
void string_list_sort(struct string_list *list)
{
compare_for_qsort = list->cmp ? list->cmp : strcmp;
- qsort(list->items, list->nr, sizeof(*list->items), cmp_items);
+ QSORT(list->items, list->nr, cmp_items);
}
struct string_list_item *unsorted_string_list_lookup(struct string_list *list,