[PATCH 10/12] dmx: Mark glxIsExtensionSupported as a const char *

Alan Coopersmith alan.coopersmith at oracle.com
Wed Dec 17 21:06:34 PST 2014


Gets rid of 9 instances of gcc 4.8 warning:

glxcmds.c: In function ‘CreateContext’:
glxcmds.c:378:13: warning: passing argument 1 of ‘glxIsExtensionSupported’
 discards ‘const’ qualifier from pointer target type [enabled by default]
             else if (glxIsExtensionSupported("GLX_SGIX_fbconfig")) {
             ^
In file included from glxserver.h:49:0,
                 from glxcmds.c:41:
glxscreens.h:53:12: note: expected ‘char *’ but argument is of type
 ‘const char *’
 extern int glxIsExtensionSupported(char *ext);

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 hw/dmx/glxProxy/glxscreens.c |    2 +-
 hw/dmx/glxProxy/glxscreens.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c
index b62776c..15bb1e8 100644
--- a/hw/dmx/glxProxy/glxscreens.c
+++ b/hw/dmx/glxProxy/glxscreens.c
@@ -335,7 +335,7 @@ __glXGetServerString(unsigned int name)
 }
 
 int
-glxIsExtensionSupported(char *ext)
+glxIsExtensionSupported(const char *ext)
 {
     return (strstr(ExtensionsString, ext) != NULL);
 }
diff --git a/hw/dmx/glxProxy/glxscreens.h b/hw/dmx/glxProxy/glxscreens.h
index 9a538d1..bb7477b 100644
--- a/hw/dmx/glxProxy/glxscreens.h
+++ b/hw/dmx/glxProxy/glxscreens.h
@@ -50,6 +50,6 @@ extern void __glXScreenReset(void);
 
 extern char *__glXGetServerString(unsigned int name);
 
-extern int glxIsExtensionSupported(char *ext);
+extern int glxIsExtensionSupported(const char *ext);
 
 #endif                          /* !__GLX_screens_h__ */
-- 
1.7.9.2



More information about the xorg-devel mailing list