changeset 1365:249bf204004a

When g_new0() is used, drop redundant initializations to NULL, FALSE or 0.
author zas_
date Sun, 01 Mar 2009 21:06:55 +0000
parents 17f80c6be6b6
children ff3cd67235af
files src/image.c src/layout.c src/slideshow.c src/thumb.c src/thumb_standard.c src/ui_pathsel.c src/ui_tabcomp.c src/view_dir.c src/view_dir_list.c src/view_dir_tree.c src/view_file.c src/view_file_icon.c src/view_file_list.c
diffstat 13 files changed, 5 insertions(+), 115 deletions(-) [+]
line wrap: on
line diff
--- a/src/image.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/image.c	Sun Mar 01 21:06:55 2009 +0000
@@ -1711,49 +1711,17 @@
 
 	imd = g_new0(ImageWindow, 1);
 
-	imd->top_window = NULL;
-	imd->title = NULL;
-	imd->title_right = NULL;
-	imd->title_show_zoom = FALSE;
-
 	imd->unknown = TRUE;
-
 	imd->has_frame = -1; /* not initialized; for image_set_frame */
-	imd->top_window_sync = FALSE;
-
 	imd->delay_alter_type = ALTER_NONE;
-
-	imd->read_ahead_il = NULL;
-	imd->read_ahead_fd = NULL;
-
-	imd->completed = FALSE;
 	imd->state = IMAGE_STATE_NONE;
-
-	imd->color_profile_enable = FALSE;
-	imd->color_profile_input = 0;
-	imd->color_profile_screen = 0;
-	imd->color_profile_use_image = FALSE;
 	imd->color_profile_from_image = COLOR_PROFILE_NONE;
-
-	imd->auto_refresh = FALSE;
-
-	imd->delay_flip = FALSE;
-
-	imd->func_update = NULL;
-	imd->func_complete = NULL;
-	imd->func_tile_request = NULL;
-	imd->func_tile_dispose = NULL;
-
-	imd->func_button = NULL;
-	imd->func_scroll = NULL;
-
 	imd->orientation = 1;
 
 	imd->pr = GTK_WIDGET(pixbuf_renderer_new());
 
 	image_options_set(imd);
 
-
 	imd->widget = gtk_vbox_new(0, 0);
 
 	image_set_frame(imd, frame);
--- a/src/layout.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/layout.c	Sun Mar 01 21:06:55 2009 +0000
@@ -2016,15 +2016,9 @@
 
 //	lw->options.tools_float = popped;
 //	lw->options.tools_hidden = hidden;
-
-	lw->utility_box = NULL;
-	lw->bar_sort = NULL;
 //	lw->bar_sort_enabled = options->panels.sort.enabled;
-
-	lw->bar = NULL;
 //	lw->bar_enabled = options->panels.info.enabled;
 
-	lw->exif_window = NULL;
 	/* default layout */
 
 	layout_config_parse(lw->options.style, lw->options.order,
--- a/src/slideshow.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/slideshow.c	Sun Mar 01 21:06:55 2009 +0000
@@ -358,21 +358,10 @@
 	ss = g_new0(SlideShowData, 1);
 
 	ss->imd = imd;
-
 	ss->filelist = filelist;
 	ss->cd = cd;
 	ss->layout = lw;
-	ss->dir_fd = NULL;
-
-	ss->list = NULL;
-	ss->list_done = NULL;
-
-	ss->from_selection = FALSE;
-
-	ss->stop_func = NULL;
-
 	ss->timeout_id = -1;
-	ss->paused = FALSE;
 
 	if (ss->filelist)
 		{
--- a/src/thumb.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/thumb.c	Sun Mar 01 21:06:55 2009 +0000
@@ -475,16 +475,11 @@
 		}
 
 	tl = g_new0(ThumbLoader, 1);
-	tl->standard_loader = FALSE;
-	tl->fd = NULL;
+	
 	tl->cache_enable = options->thumbnails.enable_caching;
-	tl->cache_hit = FALSE;
 	tl->percent_done = 0.0;
 	tl->max_w = width;
 	tl->max_h = height;
-
-	tl->il = NULL;
-
 	tl->idle_done_id = -1;
 
 	return tl;
--- a/src/thumb_standard.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/thumb_standard.c	Sun Mar 01 21:06:55 2009 +0000
@@ -76,16 +76,9 @@
 	tl = g_new0(ThumbLoaderStd, 1);
 
 	tl->standard_loader = TRUE;
-
 	tl->requested_width = width;
 	tl->requested_height = height;
-
-	tl->il = NULL;
-	tl->fd = NULL;
-
 	tl->cache_enable = options->thumbnails.enable_caching;
-	tl->cache_local = FALSE;
-	tl->cache_retry = FALSE;
 
 	return tl;
 }
--- a/src/ui_pathsel.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/ui_pathsel.c	Sun Mar 01 21:06:55 2009 +0000
@@ -1033,10 +1033,6 @@
 	GtkCellRenderer *renderer;
 
 	dd = g_new0(Dest_Data, 1);
