[libdvdcss-devel] ioctl: const correctness

Jean-Baptiste Kempf jb at videolan.org
Sat Nov 1 12:50:07 CET 2014


On 31 Oct, Diego Biurrun wrote :
> libdvdcss | branch: master | Diego Biurrun <diego at biurrun.de> | Fri Oct 31 00:14:26 2014 +0100| [4c8f0b12c8b2df87e4a9dfe06f01a54fbb58c67b] | committer: Diego Biurrun
> 
> ioctl: const correctness

> @@ -901,7 +901,7 @@ int ioctl_ReportKey1( int i_fd, int *pi_agid, uint8_t *p_key )
>  /*****************************************************************************
>   * ioctl_InvalidateAgid: invalidate the current AGID
>   *****************************************************************************/
> -int ioctl_InvalidateAgid( int i_fd, int *pi_agid )
> +int ioctl_InvalidateAgid( int i_fd, const int *pi_agid )

This adds warnings on Win32

../src/ioctl.c: In function 'ioctl_InvalidateAgid':
../src/ioctl.c:954:13: warning: passing argument 3 of 'DeviceIoControl' discards 'const' qualifier from pointer target type
     i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_END_SESSION,
             ^
In file included from /usr/i686-w64-mingw32/include/winbase.h:21:0,
                 from /usr/i686-w64-mingw32/include/windows.h:70,
                 from ../src/ioctl.c:41:
/usr/i686-w64-mingw32/include/ioapiset.h:22:29: note: expected 'LPVOID' but argument is of type 'const int *'
   WINBASEAPI WINBOOL WINAPI DeviceIoControl (HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped);

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the libdvdcss-devel mailing list