tree-wide: Convert compare_func's to use CMP() macro wherever possible.

Looked for definitions of functions using the *_compare_func() suffix.

Tested:
- Unit tests passed (ninja -C build/ test)
- Installed this build and booted with it.
This commit is contained in:
Filipe Brandenburger
2018-08-06 19:26:35 -07:00
parent 26cdf3e50b
commit a0edd02e43
14 changed files with 86 additions and 120 deletions
+4 -4
View File
@@ -484,11 +484,11 @@ static void peer_address_hash_func(const void *p, struct siphash *state) {
static int peer_address_compare_func(const void *a, const void *b) {
const SocketPeer *x = a, *y = b;
int r;
if (x->peer.sa.sa_family < y->peer.sa.sa_family)
return -1;
if (x->peer.sa.sa_family > y->peer.sa.sa_family)
return 1;
r = CMP(x->peer.sa.sa_family, y->peer.sa.sa_family);
if (r != 0)
return r;
switch(x->peer.sa.sa_family) {
case AF_INET: