summaryrefslogtreecommitdiff
path: root/src/hwdb
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-18 11:08:23 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-19 08:08:03 +0900
commitbc861c2e09079315b6725600070fdbecc7bd8fc6 (patch)
tree74c71d1c5798a9cd805617ec8f35cae66662821a /src/hwdb
parentf0f6d791feee4ed4c34624228e6ced8a231b5811 (diff)
downloadsystemd-bc861c2e09079315b6725600070fdbecc7bd8fc6.tar.gz
tree-wide: use typesafe_bsearch() or typesafe_bsearch_r()
Diffstat (limited to 'src/hwdb')
-rw-r--r--src/hwdb/hwdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
index d9a6d8390d..ec96923357 100644
--- a/src/hwdb/hwdb.c
+++ b/src/hwdb/hwdb.c
@@ -104,7 +104,7 @@ static struct trie_node *node_lookup(const struct trie_node *node, uint8_t c) {
struct trie_child_entry search;
search.c = c;
- child = bsearch_safe(&search, node->children, node->children_count, sizeof(struct trie_child_entry), (comparison_fn_t) trie_children_cmp);
+ child = typesafe_bsearch(&search, node->children, node->children_count, trie_children_cmp);
if (child)
return child->child;
return NULL;
@@ -160,7 +160,7 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
.value_off = v,
};
- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), (__compar_d_fn_t) trie_values_cmp, trie);
+ val = typesafe_bsearch_r(&search, node->values, node->values_count, trie_values_cmp, trie);
if (val) {
/* At this point we have 2 identical properties on the same match-string.
* Since we process files in order, we just replace the previous value.