Hi, Stephen

On 9/15/2020 6:54 PM, Stephen Hemminger wrote:
On Tue, 15 Sep 2020 16:28:03 -0700
Pallavi Kadam <pallavi.ka...@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)

....

ranjit m.

Reply via email to