Skip to content

Commit ec51162

Browse files
committed
checkasm/swscale: fix function prototypes
This aligns declared function types in checkasm with real definition. Fixes FATE: checkasm-{sw_rgb,sw_scale,sw_yuv2rgb,sw_yuv2yuv} Fixes: runtime error: call to function <func> through pointer to incorrect function type Fixes: c1a0e65 Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
1 parent 9015d59 commit ec51162

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

tests/checkasm/sw_rgb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static void check_rgb24toyv12(SwsContext *sws)
142142

143143
declare_func(void, const uint8_t *src, uint8_t *ydst, uint8_t *udst,
144144
uint8_t *vdst, int width, int height, int lumStride,
145-
int chromStride, int srcStride, int32_t *rgb2yuv);
145+
int chromStride, int srcStride, const int32_t *rgb2yuv);
146146

147147
randomize_buffers(src, BUFSIZE * 3);
148148

tests/checkasm/sw_scale.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static void check_hscale(void)
362362

363363
// The dst parameter here is either int16_t or int32_t but we use void* to
364364
// just cover both cases.
365-
declare_func(void, void *c, void *dst, int dstW,
365+
declare_func(void, SwsInternal *c, int16_t *dst, int dstW,
366366
const uint8_t *src, const int16_t *filter,
367367
const int32_t *filterPos, int filterSize);
368368

@@ -422,11 +422,11 @@ static void check_hscale(void)
422422
memset(dst0, 0, SRC_PIXELS * sizeof(dst0[0]));
423423
memset(dst1, 0, SRC_PIXELS * sizeof(dst1[0]));
424424

425-
call_ref(NULL, dst0, sws->dst_w, src, filter, filterPos, width);
426-
call_new(NULL, dst1, sws->dst_w, src, filterAvx2, filterPosAvx, width);
425+
call_ref(NULL, (int16_t *)dst0, sws->dst_w, src, filter, filterPos, width);
426+
call_new(NULL, (int16_t *)dst1, sws->dst_w, src, filterAvx2, filterPosAvx, width);
427427
if (memcmp(dst0, dst1, sws->dst_w * sizeof(dst0[0])))
428428
fail();
429-
bench_new(NULL, dst0, sws->dst_w, src, filter, filterPosAvx, width);
429+
bench_new(NULL, (int16_t *)dst0, sws->dst_w, src, filter, filterPosAvx, width);
430430
}
431431
}
432432
}

tests/checkasm/sw_yuv2rgb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ static void check_yuv2rgb(int src_pix_fmt)
107107
static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE};
108108

109109
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT,
110-
int, SwsInternal *c, const uint8_t *src[],
111-
int srcStride[], int srcSliceY, int srcSliceH,
112-
uint8_t *dst[], int dstStride[]);
110+
int, SwsInternal *c, const uint8_t *const src[],
111+
const int srcStride[], int srcSliceY, int srcSliceH,
112+
uint8_t *const dst[], const int dstStride[]);
113113

114114
LOCAL_ALIGNED_8(uint8_t, src_y, [MAX_LINE_SIZE * 2]);
115115
LOCAL_ALIGNED_8(uint8_t, src_u, [MAX_LINE_SIZE]);

tests/checkasm/sw_yuv2yuv.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ static void check_semiplanar(int dst_pix_fmt)
4646
static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE};
4747

4848
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT,
49-
int, SwsInternal *c, const uint8_t *src[],
50-
int srcStride[], int srcSliceY, int srcSliceH,
51-
uint8_t *dst[], int dstStride[]);
49+
int, SwsInternal *c, const uint8_t *const src[],
50+
const int srcStride[], int srcSliceY, int srcSliceH,
51+
uint8_t *const dstParam[], const int dstStride[]);
5252

5353
LOCAL_ALIGNED_8(uint8_t, src_y, [MAX_LINE_SIZE * NUM_LINES]);
5454
LOCAL_ALIGNED_8(uint8_t, src_uv, [MAX_LINE_SIZE * NUM_LINES * 2]);

0 commit comments

Comments
 (0)