[13/15] hq_hqa: Change type of array stride parameters to ptrdiff_t

Message ID 1473178294-16959-13-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/hq_hqadsp.c | 3 ++-
 libavcodec/hq_hqadsp.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Vittorio Giovara Oct. 2, 2016, 8:38 p.m. | #1
On Tue, Sep 6, 2016 at 12:11 PM, Diego Biurrun <diego@biurrun.de> wrote:
> ptrdiff_t is the correct type for array strides and similar.
> ---
>  libavcodec/hq_hqadsp.c | 3 ++-
>  libavcodec/hq_hqadsp.h | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/hq_hqadsp.c b/libavcodec/hq_hqadsp.c
> index 93fc067..3fb2a76 100644
> --- a/libavcodec/hq_hqadsp.c
> +++ b/libavcodec/hq_hqadsp.c
> @@ -18,6 +18,7 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>
> +#include <stddef.h>
>  #include <stdint.h>
>
>  #include "libavutil/attributes.h"
> @@ -108,7 +109,7 @@ static inline void idct_col(int16_t *blk)
>      blk[7 * 8] = (tmp14 - tmp8) >> 6;
>  }
>
> -static void hq_idct_put(uint8_t *dst, int stride, int16_t *block)
> +static void hq_idct_put(uint8_t *dst, ptrdiff_t stride, int16_t *block)
>  {
>      int i, j;
>
> diff --git a/libavcodec/hq_hqadsp.h b/libavcodec/hq_hqadsp.h
> index 22b1e61..2003ca9 100644
> --- a/libavcodec/hq_hqadsp.h
> +++ b/libavcodec/hq_hqadsp.h
> @@ -27,10 +27,11 @@
>  #ifndef AVCODEC_HQ_HQADSP_H
>  #define AVCODEC_HQ_HQADSP_H
>
> +#include <stddef.h>
>  #include <stdint.h>
>
>  typedef struct HQDSPContext {
> -    void (*idct_put)(uint8_t *dst, int stride, int16_t *block);
> +    void (*idct_put)(uint8_t *dst, ptrdiff_t stride, int16_t *block);
>  } HQDSPContext;
>
>  void ff_hqdsp_init(HQDSPContext *c);
> --

Looks ok

Patch

diff --git a/libavcodec/hq_hqadsp.c b/libavcodec/hq_hqadsp.c
index 93fc067..3fb2a76 100644
--- a/libavcodec/hq_hqadsp.c
+++ b/libavcodec/hq_hqadsp.c
@@ -18,6 +18,7 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <stddef.h>
 #include <stdint.h>
 
 #include "libavutil/attributes.h"
@@ -108,7 +109,7 @@  static inline void idct_col(int16_t *blk)
     blk[7 * 8] = (tmp14 - tmp8) >> 6;
 }
 
-static void hq_idct_put(uint8_t *dst, int stride, int16_t *block)
+static void hq_idct_put(uint8_t *dst, ptrdiff_t stride, int16_t *block)
 {
     int i, j;
 
diff --git a/libavcodec/hq_hqadsp.h b/libavcodec/hq_hqadsp.h
index 22b1e61..2003ca9 100644
--- a/libavcodec/hq_hqadsp.h
+++ b/libavcodec/hq_hqadsp.h
@@ -27,10 +27,11 @@ 
 #ifndef AVCODEC_HQ_HQADSP_H
 #define AVCODEC_HQ_HQADSP_H
 
+#include <stddef.h>
 #include <stdint.h>
 
 typedef struct HQDSPContext {
-    void (*idct_put)(uint8_t *dst, int stride, int16_t *block);
+    void (*idct_put)(uint8_t *dst, ptrdiff_t stride, int16_t *block);
 } HQDSPContext;
 
 void ff_hqdsp_init(HQDSPContext *c);