When g_new0() is used, drop redundant initializations to NULL, FALSE or 0.
authorLaurent Monin <geeqie@norz.org>
Sun, 1 Mar 2009 21:06:55 +0000 (21:06 +0000)
committerLaurent Monin <geeqie@norz.org>
Sun, 1 Mar 2009 21:06:55 +0000 (21:06 +0000)
13 files changed:
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

index 63594b7..ca7d93a 100644 (file)
@@ -1711,49 +1711,17 @@ ImageWindow *image_new(gint frame)
 
        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);
index 3d26385..dcbd314 100644 (file)
@@ -2016,15 +2016,9 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
 
 //     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,
index 386acbc..5292de0 100644 (file)
@@ -358,21 +358,10 @@ static SlideShowData *real_slideshow_start(ImageWindow *imd, LayoutWindow *lw,
        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)
                {
index 0021be6..12c7a0f 100644 (file)
@@ -475,16 +475,11 @@ ThumbLoader *thumb_loader_new(gint width, gint height)
                }
 
        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;
index 0657a8d..5697539 100644 (file)
@@ -76,16 +76,9 @@ ThumbLoaderStd *thumb_loader_std_new(gint width, gint height)
        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;
 }
index 22f1aeb..e4a7cc3 100644 (file)
@@ -1033,10 +1033,6 @@ GtkWidget *path_selection_new_with_files(GtkWidget *entry, const gchar *path,
        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);
index 4910731..231c2ad 100644 (file)
@@ -798,17 +798,10 @@ void tab_completion_add_to_entry(GtkWidget *entry, void (*enter_func)(const gcha
                }
 
        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);
 
index 5e0712d..d0dda92 100644 (file)
@@ -67,18 +67,7 @@ ViewDir *vd_new(DirViewType type, FileData *dir_fd)
 
        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);
index 4eabd42..e8462db 100644 (file)
@@ -438,9 +438,8 @@ ViewDir *vdlist_new(ViewDir *vd, FileData *dir_fd)
        GtkCellRenderer *renderer;
 
        vd->info = g_new0(ViewDirInfoList, 1);
-       vd->type = DIRVIEW_LIST;
 
-       VDLIST(vd)->list = NULL;
+       vd->type = DIRVIEW_LIST;
 
        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));
index d32961d..bf3fd5f 100644 (file)
@@ -957,10 +957,9 @@ ViewDir *vdtree_new(ViewDir *vd, FileData *dir_fd)
        GtkCellRenderer *renderer;
 
        vd->info = g_new0(ViewDirInfoTree, 1);
-       vd->type = DIRVIEW_TREE;
 
+       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;
index fe1ced1..22e951f 100644 (file)
@@ -679,21 +679,10 @@ ViewFile *vf_new(FileViewType type, FileData *dir_fd)
        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);
index 40d39e2..1161ef6 100644 (file)
@@ -2475,16 +2475,7 @@ ViewFile *vficon_new(ViewFile *vf, FileData *dir_fd)
 
        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);
index 030e052..517ca92 100644 (file)
@@ -1936,17 +1936,12 @@ ViewFile *vflist_new(ViewFile *vf, FileData *dir_fd)
 {
        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;