[FFmpeg-devel] [PATCH] avformat: Drop const qualifier to avoid compiler warning

Michael Niedermayer michaelni at gmx.at
Tue Apr 7 15:03:20 CEST 2015


On Tue, Apr 07, 2015 at 03:31:25AM +0530, Himangi Saraogi wrote:
> ---
>  libavformat/format.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/format.c b/libavformat/format.c
> index fa94b7d..0713849 100644
> --- a/libavformat/format.c
> +++ b/libavformat/format.c
> @@ -172,7 +172,8 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened,
>      AVProbeData lpd = *pd;
>      AVInputFormat *fmt1 = NULL, *fmt;
>      int score, nodat = 0, score_max = 0;
> -    const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];
> +    static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];

the buffer should never be changed, so const seems correct
if its not const, a human reader might think
"can this change? its not const"

a cast where the warning ocurs or replacing the const by a comment
seems better

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

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150407/09923ca4/attachment.asc>


More information about the ffmpeg-devel mailing list