MT#55283 use GPOINTER_TO_UINT

Change-Id: I5e8ee279aa193c1b7f71a01c42fa3482856b9b30
pull/1910/head
Richard Fuchs 10 months ago
parent bf10ace2f3
commit c99a4691b4

@ -303,7 +303,7 @@ static struct ice_candidate_pair *__pair_candidate(stream_fd *sfd, struct ice_ag
}
static unsigned int __pair_hash(const struct ice_candidate_pair *pair) {
return g_direct_hash(pair->local_intf) ^ g_direct_hash(pair->remote_candidate);
return GPOINTER_TO_UINT(pair->local_intf) ^ GPOINTER_TO_UINT(pair->remote_candidate);
}
static int __pair_equal(const struct ice_candidate_pair *A, const struct ice_candidate_pair *B) {
return A->local_intf == B->local_intf
@ -970,7 +970,7 @@ static void __cand_ice_foundation(call_t *call, struct ice_candidate *cand) {
int len;
len = sprintf(buf, "%x%x%x", endpoint_hash(&cand->endpoint),
cand->type, g_direct_hash(cand->transport));
cand->type, GPOINTER_TO_UINT(cand->transport));
cand->foundation = call_str_cpy_len(buf, len);
}

@ -646,14 +646,14 @@ static struct logical_intf *__get_logical_interface(const str *name, sockfamily_
}
static unsigned int __name_family_hash(const struct intf_key *lif) {
return str_hash(&lif->name) ^ g_direct_hash(lif->preferred_family);
return str_hash(&lif->name) ^ GPOINTER_TO_UINT(lif->preferred_family);
}
static int __name_family_eq(const struct intf_key *A, const struct intf_key *B) {
return str_equal(&A->name, &B->name) && A->preferred_family == B->preferred_family;
}
static unsigned int __addr_type_hash(const struct intf_address *addr) {
return sockaddr_hash(&addr->addr) ^ g_direct_hash(addr->type);
return sockaddr_hash(&addr->addr) ^ GPOINTER_TO_UINT(addr->type);
}
static int __addr_type_eq(const struct intf_address *A, const struct intf_address *B) {
return sockaddr_eq(&A->addr, &B->addr) && A->type == B->type;

@ -143,7 +143,7 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) {
#define TYPED_DIRECT_FUNCS(hash_name, eq_name, type) \
static inline unsigned int hash_name(const type *a) { \
return g_direct_hash(a); \
return GPOINTER_TO_UINT(a); \
} \
static inline gboolean eq_name(const type *a, const type *b) { \
return a == b; \

@ -526,7 +526,7 @@ static unsigned int __ip6_packet_header(unsigned char *out, const endpoint_t *sr
unsigned int sockaddr_hash(const sockaddr_t *a) {
return a->family->hash(a) ^ g_direct_hash(a->family);
return a->family->hash(a) ^ GPOINTER_TO_UINT(a->family);
}
bool sockaddr_eq(const sockaddr_t *a, const sockaddr_t *b) {
return a->family == b->family && a->family->eq(a, b);

Loading…
Cancel
Save