On Fri, Jul 19, 2019 at 11:49:04PM +0200, Nicolas George wrote:
> Michael Niedermayer (12019-07-19):
> > > +if ((whence & AVSEEK_SIZE))
> > redundant ()
>
> I use it as a marker that it is not a mistake for &&. IIRC, gcc (with
> some options) warns about "if (a & b)" but accepts "if ((a & b))"
Hendrik Leppkes (12019-07-20):
> That seems like a particularly dumb compiler "feature". Checking
> bitmasks for a set bit seems like a rather standard if condition.
Maybe, to each their own, but it saved me a few times, so personally I
like it, especially since the double-parentheses is an
obviou
On Fri, Jul 19, 2019 at 11:49 PM Nicolas George wrote:
>
> Michael Niedermayer (12019-07-19):
> > > +if ((whence & AVSEEK_SIZE))
> > redundant ()
>
> I use it as a marker that it is not a mistake for &&. IIRC, gcc (with
> some options) warns about "if (a & b)" but accepts "if ((a & b))", and
>
Michael Niedermayer (12019-07-19):
> > +if ((whence & AVSEEK_SIZE))
> redundant ()
I use it as a marker that it is not a mistake for &&. IIRC, gcc (with
some options) warns about "if (a & b)" but accepts "if ((a & b))", and
that is the preferred way. We already have a few instances in the code
On Fri, Jul 19, 2019 at 02:23:53PM +0200, Nicolas George wrote:
> Signed-off-by: Nicolas George
> ---
> libavformat/aviobuf.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> index 6a5cd97b0a..750326f62d 100644
> --- a/libavformat/aviobu
Signed-off-by: Nicolas George
---
libavformat/aviobuf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 6a5cd97b0a..750326f62d 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -255,6 +255,9 @@ int64_t avio_seek(AVIOContex