diff dvdread/dvd_reader.c @ 242:f794e1c17947 src

porting AMD64 patches from xine (provided by Goetz Waschk and Gwenole Beauchesne from Mandrake)
author mroi
date Wed, 03 Mar 2004 16:48:36 +0000
parents 59b5753b09d7
children 12cdd1369f77
line wrap: on
line diff
--- a/dvdread/dvd_reader.c	Mon Feb 23 18:14:42 2004 +0000
+++ b/dvdread/dvd_reader.c	Wed Mar 03 16:48:36 2004 +0000
@@ -1034,7 +1034,7 @@
       ( ( ( seek_byte + byte_size ) % DVD_VIDEO_LB_LEN ) ? 1 : 0 );
     
     secbuf_base = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN + 2048 );
-    secbuf = (unsigned char *)(((uintptr_t)secbuf_base & ~2047) + 2048);
+    secbuf = (unsigned char *)(((uintptr_t)secbuf_base & ~((uintptr_t)2047)) + 2048);
     if( !secbuf_base ) {
 	fprintf( stderr, "libdvdread: Can't allocate memory " 
 		 "for file read!\n" );
@@ -1088,7 +1088,7 @@
 	    ssize_t bytes_read;
 	    size_t file_size = dvd_file->filesize * DVD_VIDEO_LB_LEN;
 	    char *buffer_base = malloc( file_size + 2048 );
-	    char *buffer = (unsigned char *)(((uintptr_t)buffer_base & ~2047) + 2048);
+	    char *buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048);
 	    
 	    if( buffer_base == NULL ) {
 		fprintf( stderr, "libdvdread: DVDDiscId, failed to "
@@ -1097,8 +1097,8 @@
 	    }
 	    bytes_read = DVDReadBytes( dvd_file, buffer, file_size );
 	    if( bytes_read != file_size ) {
-		fprintf( stderr, "libdvdread: DVDDiscId read returned %d bytes"
-			 ", wanted %d\n", bytes_read, file_size );
+		fprintf( stderr, "libdvdread: DVDDiscId read returned %zd bytes"
+			 ", wanted %zd\n", bytes_read, file_size );
 		DVDCloseFile( dvd_file );
 		free( buffer_base );
 		return -1;
@@ -1133,7 +1133,7 @@
   }
   
   buffer_base = malloc( DVD_VIDEO_LB_LEN + 2048 );
-  buffer = (unsigned char *)(((uintptr_t)buffer_base & ~2047) + 2048);
+  buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048);
 
   if( buffer_base == NULL ) {
     fprintf( stderr, "libdvdread: DVDISOVolumeInfo, failed to "