lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] Proposing change to netif state member


From: Bill Auerbach
Subject: Re: [lwip-devel] Proposing change to netif state member
Date: Mon, 19 Mar 2012 16:42:29 -0400

>-----Original Message-----
>On Behalf Of Simon Goldschmidt
>Sent: Monday, March 19, 2012 4:11 PM
>To: lwip-devel
>Subject: Re: [lwip-devel] Proposing change to netif state member
>

>Hmm, I don't know about that. While it would be cool to have the debugger
>look into netif->state, leaving out the casts would make the code less
>portable: if you'd happen to use more than one netif later, you'd  have to
>change the code...

True.  Good point.  You don't change or effect anyone's port or application
leaving #ifndef NETIF_STATE_TYPE to revert to 'void *'.

>That would be an unnecessary limitation to me: you're free to do this:
>
>#define NETIF_STATE_TYPE void*

This could be the default #define avoiding the #ifndef/#else/#endif.

>when not hard-coding the *, while you couldn't use a non-pointer type if
>you hard coded the *.

I hadn't thought of that - this ethernetif struct could be an instantiation
in the netif itself which would work well for me because I have only one and
don't need to have it be dereferenced everywhere it's used.  I'd already
done the pointer type change in my code but I'm going to switch to an object
declaration - thanks!

Bill





reply via email to

[Prev in Thread] Current Thread [Next in Thread]