PERFORCE change 100677 for review

Olivier Houchard cognet at FreeBSD.org
Thu Jul 6 00:07:22 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=100677

Change 100677 by cognet at cognet on 2006/07/06 00:07:03

	Protect macro variables.

Affected files ...

.. //depot/projects/mips2/src/sys/mips/include/endian.h#2 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/include/endian.h#2 (text+ko) ====

@@ -71,14 +71,14 @@
 #define	__is_constant(x)	0
 #endif
 
-#define	__bswap16_const(x)	((x >> 8) | ((x << 8) & 0xff00))
-#define	__bswap32_const(x)	((x >> 24) | ((x >> 8) & 0xff00) |	\
-	((x << 8) & 0xff0000) | ((x << 24) & 0xff000000))
-#define	__bswap64_const(x)	((x >> 56) | ((x >> 40) & 0xff00) |	\
-	((x >> 24) & 0xff0000) | ((x >> 8) & 0xff000000) |		\
-	((x << 8) & ((__uint64_t)0xff << 32)) |				\
-	((x << 24) & ((__uint64_t)0xff << 40)) |			\
-	((x << 40) & ((__uint64_t)0xff << 48)) | ((x << 56)))
+#define	__bswap16_const(x)	(((x) >> 8) | (((x) << 8) & 0xff00))
+#define	__bswap32_const(x)	(((x) >> 24) | (((x) >> 8) & 0xff00) |	\
+	(((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000))
+#define	__bswap64_const(x)	(((x) >> 56) | (((x) >> 40) & 0xff00) |	\
+	(((x) >> 24) & 0xff0000) | (((x) >> 8) & 0xff000000) |		\
+	(((x) << 8) & ((__uint64_t)0xff << 32)) |			\
+	(((x) << 24) & ((__uint64_t)0xff << 40)) |			\
+	(((x) << 40) & ((__uint64_t)0xff << 48)) | (((x) << 56)))
 
 static __inline __uint16_t
 __bswap16_var(__uint16_t _x)


More information about the p4-projects mailing list