[ofw] [RFC] [PATCH 2/3] winmad userspace library

Fab Tillier ftillier at windows.microsoft.com
Wed Jul 2 09:36:01 PDT 2008


>> I'd suggest to change all the types, that are in network order, into
>> network ones, like it is done in all the stack.
>> If you don't like IBAL names, define something like
>> typedef UINT32 UNET32;
>>
>> Using comments for the fields in the structures (like '// Network byte
>> order') is not enough error prone, IMO. You will have parameters and
>> variables, that are to be assigned to these fields and you will not
>> always look into the structure and notice the comment. Also editors and
>> debuggers show you the type of variable, not the comment ... :(
>>
>> I'd like to see this change applied to all of your code (WinVerbs,
>> libumad, drivers ...)
>  I'm not disagreeing that this isn't useful, but I'd like to keep the
> interfaces consistent with other Windows APIs.  I'm not aware of any
> Window data types like be_32.  (I looked, but maybe I missed it.)  Are
> there any existing Windows APIs (from MS) that define types like this?

I'm not aware of any and I'd probably prefer just sticking with the existing Windows types.  Having network order types isn't fool proof: recall the recent issue with pkey byte ordering.  The compiler doesn't provide any help here either, because UINT32 and UNET32 are the same underlying type.

-Fab



More information about the ofw mailing list