return 0;
}
-int prioq_ensure_put(Prioq **q, compare_func_t compare_func, void *data, unsigned *idx) {
+int _prioq_ensure_put(Prioq **q, compare_func_t compare_func, void *data, unsigned *idx) {
int r;
r = prioq_ensure_allocated(q, compare_func);
int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func);
int prioq_put(Prioq *q, void *data, unsigned *idx);
-int prioq_ensure_put(Prioq **q, compare_func_t compare_func, void *data, unsigned *idx);
+int _prioq_ensure_put(Prioq **q, compare_func_t compare_func, void *data, unsigned *idx);
+#define prioq_ensure_put(q, compare_func, data, idx) \
+ ({ \
+ int (*_func_)(const typeof((data)[0])*, const typeof((data)[0])*) = compare_func; \
+ _prioq_ensure_put(q, (compare_func_t) _func_, data, idx); \
+ })
+
int prioq_remove(Prioq *q, void *data, unsigned *idx);
void prioq_reshuffle(Prioq *q, void *data, unsigned *idx);
sd_lldp_neighbor,
lldp_neighbor_unlink);
-int lldp_neighbor_prioq_compare_func(const void *a, const void *b) {
- const sd_lldp_neighbor *x = a, *y = b;
-
+int lldp_neighbor_prioq_compare_func(const sd_lldp_neighbor *x, const sd_lldp_neighbor *y) {
assert(x);
assert(y);
extern const struct hash_ops lldp_neighbor_hash_ops;
int lldp_neighbor_id_compare_func(const LLDPNeighborID *x, const LLDPNeighborID *y);
-int lldp_neighbor_prioq_compare_func(const void *a, const void *b);
+int lldp_neighbor_prioq_compare_func(const sd_lldp_neighbor *x, const sd_lldp_neighbor *y);
sd_lldp_neighbor *lldp_neighbor_unlink(sd_lldp_neighbor *n);
sd_lldp_neighbor *lldp_neighbor_new(size_t raw_size);