From 5f4457269e98f327c9795c797ed71fd6810a49c0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 29 Jun 2009 05:28:54 +0000 Subject: [PATCH] Remove useless if-before-xfree tests. * nsfont.m (nsfont_close): Remove useless test. * term.c (delete_tty): Likewise. * w32.c (system_process_attributes): Likewise. * w32font.c (w32font_close): Likewise. * xfaces.c (x_free_gc): Likewise. * xselect.c (buffer): Likewise. --- src/ChangeLog | 10 ++++++++++ src/nsfont.m | 6 ++---- src/term.c | 6 ++---- src/w32.c | 3 +-- src/w32font.c | 3 +-- src/xfaces.c | 3 +-- src/xselect.c | 3 +-- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8bee945b136..dcf58c7f631 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2009-06-29 Jim Meyering + + Remove useless if-before-xfree test. + * nsfont.m (nsfont_close): Remove useless test. + * term.c (delete_tty): Likewise. + * w32.c (system_process_attributes): Likewise. + * w32font.c (w32font_close): Likewise. + * xfaces.c (x_free_gc): Likewise. + * xselect.c (buffer): Likewise. + 2009-06-28 Andreas Schwab * process.c (send_process): Keep decoded string in a local diff --git a/src/nsfont.m b/src/nsfont.m index 68ed1e6dd36..7241af3048c 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -868,10 +868,8 @@ nsfont_close (FRAME_PTR f, struct font *font) for (i =0; i<0x100; i++) { - if (font_info->glyphs[i]) - xfree (font_info->glyphs[i]); - if (font_info->metrics[i]) - xfree (font_info->metrics[i]); + xfree (font_info->glyphs[i]); + xfree (font_info->metrics[i]); } [font_info->nsfont release]; #ifdef NS_IMPL_COCOA diff --git a/src/term.c b/src/term.c index fc778012e23..5176214b136 100644 --- a/src/term.c +++ b/src/term.c @@ -4018,10 +4018,8 @@ delete_tty (struct terminal *terminal) xfree (tty->old_tty); xfree (tty->Wcm); - if (tty->termcap_strings_buffer) - xfree (tty->termcap_strings_buffer); - if (tty->termcap_term_buffer) - xfree (tty->termcap_term_buffer); + xfree (tty->termcap_strings_buffer); + xfree (tty->termcap_term_buffer); bzero (tty, sizeof (struct tty_display_info)); xfree (tty); diff --git a/src/w32.c b/src/w32.c index cd95f60e84f..23da0bad937 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3995,8 +3995,7 @@ system_process_attributes (pid) } } } - if (buf) - xfree (buf); + xfree (buf); } if (!result) { diff --git a/src/w32font.c b/src/w32font.c index 4148e87c373..995500aa0e4 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -289,8 +289,7 @@ w32font_close (f, font) { for (i = 0; i < w32_font->n_cache_blocks; i++) { - if (w32_font->cached_metrics[i]) - xfree (w32_font->cached_metrics[i]); + xfree (w32_font->cached_metrics[i]); } xfree (w32_font->cached_metrics); w32_font->cached_metrics = NULL; diff --git a/src/xfaces.c b/src/xfaces.c index 704d7a92049..3faaf247296 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -785,8 +785,7 @@ x_free_gc (f, gc) struct frame *f; GC gc; { - if (gc) - xfree (gc); + xfree (gc); } #endif /* HAVE_NS */ diff --git a/src/xselect.c b/src/xselect.c index b9b8e0c1539..5cf4f74602c 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2395,8 +2395,7 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, if (!data || !format) { - if (data) - xfree (data); + xfree (data); return Qnil; } -- 2.39.2