diff src/font-mgr.c @ 5438:8d29f1c4bb98

Merge with 21.5 trunk.
author Mats Lidell <matsl@xemacs.org>
date Fri, 26 Nov 2010 06:43:36 +0100
parents 308d34e9f07d 17c381a2f377
children 56144c8593a8
line wrap: on
line diff
--- a/src/font-mgr.c	Mon Nov 15 22:33:52 2010 +0100
+++ b/src/font-mgr.c	Fri Nov 26 06:43:36 2010 +0100
@@ -409,6 +409,7 @@
   Extbyte *fc_property;
   FcResult fc_result;
   FcValue fc_value;
+  int int_id = 0;
 
   /*
     process arguments
@@ -433,14 +434,21 @@
       dead_wrong_type_argument (Qstringp, property);
     }
 
-  if (!NILP (id)) CHECK_NATNUM (id);
+  if (!NILP (id))
+    {
+#ifdef HAVE_BIGNUM
+      check_integer_range (id, Qzero, make_integer (INT_MAX));
+      int_id = BIGNUMP (id) ? bignum_to_int (XBIGNUM_DATA (id)) : XINT (id);
+#else
+      check_integer_range (id, Qzero, make_integer (EMACS_INT_MAX));
+      int_id = XINT (id);      
+#endif
+    }
   if (!NILP (type)) CHECK_SYMBOL (type);
 
   /* get property */
   fc_result = FcPatternGet (XFC_PATTERN_PTR (pattern),
-			    fc_property,
-			    NILP (id) ? 0 : XINT (id),
-			    &fc_value);
+			    fc_property, int_id, &fc_value);
 
   switch (fc_result)
     {