]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove useless if-before-xfree tests.
authorJim Meyering <jim@meyering.net>
Mon, 29 Jun 2009 05:28:54 +0000 (05:28 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 29 Jun 2009 05:28:54 +0000 (05:28 +0000)
* 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
src/nsfont.m
src/term.c
src/w32.c
src/w32font.c
src/xfaces.c
src/xselect.c

index 8bee945b1360170a05d381579ce6a2753f755f4c..dcf58c7f631bedda5fdff9abc0f01a0af10bddf6 100644 (file)
@@ -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
index 68ed1e6dd360f3a91afa97f3b350900d2c1405f4..7241af3048cb69f5abfffa775745fb94467e0b7f 100644 (file)
@@ -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
index fc778012e23f596b30ab1370e3bfeb28e2fbcd79..5176214b13688c4a42436492f60da01d3cac90d5 100644 (file)
@@ -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);
index cd95f60e84fa0a9ac8d496120f4c5d129928d8c4..23da0bad9376d8d28f9ba066b2d32718a1b3fc33 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -3995,8 +3995,7 @@ system_process_attributes (pid)
                }
            }
        }
-      if (buf)
-       xfree (buf);
+      xfree (buf);
     }
   if (!result)
     {
index 4148e87c3733c9a35764e299f0858253b1f5cdb1..995500aa0e401b37409892e8b076cb6400e8e479 100644 (file)
@@ -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;
index 704d7a92049f108291cd27749e4cd418c6627024..3faaf247296f6f57f45d4a258106a91e4f58f093 100644 (file)
@@ -785,8 +785,7 @@ x_free_gc (f, gc)
      struct frame *f;
      GC gc;
 {
-  if (gc)
-      xfree (gc);
+  xfree (gc);
 }
 #endif  /* HAVE_NS */
 
index b9b8e0c15391e8af71716f2cbea4fa783f58dead..5cf4f74602c1168a455ad4d8ba1200b17abfe3b8 100644 (file)
@@ -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;
     }