[FFmpeg-devel] [PATCHv2] avdevice/libdc1394: silence -Wdiscarded-qualifiers

Ganesh Ajjanagadde gajjanagadde at gmail.com
Sun Sep 20 15:11:57 CEST 2015


fmt, fps are non-const as they are needed to loop over a static const array.
Thus the patch explicitly casts them to be non-const. This suppresses
-Wdiscarded-qualifiers seen in e.g
http://fate.ffmpeg.org/log.cgi?time=20150919100330&log=compile&slot=x86_64-archlinux-gcc-enableshared.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavdevice/libdc1394.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index 6868e9c..b926f58 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -148,11 +148,11 @@ static inline int dc1394_read_common(AVFormatContext *c,
     }
     dc1394->frame_rate = av_rescale(1000, framerate.num, framerate.den);
 
-    for (fmt = dc1394_frame_formats; fmt->width; fmt++)
+    for (fmt = (struct dc1394_frame_format *)dc1394_frame_formats; fmt->width; fmt++)
          if (fmt->pix_fmt == pix_fmt && fmt->width == width && fmt->height == height)
              break;
 
-    for (fps = dc1394_frame_rates; fps->frame_rate; fps++)
+    for (fps = (struct dc1394_frame_rate *)dc1394_frame_rates; fps->frame_rate; fps++)
          if (fps->frame_rate == dc1394->frame_rate)
              break;
 
-- 
2.5.2



More information about the ffmpeg-devel mailing list