diff options
Diffstat (limited to 'src/fontset.c')
| -rw-r--r-- | src/fontset.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/fontset.c b/src/fontset.c index 74a25a1ca04..7730f2e4fa9 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -416,9 +416,11 @@ reorder_font_vector (Lisp_Object font_group, struct font *font) | |||
| 416 | 416 | ||
| 417 | for (tail = Vcharset_ordered_list; | 417 | for (tail = Vcharset_ordered_list; |
| 418 | ! EQ (tail, Vcharset_non_preferred_head) && CONSP (tail); | 418 | ! EQ (tail, Vcharset_non_preferred_head) && CONSP (tail); |
| 419 | score += 0x100, tail = XCDR (tail)) | 419 | tail = XCDR (tail)) |
| 420 | if (EQ (encoding, XCAR (tail))) | 420 | if (EQ (encoding, XCAR (tail))) |
| 421 | break; | 421 | break; |
| 422 | else if (score <= MIN (INT_MAX, MOST_POSITIVE_FIXNUM) - 0x100) | ||
| 423 | score += 0x100; | ||
| 422 | } | 424 | } |
| 423 | else | 425 | else |
| 424 | { | 426 | { |
| @@ -787,7 +789,7 @@ make_fontset (Lisp_Object frame, Lisp_Object name, Lisp_Object base) | |||
| 787 | while (!NILP (AREF (Vfontset_table, id))) id++; | 789 | while (!NILP (AREF (Vfontset_table, id))) id++; |
| 788 | 790 | ||
| 789 | if (id + 1 == size) | 791 | if (id + 1 == size) |
| 790 | Vfontset_table = larger_vector (Vfontset_table, size + 32, Qnil); | 792 | Vfontset_table = larger_vector (Vfontset_table, 1, -1); |
| 791 | 793 | ||
| 792 | fontset = Fmake_char_table (Qfontset, Qnil); | 794 | fontset = Fmake_char_table (Qfontset, Qnil); |
| 793 | 795 | ||
| @@ -1700,7 +1702,7 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of | |||
| 1700 | static Lisp_Object auto_fontset_alist; | 1702 | static Lisp_Object auto_fontset_alist; |
| 1701 | 1703 | ||
| 1702 | /* Number of automatically created fontsets. */ | 1704 | /* Number of automatically created fontsets. */ |
| 1703 | static printmax_t num_auto_fontsets; | 1705 | static ptrdiff_t num_auto_fontsets; |
| 1704 | 1706 | ||
| 1705 | /* Retun a fontset synthesized from FONT-OBJECT. This is called from | 1707 | /* Retun a fontset synthesized from FONT-OBJECT. This is called from |
| 1706 | x_new_font when FONT-OBJECT is used for the default ASCII font of a | 1708 | x_new_font when FONT-OBJECT is used for the default ASCII font of a |
| @@ -1727,9 +1729,9 @@ fontset_from_font (Lisp_Object font_object) | |||
| 1727 | alias = intern ("fontset-startup"); | 1729 | alias = intern ("fontset-startup"); |
| 1728 | else | 1730 | else |
| 1729 | { | 1731 | { |
| 1730 | char temp[sizeof "fontset-auto" + INT_STRLEN_BOUND (printmax_t)]; | 1732 | char temp[sizeof "fontset-auto" + INT_STRLEN_BOUND (ptrdiff_t)]; |
| 1731 | 1733 | ||
| 1732 | sprintf (temp, "fontset-auto%"pMd, num_auto_fontsets - 1); | 1734 | sprintf (temp, "fontset-auto%"pD"d", num_auto_fontsets - 1); |
| 1733 | alias = intern (temp); | 1735 | alias = intern (temp); |
| 1734 | } | 1736 | } |
| 1735 | fontset_spec = copy_font_spec (font_spec); | 1737 | fontset_spec = copy_font_spec (font_spec); |
| @@ -1816,7 +1818,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, | |||
| 1816 | doc: /* For internal use only. */) | 1818 | doc: /* For internal use only. */) |
| 1817 | (Lisp_Object position, Lisp_Object ch) | 1819 | (Lisp_Object position, Lisp_Object ch) |
| 1818 | { | 1820 | { |
| 1819 | EMACS_INT pos, pos_byte, dummy; | 1821 | ptrdiff_t pos, pos_byte, dummy; |
| 1820 | int face_id; | 1822 | int face_id; |
| 1821 | int c; | 1823 | int c; |
| 1822 | struct frame *f; | 1824 | struct frame *f; |
| @@ -1836,9 +1838,9 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, | |||
| 1836 | struct window *w; | 1838 | struct window *w; |
| 1837 | 1839 | ||
| 1838 | CHECK_NUMBER_COERCE_MARKER (position); | 1840 | CHECK_NUMBER_COERCE_MARKER (position); |
| 1839 | pos = XINT (position); | 1841 | if (! (BEGV <= XINT (position) && XINT (position) < ZV)) |
| 1840 | if (pos < BEGV || pos >= ZV) | ||
| 1841 | args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); | 1842 | args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); |
| 1843 | pos = XINT (position); | ||
| 1842 | pos_byte = CHAR_TO_BYTE (pos); | 1844 | pos_byte = CHAR_TO_BYTE (pos); |
| 1843 | if (NILP (ch)) | 1845 | if (NILP (ch)) |
| 1844 | c = FETCH_CHAR (pos_byte); | 1846 | c = FETCH_CHAR (pos_byte); |