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.
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;
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;
Lisp_Object vec, font_object;
int size;
int i;
- bool score_changed = 0;
+ bool score_changed = false;
if (font)
XSETFONT (font_object, 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