changeset 3169:5bfedec8927e

[xemacs-hg @ 2005-12-24 17:33:31 by aidan] Move the XListFonts maxnames param to INT_MAX from 5000
author aidan
date Sat, 24 Dec 2005 17:33:34 +0000
parents 423e5387091f
children db0631f96757
files src/ChangeLog src/objects-gtk.c src/objects-x.c
diffstat 3 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Dec 23 22:51:11 2005 +0000
+++ b/src/ChangeLog	Sat Dec 24 17:33:34 2005 +0000
@@ -1,3 +1,9 @@
+2005-12-24  Aidan Kehoe  <kehoea@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. 
+
 2005-12-23  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* objects-x.c (x_find_charset_font): More mule-ization.
--- a/src/objects-gtk.c	Fri Dec 23 22:51:11 2005 +0000
+++ b/src/objects-gtk.c	Sat Dec 24 17:33:34 2005 +0000
@@ -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
@@ -537,9 +536,6 @@
 }
 #endif /* MULE */
 
-/* Unbounded, for sufficiently small values of infinity... */
-#define MAX_FONT_COUNT 5000
-
 static int
 valid_font_name_p (Display *dpy, char *name)
 {
--- a/src/objects-x.c	Fri Dec 23 22:51:11 2005 +0000
+++ b/src/objects-x.c	Sat Dec 24 17:33:34 2005 +0000
@@ -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;
 	}
     }