From 41634c45303643e3756b3af9d0123095942481bb Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 14 Sep 2014 11:45:02 +1000 Subject: Obsolete the old MACROS and MACROE convenience macros. --- Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h | 6 +++--- Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h | 6 +++--- Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h | 10 +++++----- Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h | 6 +++--- Demos/Device/LowLevel/MassStorage/Lib/SCSI.h | 6 +++--- Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h | 10 +++++----- 6 files changed, 22 insertions(+), 22 deletions(-) (limited to 'Demos') diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h index a8f3b7372..f663baa5c 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h +++ b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h @@ -56,9 +56,9 @@ * \param[in] Acode New SCSI additional sense key to set the additional sense code to * \param[in] Aqual New SCSI additional sense key qualifier to set the additional sense qualifier code to */ - #define SCSI_SET_SENSE(Key, Acode, Aqual) MACROS{ SenseData.SenseKey = (Key); \ - SenseData.AdditionalSenseCode = (Acode); \ - SenseData.AdditionalSenseQualifier = (Aqual); }MACROE + #define SCSI_SET_SENSE(Key, Acode, Aqual) do { SenseData.SenseKey = (Key); \ + SenseData.AdditionalSenseCode = (Acode); \ + SenseData.AdditionalSenseQualifier = (Aqual); } while (0) /** Macro for the \ref SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium. */ #define DATA_READ true diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h index 9db10693f..8ccc146ca 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h @@ -56,9 +56,9 @@ * \param[in] Acode New SCSI additional sense key to set the additional sense code to * \param[in] Aqual New SCSI additional sense key qualifier to set the additional sense qualifier code to */ - #define SCSI_SET_SENSE(Key, Acode, Aqual) MACROS{ SenseData.SenseKey = (Key); \ - SenseData.AdditionalSenseCode = (Acode); \ - SenseData.AdditionalSenseQualifier = (Aqual); }MACROE + #define SCSI_SET_SENSE(Key, Acode, Aqual) do { SenseData.SenseKey = (Key); \ + SenseData.AdditionalSenseCode = (Acode); \ + SenseData.AdditionalSenseQualifier = (Aqual); } while (0) /** Macro for the \ref SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium. */ #define DATA_READ true diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h index 754842a02..92fbdf362 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h @@ -118,32 +118,32 @@ * * \param[in] Buffer Application buffer to lock */ - #define TCP_APP_CAPTURE_BUFFER(Buffer) MACROS{ Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->InUse = true; }MACROE + #define TCP_APP_CAPTURE_BUFFER(Buffer) do { Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->InUse = true; } while (0) /** Application macro: Releases a captured application buffer, allowing for host-to-device packets to be received. * * \param[in] Buffer Application buffer to release */ - #define TCP_APP_RELEASE_BUFFER(Buffer) MACROS{ Buffer->InUse = false; }MACROE + #define TCP_APP_RELEASE_BUFFER(Buffer) do { Buffer->InUse = false; } while (0) /** Application macro: Sends the contents of the given application buffer to the host. * * \param[in] Buffer Application buffer to send * \param[in] Len Length of data contained in the buffer */ - #define TCP_APP_SEND_BUFFER(Buffer, Len) MACROS{ Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->Length = Len; Buffer->Ready = true; }MACROE + #define TCP_APP_SEND_BUFFER(Buffer, Len) do { Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->Length = Len; Buffer->Ready = true; } while (0) /** Application macro: Clears the application buffer, ready for a packet to be written to it. * * \param[in] Buffer Application buffer to clear */ - #define TCP_APP_CLEAR_BUFFER(Buffer) MACROS{ Buffer->Ready = false; Buffer->Length = 0; }MACROE + #define TCP_APP_CLEAR_BUFFER(Buffer) do { Buffer->Ready = false; Buffer->Length = 0; } while (0) /** Application macro: Closes an open connection to a host. * * \param[in] Connection Open TCP connection to close */ - #define TCP_APP_CLOSECONNECTION(Connection) MACROS{ Connection->State = TCP_Connection_Closing; }MACROE + #define TCP_APP_CLOSECONNECTION(Connection) do { Connection->State = TCP_Connection_Closing; } while (0) /* Enums: */ /** Enum for possible TCP port states. */ diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h index 38cb6a6d5..d26a82bde 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h @@ -56,9 +56,9 @@ * \param[in] Acode New SCSI additional sense key to set the additional sense code to * \param[in] Aqual New SCSI additional sense key qualifier to set the additional sense qualifier code to */ - #define SCSI_SET_SENSE(Key, Acode, Aqual) MACROS{ SenseData.SenseKey = (Key); \ - SenseData.AdditionalSenseCode = (Acode); \ - SenseData.AdditionalSenseQualifier = (Aqual); }MACROE + #define SCSI_SET_SENSE(Key, Acode, Aqual) do { SenseData.SenseKey = (Key); \ + SenseData.AdditionalSenseCode = (Acode); \ + SenseData.AdditionalSenseQualifier = (Aqual); } while (0) /** Macro for the \ref SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium. */ #define DATA_READ true diff --git a/Demos/Device/LowLevel/MassStorage/Lib/SCSI.h b/Demos/Device/LowLevel/MassStorage/Lib/SCSI.h index 2b0133fdc..36553bd7b 100644 --- a/Demos/Device/LowLevel/MassStorage/Lib/SCSI.h +++ b/Demos/Device/LowLevel/MassStorage/Lib/SCSI.h @@ -57,9 +57,9 @@ * \param[in] Acode New SCSI additional sense key to set the additional sense code to * \param[in] Aqual New SCSI additional sense key qualifier to set the additional sense qualifier code to */ - #define SCSI_SET_SENSE(Key, Acode, Aqual) MACROS{ SenseData.SenseKey = (Key); \ - SenseData.AdditionalSenseCode = (Acode); \ - SenseData.AdditionalSenseQualifier = (Aqual); }MACROE + #define SCSI_SET_SENSE(Key, Acode, Aqual) do { SenseData.SenseKey = (Key); \ + SenseData.AdditionalSenseCode = (Acode); \ + SenseData.AdditionalSenseQualifier = (Aqual); } while (0) /** Macro for the \ref SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium. */ #define DATA_READ true diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h index e5bf0f312..0d96430ba 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h @@ -119,32 +119,32 @@ * * \param[in] Buffer Application buffer to lock */ - #define TCP_APP_CAPTURE_BUFFER(Buffer) MACROS{ Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->InUse = true; }MACROE + #define TCP_APP_CAPTURE_BUFFER(Buffer) do { Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->InUse = true; } while (0) /** Application macro: Releases a captured application buffer, allowing for host-to-device packets to be received. * * \param[in] Buffer Application buffer to release */ - #define TCP_APP_RELEASE_BUFFER(Buffer) MACROS{ Buffer->InUse = false; }MACROE + #define TCP_APP_RELEASE_BUFFER(Buffer) do { Buffer->InUse = false; } while (0) /** Application macro: Sends the contents of the given application buffer to the host. * * \param[in] Buffer Application buffer to send * \param[in] Len Length of data contained in the buffer */ - #define TCP_APP_SEND_BUFFER(Buffer, Len) MACROS{ Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->Length = Len; Buffer->Ready = true; }MACROE + #define TCP_APP_SEND_BUFFER(Buffer, Len) do { Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->Length = Len; Buffer->Ready = true; } while (0) /** Application macro: Clears the application buffer, ready for a packet to be written to it. * * \param[in] Buffer Application buffer to clear */ - #define TCP_APP_CLEAR_BUFFER(Buffer) MACROS{ Buffer->Ready = false; Buffer->Length = 0; }MACROE + #define TCP_APP_CLEAR_BUFFER(Buffer) do { Buffer->Ready = false; Buffer->Length = 0; } while (0) /** Application macro: Closes an open connection to a host. * * \param[in] Connection Open TCP connection to close */ - #define TCP_APP_CLOSECONNECTION(Connection) MACROS{ Connection->State = TCP_Connection_Closing; }MACROE + #define TCP_APP_CLOSECONNECTION(Connection) do { Connection->State = TCP_Connection_Closing; } while (0) /* Enums: */ /** Enum for possible TCP port states. */ -- cgit v1.2.3