[03/14] blockdsp: Change type of array stride parameters to ptrdiff_t

Message ID 1474396595-14910-3-git-send-email-diego@biurrun.de
State New
Headers show

Commit Message

Diego Biurrun Sept. 20, 2016, 6:36 p.m.
ptrdiff_t is the correct type for array strides and similar.
---
 libavcodec/blockdsp.c | 6 ++++--
 libavcodec/blockdsp.h | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Martin Storsjo Sept. 29, 2016, 10:47 a.m. | #1
On Tue, 20 Sep 2016, Diego Biurrun wrote:

> ptrdiff_t is the correct type for array strides and similar.
> ---
> libavcodec/blockdsp.c | 6 ++++--
> libavcodec/blockdsp.h | 3 ++-
> 2 files changed, 6 insertions(+), 3 deletions(-)

Ok

// Martin

Patch

diff --git a/libavcodec/blockdsp.c b/libavcodec/blockdsp.c
index e3d2ca1..92a1f17 100644
--- a/libavcodec/blockdsp.c
+++ b/libavcodec/blockdsp.c
@@ -35,7 +35,8 @@  static void clear_blocks_8_c(int16_t *blocks)
     memset(blocks, 0, sizeof(int16_t) * 6 * 64);
 }
 
-static void fill_block16_c(uint8_t *block, uint8_t value, int line_size, int h)
+static void fill_block16_c(uint8_t *block, uint8_t value, ptrdiff_t line_size,
+                           int h)
 {
     int i;
 
@@ -45,7 +46,8 @@  static void fill_block16_c(uint8_t *block, uint8_t value, int line_size, int h)
     }
 }
 
-static void fill_block8_c(uint8_t *block, uint8_t value, int line_size, int h)
+static void fill_block8_c(uint8_t *block, uint8_t value, ptrdiff_t line_size,
+                          int h)
 {
     int i;
 
diff --git a/libavcodec/blockdsp.h b/libavcodec/blockdsp.h
index 32c671c..58cffc9 100644
--- a/libavcodec/blockdsp.h
+++ b/libavcodec/blockdsp.h
@@ -19,6 +19,7 @@ 
 #ifndef AVCODEC_BLOCKDSP_H
 #define AVCODEC_BLOCKDSP_H
 
+#include <stddef.h>
 #include <stdint.h>
 
 #include "avcodec.h"
@@ -29,7 +30,7 @@ 
  * h for op_pixels_func is limited to { width / 2, width },
  * but never larger than 16 and never smaller than 4. */
 typedef void (*op_fill_func)(uint8_t *block /* align width (8 or 16) */,
-                             uint8_t value, int line_size, int h);
+                             uint8_t value, ptrdiff_t line_size, int h);
 
 typedef struct BlockDSPContext {
     void (*clear_block)(int16_t *block /* align 16 */);