diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-07-15 10:34:29 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-07-15 10:34:29 +0000 |
| commit | 79ee5516459e285d3512648a262a289ddcac2056 (patch) | |
| tree | 947c29ca6189a7943446b476e204ca17591d65e9 /Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c | |
| parent | a1ffc53e4e76b56d295e76fd9a8c2b95952693f8 (diff) | |
Fix pointer aliasing warning in the Mass Storage demos.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1389 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c')
| -rw-r--r-- | Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c index e4bf4d60..15955a77 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c @@ -148,8 +148,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) */ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) { - uint16_t AllocationLength = (((uint16_t)MSInterfaceInfo->State.CommandBlock.SCSICommandData[3] << 8) | - MSInterfaceInfo->State.CommandBlock.SCSICommandData[4]); + uint16_t AllocationLength = SwapEndian_16(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]); uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength : sizeof(InquiryData); @@ -310,7 +309,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]); /* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */ - TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]); + TotalBlocks = SwapEndian_16(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]); /* Check if the block address is outside the maximum allowable value for the LUN */ if (BlockAddress >= LUN_MEDIA_BLOCKS) |
