comparison src/macterm.c @ 95481:4390d64d3328

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.
author Jim Meyering <jim@meyering.net>
date Mon, 02 Jun 2008 06:09:17 +0000
parents b6dc3d9d071d
children 953225ddde83
comparison
equal deleted inserted replaced
95480:1c16540a2329 95481:4390d64d3328
908 Pixmap pixmap; 908 Pixmap pixmap;
909 { 909 {
910 #if USE_MAC_IMAGE_IO 910 #if USE_MAC_IMAGE_IO
911 if (pixmap) 911 if (pixmap)
912 { 912 {
913 if (pixmap->data) 913 xfree (pixmap->data);
914 xfree (pixmap->data);
915 xfree (pixmap); 914 xfree (pixmap);
916 } 915 }
917 #else 916 #else
918 DisposeGWorld (pixmap); 917 DisposeGWorld (pixmap);
919 #endif 918 #endif
7388 if (FRAME_FACE_CACHE (f)) 7387 if (FRAME_FACE_CACHE (f))
7389 free_frame_faces (f); 7388 free_frame_faces (f);
7390 7389
7391 x_free_gcs (f); 7390 x_free_gcs (f);
7392 7391
7393 if (FRAME_SIZE_HINTS (f)) 7392 xfree (FRAME_SIZE_HINTS (f));
7394 xfree (FRAME_SIZE_HINTS (f));
7395 7393
7396 xfree (f->output_data.mac); 7394 xfree (f->output_data.mac);
7397 f->output_data.mac = NULL; 7395 f->output_data.mac = NULL;
7398 7396
7399 if (f == dpyinfo->x_focus_frame) 7397 if (f == dpyinfo->x_focus_frame)
7638 { 7636 {
7639 if (pat) 7637 if (pat)
7640 { 7638 {
7641 if (pat->buf) 7639 if (pat->buf)
7642 { 7640 {
7643 if (pat->blocks) 7641 xfree (pat->blocks);
7644 xfree (pat->blocks);
7645 xfree (pat->buf); 7642 xfree (pat->buf);
7646 } 7643 }
7647 xfree (pat); 7644 xfree (pat);
7648 } 7645 }
7649 } 7646 }
8362 else if (EQ (prev_family, family)) 8359 else if (EQ (prev_family, family))
8363 HASH_VALUE (h, j) = Fcons (long_to_cons (font_ids[i]), 8360 HASH_VALUE (h, j) = Fcons (long_to_cons (font_ids[i]),
8364 HASH_VALUE (h, j)); 8361 HASH_VALUE (h, j));
8365 prev_family = family; 8362 prev_family = family;
8366 } 8363 }
8367 if (font_ids) 8364 xfree (font_ids);
8368 xfree (font_ids);
8369 } 8365 }
8370 #endif 8366 #endif
8371 8367
8372 /* Create a dummy instance iterator here to avoid creating and 8368 /* Create a dummy instance iterator here to avoid creating and
8373 destroying it in the loop. */ 8369 destroying it in the loop. */
9240 if (font->mac_style) 9236 if (font->mac_style)
9241 { 9237 {
9242 int i; 9238 int i;
9243 9239
9244 for (i = font->min_byte1; i <= font->max_byte1; i++) 9240 for (i = font->min_byte1; i <= font->max_byte1; i++)
9245 if (font->bounds.rows[i]) 9241 xfree (font->bounds.rows[i]);
9246 xfree (font->bounds.rows[i]);
9247 xfree (font->bounds.rows); 9242 xfree (font->bounds.rows);
9248 ATSUDisposeStyle (font->mac_style); 9243 ATSUDisposeStyle (font->mac_style);
9249 } 9244 }
9250 else 9245 else
9251 #endif 9246 #endif
9252 if (font->bounds.per_char) 9247 xfree (font->bounds.per_char);
9253 xfree (font->bounds.per_char);
9254 #if USE_CG_TEXT_DRAWING 9248 #if USE_CG_TEXT_DRAWING
9255 if (font->cg_font) 9249 if (font->cg_font)
9256 CGFontRelease (font->cg_font); 9250 CGFontRelease (font->cg_font);
9257 if (font->cg_glyphs) 9251 xfree (font->cg_glyphs);
9258 xfree (font->cg_glyphs);
9259 #endif 9252 #endif
9260 xfree (font); 9253 xfree (font);
9261 } 9254 }
9262 9255
9263 9256
13024 xfree (dpyinfo->font_table[i].name); 13017 xfree (dpyinfo->font_table[i].name);
13025 } 13018 }
13026 13019
13027 if (dpyinfo->font_table) 13020 if (dpyinfo->font_table)
13028 { 13021 {
13029 if (dpyinfo->font_table->font_encoder) 13022 xfree (dpyinfo->font_table->font_encoder);
13030 xfree (dpyinfo->font_table->font_encoder);
13031 xfree (dpyinfo->font_table); 13023 xfree (dpyinfo->font_table);
13032 } 13024 }
13033 if (dpyinfo->mac_id_name) 13025 xfree (dpyinfo->mac_id_name);
13034 xfree (dpyinfo->mac_id_name);
13035 13026
13036 if (x_display_list == 0) 13027 if (x_display_list == 0)
13037 { 13028 {
13038 mac_clear_font_name_table (); 13029 mac_clear_font_name_table ();
13039 bzero (dpyinfo, sizeof (*dpyinfo)); 13030 bzero (dpyinfo, sizeof (*dpyinfo));