]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/dvdsub: Fix warning about incompatible pointer type
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 14 Feb 2020 11:24:03 +0000 (12:24 +0100)
committerJames Almer <jamrial@gmail.com>
Fri, 14 Feb 2020 13:20:36 +0000 (10:20 -0300)
Fixes "passing argument 2 of ‘strtoul’ from incompatible pointer
type [-Wincompatible-pointer-types]" ("expected ‘char ** restrict’ but
argument is of type ‘const char **’") for GCC and "passing 'const char
**' to parameter of type 'char **' discards qualifiers in nested pointer
types [-Wincompatible-pointer-types-discards-qualifiers]" for Clang.

The cast itself is safe; it is only needed because strtoul itself is not
const-correct.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/dvdsub.c

index a03ff27754af089a0000fa3d955c0827d8293317..87215d2bd12504e1ca57673502f73798e7bdcb6e 100644 (file)
@@ -26,7 +26,7 @@
 void ff_dvdsub_parse_palette(uint32_t *palette, const char *p)
 {
     for (int i = 0; i < 16; i++) {
-        palette[i] = strtoul(p, &p, 16);
+        palette[i] = strtoul(p, (char **)&p, 16);
         while (*p == ',' || av_isspace(*p))
             p++;
     }