[libdvdcss-devel] ioctl: const correctness

Diego Biurrun diego at biurrun.de
Sat Nov 1 15:41:00 CET 2014


On Sat, Nov 01, 2014 at 12:50:07PM +0100, Jean-Baptiste Kempf wrote:
> On 31 Oct, Diego Biurrun wrote :
> > @@ -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);

Looks like I'll have to drop the const on this one, pity.

Diego


More information about the libdvdcss-devel mailing list