[FFmpeg-devel] [PATCH] Fix printf format warnings

Michael Niedermayer michaelni
Wed Jun 9 03:42:18 CEST 2010


On Tue, Jun 08, 2010 at 03:34:08PM -0700, Eli Friedman wrote:
> 2010/6/8 M?ns Rullg?rd <mans at mansr.com>:
> > Eli Friedman <eli.friedman at gmail.com> writes:
> >
> >> Attached are fixes for printf format warnings in
> >> libavformat/rtpdec_xiph.c and libavformat/oggdec.c. ?The pointer
> >> differences in libavformat/rtpdec_xiph.c have type ptrdiff_t, and
> >> page_pos in oggdec.c is an int64_t.
> >>
> >> -Eli Friedman
> >>
> >> Index: libavformat/rtpdec_xiph.c
> >> ===================================================================
> >> --- libavformat/rtpdec_xiph.c (revision 23520)
> >> +++ libavformat/rtpdec_xiph.c (working copy)
> >> @@ -237,7 +237,7 @@
> >> ? ? ?if (packed_headers_end - packed_headers < 9) {
> >> ? ? ? ? ?av_log(codec, AV_LOG_ERROR,
> >> ? ? ? ? ? ? ? ? "Invalid %d byte packed header.",
> >> - ? ? ? ? ? ? ? packed_headers_end - packed_headers);
> >> + ? ? ? ? ? ? ? (int)(packed_headers_end - packed_headers));
> >
> > %zd
> >
> >> ? ? ? ? ?return AVERROR_INVALIDDATA;
> >> ? ? ?}
> >>
> >> @@ -259,7 +259,7 @@
> >> ? ? ? ? ?length1 > length || length2 > length - length1) {
> >> ? ? ? ? ?av_log(codec, AV_LOG_ERROR,
> >> ? ? ? ? ? ? ? ? "Bad packed header lengths (%d,%d,%d,%d)\n", length1,
> >> - ? ? ? ? ? ? ? length2, packed_headers_end - packed_headers, length);
> >> + ? ? ? ? ? ? ? length2, (int)(packed_headers_end - packed_headers), length);
> >
> > %zd
> 
> Oh, I wasn't sure if ffmpeg expects a C99-compliant printf.  Changed
> to %td (which is technically more correct here).
> 
> >> ? ? ? ? ?return AVERROR_INVALIDDATA;
> >> ? ? ?}
> >>
> >>
> >> Index: libavformat/oggdec.c
> >> ===================================================================
> >> --- libavformat/oggdec.c ? ? ?(revision 23520)
> >> +++ libavformat/oggdec.c ? ? ?(working copy)
> >> @@ -363,7 +363,8 @@
> >> ?#endif
> >>
> >> ? ? ?if (os->granule == -1)
> >> - ? ? ? ?av_log(s, AV_LOG_WARNING, "Page at %lld is missing granule\n", os->page_pos);
> >> + ? ? ? ?av_log(s, AV_LOG_WARNING, "Page at %lld is missing granule\n",
> >> + ? ? ? ? ? ? ? (long long)os->page_pos);
> >
> > PRId64
> 
> Changed.
> 
> New versions attached.

if someone like mans confirms it standard compliant then ok
also maybe you could look at patcheck, it would be usefull if it did
check such things

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100609/3423bff1/attachment.pgp>



More information about the ffmpeg-devel mailing list