summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_endian.h
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-04-05 18:20:58 +0000
committerthompsa <thompsa@FreeBSD.org>2009-04-05 18:20:58 +0000
commite0173c7bbd3d923a5564df1cba907c58d681db38 (patch)
treec91dc0400bd783fd0aeb8a14ae6319661f841557 /sys/dev/usb/usb_endian.h
parentd21a622bba09d8841faedb2b868bfbaf8df99c0c (diff)
downloadFreeBSD-src-e0173c7bbd3d923a5564df1cba907c58d681db38.zip
FreeBSD-src-e0173c7bbd3d923a5564df1cba907c58d681db38.tar.gz
MFp4 //depot/projects/usb@159925
Cast variables properly for non-32-bit platforms. Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/usb_endian.h')
-rw-r--r--sys/dev/usb/usb_endian.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/usb/usb_endian.h b/sys/dev/usb/usb_endian.h
index 2f49008..f7d2244 100644
--- a/sys/dev/usb/usb_endian.h
+++ b/sys/dev/usb/usb_endian.h
@@ -48,19 +48,19 @@ typedef uint8_t uQWord[8];
#define UGETW(w) \
((w)[0] | \
- ((w)[1] << 8))
+ (((uint16_t)((w)[1])) << 8))
#define UGETDW(w) \
((w)[0] | \
- ((w)[1] << 8) | \
- ((w)[2] << 16) | \
- ((w)[3] << 24))
+ (((uint16_t)((w)[1])) << 8) | \
+ (((uint32_t)((w)[2])) << 16) | \
+ (((uint32_t)((w)[3])) << 24))
#define UGETQW(w) \
((w)[0] | \
- ((w)[1] << 8) | \
- ((w)[2] << 16) | \
- ((w)[3] << 24) | \
+ (((uint16_t)((w)[1])) << 8) | \
+ (((uint32_t)((w)[2])) << 16) | \
+ (((uint32_t)((w)[3])) << 24) | \
(((uint64_t)((w)[4])) << 32) | \
(((uint64_t)((w)[5])) << 40) | \
(((uint64_t)((w)[6])) << 48) | \
OpenPOWER on IntegriCloud