]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Squid_endian.h was broken - bug 738.
authorrobertc <>
Sun, 17 Aug 2003 05:32:29 +0000 (05:32 +0000)
committerrobertc <>
Sun, 17 Aug 2003 05:32:29 +0000 (05:32 +0000)
Keywords:

Mismatched parentheses in the definition of bswap16 in line 87
od squid_endian.h.  Try the attached patch.
- apb

include/squid_endian.h

index 979b7c1f206161c3e4771317207a060f60e2740e..862366ec246b4d5dbd074ab1e7b05ef15d536c87 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: squid_endian.h,v 1.2 2003/08/07 13:31:34 robertc Exp $
+ * $Id: squid_endian.h,v 1.3 2003/08/16 23:32:29 robertc Exp $
  *
  * AUTHOR: Alan Barrett
  *
@@ -84,7 +84,7 @@
 #    define bswap16(x) bswap_16(x)
 #  else
 #    define bswap16(x) \
-       ((((u_int16_t)x) >> 8) & 0xff) | ((((u_int16_t)x) & 0xff) << 8))
+       (((((u_int16_t)(x)) >> 8) & 0xff) | ((((u_int16_t)(x)) & 0xff) << 8))
 #  endif
 #endif /* ! HAVE_BSWAP16 && ! defined(bswap16) */
 #if ! HAVE_BSWAP32 && ! defined(bswap32)
 #    define bswap32(x) bswap_32(x)
 #  else
 #    define bswap32(x) \
-       (((((u_int32_t)x) & 0xff000000) >> 24) | \
-        ((((u_int32_t)x) & 0x00ff0000) >>  8) | \
-        ((((u_int32_t)x) & 0x0000ff00) <<  8) | \
-        ((((u_int32_t)x) & 0x000000ff) << 24))
+       (((((u_int32_t)(x)) & 0xff000000) >> 24) | \
+        ((((u_int32_t)(x)) & 0x00ff0000) >>  8) | \
+        ((((u_int32_t)(x)) & 0x0000ff00) <<  8) | \
+        ((((u_int32_t)(x)) & 0x000000ff) << 24))
 #  endif
 #endif /* ! HAVE_BSWAP32 && ! defined(bswap32) */