tech-net archive

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

Re: patch make struct protosw pr_input non-variadic



In article <15688F42-CFFC-409C-9508-1CC27ADCE68F%3am-software.com@localhost>,
Matt Thomas  <matt%3am-software.com@localhost> wrote:
>
>> On Jan 7, 2017, at 1:03 AM, Joerg Sonnenberger <joerg%bec.de@localhost> wrote:
>> 
>> On Sat, Jan 07, 2017 at 03:52:27AM +0000, Taylor R Campbell wrote:
>>> So.  OK to commit?
>> 
>> Yes.
>
>For me it's a no.  I find it ugly.  I'm going to give an alternate
>approach while is almost as ugly but a little simpler.
>
>Why not replace void (*pr_input)(struct mbuf *, ...); in protosw
>with a union?  The first member of the union can be that and then
>include the (mbuf *, int, int) as a secondary member.  
>
>Then the netinet/netinet6 can just call the alternate member and
>completely avoid variadic style.  initializers can use the addition
>member as well.

I like that... Can't it be done with a transparent union and c99 initializers?

christos




Home | Main Index | Thread Index | Old Index