diff 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
line wrap: on
line diff
--- a/src/faces.c	Wed Oct 03 10:06:42 2007 +0000
+++ b/src/faces.c	Wed Oct 03 13:28:21 2007 +0000
@@ -1584,6 +1584,7 @@
   if (w->face_cachels)
     {
       int i;
+      face_index fi;
 
       for (i = 0; i < Dynarr_length (w->face_cachels); i++)
 	{
@@ -1594,10 +1595,13 @@
       Dynarr_reset (w->face_cachels);
       /* #### NOTE: be careful with the order !
 	 The cpp macros DEFAULT_INDEX and MODELINE_INDEX defined in
-	 redisplay.h depend on the code below, which is really clumsy.
+	 redisplay.h depend on the code below. Please make sure to assert the
+	 correct values if you ever add new built-in faces here.
 	 -- dvl */
-      get_builtin_face_cache_index (w, Vdefault_face);
-      get_builtin_face_cache_index (w, Vmodeline_face);
+      fi = get_builtin_face_cache_index (w, Vdefault_face);
+      assert (fi == DEFAULT_INDEX);
+      fi = get_builtin_face_cache_index (w, Vmodeline_face);
+      assert (fi == MODELINE_INDEX);
       XFRAME (w->frame)->window_face_cache_reset = 1;
     }
 }