APPROVE COMMIT 21.5
This eliminates some more GCC 4 whining. However, there is a possibly
controversial aspect here: fontconfig uses "const" all over the place,
and I needed to match it. Please report any problems, I will fix
immediately or revert. Unfortunately I'm not enough of a language
lawyer to fix const issues without bug reports, so I figure I may as
well commit. :-/
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.978
diff -u -r1.978 ChangeLog
--- src/ChangeLog 21 Jun 2006 17:30:33 -0000 1.978
+++ src/ChangeLog 23 Jun 2006 14:14:49 -0000
@@ -0,0 +1,13 @@
+2006-06-23 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * font-mgr.c (extract_fcapi_string):
+ (fc_intern):
+ (Ffc_name_parse):
+ (Ffc_name_unparse):
+ (Ffc_pattern_add):
+ (Ffc_pattern_del):
+ (Ffc_pattern_get):
+ (string_list_to_fcobjectset):
+ fc_intern and extract_fcapi_string should return
+ [const] Extbyte *. Make it so, update callers.
+
Index: src/font-mgr.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/font-mgr.c,v
retrieving revision 1.3
diff -u -r1.3 font-mgr.c
--- src/font-mgr.c 1 May 2006 18:17:23 -0000 1.3
+++ src/font-mgr.c 23 Jun 2006 14:14:49 -0000
@@ -120,7 +120,7 @@
is a Lisp string.
*/
#define extract_fcapi_string(str) \
- ((FcChar8 *) NEW_LISP_STRING_TO_EXTERNAL ((str), Qfc_font_name_encoding))
+ (NEW_LISP_STRING_TO_EXTERNAL ((str), Qfc_font_name_encoding))
/* #### This homebrew lashup should be replaced with FcConstants.
@@ -158,20 +158,20 @@
/* #### Maybe fc_intern should be exposed to LISP? The idea is that
fc-pattern-add could warn or error if the property isn't interned. */
-static FcChar8 *
+static const Extbyte *
fc_intern (Lisp_Object property)
{
const void *dummy;
- FcChar8 *prop = extract_fcapi_string (property);
+ const Extbyte *prop = extract_fcapi_string (property);
const void *val = gethash (prop, fc_property_name_hash_table, &dummy);
/* extract_fcapi_string returns something alloca'd
so we can just drop the old value of prop on the floor */
if (val)
- prop = (FcChar8 *) val;
+ prop = (const Extbyte *) val;
else
{
- prop = FcStrCopy (prop);
+ prop = (const Extbyte *) FcStrCopy ((FcChar8 *) prop);
puthash (prop, NULL, fc_property_name_hash_table);
}
return prop;
@@ -207,7 +207,7 @@
CHECK_STRING(name); /* #### MEMORY LEAK!! maybe not ... */
- fcpat->fcpatPtr = FcNameParse (extract_fcapi_string (name));
+ fcpat->fcpatPtr = FcNameParse ((FcChar8 *) extract_fcapi_string (name));
return wrap_fcpattern(fcpat);
}
@@ -220,10 +220,10 @@
{
CHECK_FCPATTERN(pattern);
{
- FcChar8 *temp = FcNameUnparse(XFCPATTERN_PTR(pattern));
- Lisp_Object res = build_ext_string (temp, Qfc_font_name_encoding);
- free (temp);
- return res;
+ Extbyte *temp = (Extbyte *) FcNameUnparse(XFCPATTERN_PTR(pattern));
+ Lisp_Object res = build_ext_string (temp, Qfc_font_name_encoding);
+ free (temp);
+ return res;
}
}
@@ -250,7 +250,7 @@
(pattern, property, value))
{
Bool res = 0;
- Extbyte *obj;
+ const Extbyte *obj;
FcPattern *fcpat;
CHECK_FCPATTERN(pattern);
@@ -291,8 +291,7 @@
CHECK_FCPATTERN(pattern);
CHECK_STRING(property);
- res = FcPatternDel(XFCPATTERN_PTR(pattern),
- extract_fcapi_string (property));
+ res = FcPatternDel(XFCPATTERN_PTR(pattern), extract_fcapi_string (property));
return res ? Qt : Qnil;
}
@@ -375,7 +374,7 @@
Xft v.2: encoding, charwidth, charheight, core, and render. */
(pattern, property, id, type))
{
- FcChar8 *fc_property; /* UExtbyte * */
+ Extbyte *fc_property;
FcResult fc_result;
FcValue fc_value;
@@ -390,7 +389,7 @@
#endif
if (STRINGP (property))
{
- fc_property = (FcChar8 *) extract_fcapi_string (property);
+ fc_property = extract_fcapi_string (property);
}
else
{
@@ -427,7 +426,8 @@
case FcTypeString:
return ((!NILP (type) && !EQ (type, Qstring))
? Qfc_result_type_mismatch
- : build_ext_string (fc_value.u.s, Qfc_font_name_encoding));
+ : build_ext_string ((Extbyte *) fc_value.u.s,
+ Qfc_font_name_encoding));
case FcTypeBool:
return ((!NILP (type) && !EQ (type, Qboolean))
? Qfc_result_type_mismatch : fc_value.u.b ? Qt : Qnil);
@@ -700,7 +700,7 @@
{
EXTERNAL_LIST_LOOP_2 (elt, list)
{
- FcChar8 *s;
+ const Extbyte *s;
CHECK_STRING (elt);
s = fc_intern (elt);
--
Graduate School of Systems and Information Engineering University of Tsukuba
http://turnbull.sk.tsukuba.ac.jp/ Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Economics of Information Communication and Computation Systems
Experimental Economics, Microeconomic Theory, Game Theory