]> git.eshelyaron.com Git - emacs.git/commitdiff
* xfaces.c (make_face_cache): For struct face_cache, prefer
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 30 Jul 2013 13:40:46 +0000 (17:40 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 30 Jul 2013 13:40:46 +0000 (17:40 +0400)
xmalloc to xzalloc and so avoid redundant call to memset.
(Finternal_set_lisp_face_attribute): Fix comment typo and style.

src/ChangeLog
src/xfaces.c

index 79fce55c00315c762c316f2ec18a84abadb1e0f3..bfe4dfaf39a1edfe0f48905a3bbab805fb938f52 100644 (file)
@@ -1,3 +1,9 @@
+2013-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * 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  <dmantipov@yandex.ru>
 
        * fringe.c (draw_window_fringes, update_window_fringes)
index 7bf05fc85cdd1a4d2ba0b572585181689528e605..52cd65c029f5937deef4290a6bf50a7ce541d663 100644 (file)
@@ -3247,10 +3247,9 @@ FRAME 0 means change the face on all frames, and change the default
 #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 @@ If FRAME is unspecified or nil, the current frame is used.  */)
 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;