emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114831: * dispextern.h (struct face): Use bitfields


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r114831: * dispextern.h (struct face): Use bitfields for 'underline_type'
Date: Mon, 28 Oct 2013 10:58:44 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114831
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Mon 2013-10-28 14:58:01 +0400
message:
  * dispextern.h (struct face): Use bitfields for 'underline_type'
  and 'box' members.  Remove set-but-unused members 'pixmap_w' and
  'pixmap_h'.  If not HAVE_WINDOW_SYSTEM, also remove dummy
  'stipple' member.  Move 'lface' member up to help...
  * xfaces.c (make_realized_face): ...this function to find and
  clear just the members that need clearing.
  (load_face_colors, realize_x_face):
  * xdisp.c (extend_face_to_end_of_line): Adjust user.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/dispextern.h               
dispextern.h-20091113204419-o5vbwnq5f7feedwu-218
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-10-27 05:30:34 +0000
+++ b/src/ChangeLog     2013-10-28 10:58:01 +0000
@@ -1,3 +1,14 @@
+2013-10-28  Dmitry Antipov  <address@hidden>
+
+       * dispextern.h (struct face): Use bitfields for 'underline_type'
+       and 'box' members.  Remove set-but-unused members 'pixmap_w' and
+       'pixmap_h'.  If not HAVE_WINDOW_SYSTEM, also remove dummy
+       'stipple' member.  Move 'lface' member up to help...
+       * xfaces.c (make_realized_face): ...this function to find and
+       clear just the members that need clearing.
+       (load_face_colors, realize_x_face):
+       * xdisp.c (extend_face_to_end_of_line): Adjust user.
+
 2013-10-27  Dmitry Antipov  <address@hidden>
 
        * xftfont.c (struct xftfont_info): Remove set-but-unused

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2013-10-17 06:42:21 +0000
+++ b/src/dispextern.h  2013-10-28 10:58:01 +0000
@@ -1581,6 +1581,10 @@
 
 struct face
 {
+  /* The Lisp face attributes this face realizes.  All attributes
+     in this vector are non-nil.  */
+  Lisp_Object lface[LFACE_VECTOR_SIZE];
+
   /* The id of this face.  The id equals the index of this face in the
      vector faces_by_id of its face cache.  */
   int id;
@@ -1595,11 +1599,6 @@
      an id as returned from load_pixmap.  */
   ptrdiff_t stipple;
 
-#else /* not HAVE_WINDOW_SYSTEM */
-
-  /* Dummy.  */
-  ptrdiff_t stipple;
-
 #endif /* not HAVE_WINDOW_SYSTEM */
 
   /* Pixel value of foreground color for X frames.  Color index
@@ -1624,9 +1623,6 @@
      from the same ASCII face have the same fontset.  */
   int fontset;
 
-  /* Pixmap width and height.  */
-  unsigned int pixmap_w, pixmap_h;
-
   /* Non-zero means characters in this face have a box of that
      thickness around them.  If this value is negative, its absolute
      value indicates the thickness, and the horizontal (top and
@@ -1640,10 +1636,10 @@
      of width box_line_width is drawn in color box_color.  A value of
      FACE_RAISED_BOX or FACE_SUNKEN_BOX means a 3D box is drawn with
      shadow colors derived from the background color of the face.  */
-  enum face_box_type box;
+  ENUM_BF (face_box_type) box : 2;
 
   /* Style of underlining. */
-  enum face_underline_type underline_type;
+  ENUM_BF (face_underline_type) underline_type : 1;
 
   /* If `box' above specifies a 3D type, 1 means use box_color for
      drawing shadows.  */
@@ -1695,10 +1691,6 @@
   unsigned synth_ital : 1;
 #endif
 
-  /* The Lisp face attributes this face realizes.  All attributes
-     in this vector are non-nil.  */
-  Lisp_Object lface[LFACE_VECTOR_SIZE];
-
   /* The hash value of this face.  */
   unsigned hash;
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2013-10-17 06:42:21 +0000
+++ b/src/xdisp.c       2013-10-28 10:58:01 +0000
@@ -18615,7 +18615,9 @@
       && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row)
       && face->box == FACE_NO_BOX
       && face->background == FRAME_BACKGROUND_PIXEL (f)
+#ifdef HAVE_WINDOW_SYSTEM
       && !face->stipple
+#endif
       && !it->glyph_row->reversed_p)
     return;
 

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2013-10-17 06:42:21 +0000
+++ b/src/xfaces.c      2013-10-28 10:58:01 +0000
@@ -1298,8 +1298,7 @@
       && !NILP (Fbitmap_spec_p (Vface_default_stipple)))
     {
       x_destroy_bitmap (f, face->stipple);
-      face->stipple = load_pixmap (f, Vface_default_stipple,
-                                  &face->pixmap_w, &face->pixmap_h);
+      face->stipple = load_pixmap (f, Vface_default_stipple, NULL, NULL);
     }
 
   face->background = load_color (f, face, bg, LFACE_BACKGROUND_INDEX);
@@ -4018,9 +4017,13 @@
 static struct face *
 make_realized_face (Lisp_Object *attr)
 {
-  struct face *face = xzalloc (sizeof *face);
-  face->ascii_face = face;
+  enum { off = offsetof (struct face, id) };
+  struct face *face = xmalloc (sizeof *face);
+
   memcpy (face->lface, attr, sizeof face->lface);
+  memset (&face->id, 0, sizeof *face - off);
+  face->ascii_face = face;
+
   return face;
 }
 
@@ -5716,7 +5719,7 @@
 
   stipple = attrs[LFACE_STIPPLE_INDEX];
   if (!NILP (stipple))
-    face->stipple = load_pixmap (f, stipple, &face->pixmap_w, &face->pixmap_h);
+    face->stipple = load_pixmap (f, stipple, NULL, NULL);
 #endif /* HAVE_WINDOW_SYSTEM */
 
   return face;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]