[dpdk-dev] [PATCH v2] bus/pci: netuio interface for windows

Ranjit Menon ranjit.menon at intel.com
Thu Sep 17 03:20:13 CEST 2020


On 9/16/2020 5:48 PM, Ranjit Menon wrote:
> Hi, Stephen
>
> On 9/15/2020 6:54 PM, Stephen Hemminger wrote:
>> On Tue, 15 Sep 2020 16:28:03 -0700
>> Pallavi Kadam <pallavi.kadam at intel.com> wrote:
>>
>>> +    if (IsEqualGUID((const void *)&(device_info_data->ClassGuid),
>>> +        (const void *)&GUID_DEVCLASS_NETUIO))
>> Is there anyway to get rid of casts and have the right types?
>> Casts are evil
>
> Unfortunately, this macro is defined inside the Windows SDK and it 
> simply calls the C library function memcmp() which expects a (void *).
>
> Would something like this be acceptable?
>
> const void *guid = &(device_info_data->ClassGuid);
>
> const void *guid_netuio = &GUID_DEVCLASS_NETUIO;
>
> if (IsEqualGUID(guid, guid_netuio)
>
> ....
Actually, ignore what I wrote above! It's a void * - it doesn't need a 
cast.

We'll fix this in V3.

ranjit m.




More information about the dev mailing list