From 9886bc07048118035f0aed9df1ab706ded5cfb13 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 3 Jan 2024 22:27:46 +0100 Subject: Reformatted light_cmp() --- FICS/comproc.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'FICS/comproc.c') diff --git a/FICS/comproc.c b/FICS/comproc.c index 535192a..0aae31c 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -981,27 +981,29 @@ PRIVATE int blitz_cmp(const void *pp1, const void *pp2) return strcmp(parray[p1].login, parray[p2].login); } -PRIVATE int light_cmp(const void *pp1, const void *pp2) +PRIVATE int +light_cmp(const void *pp1, const void *pp2) { - register int p1 = *(int *) pp1; - register int p2 = *(int *) pp2; - if (parray[p1].status != PLAYER_PROMPT) { - if (parray[p2].status != PLAYER_PROMPT) - return 0; - else - return -1; - } - if (parray[p2].status != PLAYER_PROMPT) - return 1; - if (parray[p1].l_stats.rating > parray[p2].l_stats.rating) - return -1; - if (parray[p1].l_stats.rating < parray[p2].l_stats.rating) - return 1; - if (parray[p1].registered > parray[p2].registered) - return -1; - if (parray[p1].registered < parray[p2].registered) - return 1; - return strcmp(parray[p1].login, parray[p2].login); + register int p1 = *(int *) pp1; + register int p2 = *(int *) pp2; + + if (parray[p1].status != PLAYER_PROMPT) { + if (parray[p2].status != PLAYER_PROMPT) + return 0; + else + return -1; + } + if (parray[p2].status != PLAYER_PROMPT) + return 1; + if (parray[p1].l_stats.rating > parray[p2].l_stats.rating) + return -1; + if (parray[p1].l_stats.rating < parray[p2].l_stats.rating) + return 1; + if (parray[p1].registered > parray[p2].registered) + return -1; + if (parray[p1].registered < parray[p2].registered) + return 1; + return strcmp(parray[p1].login, parray[p2].login); } PRIVATE int -- cgit v1.2.3