You need to sign in or sign up before continuing.
Commit e667b905 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

Fix const handling in XSetLocaleModifiers

Instead of reusing the input parameter to store the output, make a result variable instead, so that there's less const confusion. Fixes gcc warnings: lcWrap.c: In function 'XSetLocaleModifiers': lcWrap.c:87:18: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] lcWrap.c:91:25: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] lcWrap.c:93:12: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent d2671c28
......@@ -77,20 +77,20 @@ XSetLocaleModifiers(
{
XLCd lcd = _XlcCurrentLC();
char *user_mods;
char *mapped_mods;
if (!lcd)
return (char *) NULL;
if (!modifiers)
return lcd->core->modifiers;
user_mods = getenv("XMODIFIERS");
modifiers = (*lcd->methods->map_modifiers) (lcd,
user_mods, (char *)modifiers);
if (modifiers) {
mapped_mods = (*lcd->methods->map_modifiers) (lcd, user_mods, modifiers);
if (mapped_mods) {
if (lcd->core->modifiers)
Xfree(lcd->core->modifiers);
lcd->core->modifiers = (char *)modifiers;
lcd->core->modifiers = mapped_mods;
}
return (char *)modifiers;
return mapped_mods;
}
Bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment