aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-10 22:18:00 -0700
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:28 +0200
commite667b9054308dd2033d3771a0656dd485286e855 (patch)
tree17e7e8c708f79d5283a429a0ca50e544e7f5c013 /nx-X11/lib
parentd2671c285e1923acae674ef9390a3f8bf23c11b3 (diff)
downloadnx-libs-e667b9054308dd2033d3771a0656dd485286e855.tar.gz
nx-libs-e667b9054308dd2033d3771a0656dd485286e855.tar.bz2
nx-libs-e667b9054308dd2033d3771a0656dd485286e855.zip
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: Alan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/X11/lcWrap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/nx-X11/lib/X11/lcWrap.c b/nx-X11/lib/X11/lcWrap.c
index 47581f8f8..358748fdc 100644
--- a/nx-X11/lib/X11/lcWrap.c
+++ b/nx-X11/lib/X11/lcWrap.c
@@ -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