[10/15] loco: Change type of array stride parameters to ptrdiff_t

Message ID 1473178294-16959-10-git-send-email-diego@biurrun.de
State New
Headers show

Commit Message

Diego Biurrun Sept. 6, 2016, 4:11 p.m.
ptrdiff_t is the correct type for array strides and similar.
---
 libavcodec/loco.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Luca Barbato Sept. 7, 2016, 11:37 a.m. | #1
On 06/09/16 18:11, Diego Biurrun wrote:
> ptrdiff_t is the correct type for array strides and similar.
> ---
>  libavcodec/loco.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/loco.c b/libavcodec/loco.c
> index f25ef61..c031ac6 100644
> --- a/libavcodec/loco.c
> +++ b/libavcodec/loco.c
> @@ -114,7 +114,7 @@ static inline int loco_get_rice(RICEContext *r)
>  }
>  
>  /* LOCO main predictor - LOCO-I/JPEG-LS predictor */
> -static inline int loco_predict(uint8_t* data, int stride, int step)
> +static inline int loco_predict(uint8_t* data, ptrdiff_t stride, ptrdiff_t step)
>  {
>      int a, b, c;
>  
> @@ -126,7 +126,8 @@ static inline int loco_predict(uint8_t* data, int stride, int step)
>  }
>  
>  static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int height,
> -                             int stride, const uint8_t *buf, int buf_size, int step)
> +                             ptrdiff_t stride, const uint8_t *buf, int buf_size,
> +                             ptrdiff_t step)
>  {
>      RICEContext rc;
>      int val;
> 

Ok.

Patch

diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index f25ef61..c031ac6 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -114,7 +114,7 @@  static inline int loco_get_rice(RICEContext *r)
 }
 
 /* LOCO main predictor - LOCO-I/JPEG-LS predictor */
-static inline int loco_predict(uint8_t* data, int stride, int step)
+static inline int loco_predict(uint8_t* data, ptrdiff_t stride, ptrdiff_t step)
 {
     int a, b, c;
 
@@ -126,7 +126,8 @@  static inline int loco_predict(uint8_t* data, int stride, int step)
 }
 
 static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int height,
-                             int stride, const uint8_t *buf, int buf_size, int step)
+                             ptrdiff_t stride, const uint8_t *buf, int buf_size,
+                             ptrdiff_t step)
 {
     RICEContext rc;
     int val;