[FFmpeg-devel] [PATCH] Remove two warnings during libavformat build

Måns Rullgård mans
Fri May 2 19:43:21 CEST 2008


flameeyes at gmail.com (Diego 'Flameeyes' Petten?) writes:

> Trivial patch, on 64-bit architectures, int and long int have different
> sizes, and the difference between pointer (ptrdiff_t) is usually mapped
> on long int. At any rate, %ld should cover all architectures whatever
> their pointer size, afaict.
>
>
> Kill warnings:
>
> From: Diego 'Flameeyes' Petten?? <flameeyes at gmail.com>
>
> ffmpeg/libavformat/sdp.c:126: warning: format ???%d??? expects type ???int???, but argument 4 has type ???long int???
> ffmpeg/libavformat/sdp.c:126: warning: format ???%d??? expects type ???int???, but argument 5 has type ???long int???

Something funny is going on with your character encoding.

> ---
>
>  libavformat/sdp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> diff --git a/libavformat/sdp.c b/libavformat/sdp.c
> index bddfcd6..04c4b83 100644
> --- a/libavformat/sdp.c
> +++ b/libavformat/sdp.c
> @@ -123,7 +123,7 @@ static char *extradata2psets(AVCodecContext *c)
>              p++;
>          }
>          if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) {
> -            av_log(c, AV_LOG_ERROR, "Cannot BASE64 encode %d %d!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
> +            av_log(c, AV_LOG_ERROR, "Cannot BASE64 encode %ld %ld!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
>              av_free(psets);

%td is the correct format for ptrdiff_t.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list