From b6bab9010eebe1e476a757bbece7ba3c09e4eefa Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 3 Jan 2024 03:07:49 +0100 Subject: Reformatted sort_players() and made it private --- FICS/comproc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'FICS/comproc.c') diff --git a/FICS/comproc.c b/FICS/comproc.c index 3685f73..a3b8de4 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -1063,15 +1063,13 @@ PRIVATE int alpha_cmp(const void *pp1, const void *pp2) return strcmp(parray[p1].login, parray[p2].login); } -PUBLIC void sort_players(int players[PARRAY_SIZE], - int ((*cmp_func) (const void *, const void *))) +PRIVATE void +sort_players(int players[PARRAY_SIZE], int ((*cmp_func)(const void *, + const void *))) { - int i; - - for (i = 0; i < p_num; i++) { - players[i] = i; - } - qsort(players, p_num, sizeof(int), cmp_func); + for (int i = 0; i < p_num; i++) + players[i] = i; + qsort(players, p_num, sizeof(int), cmp_func); } /* This is the of the most compliclicated commands in terms of parameters */ -- cgit v1.2.3