comparison src/faces.c @ 4208:e820df1cb11a

[xemacs-hg @ 2007-10-03 13:28:19 by didierv] Assert correct order in face cache
author didierv
date Wed, 03 Oct 2007 13:28:21 +0000
parents 26dccfc8fa60
children 65c3847d432c
comparison
equal deleted inserted replaced
4207:62d532188a28 4208:e820df1cb11a
1582 { 1582 {
1583 /* #### Not initialized in batch mode for the stream device. */ 1583 /* #### Not initialized in batch mode for the stream device. */
1584 if (w->face_cachels) 1584 if (w->face_cachels)
1585 { 1585 {
1586 int i; 1586 int i;
1587 face_index fi;
1587 1588
1588 for (i = 0; i < Dynarr_length (w->face_cachels); i++) 1589 for (i = 0; i < Dynarr_length (w->face_cachels); i++)
1589 { 1590 {
1590 struct face_cachel *cachel = Dynarr_atp (w->face_cachels, i); 1591 struct face_cachel *cachel = Dynarr_atp (w->face_cachels, i);
1591 if (cachel->merged_faces) 1592 if (cachel->merged_faces)
1592 Dynarr_free (cachel->merged_faces); 1593 Dynarr_free (cachel->merged_faces);
1593 } 1594 }
1594 Dynarr_reset (w->face_cachels); 1595 Dynarr_reset (w->face_cachels);
1595 /* #### NOTE: be careful with the order ! 1596 /* #### NOTE: be careful with the order !
1596 The cpp macros DEFAULT_INDEX and MODELINE_INDEX defined in 1597 The cpp macros DEFAULT_INDEX and MODELINE_INDEX defined in
1597 redisplay.h depend on the code below, which is really clumsy. 1598 redisplay.h depend on the code below. Please make sure to assert the
1599 correct values if you ever add new built-in faces here.
1598 -- dvl */ 1600 -- dvl */
1599 get_builtin_face_cache_index (w, Vdefault_face); 1601 fi = get_builtin_face_cache_index (w, Vdefault_face);
1600 get_builtin_face_cache_index (w, Vmodeline_face); 1602 assert (fi == DEFAULT_INDEX);
1603 fi = get_builtin_face_cache_index (w, Vmodeline_face);
1604 assert (fi == MODELINE_INDEX);
1601 XFRAME (w->frame)->window_face_cache_reset = 1; 1605 XFRAME (w->frame)->window_face_cache_reset = 1;
1602 } 1606 }
1603 } 1607 }
1604 1608
1605 void 1609 void