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/term.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/term.c') diff --git a/src/term.c b/src/term.c index fb69aefbe7a..2966466aed2 100644 --- a/src/term.c +++ b/src/term.c @@ -2233,8 +2233,7 @@ get_named_tty (const char *name) { struct terminal *t; - if (!name) - emacs_abort (); + eassert (name); for (t = terminal_list; t; t = t->next_terminal) { @@ -2786,8 +2785,7 @@ create_tty_output (struct frame *f) { struct tty_output *t = xzalloc (sizeof *t); - if (! FRAME_TERMCAP_P (f)) - emacs_abort (); + eassert (FRAME_TERMCAP_P (f)); t->display_info = FRAME_TERMINAL (f)->display_info.tty; @@ -2799,8 +2797,7 @@ create_tty_output (struct frame *f) static void tty_free_frame_resources (struct frame *f) { - if (! FRAME_TERMCAP_P (f)) - emacs_abort (); + eassert (FRAME_TERMCAP_P (f)); if (FRAME_FACE_CACHE (f)) free_frame_faces (f); @@ -2815,8 +2812,7 @@ tty_free_frame_resources (struct frame *f) static void tty_free_frame_resources (struct frame *f) { - if (! FRAME_TERMCAP_P (f) && ! FRAME_MSDOS_P (f)) - emacs_abort (); + eassert (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)); if (FRAME_FACE_CACHE (f)) free_frame_faces (f); @@ -3443,8 +3439,7 @@ delete_tty (struct terminal *terminal) if (!terminal->name) return; - if (terminal->type != output_termcap) - emacs_abort (); + eassert (terminal->type == output_termcap); tty = terminal->display_info.tty; -- cgit v1.2.3