Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Mar 2009 21:06:49 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 159925 for review
Message-ID:  <200903272106.n2RL6nQu057630@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=159925

Change 159925 by hselasky@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) |	\



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