[PATCH:libX11 3/7] XStringToKeysym: preserve constness when casting off unsignedness for strcmp

Alan Coopersmith alan.coopersmith at oracle.com
Sun Feb 17 09:45:44 PST 2013


Fixes gcc warning:
StrKeysym.c:97:17: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 src/StrKeysym.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/StrKeysym.c b/src/StrKeysym.c
index 4394e0c..12fce68 100644
--- a/src/StrKeysym.c
+++ b/src/StrKeysym.c
@@ -94,7 +94,7 @@ XStringToKeysym(_Xconst char *s)
     {
 	entry = &_XkeyTable[idx];
 	if ((entry[0] == sig1) && (entry[1] == sig2) &&
-	    !strcmp(s, (char *)entry + 6))
+	    !strcmp(s, (const char *)entry + 6))
 	{
 	    val = (entry[2] << 24) | (entry[3] << 16) |
 	          (entry[4] << 8)  | entry[5];
-- 
1.7.9.2



More information about the xorg-devel mailing list