eap-radius: Fix incompatible function types warnings

This commit is contained in:
Tobias Brunner 2021-11-17 18:09:39 +01:00
parent 9b2e9a943c
commit cceca1a3c4
2 changed files with 10 additions and 11 deletions

View File

@ -379,7 +379,8 @@ static void process_coa(private_eap_radius_dae_t *this,
/**
* Receive RADIUS DAE requests
*/
static bool receive(private_eap_radius_dae_t *this)
CALLBACK(receive, bool,
private_eap_radius_dae_t *this, int fd, watcher_event_t event)
{
struct sockaddr_storage addr;
socklen_t addr_len = sizeof(addr);
@ -530,8 +531,7 @@ eap_radius_dae_t *eap_radius_dae_create(eap_radius_accounting_t *accounting)
return NULL;
}
lib->watcher->add(lib->watcher, this->fd, WATCHER_READ,
(watcher_cb_t)receive, this);
lib->watcher->add(lib->watcher, this->fd, WATCHER_READ, receive, this);
return &this->public;
}

View File

@ -152,17 +152,18 @@ static void put_or_destroy_entry(hashtable_t *hashtable, entry_t *entry)
/**
* Hashtable hash function
*/
static u_int hash(uintptr_t id)
static u_int hash(const void *key)
{
return id;
uintptr_t id = (uintptr_t)key;
return chunk_hash(chunk_from_thing(id));
}
/**
* Hashtable equals function
*/
static bool equals(uintptr_t a, uintptr_t b)
static bool equals(const void *a, const void *b)
{
return a == b;
return (uintptr_t)a == (uintptr_t)b;
}
/**
@ -553,10 +554,8 @@ eap_radius_provider_t *eap_radius_provider_create()
.ike_rekey = _ike_rekey,
.message = _message_hook,
},
.claimed = hashtable_create((hashtable_hash_t)hash,
(hashtable_equals_t)equals, 32),
.unclaimed = hashtable_create((hashtable_hash_t)hash,
(hashtable_equals_t)equals, 32),
.claimed = hashtable_create(hash, equals, 32),
.unclaimed = hashtable_create(hash, equals, 32),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
},
);