diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-01-03 22:28:51 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-01-03 22:28:51 +0100 |
commit | c0b5fe46be5a036efdca00da4390ac3f8f844e03 (patch) | |
tree | 0a7ec59a908881ee0ebb8be41042c1001420bd61 | |
parent | 9886bc07048118035f0aed9df1ab706ded5cfb13 (diff) |
Reformatted blitz_cmp()
-rw-r--r-- | FICS/comproc.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c index 0aae31c..4041a5b 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -958,27 +958,29 @@ PRIVATE int who_ok(int p, unsigned int sel_bits) } -PRIVATE int blitz_cmp(const void *pp1, const void *pp2) +PRIVATE int +blitz_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].b_stats.rating > parray[p2].b_stats.rating) - return -1; - if (parray[p1].b_stats.rating < parray[p2].b_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].b_stats.rating > parray[p2].b_stats.rating) + return -1; + if (parray[p1].b_stats.rating < parray[p2].b_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 |