User: stephent
Date: 06/06/23 17:45:05
Modified: xemacs/src ChangeLog font-mgr.c objects-x.c
Log:
Quiet GCC 4 signedness warnings.
<87zmg399dw.fsf(a)tleepslib.sk.tsukuba.ac.jp>
<87veqr996l.fsf(a)tleepslib.sk.tsukuba.ac.jp>
Revision Changes Path
1.979 +21 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.978
retrieving revision 1.979
diff -u -p -r1.978 -r1.979
--- ChangeLog 2006/06/21 17:30:33 1.978
+++ ChangeLog 2006/06/23 15:44:59 1.979
@@ -1,3 +1,24 @@
+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.
+
+2006-05-26 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * objects-x.c (x_initialize_font_instance):
+ (x_font_instance_truename):
+ (charset_table):
+ (x_find_charset_font):
+ Pander to GCC4 signed character paranoia.
+
2006-06-19 Jerry James <james(a)xemacs.org>
* device-x.c (x_IO_error_handler): Do not dereference d if it is
1.4 +17 -17 XEmacs/xemacs/src/font-mgr.c
Index: font-mgr.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/font-mgr.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- font-mgr.c 2006/05/01 18:17:23 1.3
+++ font-mgr.c 2006/06/23 15:45:02 1.4
@@ -120,7 +120,7 @@ static void string_list_to_fcobjectset (
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 @@ static struct hash_table *fc_property_na
/* #### 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 @@ Parse an Fc font name and return its rep
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 @@ Unparse an fc pattern object to a string
{
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 @@ will be added as an FcChar8[], int, doub
(pattern, property, value))
{
Bool res = 0;
- Extbyte *obj;
+ const Extbyte *obj;
FcPattern *fcpat;
CHECK_FCPATTERN(pattern);
@@ -291,8 +291,7 @@ Remove attribute PROPERTY from fc patter
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 @@ The following properties which were stan
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 @@ Xft v.2: encoding, charwidth, charheigh
#endif
if (STRINGP (property))
{
- fc_property = (FcChar8 *) extract_fcapi_string (property);
+ fc_property = extract_fcapi_string (property);
}
else
{
@@ -427,7 +426,8 @@ Xft v.2: encoding, charwidth, charheigh
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 @@ string_list_to_fcobjectset (Lisp_Object
{
EXTERNAL_LIST_LOOP_2 (elt, list)
{
- FcChar8 *s;
+ const Extbyte *s;
CHECK_STRING (elt);
s = fc_intern (elt);
1.43 +19 -17 XEmacs/xemacs/src/objects-x.c
Index: objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -p -r1.42 -r1.43
--- objects-x.c 2006/05/30 06:21:31 1.42
+++ objects-x.c 2006/06/23 15:45:03 1.43
@@ -253,7 +253,7 @@ x_color_list (void)
#define PRINT_XFT_PATTERN(level,format,pattern) \
do { \
DECLARE_EISTRING (eistrpxft_name); \
- FcChar8 *name = FcNameUnparse (pattern); \
+ Extbyte *name = (Extbyte *) FcNameUnparse (pattern); \
\
eicpy_ext(eistrpxft_name, name, Qfc_font_name_encoding); \
DEBUG_XFT1 (level, format, eidata(eistrpxft_name)); \
@@ -267,7 +267,7 @@ x_color_list (void)
#define CHECKING_LANG(level,font,lang) \
do { \
DECLARE_EISTRING (eistrcl_name); \
- eicpy_ext(eistrcl_name, font, Qfc_font_name_encoding); \
+ eicpy_ext(eistrcl_name, (Extbyte *) font, Qfc_font_name_encoding); \
DEBUG_XFT2 (level, "checking if %s handles %s\n", \
eidata(eistrcl_name), lang); \
} while (0)
@@ -347,7 +347,7 @@ x_initialize_font_instance (Lisp_Font_In
cell size for estimating window dimensions. The test_string8
is an ASCII string whose characters should approximate the
distribution of widths expected in real text. */
- static const char test_string8[] = "Mmneei";
+ static const FcChar8 test_string8[] = "Mmneei";
static const int len = sizeof (test_string8) - 1;
XGlyphInfo glyphinfo;
@@ -814,7 +814,7 @@ x_font_instance_truename (Lisp_Font_Inst
if (res)
{
FONT_INSTANCE_TRUENAME (f) =
- build_ext_string (res, Qfc_font_name_encoding);
+ build_ext_string ((Extbyte *) res, Qfc_font_name_encoding);
free (res);
return FONT_INSTANCE_TRUENAME (f);
}
@@ -1120,7 +1120,8 @@ struct charset_reporter {
Lisp_Object *charset;
/* This is a debug facility, require ASCII. */
Extbyte *language; /* ASCII, please */
- FcChar8 *rfc3066; /* ASCII, please */
+ /* Technically this is FcChar8, but fsckin' GCC 4 bitches. */
+ Extbyte *rfc3066; /* ASCII, please */
};
static struct charset_reporter charset_table[] =
@@ -1218,7 +1219,7 @@ x_find_charset_font (Lisp_Object device,
FcPattern *fontxft; /* long-lived, freed at end of this block */
FcResult fcresult;
FcConfig *fcc;
- FcChar8 *lang = "en"; /* #### fix this bogus hack! */
+ FcChar8 *lang = (FcChar8 *) "en"; /* #### fix this bogus hack! */
FcCharSet *fccs = NULL;
DECLARE_EISTRING (eistr_shortname); /* user-friendly nickname */
DECLARE_EISTRING (eistr_longname); /* omit FC_LANG and FC_CHARSET */
@@ -1230,7 +1231,7 @@ x_find_charset_font (Lisp_Object device,
/* parse the name, do the substitutions, and match the font */
{
- FcPattern *p = FcNameParse (patternext);
+ FcPattern *p = FcNameParse ((FcChar8 *) patternext);
PRINT_XFT_PATTERN (3, "FcNameParse'ed name is %s\n", p);
/* #### Next two return FcBool, but what does the return mean? */
/* The order is correct according the fontconfig docs. */
@@ -1257,7 +1258,7 @@ x_find_charset_font (Lisp_Object device,
/* full name, including language coverage and repertoire */
name = FcNameUnparse (p);
- eicpy_ext (eistr_fullname, name, Qfc_font_name_encoding);
+ eicpy_ext (eistr_fullname, (Extbyte *) name, Qfc_font_name_encoding);
free (name);
/* long name, omitting coverage and repertoire, plus a number
@@ -1274,7 +1275,7 @@ x_find_charset_font (Lisp_Object device,
FcPatternDel (p, FC_SCALE);
FcPatternDel (p, FC_FONTVERSION);
name = FcNameUnparse (p);
- eicpy_ext (eistr_longname, name, Qfc_font_name_encoding);
+ eicpy_ext (eistr_longname, (Extbyte *) name, Qfc_font_name_encoding);
free (name);
/* nickname, just family and size, but
@@ -1288,7 +1289,7 @@ x_find_charset_font (Lisp_Object device,
FcPatternDel (p, FC_SCALABLE);
FcPatternDel (p, FC_DPI);
name = FcNameUnparse (p);
- eicpy_ext (eistr_shortname, name, Qfc_font_name_encoding);
+ eicpy_ext (eistr_shortname, (Extbyte *) name, Qfc_font_name_encoding);
free (name);
FcPatternDestroy (p);
@@ -1316,14 +1317,15 @@ x_find_charset_font (Lisp_Object device,
{
DECLARE_DEBUG_FONTNAME (name);
CHECKING_LANG (0, eidata(name), cr->language);
- lang = cr->rfc3066;
+ lang = (FcChar8 *) cr->rfc3066;
}
else if (cr->charset)
{
/* what the hey, build 'em on the fly */
/* #### in the case of error this could return NULL! */
fccs = mule_to_fc_charset (charset);
- lang = XSTRING_DATA (XSYMBOL (XCHARSET_NAME (charset))-> name);
+ lang = (FcChar8 *) XSTRING_DATA (XSYMBOL
+ (XCHARSET_NAME (charset))-> name);
}
else
{
@@ -1331,13 +1333,13 @@ x_find_charset_font (Lisp_Object device,
warn_when_safe_lispobj (intern ("xft"), intern ("alert"),
list2 (build_string ("unchecked charset"),
charset));
+ /* default to "en"
+ #### THIS IS WRONG, WRONG, WRONG!!
+ It is why we never fall through to XLFD-checking. */
}
- /* default to "en"
- #### THIS IS WRONG, WRONG, WRONG!!
- It is why we never fall through to XLFD-checking. */
- }
- ASSERT_ASCTEXT_ASCII(lang);
+ ASSERT_ASCTEXT_ASCII((Extbyte *) lang);
+ }
if (fccs)
{