[vlc-devel] [PATCH 14/16] Fix C++ compilation

Jean-Baptiste Kempf jb at videolan.org
Mon Jul 6 18:15:26 CEST 2015


OK.

On 26 Jun, glenvt18 wrote :
> Cast pointers.
> ---
>  src/dvbcsa_algo.c    | 2 +-
>  src/dvbcsa_bs_algo.c | 2 +-
>  test/testbitslice.c  | 2 +-
>  test/testdec.c       | 2 +-
>  test/testenc.c       | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/dvbcsa_algo.c b/src/dvbcsa_algo.c
> index 6e8de8c..8c4d58f 100644
> --- a/src/dvbcsa_algo.c
> +++ b/src/dvbcsa_algo.c
> @@ -72,7 +72,7 @@ void dvbcsa_encrypt (const struct dvbcsa_key_s *key, uint8_t *data, unsigned int
>  
>  struct dvbcsa_key_s * dvbcsa_key_alloc(void)
>  {
> -  return malloc(sizeof (struct dvbcsa_key_s));
> +  return (struct dvbcsa_key_s *)malloc(sizeof (struct dvbcsa_key_s));
>  }
>  
>  void dvbcsa_key_free(struct dvbcsa_key_s *key)
> diff --git a/src/dvbcsa_bs_algo.c b/src/dvbcsa_bs_algo.c
> index bc8e61f..58c109e 100644
> --- a/src/dvbcsa_bs_algo.c
> +++ b/src/dvbcsa_bs_algo.c
> @@ -94,7 +94,7 @@ struct dvbcsa_bs_key_s * dvbcsa_bs_key_alloc(void)
>  # endif
>  #endif
>  
> -  return p;
> +  return (struct dvbcsa_bs_key_s *)p;
>  }
>  
>  void dvbcsa_bs_key_free(struct dvbcsa_bs_key_s *key)
> diff --git a/test/testbitslice.c b/test/testbitslice.c
> index d87699a..039a15a 100644
> --- a/test/testbitslice.c
> +++ b/test/testbitslice.c
> @@ -32,7 +32,7 @@
>  static void
>  hexdump (const char *str, const void *data, uint32_t len)
>  {
> -  const uint8_t *p = data;
> +  const uint8_t *p = (const uint8_t *)data;
>    uint32_t i;
>  
>    printf ("- %s - %u bytes\n", str, len);
> diff --git a/test/testdec.c b/test/testdec.c
> index a4a2496..c3bb150 100644
> --- a/test/testdec.c
> +++ b/test/testdec.c
> @@ -107,7 +107,7 @@ hexdump		(const char	*str,
>  		 const void	*data,
>  		 unsigned int	len)
>  {
> -  const uint8_t	*p = data;
> +  const uint8_t	*p = (const uint8_t *)data;
>    unsigned int	i;
>  
>    printf("- %s -\n", str);
> diff --git a/test/testenc.c b/test/testenc.c
> index 634cdfb..c7441dd 100644
> --- a/test/testenc.c
> +++ b/test/testenc.c
> @@ -107,7 +107,7 @@ hexdump		(const char	*str,
>  		 const void	*data,
>  		 unsigned int	len)
>  {
> -  const uint8_t	*p = data;
> +  const uint8_t	*p = (const uint8_t *)data;
>    unsigned int	i;
>  
>    printf("- %s -\n", str);
> -- 
> 1.9.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-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 vlc-devel mailing list