aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorJim Meyering2008-06-02 06:09:17 +0000
committerJim Meyering2008-06-02 06:09:17 +0000
commit70fdbb46cd40f9376333e10c9284873d3a3a787f (patch)
treed087a93bc6d9be911fce5e28e1112f6c5dfddb09 /src/term.c
parent5c19cd0bbb8f3b8142c0b8f90eebdd84b7a3eb29 (diff)
downloademacs-70fdbb46cd40f9376333e10c9284873d3a3a787f.tar.gz
emacs-70fdbb46cd40f9376333e10c9284873d3a3a787f.zip
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
* src/alloc.c (xfree): Return right away for a NULL arg. * src/lread.c (nosuffix): Remove now-useless if-before-xfree tests. * src/gtkutil.c (xg_gtk_scroll_destroy): Likewise. * src/mac.c (create_apple_event_from_event_ref): Likewise. (create_apple_event_from_drag_ref, cfstring_create_normalized): Likewise. * src/doprnt.c (doprnt1): Likewise. * src/frame.c (frame): Likewise. * src/keyboard.c (wipe_kboard): Likewise. * src/macterm.c (x_free_frame_resources, xlfdpat_destroy, XFreePixmap): (init_font_name_table, mac_unload_font, x_delete_display): Likewise. * src/term.c (tty_default_color_capabilities, maybe_fatal) (delete_tty): Likewise. * src/w16select.c (string): Likewise. * src/w32.c (w32_get_resource, SET_ENV_BUF_SIZE): Likewise. * src/w32bdf.c (w32_free_bdf_font): Likewise. * src/w32fns.c (w32_unload_font): Likewise. * src/w32font.c (w32font_close): Likewise. * src/window.c (size_window): Likewise. * src/xselect.c (receive_incremental_selection): Likewise. * src/xterm.c (x_free_frame_resources, x_delete_display): Likewise. * src/mactoolbox.c (create_apple_event_from_drag_ref): Likewise. * src/w32.c (stat): Likewise.
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/term.c b/src/term.c
index 7636f22db75..533104dc040 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2090,17 +2090,14 @@ tty_default_color_capabilities (struct tty_display_info *tty, int save)
2090 2090
2091 if (save) 2091 if (save)
2092 { 2092 {
2093 if (default_orig_pair) 2093 xfree (default_orig_pair);
2094 xfree (default_orig_pair);
2095 default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL; 2094 default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL;
2096 2095
2097 if (default_set_foreground) 2096 xfree (default_set_foreground);
2098 xfree (default_set_foreground);
2099 default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground) 2097 default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground)
2100 : NULL; 2098 : NULL;
2101 2099
2102 if (default_set_background) 2100 xfree (default_set_background);
2103 xfree (default_set_background);
2104 default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background) 2101 default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background)
2105 : NULL; 2102 : NULL;
2106 2103
@@ -3833,8 +3830,7 @@ maybe_fatal (must_succeed, buffer, terminal, str1, str2, arg1, arg2)
3833 struct terminal *terminal; 3830 struct terminal *terminal;
3834 char *str1, *str2, *arg1, *arg2; 3831 char *str1, *str2, *arg1, *arg2;
3835{ 3832{
3836 if (buffer) 3833 xfree (buffer);
3837 xfree (buffer);
3838 3834
3839 if (terminal) 3835 if (terminal)
3840 delete_tty (terminal); 3836 delete_tty (terminal);
@@ -3915,11 +3911,8 @@ delete_tty (struct terminal *terminal)
3915 3911
3916 delete_terminal (terminal); 3912 delete_terminal (terminal);
3917 3913
3918 if (tty->name) 3914 xfree (tty->name);
3919 xfree (tty->name); 3915 xfree (tty->type);
3920
3921 if (tty->type)
3922 xfree (tty->type);
3923 3916
3924 if (tty->input) 3917 if (tty->input)
3925 { 3918 {
@@ -3932,11 +3925,8 @@ delete_tty (struct terminal *terminal)
3932 if (tty->termscript) 3925 if (tty->termscript)
3933 fclose (tty->termscript); 3926 fclose (tty->termscript);
3934 3927
3935 if (tty->old_tty) 3928 xfree (tty->old_tty);
3936 xfree (tty->old_tty); 3929 xfree (tty->Wcm);
3937
3938 if (tty->Wcm)
3939 xfree (tty->Wcm);
3940 3930
3941 bzero (tty, sizeof (struct tty_display_info)); 3931 bzero (tty, sizeof (struct tty_display_info));
3942 xfree (tty); 3932 xfree (tty);