-	dd->show_hidden = FALSE;
-	dd->select_func = NULL;
-	dd->select_data = NULL;
-	dd->gd = NULL;
 
 	table = gtk_table_new(4, (filter != NULL) ? 3 : 1, FALSE);
 	gtk_table_set_col_spacings(GTK_TABLE(table), PREF_PAD_GAP);
--- a/src/ui_tabcomp.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/ui_tabcomp.c	Sun Mar 01 21:06:55 2009 +0000
@@ -798,17 +798,10 @@
 		}
 
 	td = g_new0(TabCompData, 1);
+
 	td->entry = entry;
-	td->dir_path = NULL;
-	td->file_list = NULL;
 	td->enter_func = enter_func;
 	td->enter_data = data;
-	td->tab_func = NULL;
-	td->tab_data = NULL;
-
-	td->has_history = FALSE;
-	td->history_key = NULL;
-	td->history_levels = 0;
 
 	g_object_set_data(G_OBJECT(td->entry), "tab_completion_data", td);
 
--- a/src/view_dir.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/view_dir.c	Sun Mar 01 21:06:55 2009 +0000
@@ -67,18 +67,7 @@
 
 	ViewDir *vd = g_new0(ViewDir, 1);
 
-	vd->dir_fd = NULL;
-	vd->click_fd = NULL;
-
-	vd->drop_fd = NULL;
-	vd->drop_list = NULL;
 	vd->drop_scroll_id = -1;
-	vd->drop_list = NULL;
-
-	vd->popup = NULL;
-
-	vd->dnd_drop_leave_func = NULL;
-	vd->dnd_drop_update_func = NULL;
 
 	vd->widget = gtk_scrolled_window_new(NULL, NULL);
 	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(vd->widget), GTK_SHADOW_IN);
--- a/src/view_dir_list.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/view_dir_list.c	Sun Mar 01 21:06:55 2009 +0000
@@ -438,10 +438,9 @@
 	GtkCellRenderer *renderer;
 
 	vd->info = g_new0(ViewDirInfoList, 1);
+
 	vd->type = DIRVIEW_LIST;
 
-	VDLIST(vd)->list = NULL;
-
 	store = gtk_list_store_new(5, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING);
 	vd->view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
 	g_object_unref(store);
--- a/src/view_dir_tree.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/view_dir_tree.c	Sun Mar 01 21:06:55 2009 +0000
@@ -957,10 +957,9 @@
 	GtkCellRenderer *renderer;
 
 	vd->info = g_new0(ViewDirInfoTree, 1);
+
 	vd->type = DIRVIEW_TREE;
-
 	VDTREE(vd)->drop_expand_id = -1;
-	VDTREE(vd)->busy_ref = 0;
 
 	vd->dnd_drop_leave_func = vdtree_dnd_drop_expand_cancel;
 	vd->dnd_drop_update_func = vdtree_dnd_drop_expand;
--- a/src/view_file.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/view_file.c	Sun Mar 01 21:06:55 2009 +0000
@@ -679,21 +679,10 @@
 	ViewFile *vf;
 
 	vf = g_new0(ViewFile, 1);
+	
 	vf->type = type;
-
-	vf->info = NULL;
-	vf->dir_fd = NULL;
-	vf->list = NULL;
-
 	vf->sort_method = SORT_NAME;
 	vf->sort_ascend = TRUE;
-	
-	vf->thumbs_running = FALSE;
-	vf->thumbs_loader = NULL;
-	vf->thumbs_filedata = NULL;
-
-	vf->popup = NULL;
-
 	vf->refresh_idle_id = -1;
 
 	vf->scrolled = gtk_scrolled_window_new(NULL, NULL);
--- a/src/view_file_icon.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/view_file_icon.c	Sun Mar 01 21:06:55 2009 +0000
@@ -2475,16 +2475,7 @@
 
 	vf->info = g_new0(ViewFileInfoIcon, 1);
 
-	VFICON(vf)->selection = NULL;
-	VFICON(vf)->prev_selection = NULL;
-
-	VFICON(vf)->tip_window = NULL;
 	VFICON(vf)->tip_delay_id = -1;
-
-	VFICON(vf)->focus_row = 0;
-	VFICON(vf)->focus_column = 0;
-	VFICON(vf)->focus_id = NULL;
-
 	VFICON(vf)->show_text = options->show_icon_names;
 
 	store = gtk_list_store_new(1, G_TYPE_POINTER);
--- a/src/view_file_list.c	Sun Mar 01 19:48:38 2009 +0000
+++ b/src/view_file_list.c	Sun Mar 01 21:06:55 2009 +0000
@@ -1936,17 +1936,12 @@
 {
 	GtkTreeStore *store;
 	GtkTreeSelection *selection;
-
 	GType flist_types[FILE_COLUMN_COUNT];
 	gint i;
 	gint column;
 
 	vf->info = g_new0(ViewFileInfoList, 1);
 	
-	VFLIST(vf)->click_fd = NULL;
-	VFLIST(vf)->select_fd = NULL;
-	VFLIST(vf)->thumbs_enabled = FALSE;
-
 	VFLIST(vf)->select_idle_id = -1;
 
 	flist_types[FILE_COLUMN_POINTER] = G_TYPE_POINTER;