patches to avoid gcc warnings for libX11 (#3)

Author is Peter Breitenlohner <peb@mppmu.mpg.de>
Bug #17946, attachment #19441

This patch avoids the two gcc warnings
	../../../../libX11-1.1.5/modules/im/ximcp/imRm.c:413: warning: assignment discards qualifiers from pointer target type
	../../../../libX11-1.1.5/modules/im/ximcp/imRm.c:450: warning: assignment discards qualifiers from pointer target type

Note, that this as a rather crude fix of the problem (and it is really a
shame to cast name_table to non-const).

The right solution would be to declare XIMValuesList.supported_values
(in include/X11/Xlib.h) as 'const char **' (or '_Xconst char **').
This will, however, require extensive modifications in various places.
This commit is contained in:
Paulo Cesar Pereira de Andrade 2009-01-29 20:22:21 -02:00
parent cce75c5dce
commit f16dd6af3e

View file

@ -410,7 +410,7 @@ _XimDefaultIMValues(
= (char **)((char *)tmp + sizeof(XIMValuesList));
for(i = 0; i < n; i++) {
values_list->supported_values[i] =
name_table + supported_local_im_values_list[i];
(char *)name_table + supported_local_im_values_list[i];
}
}
@ -447,7 +447,7 @@ _XimDefaultICValues(
= (char **)((char *)tmp + sizeof(XIMValuesList));
for(i = 0; i < n; i++) {
values_list->supported_values[i] =
name_table + supported_local_ic_values_list[i];
(char *)name_table + supported_local_ic_values_list[i];
}
}