PERFORCE change 159925 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Fri Mar 27 14:07:27 PDT 2009
http://perforce.freebsd.org/chv.cgi?CH=159925
Change 159925 by hselasky at hselasky_laptop001 on 2009/03/27 21:05:49
USB endian:
- cast variables properly for non-32-bit platforms.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/usb_endian.h#5 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/usb_endian.h#5 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/usb/usb_endian.h,v 1.3 2009/03/21 05:44:22 thompsa Exp $ */
+/* $FreeBSD: src/sys/dev/usb/usb_endian.h,v 1.2 2009/03/20 18:59:53 thompsa Exp $ */
/*
* Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
*
@@ -48,19 +48,19 @@
#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) | \
More information about the p4-projects
mailing list