]> git.eshelyaron.com Git - emacs.git/commitdiff
* dispextern.h (struct face): Use bitfields for 'underline_type'
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 28 Oct 2013 10:58:01 +0000 (14:58 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Mon, 28 Oct 2013 10:58:01 +0000 (14:58 +0400)
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.

src/ChangeLog
src/dispextern.h
src/xdisp.c
src/xfaces.c

index d6f258ed1568893e38dbf8c81cc33f32d6656d0a..43ea7266bef48ca957fab03a0f51bbbae6e77253 100644 (file)
@@ -1,3 +1,14 @@
+2013-10-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * 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  <dmantipov@yandex.ru>
 
        * xftfont.c (struct xftfont_info): Remove set-but-unused
index 681eba25cb3d399e8ad18708ef28de5f34ad2b5f..c312fab448d0439e78667833247c234e807f61ff 100644 (file)
@@ -1581,6 +1581,10 @@ enum face_underline_type
 
 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 @@ struct face
      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 @@ struct face
      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 @@ struct face
      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 @@ struct face
   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;
 
index 395a74e4122a52c4411ed82cfb000b1892396ba7..d62bc6ba96cee4d57cb0a78bf004f7c3037aa8ad 100644 (file)
@@ -18615,7 +18615,9 @@ extend_face_to_end_of_line (struct it *it)
       && 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;
 
index 363d3bb0784e44dac19957c6fdbdc1f934430a9a..c0f5c45ec54e2277623f6820aaea40d6dc58a7d0 100644 (file)
@@ -1298,8 +1298,7 @@ load_face_colors (struct frame *f, struct face *face,
       && !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 @@ lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2)
 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 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE])
 
   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;