Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Apr 2009 18:20:58 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190736 - head/sys/dev/usb
Message-ID:  <200904051820.n35IKw12028022@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Sun Apr  5 18:20:58 2009
New Revision: 190736
URL: http://svn.freebsd.org/changeset/base/190736

Log:
  MFp4 //depot/projects/usb@159925
  
  Cast variables properly for non-32-bit platforms.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_endian.h

Modified: head/sys/dev/usb/usb_endian.h
==============================================================================
--- head/sys/dev/usb/usb_endian.h	Sun Apr  5 18:20:49 2009	(r190735)
+++ head/sys/dev/usb/usb_endian.h	Sun Apr  5 18:20:58 2009	(r190736)
@@ -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) |	\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904051820.n35IKw12028022>