1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/net/netif: allow const in netif_iter()

For consistency with `gnrc_netif_iter()`, add the `const` qualifier to the
parameter of `netif_iter()`. This allows calling it on `const` pointers without
having to cast `netif_t *`, which (apart of dropping the `const` qualifier)
disables a lot of type safety checks offered by the compiler.
This commit is contained in:
Marian Buschsieweke 2021-01-13 09:59:26 +01:00
parent be09ba67a6
commit 581aa6b70b
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94
2 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ typedef struct {
* @return next network interface.
* @return NULL, if there is no interface after @p last
*/
netif_t *netif_iter(netif_t *last);
netif_t *netif_iter(const netif_t *last);
/**
* @brief Gets name of an interface

View File

@ -36,7 +36,7 @@ int netif_register(netif_t *netif)
return 0;
}
netif_t *netif_iter(netif_t *last)
netif_t *netif_iter(const netif_t *last)
{
if (last == NULL) {
return (netif_t *)netif_list.next;