CVS update by didierv xemacs/src ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Wed Oct 3 09:28:24 EDT 2007


  User: didierv 
  Date: 07/10/03 15:28:24

  Modified:    xemacs/src ChangeLog faces.c
Log:
Assert correct order in face cache

Revision  Changes    Path
1.1101    +5 -0      XEmacs/xemacs/src/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.1100
retrieving revision 1.1101
diff -u -p -r1.1100 -r1.1101
--- ChangeLog	2007/10/03 10:06:39	1.1100
+++ ChangeLog	2007/10/03 13:28:19	1.1101
@@ -1,5 +1,10 @@
 2007-10-03  Didier Verna  <didier at xemacs.org>
 
+	* faces.c (reset_face_cachels): Assert correct order of built-in
+	faces additions to the face cache, as per suggestion from Aidan.
+
+2007-10-03  Didier Verna  <didier at xemacs.org>
+
 	Again, fix some DEFAULT_INDEX == 0 assumptions. Actually, properly
 	initialize display_line structures.
 



1.57      +7 -3      XEmacs/xemacs/src/faces.c

Index: faces.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/faces.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -p -r1.56 -r1.57
--- faces.c	2007/09/26 13:28:00	1.56
+++ faces.c	2007/10/03 13:28:21	1.57
@@ -1584,6 +1584,7 @@ reset_face_cachels (struct window *w)
   if (w->face_cachels)
     {
       int i;
+      face_index fi;
 
       for (i = 0; i < Dynarr_length (w->face_cachels); i++)
 	{
@@ -1594,10 +1595,13 @@ reset_face_cachels (struct window *w)
       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;
     }
 }





More information about the XEmacs-CVS mailing list