event-util: use DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR() to define event_source_hash_ops
Currently, the hash_ops is only used by set, so this does not change anything. But, there are several benefits, - we can drop cast in the definition, - the hash_ops can be also used by hashmap.
This commit is contained in:
@@ -12,12 +12,10 @@
|
||||
#define SI_FLAG_FORWARD (INT32_C(1) << 30)
|
||||
#define SI_FLAG_POSITIVE (INT32_C(1) << 29)
|
||||
|
||||
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR(
|
||||
event_source_hash_ops,
|
||||
sd_event_source,
|
||||
(void (*)(const sd_event_source*, struct siphash*)) trivial_hash_func,
|
||||
(int (*)(const sd_event_source*, const sd_event_source*)) trivial_compare_func,
|
||||
sd_event_source_disable_unref);
|
||||
void, trivial_hash_func, trivial_compare_func,
|
||||
sd_event_source, sd_event_source_disable_unref);
|
||||
|
||||
int event_reset_time(
|
||||
sd_event *e,
|
||||
|
||||
Reference in New Issue
Block a user