libavcodec: Mark AVCodec->priv_class const

Message ID 1302721683-88361-1-git-send-email-martin@martin.st
State Committed
Commit 567ad0e31d94512410fd02ead1a1d6f72d369456
Headers show

Commit Message

Martin Storsjö April 13, 2011, 7:08 p.m.
This avoids warnings of this kind, everywhere priv_class
is initialized:

warning: initialization discards qualifiers from pointer target type
---
 libavcodec/avcodec.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Ronald Bultje April 13, 2011, 7:13 p.m. | #1
Hi,

On Wed, Apr 13, 2011 at 3:08 PM, Martin Storsjö <martin@martin.st> wrote:
> This avoids warnings of this kind, everywhere priv_class
> is initialized:
>
> warning: initialization discards qualifiers from pointer target type
> ---
>  libavcodec/avcodec.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 7eb8b52..109d2a4 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2944,7 +2944,7 @@ typedef struct AVCodec {
>     const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
>     const int64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
>     uint8_t max_lowres;                     ///< maximum value for lowres supported by the decoder
> -    AVClass *priv_class;                    ///< AVClass for the private context
> +    const AVClass *priv_class;              ///< AVClass for the private context

OK.

Ronald
Martin Storsjö April 13, 2011, 9:23 p.m. | #2
On Wed, 13 Apr 2011, Ronald S. Bultje wrote:

> On Wed, Apr 13, 2011 at 3:08 PM, Martin Storsjö <martin@martin.st> wrote:
> > This avoids warnings of this kind, everywhere priv_class
> > is initialized:
> >
> > warning: initialization discards qualifiers from pointer target type
> > ---
> >  libavcodec/avcodec.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > index 7eb8b52..109d2a4 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -2944,7 +2944,7 @@ typedef struct AVCodec {
> >     const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
> >     const int64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
> >     uint8_t max_lowres;                     ///< maximum value for lowres supported by the decoder
> > -    AVClass *priv_class;                    ///< AVClass for the private context
> > +    const AVClass *priv_class;              ///< AVClass for the private context
> 
> OK.

Queued

// Martin

Patch

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7eb8b52..109d2a4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2944,7 +2944,7 @@  typedef struct AVCodec {
     const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
     const int64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
     uint8_t max_lowres;                     ///< maximum value for lowres supported by the decoder
-    AVClass *priv_class;                    ///< AVClass for the private context
+    const AVClass *priv_class;              ///< AVClass for the private context
     const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
 
     /**