diff mbox series

[FFmpeg-devel,2/3] lavu/fifo: uninline deprecated av_fifo_peek2()

Message ID 20230129101735.14173-2-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/3] lavu/fifo: remove FF_API_FIFO_PEEK2 | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Jan. 29, 2023, 10:17 a.m. UTC
Will allow to mark AVFifoBuffer fields as deprecated without triggering
spurious warnings.
---
 libavutil/fifo.c | 10 ++++++++++
 libavutil/fifo.h | 10 +---------
 2 files changed, 11 insertions(+), 9 deletions(-)

Comments

Andreas Rheinhardt Jan. 29, 2023, 4:11 p.m. UTC | #1
Anton Khirnov:
> Will allow to mark AVFifoBuffer fields as deprecated without triggering
> spurious warnings.
> ---
>  libavutil/fifo.c | 10 ++++++++++
>  libavutil/fifo.h | 10 +---------
>  2 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/libavutil/fifo.c b/libavutil/fifo.c
> index 51a5af6f39..5b114fc808 100644
> --- a/libavutil/fifo.c
> +++ b/libavutil/fifo.c
> @@ -506,5 +506,15 @@ void av_fifo_drain(AVFifoBuffer *f, int size)
>          f->rptr -= f->end - f->buffer;
>      f->rndx += size;
>  }
> +
> +uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
> +{
> +    uint8_t *ptr = f->rptr + offs;
> +    if (ptr >= f->end)
> +        ptr = f->buffer + (ptr - f->end);
> +    else if (ptr < f->buffer)
> +        ptr = f->end - (f->buffer - ptr);
> +    return ptr;
> +}
>  FF_ENABLE_DEPRECATION_WARNINGS
>  #endif
> diff --git a/libavutil/fifo.h b/libavutil/fifo.h
> index 0a1ea70a60..ed86800da4 100644
> --- a/libavutil/fifo.h
> +++ b/libavutil/fifo.h
> @@ -428,15 +428,7 @@ void av_fifo_drain(AVFifoBuffer *f, int size);
>   * @deprecated use the new AVFifo-API with av_fifo_peek() or av_fifo_peek_to_cb()
>   */
>  attribute_deprecated
> -static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
> -{
> -    uint8_t *ptr = f->rptr + offs;
> -    if (ptr >= f->end)
> -        ptr = f->buffer + (ptr - f->end);
> -    else if (ptr < f->buffer)
> -        ptr = f->end - (f->buffer - ptr);
> -    return ptr;
> -}
> +uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs);
>  #endif
>  
>  /**

Why is this part of the major bump patchset? Can't it be applied at any
time? (As long as we don't change the implementation of the old FIFO
API, of course.)

- Andreas
diff mbox series

Patch

diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 51a5af6f39..5b114fc808 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -506,5 +506,15 @@  void av_fifo_drain(AVFifoBuffer *f, int size)
         f->rptr -= f->end - f->buffer;
     f->rndx += size;
 }
+
+uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
+{
+    uint8_t *ptr = f->rptr + offs;
+    if (ptr >= f->end)
+        ptr = f->buffer + (ptr - f->end);
+    else if (ptr < f->buffer)
+        ptr = f->end - (f->buffer - ptr);
+    return ptr;
+}
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 0a1ea70a60..ed86800da4 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -428,15 +428,7 @@  void av_fifo_drain(AVFifoBuffer *f, int size);
  * @deprecated use the new AVFifo-API with av_fifo_peek() or av_fifo_peek_to_cb()
  */
 attribute_deprecated
-static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
-{
-    uint8_t *ptr = f->rptr + offs;
-    if (ptr >= f->end)
-        ptr = f->buffer + (ptr - f->end);
-    else if (ptr < f->buffer)
-        ptr = f->end - (f->buffer - ptr);
-    return ptr;
-}
+uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs);
 #endif
 
 /**