[FFmpeg-devel] [PATCH v1] avcodec/tscc: fix the warning: assigning to 'Bytef *' (aka 'unsigned char *') from 'const uint8_t *

Limin Wang lance.lmwang at gmail.com
Thu Sep 5 01:39:45 EEST 2019


On Wed, Sep 04, 2019 at 08:06:39PM +0200, Carl Eugen Hoyos wrote:
> Am Mi., 4. Sept. 2019 um 16:47 Uhr schrieb <lance.lmwang at gmail.com>:
> >
> > From: Limin Wang <lance.lmwang at gmail.com>
> >
> > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > ---
> >  libavcodec/tscc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
> > index 6d03081..f3b959c 100644
> > --- a/libavcodec/tscc.c
> > +++ b/libavcodec/tscc.c
> > @@ -64,7 +64,7 @@ typedef struct TsccContext {
> >  static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
> >                          AVPacket *avpkt)
> >  {
> > -    const uint8_t *buf = avpkt->data;
> > +    uint8_t *buf = avpkt->data;
> 
> How can I reproduce the warning?

 My system info:
 ➜  ~ sw_vers
 ProductName:    Mac OS X
 ProductVersion: 10.11.6
 BuildVersion:   15G22010
 ➜  ~ gcc -v
 Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
 Apple LLVM version 8.0.0 (clang-800.0.42.1)
 Target: x86_64-apple-darwin15.6.0
 Thread model: posix
 InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Maybe the change is misleading as avpkt->data is const, I'll update the patch to more clear.

> 
> Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list