summaryrefslogtreecommitdiff
path: root/src/busctl
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-19 08:28:50 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-19 08:28:54 +0900
commitdc5f9c6f3951c8be64514d687d0355a704794cac (patch)
treece9b12ee5413e3271d18a455cc85bc31ea167e26 /src/busctl
parentbc861c2e09079315b6725600070fdbecc7bd8fc6 (diff)
downloadsystemd-dc5f9c6f3951c8be64514d687d0355a704794cac.tar.gz
systemd-dc5f9c6f3951c8be64514d687d0355a704794cac.tar.bz2
systemd-dc5f9c6f3951c8be64514d687d0355a704794cac.zip
busctl,sd-lldp: explicitly specify type of argument in compare function
Several functions are shared by qsort and hash_ops or Prioq. This makes these functions explicitly specify argument type, and cast to __compar_fn_t where necessary.
Diffstat (limited to 'src/busctl')
-rw-r--r--src/busctl/busctl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c
index 1fe6500ae8..7b651cfcd6 100644
--- a/src/busctl/busctl.c
+++ b/src/busctl/busctl.c
@@ -719,8 +719,7 @@ static void member_hash_func(const void *p, struct siphash *state) {
string_hash_func(m->interface, state);
}
-static int member_compare_func(const void *a, const void *b) {
- const Member *x = a, *y = b;
+static int member_compare_func(const Member *x, const Member *y) {
int d;
assert(x);
@@ -911,7 +910,7 @@ static int on_property(const char *interface, const char *name, const char *sign
static int introspect(int argc, char **argv, void *userdata) {
static const struct hash_ops member_hash_ops = {
.hash = member_hash_func,
- .compare = member_compare_func,
+ .compare = (__compar_fn_t) member_compare_func,
};
static const XMLIntrospectOps ops = {