diff options
author | Filipe Brandenburger <filbranden@google.com> | 2018-08-02 16:43:37 -0700 |
---|---|---|
committer | Filipe Brandenburger <filbranden@google.com> | 2018-08-06 19:26:35 -0700 |
commit | a0edd02e43b06ec877bedb6ccf622e6748ccdf64 (patch) | |
tree | fc536ed669c7c485a33b8c7293aac1d34f481a4b /src/resolve/resolved-dns-rr.c | |
parent | 26cdf3e50b7c4e3b7c617771eb64087130ff801b (diff) | |
download | systemd-a0edd02e43b06ec877bedb6ccf622e6748ccdf64.tar.gz |
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.
Diffstat (limited to 'src/resolve/resolved-dns-rr.c')
-rw-r--r-- | src/resolve/resolved-dns-rr.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index cfd0ed214d..05a4915101 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -300,15 +300,13 @@ static int dns_resource_key_compare_func(const void *a, const void *b) { if (ret != 0) return ret; - if (x->type < y->type) - return -1; - if (x->type > y->type) - return 1; + ret = CMP(x->type, y->type); + if (ret != 0) + return ret; - if (x->class < y->class) - return -1; - if (x->class > y->class) - return 1; + ret = CMP(x->class, y->class); + if (ret != 0) + return ret; return 0; } |