[libdvdcss-devel] [PATCH 24/47] device: Use correct type for ReadFile() function instead of casting

Diego Biurrun diego at biurrun.de
Wed Oct 29 21:33:24 CET 2014


This fixes some related incompatible pointer type warnings.
---
 src/device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/device.c b/src/device.c
index 6e37e37..cd32acd 100644
--- a/src/device.c
+++ b/src/device.c
@@ -635,11 +635,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;
@@ -728,6 +728,7 @@ static int win2k_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 */
@@ -757,7 +758,6 @@ static int win2k_readv ( dvdcss_t dvdcss, struct iovec *p_iovec, int i_blocks )
 
     i_blocks_total /= DVDCSS_BLOCK_SIZE;
 
-    unsigned long int i_bytes;
     if( !ReadFile( (HANDLE)dvdcss->i_fd, dvdcss->p_readv_buffer,
                    i_blocks_total * DVDCSS_BLOCK_SIZE, &i_bytes, NULL ) )
     {
-- 
1.9.1



More information about the libdvdcss-devel mailing list