comparison src/font-mgr.c @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 8d29f1c4bb98
children 3192994c49ca
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
294 if (STRINGP (value)) 294 if (STRINGP (value))
295 { 295 {
296 FcChar8 *str = (FcChar8 *) extract_fcapi_string (value); 296 FcChar8 *str = (FcChar8 *) extract_fcapi_string (value);
297 res = FcPatternAddString (fcpat, obj, str); 297 res = FcPatternAddString (fcpat, obj, str);
298 } 298 }
299 else if (INTP (value)) 299 else if (FIXNUMP (value))
300 { 300 {
301 res = FcPatternAddInteger (fcpat, obj, XINT (value)); 301 res = FcPatternAddInteger (fcpat, obj, XFIXNUM (value));
302 } 302 }
303 else if (FLOATP (value)) 303 else if (FLOATP (value))
304 { 304 {
305 res = FcPatternAddDouble (fcpat, obj, (double) XFLOAT_DATA (value)); 305 res = FcPatternAddDouble (fcpat, obj, (double) XFLOAT_DATA (value));
306 } 306 }
436 436
437 if (!NILP (id)) 437 if (!NILP (id))
438 { 438 {
439 #ifdef HAVE_BIGNUM 439 #ifdef HAVE_BIGNUM
440 check_integer_range (id, Qzero, make_integer (INT_MAX)); 440 check_integer_range (id, Qzero, make_integer (INT_MAX));
441 int_id = BIGNUMP (id) ? bignum_to_int (XBIGNUM_DATA (id)) : XINT (id); 441 int_id = BIGNUMP (id) ? bignum_to_int (XBIGNUM_DATA (id)) : XFIXNUM (id);
442 #else 442 #else
443 check_integer_range (id, Qzero, make_integer (EMACS_INT_MAX)); 443 check_integer_range (id, Qzero, make_integer (MOST_POSITIVE_FIXNUM));
444 int_id = XINT (id); 444 int_id = XFIXNUM (id);
445 #endif 445 #endif
446 } 446 }
447 if (!NILP (type)) CHECK_SYMBOL (type); 447 if (!NILP (type)) CHECK_SYMBOL (type);
448 448
449 /* get property */ 449 /* get property */
456 /* wrap it and return */ 456 /* wrap it and return */
457 switch (fc_value.type) 457 switch (fc_value.type)
458 { 458 {
459 case FcTypeInteger: 459 case FcTypeInteger:
460 return ((!NILP (type) && !EQ (type, Qinteger)) 460 return ((!NILP (type) && !EQ (type, Qinteger))
461 ? Qfc_result_type_mismatch : make_int (fc_value.u.i)); 461 ? Qfc_result_type_mismatch : make_fixnum (fc_value.u.i));
462 case FcTypeDouble: 462 case FcTypeDouble:
463 return ((!NILP (type) && !EQ (type, intern ("double")) 463 return ((!NILP (type) && !EQ (type, intern ("double"))
464 && !EQ (type, Qfloat)) 464 && !EQ (type, Qfloat))
465 ? Qfc_result_type_mismatch : make_float (fc_value.u.d)); 465 ? Qfc_result_type_mismatch : make_float (fc_value.u.d));
466 case FcTypeString: 466 case FcTypeString:
472 ? Qfc_result_type_mismatch : fc_value.u.b ? Qt : Qnil); 472 ? Qfc_result_type_mismatch : fc_value.u.b ? Qt : Qnil);
473 case FcTypeMatrix: 473 case FcTypeMatrix:
474 return Qfc_result_type_mismatch; 474 return Qfc_result_type_mismatch;
475 /* #### unimplemented 475 /* #### unimplemented
476 return ((!NILP (type) && !EQ (type, intern ("matrix"))) 476 return ((!NILP (type) && !EQ (type, intern ("matrix")))
477 ? Qfc_result_type_mismatch : make_int (fc_value.u.m)); 477 ? Qfc_result_type_mismatch : make_fixnum (fc_value.u.m));
478 */ 478 */
479 case FcTypeCharSet: 479 case FcTypeCharSet:
480 return Qfc_result_type_mismatch; 480 return Qfc_result_type_mismatch;
481 /* #### unimplemented 481 /* #### unimplemented
482 return ((!NILP (type) && !EQ (type, intern ("charset"))) 482 return ((!NILP (type) && !EQ (type, intern ("charset")))
483 ? Qfc_result_type_mismatch : make_int (fc_value.u.c)); 483 ? Qfc_result_type_mismatch : make_fixnum (fc_value.u.c));
484 */ 484 */
485 } 485 }
486 case FcResultTypeMismatch: 486 case FcResultTypeMismatch:
487 return Qfc_result_type_mismatch; 487 return Qfc_result_type_mismatch;
488 case FcResultNoMatch: 488 case FcResultNoMatch:
745 during a call to FcFontList when this interval has passed since 745 during a call to FcFontList when this interval has passed since
746 the last check. */ 746 the last check. */
747 (config)) 747 (config))
748 { 748 {
749 CHECK_FC_CONFIG (config); 749 CHECK_FC_CONFIG (config);
750 return make_int (FcConfigGetRescanInterval (XFC_CONFIG_PTR (config))); 750 return make_fixnum (FcConfigGetRescanInterval (XFC_CONFIG_PTR (config)));
751 } 751 }
752 752
753 DEFUN ("fc-config-set-rescan-interval", Ffc_config_set_rescan_interval, 2, 2, 0, /* 753 DEFUN ("fc-config-set-rescan-interval", Ffc_config_set_rescan_interval, 2, 2, 0, /*
754 -- Function: FcBool FcConfigSetRescanInterval (FcConfig *config, int 754 -- Function: FcBool FcConfigSetRescanInterval (FcConfig *config, int
755 rescanInterval) 755 rescanInterval)
756 Sets the rescan interval; returns FcFalse if an error occurred. 756 Sets the rescan interval; returns FcFalse if an error occurred.
757 XEmacs: signal such error, or return nil on success. */ 757 XEmacs: signal such error, or return nil on success. */
758 (config, rescan_interval)) 758 (config, rescan_interval))
759 { 759 {
760 CHECK_FC_CONFIG (config); 760 CHECK_FC_CONFIG (config);
761 CHECK_INT (rescan_interval); 761 CHECK_FIXNUM (rescan_interval);
762 if (FcConfigSetRescanInterval (XFC_CONFIG_PTR (config), 762 if (FcConfigSetRescanInterval (XFC_CONFIG_PTR (config),
763 XINT (rescan_interval)) == FcFalse) 763 XFIXNUM (rescan_interval)) == FcFalse)
764 signal_error (Qio_error, "FcConfigSetRescanInverval barfed", 764 signal_error (Qio_error, "FcConfigSetRescanInverval barfed",
765 intern ("fc-config-set-rescan-interval")); 765 intern ("fc-config-set-rescan-interval"));
766 return Qnil; 766 return Qnil;
767 } 767 }
768 768
1135 gives the usual x.y.z format. This is the version of the .so. It can be 1135 gives the usual x.y.z format. This is the version of the .so. It can be
1136 checked against `fc-version', which is the version of fontconfig.h. 1136 checked against `fc-version', which is the version of fontconfig.h.
1137 It's probably not a disaster if `(> (fc-get-version) fc-version)'. */ 1137 It's probably not a disaster if `(> (fc-get-version) fc-version)'. */
1138 ()) 1138 ())
1139 { 1139 {
1140 return make_int (FcGetVersion ()); 1140 return make_fixnum (FcGetVersion ());
1141 } 1141 }
1142 1142
1143 DEFUN ("fc-init-reinitialize", Ffc_init_reinitialize, 0, 0, 0, /* 1143 DEFUN ("fc-init-reinitialize", Ffc_init_reinitialize, 0, 0, 0, /*
1144 -- Function: FcBool FcInitReinitialize (void) 1144 -- Function: FcBool FcInitReinitialize (void)
1145 Forces the default configuration file to be reloaded and resets 1145 Forces the default configuration file to be reloaded and resets