From 9c25330708e49ddaeb71f16a65cdc1b51be2a27d Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Thu, 15 Aug 2013 09:23:40 +0400 Subject: * term.c (get_named_tty, create_tty_output, tty_free_frame_resources) (tty_free_frame_resources, delete_tty): Prefer eassert to emacs_abort. * image.c (make_image_cache): For struct image_cache, prefer xmalloc to xzalloc and so avoid redundant call to memset. * xterm.c (x_term_init): Avoid unnecessary initializations of dpyinfo members because it is allocated with xzalloc and so already zeroed. --- src/image.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/image.c') diff --git a/src/image.c b/src/image.c index f71ba211d44..8d969a6f9c6 100644 --- a/src/image.c +++ b/src/image.c @@ -1360,14 +1360,12 @@ static void cache_image (struct frame *f, struct image *img); struct image_cache * make_image_cache (void) { - struct image_cache *c = xzalloc (sizeof *c); - int size; - - size = 50; - c->images = xmalloc (size * sizeof *c->images); - c->size = size; - size = IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; - c->buckets = xzalloc (size); + struct image_cache *c = xmalloc (sizeof *c); + + c->size = 50; + c->used = c->refcount = 0; + c->images = xmalloc (c->size * sizeof *c->images); + c->buckets = xzalloc (IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets); return c; } -- cgit v1.2.3