[DVDnav-discuss] r976 - trunk/libdvdnav/src/dvdread/bswap.h

nicodvb subversion at mplayerhq.hu
Wed Dec 5 00:04:00 CET 2007


Author: nicodvb
Date: Wed Dec  5 00:03:58 2007
New Revision: 976

Log:
in B2N_64 always append ULL to the hex bitmasks to force conversion of
the expression to 64 bit and prevent overflow; patch by VLC team


Modified:
   trunk/libdvdnav/src/dvdread/bswap.h

Modified: trunk/libdvdnav/src/dvdread/bswap.h
==============================================================================
--- trunk/libdvdnav/src/dvdread/bswap.h	(original)
+++ trunk/libdvdnav/src/dvdread/bswap.h	Wed Dec  5 00:03:58 2007
@@ -81,14 +81,14 @@
       (((x) & 0x0000ff00) <<  8) | \
       (((x) & 0x000000ff) << 24))
 #define B2N_64(x) \
- x = ((((x) & 0xff00000000000000) >> 56) | \
-      (((x) & 0x00ff000000000000) >> 40) | \
-      (((x) & 0x0000ff0000000000) >> 24) | \
-      (((x) & 0x000000ff00000000) >>  8) | \
-      (((x) & 0x00000000ff000000) <<  8) | \
-      (((x) & 0x0000000000ff0000) << 24) | \
-      (((x) & 0x000000000000ff00) << 40) | \
-      (((x) & 0x00000000000000ff) << 56))
+ x = ((((x) & 0xff00000000000000ULL) >> 56) | \
+      (((x) & 0x00ff000000000000ULL) >> 40) | \
+      (((x) & 0x0000ff0000000000ULL) >> 24) | \
+      (((x) & 0x000000ff00000000ULL) >>  8) | \
+      (((x) & 0x00000000ff000000ULL) <<  8) | \
+      (((x) & 0x0000000000ff0000ULL) << 24) | \
+      (((x) & 0x000000000000ff00ULL) << 40) | \
+      (((x) & 0x00000000000000ffULL) << 56))
 
 #else
 



More information about the DVDnav-discuss mailing list