[FFmpeg-devel] [PATCH] A bunch of trivial warnings removal

Stefano Sabatini stefasab at gmail.com
Sun Sep 25 15:00:00 CEST 2011


On date Sunday 2011-09-25 14:17:21 +0200, Nicolas George encoded:
> Le quartidi 4 vendémiaire, an CCXX, Stefano Sabatini a écrit :
> > > The attached trivial patches fix a few warnings.
> > No ;-).
> 
> Sorry.
> 
> Regards,
> 
> -- 
>   Nicolas George

> From bf94d40ccb67814206c700865ca923d78f1d8de9 Mon Sep 17 00:00:00 2001
> From: Nicolas George <nicolas.george at normalesup.org>
> Date: Sun, 25 Sep 2011 12:34:05 +0200
> Subject: [PATCH 1/6] j2kdec: use correct printf format.
> 
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavcodec/j2kdec.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c
> index 73af6a7..c047ff7 100644
> --- a/libavcodec/j2kdec.c
> +++ b/libavcodec/j2kdec.c
> @@ -948,7 +948,7 @@ static int decode_codestream(J2kDecoderContext *s)
>                  // the comment is ignored
>                  s->buf += len - 2; break;
>              default:
> -                av_log(s->avctx, AV_LOG_ERROR, "unsupported marker 0x%.4X at pos 0x%x\n", marker, s->buf - s->buf_start - 4);
> +                av_log(s->avctx, AV_LOG_ERROR, "unsupported marker 0x%.4X at pos 0x%tx\n", marker, s->buf - s->buf_start - 4);
>                  s->buf += len - 2; break;
>          }
>          if (s->buf - oldbuf != len || ret){

Seems correct ("%tx" -> ptrdiff_t)-

> -- 
> 1.7.5.4
> 

> From 13a19ada8f12d173a22996aa5e1403de083871ee Mon Sep 17 00:00:00 2001
> From: Nicolas George <nicolas.george at normalesup.org>
> Date: Sun, 25 Sep 2011 13:10:15 +0200
> Subject: [PATCH 2/6] vf_boxblur: remove useless code.
> 
> This block was probably leftovers from code refactoring.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/vf_boxblur.c |    7 -------
>  1 files changed, 0 insertions(+), 7 deletions(-)
> 
> diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c
> index a10b630..ef5da06 100644
> --- a/libavfilter/vf_boxblur.c
> +++ b/libavfilter/vf_boxblur.c
> @@ -309,13 +309,6 @@ static void draw_slice(AVFilterLink *inlink, int y0, int h0, int slice_dir)
>      int cw = inlink->w >> boxblur->hsub, ch = h0 >> boxblur->vsub;
>      int w[4] = { inlink->w, cw, cw, inlink->w };
>      int h[4] = { h0, ch, ch, h0 };
> -    uint8_t *dst[4], *src[4];
> -
> -    for (plane = 0; inpicref->data[plane] && plane < 4; plane++) {
> -        int y = plane == 1 || plane == 2 ? y0 >> boxblur->vsub : y0;
> -        src[plane] = inpicref ->data[plane] + inpicref ->linesize[plane] * y;
> -        dst[plane] = outpicref->data[plane] + outpicref->linesize[plane] * y;
> -    }
>  
>      for (plane = 0; inpicref->data[plane] && plane < 4; plane++)
>          hblur(outpicref->data[plane], outpicref->linesize[plane],
> -- 
> 1.7.5.4

Looks correct, assuming you checked that src/dst are never used.

> From ac7833d2b0c122d0e09678d64e4cd9974026d1a6 Mon Sep 17 00:00:00 2001
> From: Nicolas George <nicolas.george at normalesup.org>
> Date: Sun, 25 Sep 2011 13:12:05 +0200
> Subject: [PATCH 3/6] bintext: remove unused variable.
> 
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavformat/bintext.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/bintext.c b/libavformat/bintext.c
> index 904fd1f..62a916e 100644
> --- a/libavformat/bintext.c
> +++ b/libavformat/bintext.c
> @@ -173,7 +173,6 @@ static int xbin_read_header(AVFormatContext *s,
>      BinDemuxContext *bin = s->priv_data;
>      ByteIOContext *pb = s->pb;
>      char fontheight, flags;
> -    uint8_t *h;
>  
>      AVStream *st = init_stream(s, ap);
>      if (!st)
> @@ -193,7 +192,7 @@ static int xbin_read_header(AVFormatContext *s,
>          st->codec->extradata_size += fontheight * (flags & 0x10 ? 512 : 256);
>      st->codec->codec_id    = flags & 4 ? CODEC_ID_XBIN : CODEC_ID_BINTEXT;
>  
> -    h = st->codec->extradata = av_malloc(st->codec->extradata_size);
> +    st->codec->extradata = av_malloc(st->codec->extradata_size);
>      if (!st->codec->extradata)
>          return AVERROR(ENOMEM);
>      st->codec->extradata[0] = fontheight;
> -- 
> 1.7.5.4

Seems trivial.

> From e7a53c783618ced9a195d916878cf4a5b2f20bda Mon Sep 17 00:00:00 2001
> From: Nicolas George <nicolas.george at normalesup.org>
> Date: Sun, 25 Sep 2011 13:24:40 +0200
> Subject: [PATCH 4/6] libswr/rematrix: add braces to silence a warning.
> 
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libswresample/rematrix.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
> index f8ba737..eaf7653 100644
> --- a/libswresample/rematrix.c
> +++ b/libswresample/rematrix.c
> @@ -83,7 +83,7 @@ static int sane_layout(int64_t layout){
>  
>  int swr_rematrix_init(SwrContext *s){
>      int i, j, in_i, out_i;
> -    double matrix[64][64]={0};
> +    double matrix[64][64]={{0}};
>      int64_t unaccounted= s->in_ch_layout & ~s->out_ch_layout;
>      double maxcoef=0;
>  
> -- 
> 1.7.5.4

Should be OK.

> From 25f77d97f18ac237e2ffb830c1db5bd344eea75c Mon Sep 17 00:00:00 2001
> From: Nicolas George <nicolas.george at normalesup.org>
> Date: Sun, 25 Sep 2011 13:35:03 +0200
> Subject: [PATCH 5/6] libswr/rematrix: remove unused variable.
> 
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---

>  libavcodec/g729postfilter.c |    2 +-

spurious?

>  libswresample/rematrix.c    |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/g729postfilter.c b/libavcodec/g729postfilter.c
> index 971c3d2..679388a 100644
> --- a/libavcodec/g729postfilter.c
> +++ b/libavcodec/g729postfilter.c
> @@ -111,7 +111,7 @@ static int16_t long_term_filter(DSPContext *dsp, int pitch_delay_int,
>                                  const int16_t* residual, int16_t *residual_filt,
>                                  int subframe_size)
>  {
> -    int i, k, n, tmp, tmp2;
> +    int i, k, tmp, tmp2;
>      int sum;
>      int L_temp0;
>      int L_temp1;
> diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
> index eaf7653..87fd35a 100644
> --- a/libswresample/rematrix.c
> +++ b/libswresample/rematrix.c
> @@ -82,7 +82,7 @@ static int sane_layout(int64_t layout){
>  }
>  
>  int swr_rematrix_init(SwrContext *s){
> -    int i, j, in_i, out_i;
> +    int i, j, out_i;
>      double matrix[64][64]={{0}};
>      int64_t unaccounted= s->in_ch_layout & ~s->out_ch_layout;
>      double maxcoef=0;
> -- 
> 1.7.5.4
> 

> From 48b1749bcbabbecd6b2846b4acc5a65a3d70259e Mon Sep 17 00:00:00 2001
> From: Nicolas George <nicolas.george at normalesup.org>
> Date: Sun, 25 Sep 2011 13:36:03 +0200
> Subject: [PATCH 6/6] swresample: remove unused variable.
> 
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libswresample/swresample.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/libswresample/swresample.c b/libswresample/swresample.c
> index db2d1df..20a1e64 100644
> --- a/libswresample/swresample.c
> +++ b/libswresample/swresample.c
> @@ -361,7 +361,6 @@ static int resample(SwrContext *s, AudioData *out_param, int out_count,
>      AudioData in, out, tmp;
>      int ret_sum=0;
>      int border=0;
> -    int ch_count= s->resample_first ? s->in.ch_count : s->out.ch_count;
>  
>      tmp=out=*out_param;
>      in =  *in_param;
> -- 
> 1.7.5.4

Should be fine otherwise (of course you could wait explicit approval
from the respective maintainers, but with small patches usually no
much harm is done even if they may conflict with local changes, so
IMO direct commit with no patch is acceptable).
-- 
FFmpeg = Fancy Fast Mythic Philosophical ExchanGer


More information about the ffmpeg-devel mailing list