MCPcopy Create free account
hub / github.com/NetHack/NetHack / cond_cmp

Function cond_cmp

src/botl.c:1332–1342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1330
1331/* qsort callback routine for sorting the condition index */
1332staticfn int QSORTCALLBACK
1333cond_cmp(const genericptr vptr1, const genericptr vptr2)
1334{
1335 int indx1 = *(int *) vptr1, indx2 = *(int *) vptr2,
1336 c1 = conditions[indx1].ranking, c2 = conditions[indx2].ranking;
1337
1338 if (c1 != c2)
1339 return c1 - c2;
1340 /* tie-breaker - visible alpha by name */
1341 return strcmpi(condtests[indx1].useroption, condtests[indx2].useroption);
1342}
1343
1344/* qsort callback routine for alphabetical sorting of index */
1345staticfn int QSORTCALLBACK

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected