[FFmpeg-devel] [PATCH] fftools/objpool: Don't use return with expression when returning void
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Sat Jul 23 19:24:29 EEST 2022
Using tail calls with functions returning void is forbidden
(C99/C11 6.8.6.4: "A return statement with an expression shall not appear
in a function whose return type is void.") GCC emits a warning
because of this when using -pedantic: "ISO C forbids ‘return’ with
expression, in function returning void"
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
fftools/objpool.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fftools/objpool.c b/fftools/objpool.c
index b1561ecd69..06e4f069a5 100644
--- a/fftools/objpool.c
+++ b/fftools/objpool.c
@@ -101,11 +101,13 @@ static void *alloc_frame(void)
static void reset_packet(void *obj)
{
- return av_packet_unref(obj);
+ av_packet_unref(obj);
+ return;
}
static void reset_frame(void *obj)
{
- return av_frame_unref(obj);
+ av_frame_unref(obj);
+ return;
}
static void free_packet(void **obj)
--
2.34.1
More information about the ffmpeg-devel
mailing list