summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-10 22:18:00 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-20 12:51:08 -0700
commiteb3676113fc2dd0f34d92b89beb81b3f61569aa1 (patch)
treeb3b47904b0ae39fb1473331e94fa49fe44f0db13
parent8ebbffa98563960910152e4f2e31cb032375d871 (diff)
downloadxorg-lib-libX11-eb3676113fc2dd0f34d92b89beb81b3f61569aa1.tar.gz
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>
-rw-r--r--src/xlibi18n/lcWrap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c
index c3f5ca53..e6143fd3 100644
--- a/src/xlibi18n/lcWrap.c
+++ b/src/xlibi18n/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