mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-15 09:33:50 +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:
parent
be09ba67a6
commit
581aa6b70b
@ -84,7 +84,7 @@ typedef struct {
|
|||||||
* @return next network interface.
|
* @return next network interface.
|
||||||
* @return NULL, if there is no interface after @p last
|
* @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
|
* @brief Gets name of an interface
|
||||||
|
|||||||
@ -36,7 +36,7 @@ int netif_register(netif_t *netif)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
netif_t *netif_iter(netif_t *last)
|
netif_t *netif_iter(const netif_t *last)
|
||||||
{
|
{
|
||||||
if (last == NULL) {
|
if (last == NULL) {
|
||||||
return (netif_t *)netif_list.next;
|
return (netif_t *)netif_list.next;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user