[libdvdcss-devel] [PATCH] ioctl: const correctness

Jean-Baptiste Kempf jb at videolan.org
Fri Oct 31 16:35:23 CET 2014


LGTM.

On 31 Oct, Diego Biurrun wrote :
> ---
>  src/ioctl.c | 14 +++++++-------
>  src/ioctl.h | 14 +++++++-------
>  2 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/src/ioctl.c b/src/ioctl.c
> index 9c7c7f7..d75e6e8 100644
> --- a/src/ioctl.c
> +++ b/src/ioctl.c
> @@ -217,7 +217,7 @@ int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )
>  /*****************************************************************************
>   * 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 @@ int ioctl_ReadDiscKey( int i_fd, int *pi_agid, uint8_t *p_key )
>  /*****************************************************************************
>   * 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,7 +580,7 @@ int ioctl_ReportAgid( int i_fd, int *pi_agid )
>  /*****************************************************************************
>   * 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;
>  
> @@ -798,7 +798,7 @@ int ioctl_ReportASF( int i_fd, int *pi_asf )
>  /*****************************************************************************
>   * 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 @@ 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 )
>  {
>      int i_ret;
>  
> @@ -984,7 +984,7 @@ int ioctl_InvalidateAgid( int i_fd, int *pi_agid )
>  /*****************************************************************************
>   * 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 @@ int ioctl_SendChallenge( int i_fd, int *pi_agid, uint8_t *p_challenge )
>  /*****************************************************************************
>   * 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;
>  
> diff --git a/src/ioctl.h b/src/ioctl.h
> index bbb2bd9..e813251 100644
> --- 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
> -- 
> 1.9.1
> 
> _______________________________________________
> libdvdcss-devel mailing list
> libdvdcss-devel at videolan.org
> https://mailman.videolan.org/listinfo/libdvdcss-devel

-- 
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