emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113596: * xfaces.c (make_face_cache): For struct fa


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r113596: * xfaces.c (make_face_cache): For struct face_cache, prefer
Date: Tue, 30 Jul 2013 13:41:00 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113596
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2013-07-30 17:40:46 +0400
message:
  * xfaces.c (make_face_cache): For struct face_cache, prefer
  xmalloc to xzalloc and so avoid redundant call to memset.
  (Finternal_set_lisp_face_attribute): Fix comment typo and style.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-07-30 05:56:18 +0000
+++ b/src/ChangeLog     2013-07-30 13:40:46 +0000
@@ -1,5 +1,11 @@
 2013-07-30  Dmitry Antipov  <address@hidden>
 
+       * xfaces.c (make_face_cache): For struct face_cache, prefer
+       xmalloc to xzalloc and so avoid redundant call to memset.
+       (Finternal_set_lisp_face_attribute): Fix comment typo and style.
+
+2013-07-30  Dmitry Antipov  <address@hidden>
+
        * fringe.c (draw_window_fringes, update_window_fringes)
        (compute_fringe_widths):
        * w32term.c (x_draw_glyph_string):

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2013-07-30 05:56:18 +0000
+++ b/src/xfaces.c      2013-07-30 13:40:46 +0000
@@ -3247,10 +3247,9 @@
 #endif /* HAVE_WINDOW_SYSTEM */
       else if (EQ (face, Qmenu))
        {
-         /* Indicate that we have to update the menu bar when
-            realizing faces on FRAME.  FRAME t change the
-            default for new frames.  We do this by setting
-            setting the flag in new face caches   */
+         /* Indicate that we have to update the menu bar when realizing
+            faces on FRAME.  FRAME t change the default for new frames.
+            We do this by setting the flag in new face caches.  */
          if (FRAMEP (frame))
            {
              struct frame *f = XFRAME (frame);
@@ -4167,13 +4166,11 @@
 static struct face_cache *
 make_face_cache (struct frame *f)
 {
-  struct face_cache *c;
-  int size;
+  struct face_cache *c = xmalloc (sizeof *c);
 
-  c = xzalloc (sizeof *c);
-  size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets;
-  c->buckets = xzalloc (size);
+  c->buckets = xzalloc (FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets);
   c->size = 50;
+  c->used = 0;
   c->faces_by_id = xmalloc (c->size * sizeof *c->faces_by_id);
   c->f = f;
   c->menu_face_changed_p = menu_face_changed_default;


reply via email to

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