MT#55283 fix g_ptr_array_sort usage

The compare function receives pointers to pointers as arguments.

Change-Id: I93abaa635f94207de826deb6523d8c847bef0860
pull/1918/head
Richard Fuchs 9 months ago
parent 1ad61d90bb
commit 4a03cbd996

@ -1507,10 +1507,10 @@ INLINE void __re_address_translate_ep(struct re_address *o, const endpoint_t *ep
ep->address.family->endpoint2kernel(o, ep); ep->address.family->endpoint2kernel(o, ep);
} }
static int __rtp_stats_pt_sort(const struct rtp_stats *a, const struct rtp_stats *b) { static int __rtp_stats_pt_sort(const struct rtp_stats **a, const struct rtp_stats **b) {
if (a->payload_type < b->payload_type) if ((*a)->payload_type < (*b)->payload_type)
return -1; return -1;
if (a->payload_type > b->payload_type) if ((*a)->payload_type > (*b)->payload_type)
return 1; return 1;
return 0; return 0;
} }

@ -458,7 +458,7 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) {
}) })
#define t_ptr_array_sort(A, f) ({ \ #define t_ptr_array_sort(A, f) ({ \
int (*__f)(__typeof__((A)->__ct), __typeof__((A)->__ct)) = f; \ int (*__f)(__typeof__(&(A)->__ct), __typeof__(&(A)->__ct)) = f; \
g_ptr_array_sort(&(A)->a, (GCompareFunc) __f); \ g_ptr_array_sort(&(A)->a, (GCompareFunc) __f); \
}) })

Loading…
Cancel
Save