shithub: libdvdcss

Download patch

ref: 4c8f0b12c8b2df87e4a9dfe06f01a54fbb58c67b
parent: 4c452fe94b701ffdc8269af0206df291c40c5f59
author: Diego Biurrun <[email protected]>
date: Thu Oct 30 20:14:26 EDT 2014

ioctl: const correctness

--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -217,7 +217,7 @@
 /*****************************************************************************
  * ioctl_ReadDiscKey: get the disc key
  *****************************************************************************/
-int ioctl_ReadDiscKey( int i_fd, int *pi_agid, uint8_t *p_key )
+int ioctl_ReadDiscKey( int i_fd, const int *pi_agid, uint8_t *p_key )
 {
     int i_ret;
 
@@ -350,7 +350,7 @@
 /*****************************************************************************
  * ioctl_ReadTitleKey: get the title key
  *****************************************************************************/
-int ioctl_ReadTitleKey( int i_fd, int *pi_agid, int i_pos, uint8_t *p_key )
+int ioctl_ReadTitleKey( int i_fd, const int *pi_agid, int i_pos, uint8_t *p_key )
 {
     int i_ret;
 
@@ -580,8 +580,8 @@
 /*****************************************************************************
  * ioctl_ReportChallenge: get challenge from the drive
  *****************************************************************************/
-int ioctl_ReportChallenge( int i_fd, int *pi_agid, uint8_t *p_challenge )
-{
+int ioctl_ReportChallenge( int i_fd, const int *pi_agid, uint8_t *p_challenge )
+{
     int i_ret;
 
 #if defined( HAVE_LINUX_DVD_STRUCT )
@@ -798,7 +798,7 @@
 /*****************************************************************************
  * ioctl_ReportKey1: get the first key from the drive
  *****************************************************************************/
-int ioctl_ReportKey1( int i_fd, int *pi_agid, uint8_t *p_key )
+int ioctl_ReportKey1( int i_fd, const int *pi_agid, uint8_t *p_key )
 {
     int i_ret;
 
@@ -901,7 +901,7 @@
 /*****************************************************************************
  * 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 )
 {
     int i_ret;
 
@@ -984,7 +984,7 @@
 /*****************************************************************************
  * ioctl_SendChallenge: send challenge to the drive
  *****************************************************************************/
-int ioctl_SendChallenge( int i_fd, int *pi_agid, uint8_t *p_challenge )
+int ioctl_SendChallenge( int i_fd, const int *pi_agid, const uint8_t *p_challenge )
 {
     int i_ret;
 
@@ -1093,7 +1093,7 @@
 /*****************************************************************************
  * ioctl_SendKey2: send the second key to the drive
  *****************************************************************************/
-int ioctl_SendKey2( int i_fd, int *pi_agid, uint8_t *p_key )
+int ioctl_SendKey2( int i_fd, const int *pi_agid, const uint8_t *p_key )
 {
     int i_ret;
 
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -26,15 +26,15 @@
 #include "common.h"
 
 int ioctl_ReadCopyright     ( int, int, int * );
-int ioctl_ReadDiscKey       ( int, int *, uint8_t * );
-int ioctl_ReadTitleKey      ( int, int *, int, uint8_t * );
+int ioctl_ReadDiscKey       ( int, const int *, uint8_t * );
+int ioctl_ReadTitleKey      ( int, const int *, int, uint8_t * );
 int ioctl_ReportAgid        ( int, int * );
-int ioctl_ReportChallenge   ( int, int *, uint8_t * );
-int ioctl_ReportKey1        ( int, int *, uint8_t * );
+int ioctl_ReportChallenge   ( int, const int *, uint8_t * );
+int ioctl_ReportKey1        ( int, const int *, uint8_t * );
 int ioctl_ReportASF         ( int, int * );
-int ioctl_InvalidateAgid    ( int, int * );
-int ioctl_SendChallenge     ( int, int *, uint8_t * );
-int ioctl_SendKey2          ( int, int *, uint8_t * );
+int ioctl_InvalidateAgid    ( int, const int * );
+int ioctl_SendChallenge     ( int, const int *, const uint8_t * );
+int ioctl_SendKey2          ( int, const int *, const uint8_t * );
 int ioctl_ReportRPC         ( int, int *, int *, int * );
 
 #define DVD_KEY_SIZE 5