diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2025-03-23 12:46:23 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2025-03-23 12:46:23 +0100 |
commit | f85dfe993c0a5c224fd07eb979869b00405b6bd1 (patch) | |
tree | 47dcac689a62121698906025f4bd3d752b31e66f /FICS | |
parent | e1fc982dc6aefd1f5cfe79ff6b83cd8db0f557ef (diff) |
Changed gamesortfunc()
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/obsproc.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/FICS/obsproc.c b/FICS/obsproc.c index 283ecc3..43954ff 100644 --- a/FICS/obsproc.c +++ b/FICS/obsproc.c @@ -90,19 +90,22 @@ GameNumFromParam(int p, int *p1, parameter *param) PRIVATE int gamesortfunc(const void *i, const void *j) { + const int x = *(int *)i; + const int y = *(int *)j; + /* * examine mode games moved to top of "games" output */ - return (GetRating(&parray[garray[*(int *)i].white], - garray[*(int *)i].type) + - GetRating(&parray[garray[*(int *)i].black], - garray[*(int *)i].type) - - (garray[*(int *)i].status == GAME_EXAMINE ? 10000 : 0) - - GetRating(&parray[garray[*(int *)j].white], - garray[*(int *)j].type) - - GetRating(&parray[garray[*(int *)j].black], - garray[*(int *)j].type) + - (garray[*(int *)j].status == GAME_EXAMINE ? 10000 : 0)); + return (GetRating(&parray[garray[x].white], + garray[x].type) + + GetRating(&parray[garray[x].black], + garray[x].type) - + (garray[x].status == GAME_EXAMINE ? 10000 : 0) - + GetRating(&parray[garray[y].white], + garray[y].type) - + GetRating(&parray[garray[y].black], + garray[y].type) + + (garray[y].status == GAME_EXAMINE ? 10000 : 0)); } PUBLIC int |