Change over all makefiles to use C99 standards mode, rather than C99 + GNU Extensions.
[pub/USBasp.git] / Projects / TempDataLogger / Lib / SCSI.c
index d499d9a..7bb66d3 100644 (file)
@@ -138,8 +138,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
  */
 static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
 {
  */
 static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
 {
-       uint16_t AllocationLength  = (((uint16_t)MSInterfaceInfo->State.CommandBlock.SCSICommandData[3] << 8) |
-                                                MSInterfaceInfo->State.CommandBlock.SCSICommandData[4]);
+       uint16_t AllocationLength  = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]);
        uint16_t BytesTransferred  = (AllocationLength < sizeof(InquiryData))? AllocationLength :
                                                                               sizeof(InquiryData);
 
        uint16_t BytesTransferred  = (AllocationLength < sizeof(InquiryData))? AllocationLength :
                                                                               sizeof(InquiryData);