aboutsummaryrefslogtreecommitdiffstats
path: root/src/fontset.c
diff options
context:
space:
mode:
authorPaul Eggert2014-12-20 15:20:56 -0800
committerPaul Eggert2014-12-20 15:50:45 -0800
commit4cc2f6918ddd44bf1f10a1d689b7bd769fcf6b8e (patch)
tree0f92d4a3a99608cf45a3f05283144ba160ceba01 /src/fontset.c
parent9b14d8b6f259a4d602f0c61689d6641e7ab20b49 (diff)
downloademacs-4cc2f6918ddd44bf1f10a1d689b7bd769fcf6b8e.tar.gz
emacs-4cc2f6918ddd44bf1f10a1d689b7bd769fcf6b8e.zip
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.
Diffstat (limited to 'src/fontset.c')
-rw-r--r--src/fontset.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fontset.c b/src/fontset.c
index d08d68fa28d..ac50be1c925 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -389,7 +389,7 @@ reorder_font_vector (Lisp_Object font_group, struct font *font)
389 Lisp_Object vec, font_object; 389 Lisp_Object vec, font_object;
390 int size; 390 int size;
391 int i; 391 int i;
392 bool score_changed = 0; 392 bool score_changed = false;
393 393
394 if (font) 394 if (font)
395 XSETFONT (font_object, font); 395 XSETFONT (font_object, font);
@@ -444,14 +444,15 @@ reorder_font_vector (Lisp_Object font_group, struct font *font)
444 if (RFONT_DEF_SCORE (rfont_def) != score) 444 if (RFONT_DEF_SCORE (rfont_def) != score)
445 { 445 {
446 RFONT_DEF_SET_SCORE (rfont_def, score); 446 RFONT_DEF_SET_SCORE (rfont_def, score);
447 score_changed = 1; 447 score_changed = true;
448 } 448 }
449 } 449 }
450 450
451 if (score_changed) 451 if (score_changed)
452 qsort (XVECTOR (vec)->contents, size, word_size, 452 qsort (XVECTOR (vec)->contents, size, word_size,
453 fontset_compare_rfontdef); 453 fontset_compare_rfontdef);
454 XSETCAR (font_group, make_number (charset_ordered_list_tick)); 454 EMACS_INT low_tick_bits = charset_ordered_list_tick & MOST_POSITIVE_FIXNUM;
455 XSETCAR (font_group, make_number (low_tick_bits));
455} 456}
456 457
457/* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for 458/* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for