changeset 103624:3e06f0e66062

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.
author Jim Meyering <jim@meyering.net>
date Mon, 29 Jun 2009 05:28:54 +0000
parents e5da8db417c0
children bbccbecdb55b
files src/ChangeLog src/nsfont.m src/term.c src/w32.c src/w32font.c src/xfaces.c src/xselect.c
diffstat 7 files changed, 18 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Jun 29 05:27:53 2009 +0000
+++ b/src/ChangeLog	Mon Jun 29 05:28:54 2009 +0000
@@ -1,3 +1,13 @@
+2009-06-29  Jim Meyering  <meyering@redhat.com>
+
+	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  <schwab@linux-m68k.org>
 
 	* process.c (send_process): Keep decoded string in a local
--- a/src/nsfont.m	Mon Jun 29 05:27:53 2009 +0000
+++ b/src/nsfont.m	Mon Jun 29 05:28:54 2009 +0000
@@ -868,10 +868,8 @@
 
   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
--- a/src/term.c	Mon Jun 29 05:27:53 2009 +0000
+++ b/src/term.c	Mon Jun 29 05:28:54 2009 +0000
@@ -4018,10 +4018,8 @@
 
   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);
--- a/src/w32.c	Mon Jun 29 05:27:53 2009 +0000
+++ b/src/w32.c	Mon Jun 29 05:28:54 2009 +0000
@@ -3995,8 +3995,7 @@
 		}
 	    }
 	}
-      if (buf)
-	xfree (buf);
+      xfree (buf);
     }
   if (!result)
     {
--- a/src/w32font.c	Mon Jun 29 05:27:53 2009 +0000
+++ b/src/w32font.c	Mon Jun 29 05:28:54 2009 +0000
@@ -289,8 +289,7 @@
     {
       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;
--- a/src/xfaces.c	Mon Jun 29 05:27:53 2009 +0000
+++ b/src/xfaces.c	Mon Jun 29 05:28:54 2009 +0000
@@ -785,8 +785,7 @@
      struct frame *f;
      GC gc;
 {
-  if (gc)
-      xfree (gc);
+  xfree (gc);
 }
 #endif  /* HAVE_NS */
 
--- a/src/xselect.c	Mon Jun 29 05:27:53 2009 +0000
+++ b/src/xselect.c	Mon Jun 29 05:28:54 2009 +0000
@@ -2395,8 +2395,7 @@
 
   if (!data || !format)
     {
-      if (data)
-	xfree (data);
+      xfree (data);
       return Qnil;
     }