shithub: libdvdcss

Download patch

ref: 59954f20f6eabdccb44f19eda89b8b9b59a80a76
parent: 497b1582de702a5d3252abbe2f0b31f6a68b8d9e
author: Diego Biurrun <diego@biurrun.de>
date: Fri Oct 24 15:27:29 EDT 2014

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

This fixes some related incompatible pointer type warnings.

--- a/src/device.c
+++ b/src/device.c
@@ -802,11 +802,11 @@
 #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 @@
 {
     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 @@
 
     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 ) )
         {