changeset 6922:adaa83002b22

Bswap fixes for 64bit cpus, thx to Falk Hueffner for the hint.
author atmos4
date Mon, 05 Aug 2002 13:04:54 +0000
parents 762c98c47f01
children 60374fa581fc
files bswap.h
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bswap.h	Mon Aug 05 12:57:54 2002 +0000
+++ b/bswap.h	Mon Aug 05 13:04:54 2002 +0000
@@ -40,7 +40,7 @@
 inline static unsigned long long int ByteSwap64(unsigned long long int x)
 {
   register union { __extension__ unsigned long long int __ll;
-          unsigned long int __l[2]; } __x;
+          unsigned int __l[2]; } __x;
   asm("xchgl	%0,%1":
       "=r"(__x.__l[0]),"=r"(__x.__l[1]):
       "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32))));
@@ -61,7 +61,7 @@
 #define bswap_64(x) \
      (__extension__						\
       ({ union { __extension__ unsigned long long int __ll;	\
-                 unsigned long int __l[2]; } __w, __r;		\
+                 unsigned int __l[2]; } __w, __r;		\
          __w.__ll = (x);					\
          __r.__l[0] = bswap_32 (__w.__l[1]);			\
          __r.__l[1] = bswap_32 (__w.__l[0]);			\