APPROVE COMMIT
SUPERSEDES m3u0dlepkn.fsf(a)zion.rcn.com
NOTE: This patch has been committed.
Vin, your patch only changed the limit on X11--the same problem arises for
GTK.
src/ChangeLog addition:
2005-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* objects-gtk.c (MAX_FONT_COUNT):
* objects-x.c (MAX_FONT_COUNT): Increase MAX_FONT_COUNT from 5000
to INT_MAX. Applies to both the X and GTK platforms.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/objects-x.c src/objects-gtk.c
Index: src/objects-gtk.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-gtk.c,v
retrieving revision 1.16
diff -u -u -r1.16 objects-gtk.c
--- src/objects-gtk.c 2005/01/28 02:58:51 1.16
+++ src/objects-gtk.c 2005/12/24 17:27:52
@@ -485,8 +485,7 @@
/* X Specific stuff */
#include <X11/Xatom.h>
-/* Unbounded, for sufficiently small values of infinity... */
-#define MAX_FONT_COUNT 5000
+#define MAX_FONT_COUNT INT_MAX
#ifdef MULE
/* find a font spec that matches font spec FONT and also matches
@@ -536,9 +535,6 @@
return result;
}
#endif /* MULE */
-
-/* Unbounded, for sufficiently small values of infinity... */
-#define MAX_FONT_COUNT 5000
static int
valid_font_name_p (Display *dpy, char *name)
Index: src/objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.33
diff -u -u -r1.33 objects-x.c
--- src/objects-x.c 2005/12/23 15:08:14 1.33
+++ src/objects-x.c 2005/12/24 17:27:53
@@ -693,8 +693,9 @@
return result;
}
-/* Unbounded, for sufficiently small values of infinity... */
-#define MAX_FONT_COUNT 5000
+/* XListFonts doesn't allocate memory unconditionally based on this. (For
+ XFree86 in 2005, at least. */
+#define MAX_FONT_COUNT INT_MAX
static Extbyte *
truename_via_XListFonts (Display *dpy, Extbyte *font_name)
@@ -807,8 +808,7 @@
FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern);
if (res)
{
- FONT_INSTANCE_TRUENAME (f) =
- build_ext_string (res, Qxft_font_name_encoding);
+ FONT_INSTANCE_TRUENAME (f) = make_string (res, strlen (res));
free (res);
return FONT_INSTANCE_TRUENAME (f);
}
@@ -1176,7 +1176,7 @@
Extbyte **names;
int count = 0;
const Extbyte *patternext;
- Lisp_Object result = Qnil;
+ Lisp_Object result = Qunbound;
int i;
/* #### with Xft need to handle second stage here -- sjt
@@ -1442,7 +1442,7 @@
if (x_font_spec_matches_charset (XDEVICE (device), charset,
intname, Qnil, 0, -1, 0))
{
- result = build_ext_string (intname, Qx_font_name_encoding);
+ result = make_string (intname, intlen);
break;
}
}
--
I AM IN JAIL AND ALLOWED SEND ONLY ONE CABLE SINCE WAS ARRESTED WHILE
MEASURING FIFTEEN FOOT WALL OUTSIDE PALACE AND HAVE JUST FINISHED COUNTING
THIRTY EIGHT THOUSAND FIVE HUNDERED TWENTY TWO NAMES WHOS WHO IN MIDEAST.
Show replies by date
Aidan Kehoe <kehoea(a)parhasard.net> writes:
APPROVE COMMIT
SUPERSEDES m3u0dlepkn.fsf(a)zion.rcn.com
NOTE: This patch has been committed.
Vin, your patch only changed the limit on X11--the same problem arises for
GTK.
src/ChangeLog addition:
2005-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* objects-gtk.c (MAX_FONT_COUNT):
* objects-x.c (MAX_FONT_COUNT): Increase MAX_FONT_COUNT from 5000
to INT_MAX. Applies to both the X and GTK platforms.
Aidan,
Thanks for the catch. I'll apply the objects-gtk.c part of the patch
to the 21.4 branch and the patch will appear in 21.4.19.
- Vin