From bf50959b8016adbf6b295178b26b8173514dd060 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 20 Jul 2009 14:51:19 +0000 Subject: Simplify SideShow GUID compares via a macro. --- Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c') diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c index 2726d50dac..8dc0b62467 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c @@ -134,9 +134,9 @@ static void SideShow_Sync(SideShow_PacketHeader_t* PacketHeader) Endpoint_Read_Stream_LE(&ProtocolGUID, sizeof(GUID_t)); Endpoint_ClearOUT(); - if (memcmp(&ProtocolGUID, (uint32_t[])STANDARD_PROTOCOL_GUID, sizeof(GUID_t)) != 0) + if (!(GUID_COMPARE(&ProtocolGUID, (uint32_t[])STANDARD_PROTOCOL_GUID))) PacketHeader->Type.NAK = true; - + Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(&ProtocolGUID, sizeof(GUID_t)); @@ -179,7 +179,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* PacketHeader) PacketHeader->Length = sizeof(SideShow_PacketHeader_t); - if (memcmp(&Property.PropertyGUID, (uint32_t[])SIDESHOW_PROPERTY_GUID, sizeof(GUID_t)) == 0) + if (GUID_COMPARE(&Property.PropertyGUID, (uint32_t[])SIDESHOW_PROPERTY_GUID)) { switch (Property.PropertyID) { @@ -233,7 +233,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* PacketHeader) break; } } - else if (memcmp(&Property.PropertyGUID, (uint32_t[])DEVICE_PROPERTY_GUID, sizeof(GUID_t)) == 0) + else if (GUID_COMPARE(&Property.PropertyGUID, (uint32_t[])DEVICE_PROPERTY_GUID)) { switch (Property.PropertyID) { -- cgit v1.2.3