[FFmpeg-devel] [PATCH 1/2] avutil/common: Add FFINCREASE_PTR()

Michael Niedermayer michael at niedermayer.cc
Sat Mar 13 17:18:02 EET 2021


On Fri, Feb 19, 2021 at 10:00:39PM +0100, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > Suggested-by: Andreas Rheinhardt
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  doc/APIchanges     | 3 +++
> >  libavutil/common.h | 2 ++
> >  2 files changed, 5 insertions(+)
> > 
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index c353d2d281..e38a5cb91c 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -15,6 +15,9 @@ libavutil:     2017-10-21
> >  
> >  API changes, most recent first:
> >  
> > +2021-02-xx - xxxxxxxxxx - lavu 57.xx.100 - common.h
> > +  Add FFINCREASE_PTR()
> > +
> >  2021-02-14 - xxxxxxxxxx - lavd 58.12.100 - avdevice.h
> >    Deprecated avdevice_capabilities_create() and
> >    avdevice_capabilities_free().
> > diff --git a/libavutil/common.h b/libavutil/common.h
> > index aee353d399..bf35bc8507 100644
> > --- a/libavutil/common.h
> > +++ b/libavutil/common.h
> > @@ -108,6 +108,8 @@
> >  #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
> >  #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
> >  
> > +#define FFINCREASE_PTR(ptr, off) ((off) ? (ptr) + (off) : (ptr))
> > +
> >  /* misc math functions */
> >  
> >  #ifdef HAVE_AV_CONFIG_H
> > 
> If this is intended to be a public macro, it should have a proper AV prefix.

will apply with AV prefix

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210313/86eb1fdd/attachment.sig>


More information about the ffmpeg-devel mailing list