| 12 | }; |
| 13 | |
| 14 | static int |
| 15 | node_cmp(const node_t *a, const node_t *b) { |
| 16 | int ret; |
| 17 | |
| 18 | ret = (a->key > b->key) - (a->key < b->key); |
| 19 | if (ret == 0) { |
| 20 | /* |
| 21 | * Duplicates are not allowed in the heap, so force an |
| 22 | * arbitrary ordering for non-identical items with equal keys. |
| 23 | */ |
| 24 | ret = (((uintptr_t)a) > ((uintptr_t)b)) |
| 25 | - (((uintptr_t)a) < ((uintptr_t)b)); |
| 26 | } |
| 27 | return ret; |
| 28 | } |
| 29 | |
| 30 | static int |
| 31 | node_cmp_magic(const node_t *a, const node_t *b) { |
no outgoing calls
no test coverage detected