Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Kacper Michajłow" <kasper93-at-gmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: "Kacper Michajłow" <kasper93@gmail.com>
Subject: [FFmpeg-devel] [PATCH] checkasm/swscale: fix function prototypes
Date: Thu,  3 Jul 2025 23:08:24 +0200
Message-ID: <20250703210824.143-2-kasper93@gmail.com> (raw)
In-Reply-To: <20250703210824.143-1-kasper93@gmail.com>

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: c1a0e657638f7007dcc807a2d985c22631fcd6d3

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
 tests/checkasm/sw_rgb.c     | 2 +-
 tests/checkasm/sw_scale.c   | 8 ++++----
 tests/checkasm/sw_yuv2rgb.c | 6 +++---
 tests/checkasm/sw_yuv2yuv.c | 6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c
index b98c7c6b47..6edfc93b0b 100644
--- a/tests/checkasm/sw_rgb.c
+++ b/tests/checkasm/sw_rgb.c
@@ -142,7 +142,7 @@ static void check_rgb24toyv12(SwsContext *sws)
 
     declare_func(void, const uint8_t *src, uint8_t *ydst, uint8_t *udst,
                        uint8_t *vdst, int width, int height, int lumStride,
-                       int chromStride, int srcStride, int32_t *rgb2yuv);
+                       int chromStride, int srcStride, const int32_t *rgb2yuv);
 
     randomize_buffers(src, BUFSIZE * 3);
 
diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c
index 11c9174a6b..b91e0b64ed 100644
--- a/tests/checkasm/sw_scale.c
+++ b/tests/checkasm/sw_scale.c
@@ -362,7 +362,7 @@ static void check_hscale(void)
 
     // The dst parameter here is either int16_t or int32_t but we use void* to
     // just cover both cases.
-    declare_func(void, void *c, void *dst, int dstW,
+    declare_func(void, SwsInternal *c, int16_t *dst, int dstW,
                  const uint8_t *src, const int16_t *filter,
                  const int32_t *filterPos, int filterSize);
 
@@ -422,11 +422,11 @@ static void check_hscale(void)
                     memset(dst0, 0, SRC_PIXELS * sizeof(dst0[0]));
                     memset(dst1, 0, SRC_PIXELS * sizeof(dst1[0]));
 
-                    call_ref(NULL, dst0, sws->dst_w, src, filter, filterPos, width);
-                    call_new(NULL, dst1, sws->dst_w, src, filterAvx2, filterPosAvx, width);
+                    call_ref(NULL, (int16_t *)dst0, sws->dst_w, src, filter, filterPos, width);
+                    call_new(NULL, (int16_t *)dst1, sws->dst_w, src, filterAvx2, filterPosAvx, width);
                     if (memcmp(dst0, dst1, sws->dst_w * sizeof(dst0[0])))
                         fail();
-                    bench_new(NULL, dst0, sws->dst_w, src, filter, filterPosAvx, width);
+                    bench_new(NULL, (int16_t *)dst0, sws->dst_w, src, filter, filterPosAvx, width);
                 }
             }
         }
diff --git a/tests/checkasm/sw_yuv2rgb.c b/tests/checkasm/sw_yuv2rgb.c
index c25fb99ca2..c6c1ad934b 100644
--- a/tests/checkasm/sw_yuv2rgb.c
+++ b/tests/checkasm/sw_yuv2rgb.c
@@ -107,9 +107,9 @@ static void check_yuv2rgb(int src_pix_fmt)
     static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE};
 
     declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT,
-                      int, SwsInternal *c, const uint8_t *src[],
-                           int srcStride[], int srcSliceY, int srcSliceH,
-                           uint8_t *dst[], int dstStride[]);
+                      int, SwsInternal *c, const uint8_t *const src[],
+                           const int srcStride[], int srcSliceY, int srcSliceH,
+                           uint8_t *const dst[], const int dstStride[]);
 
     LOCAL_ALIGNED_8(uint8_t, src_y, [MAX_LINE_SIZE * 2]);
     LOCAL_ALIGNED_8(uint8_t, src_u, [MAX_LINE_SIZE]);
diff --git a/tests/checkasm/sw_yuv2yuv.c b/tests/checkasm/sw_yuv2yuv.c
index 6fe8e47d19..6a7a7a8b9a 100644
--- a/tests/checkasm/sw_yuv2yuv.c
+++ b/tests/checkasm/sw_yuv2yuv.c
@@ -46,9 +46,9 @@ static void check_semiplanar(int dst_pix_fmt)
     static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE};
 
     declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT,
-                      int, SwsInternal *c, const uint8_t *src[],
-                           int srcStride[], int srcSliceY, int srcSliceH,
-                           uint8_t *dst[], int dstStride[]);
+                      int, SwsInternal *c, const uint8_t *const src[],
+                           const int srcStride[], int srcSliceY, int srcSliceH,
+                           uint8_t *const dstParam[], const int dstStride[]);
 
     LOCAL_ALIGNED_8(uint8_t, src_y,  [MAX_LINE_SIZE * NUM_LINES]);
     LOCAL_ALIGNED_8(uint8_t, src_uv, [MAX_LINE_SIZE * NUM_LINES * 2]);
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      reply	other threads:[~2025-07-03 21:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 21:08 [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null Kacper Michajłow
2025-07-03 21:08 ` Kacper Michajłow [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250703210824.143-2-kasper93@gmail.com \
    --to=kasper93-at-gmail.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=kasper93@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git