Re: [libdvdcss-devel] ioctl: const correctness

Diego Biurrun <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvdcss,gmane.comp.video.videolan.libdvdcss.devel
Message-ID <20141101144100.GH30310@nibbler>
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
_______________________________________________
libdvdcss-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvdcss-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.