[09/15] hapenc: Change type of array stride parameters to ptrdiff_t

Message ID 1473178294-16959-9-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/hapenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato Sept. 7, 2016, 10:26 a.m. | #1
On 06/09/16 18:11, Diego Biurrun wrote:
> ptrdiff_t is the correct type for array strides and similar.
> ---
>  libavcodec/hapenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c
> index 9ebad4a..c05e1c8 100644
> --- a/libavcodec/hapenc.c
> +++ b/libavcodec/hapenc.c
> @@ -61,7 +61,7 @@ static void compress_texture(AVCodecContext *avctx, const AVFrame *f)
>      for (j = 0; j < avctx->height; j += 4) {
>          for (i = 0; i < avctx->width; i += 4) {
>              uint8_t *p = f->data[0] + i * 4 + j * f->linesize[0];
> -            const int step = ctx->tex_fun(out, f->linesize[0], p);
> +            const ptrdiff_t step = ctx->tex_fun(out, f->linesize[0], p);
>              out += step;
>          }
>      }
> 

Ok.

Patch

diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c
index 9ebad4a..c05e1c8 100644
--- a/libavcodec/hapenc.c
+++ b/libavcodec/hapenc.c
@@ -61,7 +61,7 @@  static void compress_texture(AVCodecContext *avctx, const AVFrame *f)
     for (j = 0; j < avctx->height; j += 4) {
         for (i = 0; i < avctx->width; i += 4) {
             uint8_t *p = f->data[0] + i * 4 + j * f->linesize[0];
-            const int step = ctx->tex_fun(out, f->linesize[0], p);
+            const ptrdiff_t step = ctx->tex_fun(out, f->linesize[0], p);
             out += step;
         }
     }