diff options
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/libdvdnav/dvd_reader.c | 6 | ||||
-rw-r--r-- | src/input/libdvdnav/dvd_udf.c | 14 | ||||
-rw-r--r-- | src/input/libdvdnav/read_cache.c | 6 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/input/libdvdnav/dvd_reader.c b/src/input/libdvdnav/dvd_reader.c index 63076ac97..40bed7ea6 100644 --- a/src/input/libdvdnav/dvd_reader.c +++ b/src/input/libdvdnav/dvd_reader.c @@ -1001,7 +1001,7 @@ ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size ) ( ( ( seek_byte + byte_size ) % DVD_VIDEO_LB_LEN ) ? 1 : 0 ); secbuf_base = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN + 2048 ); - secbuf = (unsigned char *)(((int)secbuf_base & ~2047) + 2048); + secbuf = (unsigned char *)(((uintptr_t)secbuf_base & ~2047) + 2048); if( !secbuf_base ) { fprintf( stderr, "libdvdread: Can't allocate memory " "for file read!\n" ); @@ -1055,7 +1055,7 @@ int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid ) 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 *)(((int)buffer_base & ~2047) + 2048); + char *buffer = (unsigned char *)(((uintptr_t)buffer_base & ~2047) + 2048); if( buffer_base == NULL ) { fprintf( stderr, "libdvdread: DVDDiscId, failed to " @@ -1100,7 +1100,7 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd, } buffer_base = malloc( DVD_VIDEO_LB_LEN + 2048 ); - buffer = (unsigned char *)(((int)buffer_base & ~2047) + 2048); + buffer = (unsigned char *)(((uintptr_t)buffer_base & ~2047) + 2048); if( buffer_base == NULL ) { fprintf( stderr, "libdvdread: DVDISOVolumeInfo, failed to " diff --git a/src/input/libdvdnav/dvd_udf.c b/src/input/libdvdnav/dvd_udf.c index b65d7e659..a834cc8ac 100644 --- a/src/input/libdvdnav/dvd_udf.c +++ b/src/input/libdvdnav/dvd_udf.c @@ -492,7 +492,7 @@ static int UDFMapICB( dvd_reader_t *device, struct AD ICB, uint8_t *FileType, struct Partition *partition, struct AD *File ) { uint8_t LogBlock_base[DVD_VIDEO_LB_LEN + 2048]; - uint8_t *LogBlock = (uint8_t *)(((int)LogBlock_base & ~2047) + 2048); + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~2047) + 2048); uint32_t lbnum; uint16_t TagID; struct icbmap tmpmap; @@ -537,7 +537,7 @@ static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName, { char filename[ MAX_UDF_FILE_NAME_LEN ]; uint8_t directory_base[ 2 * DVD_VIDEO_LB_LEN + 2048]; - uint8_t *directory = (uint8_t *)(((int)directory_base & ~2047) + 2048); + uint8_t *directory = (uint8_t *)(((uintptr_t)directory_base & ~2047) + 2048); uint32_t lbnum; uint16_t TagID; uint8_t filechar; @@ -559,7 +559,7 @@ static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName, if((cached_dir_base = malloc(dir_lba * DVD_VIDEO_LB_LEN + 2048)) == NULL) { return 0; } - cached_dir = (uint8_t *)(((int)cached_dir_base & ~2047) + 2048); + cached_dir = (uint8_t *)(((uintptr_t)cached_dir_base & ~2047) + 2048); if( DVDReadLBUDF( device, lbnum, dir_lba, cached_dir, 0) <= 0 ) { free(cached_dir_base); cached_dir = NULL; @@ -650,7 +650,7 @@ static int UDFGetAVDP( dvd_reader_t *device, struct avdp_t *avdp) { uint8_t Anchor_base[ DVD_VIDEO_LB_LEN + 2048 ]; - uint8_t *Anchor = (uint8_t *)(((int)Anchor_base & ~2047) + 2048); + uint8_t *Anchor = (uint8_t *)(((uintptr_t)Anchor_base & ~2047) + 2048); uint32_t lbnum, MVDS_location, MVDS_length; uint16_t TagID; uint32_t lastsector; @@ -722,7 +722,7 @@ static int UDFFindPartition( dvd_reader_t *device, int partnum, struct Partition *part ) { uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ]; - uint8_t *LogBlock = (uint8_t *)(((int)LogBlock_base & ~2047) + 2048); + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~2047) + 2048); uint32_t lbnum, MVDS_location, MVDS_length; uint16_t TagID; int i, volvalid; @@ -785,7 +785,7 @@ uint32_t UDFFindFile( dvd_reader_t *device, char *filename, uint32_t *filesize ) { uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ]; - uint8_t *LogBlock = (uint8_t *)(((int)LogBlock_base & ~2047) + 2048); + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~2047) + 2048); uint32_t lbnum; uint16_t TagID; struct Partition partition; @@ -930,7 +930,7 @@ static int UDFGetDescriptor( dvd_reader_t *device, int id, static int UDFGetPVD(dvd_reader_t *device, struct pvd_t *pvd) { uint8_t pvd_buf_base[DVD_VIDEO_LB_LEN + 2048]; - uint8_t *pvd_buf = (uint8_t *)(((int)pvd_buf_base & ~2047) + 2048); + uint8_t *pvd_buf = (uint8_t *)(((uintptr_t)pvd_buf_base & ~2047) + 2048); if(GetUDFCache(device, PVDCache, 0, pvd)) { return 1; diff --git a/src/input/libdvdnav/read_cache.c b/src/input/libdvdnav/read_cache.c index 0e9ac568b..70685e2bd 100644 --- a/src/input/libdvdnav/read_cache.c +++ b/src/input/libdvdnav/read_cache.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: read_cache.c,v 1.9 2003/04/29 21:55:52 jcdutton Exp $ + * $Id: read_cache.c,v 1.10 2003/08/25 14:32:37 mroi Exp $ * */ @@ -448,7 +448,7 @@ void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count) self->chunk[use].cache_buffer_base = realloc(self->chunk[use].cache_buffer_base, block_count * DVD_VIDEO_LB_LEN + ALIGNMENT); self->chunk[use].cache_buffer = - (uint8_t *)(((int)self->chunk[use].cache_buffer_base & ~(ALIGNMENT - 1)) + ALIGNMENT); + (uint8_t *)(((uintptr_t)self->chunk[use].cache_buffer_base & ~(ALIGNMENT - 1)) + ALIGNMENT); dprintf("pre_cache DVD read realloc happened\n"); self->chunk[use].cache_malloc_size = block_count; } else { @@ -466,7 +466,7 @@ void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count) self->chunk[i].cache_buffer_base = malloc((block_count > 500 ? block_count : 500) * DVD_VIDEO_LB_LEN + ALIGNMENT); self->chunk[i].cache_buffer = - (uint8_t *)(((int)self->chunk[i].cache_buffer_base & ~(ALIGNMENT - 1)) + ALIGNMENT); + (uint8_t *)(((uintptr_t)self->chunk[i].cache_buffer_base & ~(ALIGNMENT - 1)) + ALIGNMENT); self->chunk[i].cache_malloc_size = block_count > 500 ? block_count : 500; dprintf("pre_cache DVD read malloc %d blocks\n", (block_count > 500 ? block_count : 500 )); |