[FFmpeg-devel] [PATCHv2] avfilter/buffersrc: add av_warn_unused_result attributes

Clément Bœsch u at pkh.me
Wed Oct 7 14:59:09 CEST 2015


On Tue, Oct 06, 2015 at 06:53:47PM -0400, Ganesh Ajjanagadde wrote:
> This adds av_warn_unused_result whenever it is relevant.
> 
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavfilter/buffersrc.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h
> index cd3d95f..847c093 100644
> --- a/libavfilter/buffersrc.h
> +++ b/libavfilter/buffersrc.h
> @@ -78,6 +78,7 @@ unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
>   * This function is equivalent to av_buffersrc_add_frame_flags() with the
>   * AV_BUFFERSRC_FLAG_KEEP_REF flag.
>   */
> +av_warn_unused_result
>  int av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame);
>  
>  /**
> @@ -98,6 +99,7 @@ int av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame);
>   * This function is equivalent to av_buffersrc_add_frame_flags() without the
>   * AV_BUFFERSRC_FLAG_KEEP_REF flag.
>   */
> +av_warn_unused_result
>  int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame);
>  
>  /**
> @@ -115,6 +117,7 @@ int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame);
>   * @return            >= 0 in case of success, a negative AVERROR code
>   *                    in case of failure
>   */
> +av_warn_unused_result
>  int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src,
>                                   AVFrame *frame, int flags);
>  

Aren't you just supposed to (void)-prefix the call in the caller when you
explicitly don't care about the result?

These functions certainly looks like you actually want to check for the
result most of the time.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151007/2b5501bd/attachment.sig>


More information about the ffmpeg-devel mailing list