[FFmpeg-devel] [PATCH] Cast AV_NOPTS_VALUE to int64_t implicitly
Michael Niedermayer
michaelni at gmx.at
Wed Sep 19 20:11:22 CEST 2012
On Wed, Sep 19, 2012 at 07:44:13PM +0200, Reimar Döffinger wrote:
> On Wed, Sep 19, 2012 at 08:08:00PM +0300, Andrey Utkin wrote:
> > Thus comparsion against int64_t value will not raise warning
> > (from -Wextra set) about comparsion of unsigned and signed integer
> > ---
> > libavutil/avutil.h | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/libavutil/avutil.h b/libavutil/avutil.h
> > index 94f9ee8..ebfb13e 100644
> > --- a/libavutil/avutil.h
> > +++ b/libavutil/avutil.h
> > @@ -223,7 +223,7 @@ const char *av_get_media_type_string(enum AVMediaType media_type);
> > * either pts or dts.
> > */
> >
> > -#define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
> > +#define AV_NOPTS_VALUE (int64_t)INT64_C(0x8000000000000000)
>
> Hm, I kind of wonder if that warning behaviour is actually matching
> the C standard, as hard to believe as that may be.
> Still, I do not like this approach.
> An alternative would be to just do
> #define AV_NOPTS_VALUE INT64_MIN
> As an aside: to avoid this issue, INT64_MIN is defined as
> -INT64_C(0x7fffffffffffffff) - 1
seems ive commited a variant of this patch before reading your comment
feel free to change the code to whatever you like best
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120919/eb0b3c14/attachment.asc>
More information about the ffmpeg-devel
mailing list