diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-27 14:25:20 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-12-02 07:53:27 +0100 |
commit | 7a08d314f20b5d6ca44c573426a8a5c812020344 (patch) | |
tree | 871818dbd5a37c437f5dad5e6a15bcccad9c4b45 /src/busctl/busctl.c | |
parent | hash-funcs: make basic hash_ops typesafe (diff) | |
download | systemd-7a08d314f20b5d6ca44c573426a8a5c812020344.tar.xz systemd-7a08d314f20b5d6ca44c573426a8a5c812020344.zip |
tree-wide: make hash_ops typesafe
Diffstat (limited to 'src/busctl/busctl.c')
-rw-r--r-- | src/busctl/busctl.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 1b0939caba..6188216d28 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -713,8 +713,7 @@ typedef struct Member { uint64_t flags; } Member; -static void member_hash_func(const void *p, struct siphash *state) { - const Member *m = p; +static void member_hash_func(const Member *m, struct siphash *state) { uint64_t arity = 1; assert(m); @@ -921,12 +920,9 @@ static int on_property(const char *interface, const char *name, const char *sign return 0; } -static int introspect(int argc, char **argv, void *userdata) { - static const struct hash_ops member_hash_ops = { - .hash = member_hash_func, - .compare = (__compar_fn_t) member_compare_func, - }; +DEFINE_PRIVATE_HASH_OPS(member_hash_ops, Member, member_hash_func, member_compare_func); +static int introspect(int argc, char **argv, void *userdata) { static const XMLIntrospectOps ops = { .on_interface = on_interface, .on_method = on_method, |