Re: [FFmpeg-devel] [PATCH] lavfi/buffersink: cast to uint64_t before shifting.

2020-09-09 Thread Nicolas George
James Almer (12020-09-08): > It's a macro designed for this specific purpose. Figured it would be > proper, and we're using them in other parts of the code to shift the > values by more than 32 bits, like you're doing here. But yes, i should > have said could, not should. > > I don't consider it l

Re: [FFmpeg-devel] [PATCH] lavfi/buffersink: cast to uint64_t before shifting.

2020-09-08 Thread James Almer
On 9/8/2020 3:36 PM, Nicolas George wrote: > James Almer (12020-09-08): >> You should use the stdint.h UINT64_C macro then, instead of casting. > > I probably *could*. But I find casting more readable. What benefit do > you see to them compared to casting? It's a macro designed for this specific

Re: [FFmpeg-devel] [PATCH] lavfi/buffersink: cast to uint64_t before shifting.

2020-09-08 Thread Nicolas George
James Almer (12020-09-08): > You should use the stdint.h UINT64_C macro then, instead of casting. I probably *could*. But I find casting more readable. What benefit do you see to them compared to casting? Regards, -- Nicolas George signature.asc Description: PGP signature __

Re: [FFmpeg-devel] [PATCH] lavfi/buffersink: cast to uint64_t before shifting.

2020-09-08 Thread James Almer
On 9/8/2020 3:19 PM, Nicolas George wrote: > Andreas Rheinhardt (12020-09-08): >> Using ULL would be shorter. > > But it would be wrong, it could be more than 64 bits. For modern C, > using longs and shorts directly is a mistake (or the consequence of > dealing with an obsolescent library), these

Re: [FFmpeg-devel] [PATCH] lavfi/buffersink: cast to uint64_t before shifting.

2020-09-08 Thread Nicolas George
Andreas Rheinhardt (12020-09-08): > Using ULL would be shorter. But it would be wrong, it could be more than 64 bits. For modern C, using longs and shorts directly is a mistake (or the consequence of dealing with an obsolescent library), these types are used internally to implement the sane types

Re: [FFmpeg-devel] [PATCH] lavfi/buffersink: cast to uint64_t before shifting.

2020-09-08 Thread Andreas Rheinhardt
Nicolas George: > Fix CID 146. > > Signed-off-by: Nicolas George > --- > libavfilter/buffersink.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c > index 9338969bf1..58848941d4 100644 > --- a/libavfilter/buffer

[FFmpeg-devel] [PATCH] lavfi/buffersink: cast to uint64_t before shifting.

2020-09-08 Thread Nicolas George
Fix CID 146. Signed-off-by: Nicolas George --- libavfilter/buffersink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index 9338969bf1..58848941d4 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.