diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-04-02 02:18:34 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-04-02 02:18:34 +0200 |
commit | b355c9b63e69fc8bb590c3ff7bfeaf1f3875208e (patch) | |
tree | ecf15bb5b4444d86bcb58ecd051235ac04c2c124 | |
parent | f17d7f370256389e836466c338e1bb7007b8e504 (diff) |
Reformatted functions
-rw-r--r-- | FICS/ratings.c | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/FICS/ratings.c b/FICS/ratings.c index cf1cda1..48160da 100644 --- a/FICS/ratings.c +++ b/FICS/ratings.c @@ -1491,36 +1491,40 @@ PUBLIC int DisplayRankedPlayers(int p, int start, int end, return 1; } -PUBLIC int ShowFromString(char *s) +PUBLIC int +ShowFromString(char *s) { - int i, len = strlen(s); - int show = 0; - - if (s == NULL || s[0] == '\0') - return SHOW_BLITZ | SHOW_STANDARD | SHOW_WILD; - for (i = 0; i < len; i++) { - switch (s[i]) { - case 'b': - SetFlag(show, SHOW_BLITZ); - break; - case 's': - SetFlag(show, SHOW_STANDARD); - break; - case 'w': - SetFlag(show, SHOW_WILD); - break; - } - } - return (show); + int len = strlen(s); + int show = 0; + + if (s == NULL || s[0] == '\0') + return (SHOW_BLITZ | SHOW_STANDARD | SHOW_WILD); + + for (int i = 0; i < len; i++) { + switch (s[i]) { + case 'b': + SetFlag(show, SHOW_BLITZ); + break; + case 's': + SetFlag(show, SHOW_STANDARD); + break; + case 'w': + SetFlag(show, SHOW_WILD); + break; + } + } + + return show; } -PUBLIC int Best(int p, param_list param, int ShowComp) +PUBLIC int +Best(int p, param_list param, int ShowComp) { - int show = SHOW_BLITZ | SHOW_STANDARD | SHOW_WILD; + int show = (SHOW_BLITZ | SHOW_STANDARD | SHOW_WILD); - if (param[0].type != TYPE_NULL) - show = ShowFromString(param[0].val.word); + if (param[0].type != TYPE_NULL) + show = ShowFromString(param[0].val.word); - DisplayRankedPlayers(p, 1, 20, show, ShowComp); - return COM_OK; + DisplayRankedPlayers(p, 1, 20, show, ShowComp); + return COM_OK; } |