[libdvdcss-devel] ioctl: const correctness

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


On 01 Nov, Diego Biurrun wrote :
> 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.

Unfortunately I don't see any other way.

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