[PATCH:libX11 2/7] XRebindKeysym: Drop unnecessary const-removing cast

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


C89 defines memcpy as taking a const void *, so casting from
const unsigned char * to char * simply angers gcc for no benefit:

KeyBind.c:1017:24: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]

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

diff --git a/src/KeyBind.c b/src/KeyBind.c
index 221cedd..f22feca 100644
--- a/src/KeyBind.c
+++ b/src/KeyBind.c
@@ -1014,7 +1014,7 @@ XRebindKeysym (
     dpy->key_bindings = p;
     dpy->free_funcs->key_bindings = _XFreeKeyBindings;
     p->next = tmp;	/* chain onto list */
-    memcpy (p->string, (char *) str, nbytes);
+    memcpy (p->string, str, nbytes);
     p->len = nbytes;
     memcpy ((char *) p->modifiers, (char *) mlist, nb);
     p->key = keysym;
-- 
1.7.9.2



More information about the xorg-devel mailing list