[PATCH:libX11 17/22] i18n modules: Fix some const cast warnings
Alan Coopersmith
alan.coopersmith at oracle.com
Mon Aug 12 00:04:08 PDT 2013
imRm.c: In function '_XimSetICMode':
imRm.c:2419:37: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
imRm.c:2420:30: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
lcGenConv.c: In function 'byteM_parse_codeset':
lcGenConv.c:345:13: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
modules/im/ximcp/imRm.c | 4 ++--
modules/lc/gen/lcGenConv.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/im/ximcp/imRm.c b/modules/im/ximcp/imRm.c
index 4c46252..4e6eae6 100644
--- a/modules/im/ximcp/imRm.c
+++ b/modules/im/ximcp/imRm.c
@@ -2416,8 +2416,8 @@ _XimSetICMode(XIMResourceList res_list, unsigned int list_num, XIMStyle style)
list_num, ic_mode_quark[i]))) {
continue;
}
- res->mode = ( (*(unsigned short *)((char *)&ic_mode[i] + pre_offset))
- | (*(unsigned short *)((char *)&ic_mode[i] + sts_offset)));
+ res->mode = ( (*(const unsigned short *)((const char *)&ic_mode[i] + pre_offset))
+ | (*(const unsigned short *)((const char *)&ic_mode[i] + sts_offset)));
}
return;
}
diff --git a/modules/lc/gen/lcGenConv.c b/modules/lc/gen/lcGenConv.c
index 1041dc7..96904af 100644
--- a/modules/lc/gen/lcGenConv.c
+++ b/modules/lc/gen/lcGenConv.c
@@ -342,7 +342,7 @@ byteM_parse_codeset(
continue;
for (j = 0; j < codeset->length; j++) {
- ch = *((unsigned char *)(inbufptr + j));
+ ch = *((const unsigned char *)(inbufptr + j));
byteM_rec = byteM[j];
byteinfo = byteM_rec.byteinfo;
--
1.7.9.2
More information about the xorg-devel
mailing list