changeset 316:e60fce5af518 src

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
author nicodvb
date Tue, 04 Dec 2007 23:03:58 +0000
parents 9abc06e356ff
children 049808d4a560
files dvdread/bswap.h
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dvdread/bswap.h	Thu Nov 29 23:24:05 2007 +0000
+++ b/dvdread/bswap.h	Tue Dec 04 23:03:58 2007 +0000
@@ -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