[FFmpeg-devel] lavf/protocols: Add a cast to silence a warning

Submitted by Carl Eugen Hoyos on Oct. 2, 2017, 12:38 p.m.

Details

Message ID CAB0OVGpqXmqXud2R4SeMPKHYbTMLfWdVsMbTa-g86E-VepTDpw@mail.gmail.com
State New
Headers show

Commit Message

Carl Eugen Hoyos Oct. 2, 2017, 12:38 p.m.
Hi!

Attached patch fixes the following warning:
libavformat/protocols.c:100:7: warning: assignment discards ‘const’
qualifier from pointer target type

Please comment, Carl Eugen

Comments

Carl Eugen Hoyos Oct. 7, 2017, 7:08 p.m.
2017-10-02 14:38 GMT+02:00 Carl Eugen Hoyos <ceffmpeg@gmail.com>:
> Hi!
>
> Attached patch fixes the following warning:
> libavformat/protocols.c:100:7: warning: assignment discards ‘const’
> qualifier from pointer target type

Ping, better suggestions very welcome.

Carl Eugen

Patch hide | download patch | download mbox

From 445245a4eb07b615511b2355b8e9f7baf9b665fe Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Mon, 2 Oct 2017 14:35:57 +0200
Subject: [PATCH] lavf/protocols: Add a cast to silence a warning.

Fixes the following warning, regression since 318778de:
libavformat/protocols.c:100:7: warning: assignment discards 'const' qualifier from pointer target type
---
 libavformat/protocols.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 8d3555e..a686d93 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -97,7 +97,7 @@  const char *avio_enum_protocols(void **opaque, int output)
 {
     const URLProtocol **p = *opaque;
 
-    p = p ? p + 1 : url_protocols;
+    p = p ? p + 1 : (const URLProtocol **)url_protocols;
     *opaque = p;
     if (!*p) {
         *opaque = NULL;
-- 
1.7.10.4