Discussion:
[libdvdcss-devel] device: Use correct type for ReadFile() function instead of casting
Diego Biurrun
2014-10-30 16:16:33 UTC
Permalink
libdvdcss | branch: master | Diego Biurrun <***@biurrun.de> | Fri Oct 24 19:27:29 2014 +0200| [59954f20f6eabdccb44f19eda89b8b9b59a80a76] | committer: Diego Biurrun

device: Use correct type for ReadFile() function instead of casting

This fixes some related incompatible pointer type warnings.
http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=59954f20f6eabdccb44f19eda89b8b9b59a80a76
---

src/device.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/device.c b/src/device.c
index a32836a..8475cc9 100644
--- a/src/device.c
+++ b/src/device.c
@@ -802,11 +802,11 @@ static int libc_read ( dvdcss_t dvdcss, void *p_buffer, int i_blocks )
#if defined( WIN32 )
static int win2k_read ( dvdcss_t dvdcss, void *p_buffer, int i_blocks )
{
- int i_bytes;
+ DWORD i_bytes;

if( !ReadFile( (HANDLE) dvdcss->i_fd, p_buffer,
i_blocks * DVDCSS_BLOCK_SIZE,
- (LPDWORD)&i_bytes, NULL ) )
+ &i_bytes, NULL ) )
{
dvdcss->i_pos = -1;
return -1;
@@ -909,6 +909,7 @@ static int win_readv ( dvdcss_t dvdcss, struct iovec *p_iovec, int i_blocks )
{
int i_index;
int i_blocks_read, i_blocks_total = 0;
+ DWORD i_bytes;

/* Check the size of the readv temp buffer, just in case we need to
* realloc something bigger */
@@ -940,7 +941,6 @@ static int win_readv ( dvdcss_t dvdcss, struct iovec *p_iovec, int i_blocks )

if( WIN2K )
{
- unsigned long int i_bytes;
if( !ReadFile( (HANDLE)dvdcss->i_fd, dvdcss->p_readv_buffer,
i_blocks_total * DVDCSS_BLOCK_SIZE, &i_bytes, NULL ) )
{

Loading...