Commit 4cc2f691 authored by Paul Eggert's avatar Paul Eggert
Browse files

Let charset tick grow past USHRT_MAX

* charset.c, charset.h (charset_ordered_list_tick):
Now EMACS_UINT, not unsigned short.
* fontset.c (reorder_font_vector): Allow the tick to grow to the
maximum representable Emacs integer value before wrapping it around.
parent 9b14d8b6
2014-12-20 Paul Eggert <eggert@cs.ucla.edu>
 
Let charset tick grow past USHRT_MAX
* charset.c, charset.h (charset_ordered_list_tick):
Now EMACS_UINT, not unsigned short.
* fontset.c (reorder_font_vector): Allow the tick to grow to the
maximum representable Emacs integer value before wrapping it around.
Simplify unexec file mode setting
* unexaix.c, unexcoff.c, unexelf.c, unexmacosx.c:
Don't include <sys/stat.h> when no longer needed.
......
......@@ -101,10 +101,9 @@ Lisp_Object Vcharset_ordered_list;
charsets. */
Lisp_Object Vcharset_non_preferred_head;
/* Incremented everytime we change Vcharset_ordered_list. This is
unsigned short so that it fits in Lisp_Int and never matches
-1. */
unsigned short charset_ordered_list_tick;
/* Incremented every time we change the priority of charsets.
Wraps around. */*/
EMACS_UINT charset_ordered_list_tick;
/* List of iso-2022 charsets. */
Lisp_Object Viso_2022_charset_list;
......
......@@ -253,8 +253,7 @@ extern struct charset *charset_table;
extern Lisp_Object Vcharset_ordered_list;
extern Lisp_Object Vcharset_non_preferred_head;
/* Incremented everytime we change the priority of charsets. */
extern unsigned short charset_ordered_list_tick;
extern EMACS_UINT charset_ordered_list_tick;
extern Lisp_Object Viso_2022_charset_list;
extern Lisp_Object Vemacs_mule_charset_list;
......
......@@ -389,7 +389,7 @@ reorder_font_vector (Lisp_Object font_group, struct font *font)
Lisp_Object vec, font_object;
int size;
int i;
bool score_changed = 0;
bool score_changed = false;
if (font)
XSETFONT (font_object, font);
......@@ -444,14 +444,15 @@ reorder_font_vector (Lisp_Object font_group, struct font *font)
if (RFONT_DEF_SCORE (rfont_def) != score)
{
RFONT_DEF_SET_SCORE (rfont_def, score);
score_changed = 1;
score_changed = true;
}
}
if (score_changed)
qsort (XVECTOR (vec)->contents, size, word_size,
fontset_compare_rfontdef);
XSETCAR (font_group, make_number (charset_ordered_list_tick));
EMACS_INT low_tick_bits = charset_ordered_list_tick & MOST_POSITIVE_FIXNUM;
XSETCAR (font_group, make_number (low_tick_bits));
}
/* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment