clang-tidy: modernize-use-auto
authorRosen Penev <rosenp@gmail.com>
Sun, 4 Jun 2023 07:55:57 +0000 (00:55 -0700)
committerColin Clark <colin.clark@cclark.uk>
Sun, 4 Jun 2023 10:09:12 +0000 (11:09 +0100)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
88 files changed:
src/advanced-exif.cc
src/bar-comment.cc
src/bar-exif.cc
src/bar-histogram.cc
src/bar-keywords.cc
src/bar-rating.cc
src/bar-sort.cc
src/bar.cc
src/cache-loader.cc
src/cache-maint.cc
src/cellrenderericon.cc
src/collect-dlg.cc
src/collect-io.cc
src/collect-table.cc
src/collect.cc
src/debug.cc
src/desktop-file.cc
src/dnd.cc
src/dupe.cc
src/editors.cc
src/exiv2.cc
src/filecache.cc
src/filedata.cc
src/filefilter.cc
src/fullscreen.cc
src/histogram.cc
src/history-list.cc
src/image-load-collection.cc
src/image-load-cr3.cc
src/image-load-dds.cc
src/image-load-external.cc
src/image-load-ffmpegthumbnailer.cc
src/image-load-jpeg.cc
src/image-load-psd.cc
src/image-load-zxscr.cc
src/image-load.cc
src/image-overlay.cc
src/image.cc
src/img-view.cc
src/jpeg-parser.cc
src/layout-config.cc
src/layout-image.cc
src/layout-util.cc
src/layout.cc
src/logwindow.cc
src/main.cc
src/menu.cc
src/metadata.cc
src/osd.cc
src/pan-view/pan-calendar.cc
src/pan-view/pan-folder.cc
src/pan-view/pan-item.cc
src/pan-view/pan-view-filter.cc
src/pan-view/pan-view-search.cc
src/pan-view/pan-view.cc
src/pixbuf-renderer.cc
src/preferences.cc
src/print.cc
src/rcfile.cc
src/remote.cc
src/renderer-tiles.cc
src/search-and-run.cc
src/search.cc
src/shortcuts.cc
src/similar.cc
src/slideshow.cc
src/thumb-standard.cc
src/thumb.cc
src/toolbar.cc
src/ui-bookmark.cc
src/ui-fileops.cc
src/ui-help.cc
src/ui-misc.cc
src/ui-pathsel.cc
src/ui-spinner.cc
src/ui-tabcomp.cc
src/ui-tree-edit.cc
src/ui-utildlg.cc
src/uri-utils.cc
src/utilops.cc
src/view-dir-list.cc
src/view-dir-tree.cc
src/view-dir.cc
src/view-file/view-file-icon.cc
src/view-file/view-file-list.cc
src/view-file/view-file.cc
src/window.cc
src/zonedetect.cc

index 6a8cf0f..10807ae 100644 (file)
@@ -281,7 +281,7 @@ void advanced_exif_close(ExifWin *ew)
 
 static gboolean advanced_exif_delete_cb(GtkWidget *UNUSED(widget), GdkEvent *UNUSED(event), gpointer data)
 {
-       ExifWin *ew = static_cast<ExifWin *>(data);
+       auto ew = static_cast<ExifWin *>(data);
 
        if (!ew) return FALSE;
 
@@ -337,7 +337,7 @@ static gint advanced_exif_sort_cb(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIt
 static gboolean advanced_exif_mouseclick(GtkWidget *UNUSED(widget),
                                                GdkEventButton *UNUSED(bevent), gpointer data)
 {
-       ExifWin *ew = static_cast<ExifWin *>(data);
+       auto ew = static_cast<ExifWin *>(data);
        GtkTreePath *path;
        GtkTreeViewColumn *column;
        GtkTreeIter iter;
@@ -371,7 +371,7 @@ static gboolean advanced_exif_mouseclick(GtkWidget *UNUSED(widget),
 
 static gboolean advanced_exif_keypress(GtkWidget *UNUSED(widget), GdkEventKey *event, gpointer data)
 {
-       ExifWin *ew = static_cast<ExifWin *>(data);
+       auto ew = static_cast<ExifWin *>(data);
        gboolean stop_signal = FALSE;
 
        if (event->state & GDK_CONTROL_MASK)
index 2ee6ea8..d179dd9 100644 (file)
@@ -115,7 +115,7 @@ static void bar_pane_comment_set_selection(PaneCommentData *pcd, gboolean append
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                if (fd == pcd->fd) continue;
 
@@ -135,14 +135,14 @@ static void bar_pane_comment_set_selection(PaneCommentData *pcd, gboolean append
 
 static void bar_pane_comment_sel_add_cb(GtkWidget *UNUSED(button), gpointer data)
 {
-       PaneCommentData *pcd = static_cast<PaneCommentData *>(data);
+       auto pcd = static_cast<PaneCommentData *>(data);
 
        bar_pane_comment_set_selection(pcd, TRUE);
 }
 
 static void bar_pane_comment_sel_replace_cb(GtkWidget *UNUSED(button), gpointer data)
 {
-       PaneCommentData *pcd = static_cast<PaneCommentData *>(data);
+       auto pcd = static_cast<PaneCommentData *>(data);
 
        bar_pane_comment_set_selection(pcd, FALSE);
 }
@@ -211,7 +211,7 @@ static void bar_pane_comment_write_config(GtkWidget *pane, GString *outstr, gint
 
 static void bar_pane_comment_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       PaneCommentData *pcd = static_cast<PaneCommentData *>(data);
+       auto pcd = static_cast<PaneCommentData *>(data);
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pcd->fd)
                {
                DEBUG_1("Notify pane_comment: %s %04x", fd->path, type);
@@ -222,7 +222,7 @@ static void bar_pane_comment_notify_cb(FileData *fd, NotifyType type, gpointer d
 
 static void bar_pane_comment_changed(GtkTextBuffer *UNUSED(buffer), gpointer data)
 {
-       PaneCommentData *pcd = static_cast<PaneCommentData *>(data);
+       auto pcd = static_cast<PaneCommentData *>(data);
 
        bar_pane_comment_write(pcd);
 }
@@ -230,7 +230,7 @@ static void bar_pane_comment_changed(GtkTextBuffer *UNUSED(buffer), gpointer dat
 
 static void bar_pane_comment_populate_popup(GtkTextView *UNUSED(textview), GtkMenu *menu, gpointer data)
 {
-       PaneCommentData *pcd = static_cast<PaneCommentData *>(data);
+       auto pcd = static_cast<PaneCommentData *>(data);
 
        menu_item_add_divider(GTK_WIDGET(menu));
        menu_item_add_stock(GTK_WIDGET(menu), _("Add text to selected files"), GTK_STOCK_ADD, G_CALLBACK(bar_pane_comment_sel_add_cb), pcd);
@@ -239,7 +239,7 @@ static void bar_pane_comment_populate_popup(GtkTextView *UNUSED(textview), GtkMe
 
 static void bar_pane_comment_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PaneCommentData *pcd = static_cast<PaneCommentData *>(data);
+       auto pcd = static_cast<PaneCommentData *>(data);
 
        file_data_unregister_notify_func(bar_pane_comment_notify_cb, pcd);
 
index 82027f8..7c060ed 100644 (file)
@@ -97,7 +97,7 @@ static gboolean bar_pane_exif_copy_cb(GtkWidget *widget, GdkEventButton *bevent,
 
 static void bar_pane_exif_entry_changed(GtkEntry *UNUSED(text_entry), gpointer data)
 {
-       ExifEntry *ee = static_cast<ExifEntry *>(data);
+       auto ee = static_cast<ExifEntry *>(data);
        gchar *text;
        if (!ee->ped->fd) return;
 
@@ -108,7 +108,7 @@ static void bar_pane_exif_entry_changed(GtkEntry *UNUSED(text_entry), gpointer d
 
 static void bar_pane_exif_entry_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ExifEntry *ee = static_cast<ExifEntry *>(data);
+       auto ee = static_cast<ExifEntry *>(data);
 
        g_free(ee->key);
        g_free(ee->title);
@@ -156,7 +156,7 @@ static void bar_pane_exif_setup_entry_box(PaneExifData *ped, ExifEntry *ee)
 
 static GtkWidget *bar_pane_exif_add_entry(PaneExifData *ped, const gchar *key, const gchar *title, gboolean if_set, gboolean editable)
 {
-       ExifEntry *ee = g_new0(ExifEntry, 1);
+       auto ee = g_new0(ExifEntry, 1);
 
        ee->key = g_strdup(key);
        if (title && title[0])
@@ -195,9 +195,9 @@ static GtkWidget *bar_pane_exif_add_entry(PaneExifData *ped, const gchar *key, c
 
 static void bar_pane_exif_reparent_entry(GtkWidget *entry, GtkWidget *pane)
 {
-       PaneExifData *ped = static_cast<PaneExifData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
+       auto ped = static_cast<PaneExifData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
        PaneExifData *old_ped;
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
 
        if (!ped || !ee) return;
 
@@ -225,7 +225,7 @@ static void bar_pane_exif_entry_update_title(ExifEntry *ee)
 static void bar_pane_exif_update_entry(PaneExifData *ped, GtkWidget *entry, gboolean update_title)
 {
        gchar *text;
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
        gshort rating;
 
        if (!ee) return;
@@ -277,7 +277,7 @@ static void bar_pane_exif_update(PaneExifData *ped)
        work = list;
        while (work)
                {
-               GtkWidget *entry = static_cast<GtkWidget *>(work->data);
+               auto entry = static_cast<GtkWidget *>(work->data);
                work = work->next;
 
                bar_pane_exif_update_entry(ped, entry, FALSE);
@@ -313,8 +313,8 @@ gint bar_pane_exif_event(GtkWidget *bar, GdkEvent *event)
        work = list;
        while (!ret && work)
                {
-               GtkWidget *entry = static_cast<GtkWidget *>(work->data);
-               ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
+               auto entry = static_cast<GtkWidget *>(work->data);
+               auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
                work = work->next;
 
                if (ee->editable && gtk_widget_has_focus(ee->value_widget)) ret = gtk_widget_event(ee->value_widget, event);
@@ -325,7 +325,7 @@ gint bar_pane_exif_event(GtkWidget *bar, GdkEvent *event)
 
 static void bar_pane_exif_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       PaneExifData *ped = static_cast<PaneExifData *>(data);
+       auto ped = static_cast<PaneExifData *>(data);
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == ped->fd)
                {
                DEBUG_1("Notify pane_exif: %s %04x", fd->path, type);
@@ -357,7 +357,7 @@ static void bar_pane_exif_entry_dnd_get(GtkWidget *entry, GdkDragContext *UNUSED
                                     GtkSelectionData *selection_data, guint info,
                                     guint UNUSED(time), gpointer UNUSED(data))
 {
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
 
        switch (info)
                {
@@ -407,7 +407,7 @@ static void bar_pane_exif_dnd_receive(GtkWidget *pane, GdkDragContext *UNUSED(co
        while (work)
                {
                gint nx, ny;
-               GtkWidget *entry = static_cast<GtkWidget *>(work->data);
+               auto entry = static_cast<GtkWidget *>(work->data);
                GtkAllocation allocation;
                work = work->next;
 
@@ -427,7 +427,7 @@ static void bar_pane_exif_dnd_receive(GtkWidget *pane, GdkDragContext *UNUSED(co
 
 static void bar_pane_exif_entry_dnd_begin(GtkWidget *entry, GdkDragContext *context, gpointer UNUSED(data))
 {
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
 
        if (!ee) return;
        dnd_set_drag_label(entry, context, ee->key);
@@ -439,7 +439,7 @@ static void bar_pane_exif_entry_dnd_end(GtkWidget *UNUSED(widget), GdkDragContex
 
 static void bar_pane_exif_entry_dnd_init(GtkWidget *entry)
 {
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
 
        gtk_drag_source_set(entry, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
                            bar_pane_exif_drag_types, n_exif_entry_drag_types,
@@ -465,13 +465,13 @@ static void bar_pane_exif_dnd_init(GtkWidget *pane)
 
 static void bar_pane_exif_edit_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GenericDialog *gd = static_cast<GenericDialog *>(data);
+       auto gd = static_cast<GenericDialog *>(data);
        generic_dialog_close(gd);
 }
 
 static void bar_pane_exif_edit_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ConfDialogData *cdd = static_cast<ConfDialogData *>(data);
+       auto cdd = static_cast<ConfDialogData *>(data);
        g_signal_handlers_disconnect_by_func(cdd->widget, (gpointer)(bar_pane_exif_edit_close_cb), cdd->gd);
        g_free(cdd);
 }
@@ -482,11 +482,11 @@ static void bar_pane_exif_edit_cancel_cb(GenericDialog *UNUSED(gd), gpointer UNU
 
 static void bar_pane_exif_edit_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       ConfDialogData *cdd = static_cast<ConfDialogData *>(data);
+       auto cdd = static_cast<ConfDialogData *>(data);
 
        /* either one or the other */
-       PaneExifData *ped = static_cast<PaneExifData *>(g_object_get_data(G_OBJECT(cdd->widget), "pane_data"));
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(cdd->widget), "entry_data"));
+       auto ped = static_cast<PaneExifData *>(g_object_get_data(G_OBJECT(cdd->widget), "pane_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(cdd->widget), "entry_data"));
 
        if (ped)
                {
@@ -544,7 +544,7 @@ static void bar_pane_exif_conf_dialog(GtkWidget *widget)
 
        /* the widget can be either ExifEntry (for editing) or Pane (for new entry)
           we can decide it by the attached data */
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(widget), "entry_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(widget), "entry_data"));
 
        cdd = g_new0(ConfDialogData, 1);
 
@@ -596,19 +596,19 @@ static void bar_pane_exif_conf_dialog(GtkWidget *widget)
 
 static void bar_pane_exif_conf_dialog_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       GtkWidget *widget = static_cast<GtkWidget *>(data);
+       auto widget = static_cast<GtkWidget *>(data);
        bar_pane_exif_conf_dialog(widget);
 }
 
 static void bar_pane_exif_delete_entry_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       GtkWidget *entry = static_cast<GtkWidget *>(data);
+       auto entry = static_cast<GtkWidget *>(data);
        gtk_widget_destroy(entry);
 }
 
 static void bar_pane_exif_copy_entry_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       GtkWidget *widget = static_cast<GtkWidget *>(data);
+       auto widget = static_cast<GtkWidget *>(data);
        GtkClipboard *clipboard;
        const gchar *value;
        ExifEntry *ee;
@@ -621,7 +621,7 @@ static void bar_pane_exif_copy_entry_cb(GtkWidget *UNUSED(menu_widget), gpointer
 
 static void bar_pane_exif_toggle_show_all_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneExifData *ped = static_cast<PaneExifData *>(data);
+       auto ped = static_cast<PaneExifData *>(data);
        ped->show_all = !ped->show_all;
        bar_pane_exif_update(ped);
 }
@@ -631,7 +631,7 @@ static void bar_pane_exif_menu_popup(GtkWidget *widget, PaneExifData *ped)
        GtkWidget *menu;
        /* the widget can be either ExifEntry (for editing) or Pane (for new entry)
           we can decide it by the attached data */
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(widget), "entry_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(widget), "entry_data"));
 
        menu = popup_menu_short_lived();
 
@@ -660,7 +660,7 @@ static void bar_pane_exif_menu_popup(GtkWidget *widget, PaneExifData *ped)
 
 static gboolean bar_pane_exif_menu_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       PaneExifData *ped = static_cast<PaneExifData *>(data);
+       auto ped = static_cast<PaneExifData *>(data);
        if (bevent->button == MOUSE_BUTTON_RIGHT)
                {
                bar_pane_exif_menu_popup(widget, ped);
@@ -692,7 +692,7 @@ static gboolean bar_pane_exif_copy_cb(GtkWidget *widget, GdkEventButton *bevent,
 
 static void bar_pane_exif_entry_write_config(GtkWidget *entry, GString *outstr, gint indent)
 {
-       ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
+       auto ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
        if (!ee) return;
 
        WRITE_NL(); WRITE_STRING("<entry ");
@@ -723,7 +723,7 @@ static void bar_pane_exif_write_config(GtkWidget *pane, GString *outstr, gint in
        work = list;
        while (work)
                {
-               GtkWidget *entry = static_cast<GtkWidget *>(work->data);
+               auto entry = static_cast<GtkWidget *>(work->data);
                work = work->next;
 
                bar_pane_exif_entry_write_config(entry, outstr, indent);
@@ -780,7 +780,7 @@ GList * bar_pane_exif_list()
 
 static void bar_pane_exif_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PaneExifData *ped = static_cast<PaneExifData *>(data);
+       auto ped = static_cast<PaneExifData *>(data);
 
        file_data_unregister_notify_func(bar_pane_exif_notify_cb, ped);
        g_object_unref(ped->size_group);
@@ -800,7 +800,7 @@ static void bar_pane_exif_destroy(GtkWidget *UNUSED(widget), gpointer data)
 
 static void bar_pane_exif_size_allocate(GtkWidget *UNUSED(pane), GtkAllocation *alloc, gpointer data)
 {
-       PaneExifData *ped = static_cast<PaneExifData *>(data);
+       auto ped = static_cast<PaneExifData *>(data);
        ped->min_height = alloc->height;
        gtk_widget_set_size_request(ped->widget, -1, ped->min_height);
 }
index 15fa54e..9c26e41 100644 (file)
@@ -83,7 +83,7 @@ static void bar_pane_histogram_update(PaneHistogramData *phd)
 static gboolean bar_pane_histogram_update_cb(gpointer data)
 {
        const HistMap *histmap;
-       PaneHistogramData *phd = static_cast<PaneHistogramData *>(data);
+       auto phd = static_cast<PaneHistogramData *>(data);
 
        phd->idle_id = 0;
        phd->need_update = FALSE;
@@ -138,7 +138,7 @@ static void bar_pane_histogram_write_config(GtkWidget *pane, GString *outstr, gi
 
 static void bar_pane_histogram_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       PaneHistogramData *phd = static_cast<PaneHistogramData *>(data);
+       auto phd = static_cast<PaneHistogramData *>(data);
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == phd->fd)
                {
                DEBUG_1("Notify pane_histogram: %s %04x", fd->path, type);
@@ -148,7 +148,7 @@ static void bar_pane_histogram_notify_cb(FileData *fd, NotifyType type, gpointer
 
 static gboolean bar_pane_histogram_draw_cb(GtkWidget *UNUSED(widget), cairo_t *cr, gpointer data)
 {
-       PaneHistogramData *phd = static_cast<PaneHistogramData *>(data);
+       auto phd = static_cast<PaneHistogramData *>(data);
        if (!phd) return TRUE;
 
        if (phd->need_update)
@@ -166,7 +166,7 @@ static gboolean bar_pane_histogram_draw_cb(GtkWidget *UNUSED(widget), cairo_t *c
 
 static void bar_pane_histogram_size_cb(GtkWidget *UNUSED(widget), GtkAllocation *allocation, gpointer data)
 {
-       PaneHistogramData *phd = static_cast<PaneHistogramData *>(data);
+       auto phd = static_cast<PaneHistogramData *>(data);
 
        phd->histogram_width = allocation->width;
        phd->histogram_height = allocation->height;
@@ -175,7 +175,7 @@ static void bar_pane_histogram_size_cb(GtkWidget *UNUSED(widget), GtkAllocation
 
 static void bar_pane_histogram_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PaneHistogramData *phd = static_cast<PaneHistogramData *>(data);
+       auto phd = static_cast<PaneHistogramData *>(data);
 
        if (phd->idle_id) g_source_remove(phd->idle_id);
        file_data_unregister_notify_func(bar_pane_histogram_notify_cb, phd);
@@ -190,7 +190,7 @@ static void bar_pane_histogram_destroy(GtkWidget *UNUSED(widget), gpointer data)
 
 static void bar_pane_histogram_popup_channels_cb(GtkWidget *widget, gpointer data)
 {
-       PaneHistogramData *phd = static_cast<PaneHistogramData *>(data);
+       auto phd = static_cast<PaneHistogramData *>(data);
        gint channel;
 
        if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return;
@@ -206,7 +206,7 @@ static void bar_pane_histogram_popup_channels_cb(GtkWidget *widget, gpointer dat
 
 static void bar_pane_histogram_popup_mode_cb(GtkWidget *widget, gpointer data)
 {
-       PaneHistogramData *phd = static_cast<PaneHistogramData *>(data);
+       auto phd = static_cast<PaneHistogramData *>(data);
        gint logmode;
 
        if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return;
@@ -245,7 +245,7 @@ static GtkWidget *bar_pane_histogram_menu(PaneHistogramData *phd)
 
 static gboolean bar_pane_histogram_press_cb(GtkGesture *UNUSED(gesture), gint UNUSED(n_press), gdouble UNUSED(x), gdouble UNUSED(y), gpointer data)
 {
-       PaneHistogramData *phd = static_cast<PaneHistogramData *>(data);
+       auto phd = static_cast<PaneHistogramData *>(data);
        GtkWidget *menu;
 
        menu = bar_pane_histogram_menu(phd);
index 4076b8e..74d18a6 100644 (file)
@@ -88,7 +88,7 @@ static void keyword_list_push(GtkWidget *textview, GList *list)
 
        while (list)
                {
-               const gchar *word = static_cast<const gchar *>(list->data);
+               auto word = static_cast<const gchar *>(list->data);
                GtkTextIter iter;
 
                gtk_text_buffer_get_end_iter(buffer, &iter);
@@ -173,7 +173,7 @@ static void bar_pane_keywords_write(PaneKeywordsData *pkd)
 
 gboolean bar_keyword_tree_expand_if_set_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        gboolean set;
 
        gtk_tree_model_get(model, iter, FILTER_KEYWORD_COLUMN_TOGGLE, &set, -1);
@@ -187,7 +187,7 @@ gboolean bar_keyword_tree_expand_if_set_cb(GtkTreeModel *model, GtkTreePath *pat
 
 gboolean bar_keyword_tree_collapse_if_unset_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        gboolean set;
 
        gtk_tree_model_get(model, iter, FILTER_KEYWORD_COLUMN_TOGGLE, &set, -1);
@@ -267,7 +267,7 @@ void bar_pane_keywords_set_fd(GtkWidget *pane, FileData *fd)
 
 void bar_keyword_tree_get_expanded_cb(GtkTreeView *keyword_treeview, GtkTreePath *path,  gpointer data)
 {
-       GList **expanded = static_cast<GList **>(data);
+       auto expanded = static_cast<GList **>(data);
        GtkTreeModel *model;
        GtkTreeIter iter;
        gchar *path_string;
@@ -350,7 +350,7 @@ gint bar_pane_keywords_event(GtkWidget *bar, GdkEvent *event)
 
 static void bar_pane_keywords_keyword_toggle(GtkCellRendererToggle *UNUSED(toggle), const gchar *path, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *model;
        GtkTreeIter iter;
        GtkTreePath *tpath;
@@ -391,7 +391,7 @@ static void bar_pane_keywords_keyword_toggle(GtkCellRendererToggle *UNUSED(toggl
 
 void bar_pane_keywords_filter_modify(GtkTreeModel *model, GtkTreeIter *iter, GValue *value, gint column, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *keyword_tree = gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(model));
        GtkTreeIter child_iter;
 
@@ -427,7 +427,7 @@ void bar_pane_keywords_filter_modify(GtkTreeModel *model, GtkTreeIter *iter, GVa
 
 gboolean bar_pane_keywords_filter_visible(GtkTreeModel *keyword_tree, GtkTreeIter *iter, gpointer data)
 {
-       GtkTreeModel *filter = static_cast<GtkTreeModel *>(data);
+       auto filter = static_cast<GtkTreeModel *>(data);
 
        return !keyword_is_hidden_in(keyword_tree, iter, filter);
 }
@@ -446,7 +446,7 @@ static void bar_pane_keywords_set_selection(PaneKeywordsData *pkd, gboolean appe
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
 
                if (append)
@@ -465,21 +465,21 @@ static void bar_pane_keywords_set_selection(PaneKeywordsData *pkd, gboolean appe
 
 static void bar_pane_keywords_sel_add_cb(GtkWidget *UNUSED(button), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
 
        bar_pane_keywords_set_selection(pkd, TRUE);
 }
 
 static void bar_pane_keywords_sel_replace_cb(GtkWidget *UNUSED(button), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
 
        bar_pane_keywords_set_selection(pkd, FALSE);
 }
 
 static void bar_pane_keywords_populate_popup_cb(GtkTextView *UNUSED(textview), GtkMenu *menu, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
 
        menu_item_add_divider(GTK_WIDGET(menu));
        menu_item_add_stock(GTK_WIDGET(menu), _("Add selected keywords to selected files"), GTK_STOCK_ADD, G_CALLBACK(bar_pane_keywords_sel_add_cb), pkd);
@@ -489,7 +489,7 @@ static void bar_pane_keywords_populate_popup_cb(GtkTextView *UNUSED(textview), G
 
 static void bar_pane_keywords_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pkd->fd)
                {
                DEBUG_1("Notify pane_keywords: %s %04x", fd->path, type);
@@ -499,7 +499,7 @@ static void bar_pane_keywords_notify_cb(FileData *fd, NotifyType type, gpointer
 
 static gboolean bar_pane_keywords_changed_idle_cb(gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
 
        bar_pane_keywords_write(pkd);
        bar_keyword_tree_sync(pkd);
@@ -509,7 +509,7 @@ static gboolean bar_pane_keywords_changed_idle_cb(gpointer data)
 
 static void bar_pane_keywords_changed(GtkTextBuffer *UNUSED(buffer), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
 
        if (pkd->idle_id) return;
        /* higher prio than redraw */
@@ -632,7 +632,7 @@ static gboolean bar_pane_keywords_dnd_skip_existing(GtkTreeModel *keyword_tree,
        GList *work = *keywords;
        while (work)
                {
-               gchar *keyword = static_cast<gchar *>(work->data);
+               auto keyword = static_cast<gchar *>(work->data);
                if (keyword_exists(keyword_tree, NULL, dest_kw_iter, keyword, FALSE, NULL))
                        {
                        GList *next = work->next;
@@ -653,7 +653,7 @@ static void bar_pane_keywords_dnd_receive(GtkWidget *tree_view, GdkDragContext *
                                          GtkSelectionData *selection_data, guint info,
                                          guint UNUSED(time), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreePath *tpath = NULL;
         GtkTreeViewDropPosition pos;
        GtkTreeModel *model;
@@ -680,7 +680,7 @@ static void bar_pane_keywords_dnd_receive(GtkWidget *tree_view, GdkDragContext *
                {
                case TARGET_APP_KEYWORD_PATH:
                        {
-                       GList *path = static_cast<GList *>(*(gpointer *)(gtk_selection_data_get_data(selection_data)));
+                       auto path = static_cast<GList *>(*(gpointer *)(gtk_selection_data_get_data(selection_data)));
                        src_valid = keyword_tree_get_iter(keyword_tree, &src_kw_iter, path);
                        string_list_free(path);
                        break;
@@ -766,7 +766,7 @@ static void bar_pane_keywords_dnd_receive(GtkWidget *tree_view, GdkDragContext *
        work = new_keywords;
        while (work)
                {
-               gchar *keyword = static_cast<gchar *>(work->data);
+               auto keyword = static_cast<gchar *>(work->data);
                keyword_set(GTK_TREE_STORE(keyword_tree), &new_kw_iter, keyword, TRUE);
                work = work->next;
 
@@ -819,7 +819,7 @@ static gint bar_pane_keywords_dnd_motion(GtkWidget *tree_view, GdkDragContext *c
 
 static void bar_pane_keywords_edit_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ConfDialogData *cdd = static_cast<ConfDialogData *>(data);
+       auto cdd = static_cast<ConfDialogData *>(data);
        gtk_tree_path_free(cdd->click_tpath);
        g_free(cdd);
 }
@@ -832,7 +832,7 @@ static void bar_pane_keywords_edit_cancel_cb(GenericDialog *UNUSED(gd), gpointer
 
 static void bar_pane_keywords_edit_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       ConfDialogData *cdd = static_cast<ConfDialogData *>(data);
+       auto cdd = static_cast<ConfDialogData *>(data);
        PaneKeywordsData *pkd = cdd->pkd;
        GtkTreeModel *model;
 
@@ -904,13 +904,13 @@ static void bar_pane_keywords_edit_ok_cb(GenericDialog *UNUSED(gd), gpointer dat
 
 static void bar_pane_keywords_conf_set_helper(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ConfDialogData *cdd = static_cast<ConfDialogData *>(data);
+       auto cdd = static_cast<ConfDialogData *>(data);
        cdd->is_keyword = FALSE;
 }
 
 static void bar_pane_keywords_conf_set_kw(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ConfDialogData *cdd = static_cast<ConfDialogData *>(data);
+       auto cdd = static_cast<ConfDialogData *>(data);
        cdd->is_keyword = TRUE;
 }
 
@@ -1005,19 +1005,19 @@ static void bar_pane_keywords_edit_dialog(PaneKeywordsData *pkd, gboolean edit_e
 
 static void bar_pane_keywords_edit_dialog_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        bar_pane_keywords_edit_dialog(pkd, TRUE);
 }
 
 static void bar_pane_keywords_add_dialog_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        bar_pane_keywords_edit_dialog(pkd, FALSE);
 }
 
 static void bar_pane_keywords_connect_mark_cb(GtkWidget *menu_widget, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
 
        GtkTreeModel *model;
        GtkTreeIter iter;
@@ -1050,7 +1050,7 @@ static void dummy_cancel_cb(GenericDialog *UNUSED(gd), gpointer UNUSED(data))
 
 static void bar_pane_keywords_disconnect_marks_cb(GtkWidget *menu_widget, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
 
        GenericDialog *gd;
        GString *message = g_string_new("");
@@ -1070,7 +1070,7 @@ static void bar_pane_keywords_disconnect_marks_cb(GtkWidget *menu_widget, gpoint
 
 static void bar_pane_keywords_delete_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *model;
        GtkTreeIter iter;
 
@@ -1090,7 +1090,7 @@ static void bar_pane_keywords_delete_cb(GtkWidget *UNUSED(menu_widget), gpointer
 
 static void bar_pane_keywords_hide_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *model;
        GtkTreeIter iter;
 
@@ -1110,7 +1110,7 @@ static void bar_pane_keywords_hide_cb(GtkWidget *UNUSED(menu_widget), gpointer d
 
 static void bar_pane_keywords_show_all_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *model;
 
        GtkTreeModel *keyword_tree;
@@ -1133,7 +1133,7 @@ static void bar_pane_keywords_show_all_cb(GtkWidget *UNUSED(menu_widget), gpoint
 
 static void bar_pane_keywords_revert_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GList *work;
        GtkTreePath *tree_path;
        gchar *path;
@@ -1155,7 +1155,7 @@ static void bar_pane_keywords_revert_cb(GtkWidget *UNUSED(menu_widget), gpointer
 
 static void bar_pane_keywords_expand_checked_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *model;
 
        model = gtk_tree_view_get_model(GTK_TREE_VIEW(pkd->keyword_treeview));
@@ -1164,7 +1164,7 @@ static void bar_pane_keywords_expand_checked_cb(GtkWidget *UNUSED(menu_widget),
 
 static void bar_pane_keywords_collapse_all_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
 
        string_list_free(pkd->expanded_rows);
        pkd->expanded_rows = NULL;
@@ -1178,7 +1178,7 @@ static void bar_pane_keywords_collapse_all_cb(GtkWidget *UNUSED(menu_widget), gp
 
 static void bar_pane_keywords_revert_hidden_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *model;
        GtkTreeModel *keyword_tree;
 
@@ -1192,7 +1192,7 @@ static void bar_pane_keywords_revert_hidden_cb(GtkWidget *UNUSED(menu_widget), g
 
 static void bar_pane_keywords_collapse_unchecked_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *model;
 
        model = gtk_tree_view_get_model(GTK_TREE_VIEW(pkd->keyword_treeview));
@@ -1201,7 +1201,7 @@ static void bar_pane_keywords_collapse_unchecked_cb(GtkWidget *UNUSED(menu_widge
 
 static void bar_pane_keywords_hide_unchecked_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeModel *model;
 
        GtkTreeModel *keyword_tree;
@@ -1218,21 +1218,21 @@ static void bar_pane_keywords_hide_unchecked_cb(GtkWidget *UNUSED(menu_widget),
 
 static void bar_pane_keywords_expand_checked_toggle_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        pkd->expand_checked = !pkd->expand_checked;
        bar_keyword_tree_sync(pkd);
 }
 
 static void bar_pane_keywords_collapse_unchecked_toggle_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        pkd->collapse_unchecked = !pkd->collapse_unchecked;
        bar_keyword_tree_sync(pkd);
 }
 
 static void bar_pane_keywords_hide_unchecked_toggle_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        pkd->hide_unchecked = !pkd->hide_unchecked;
        bar_keyword_tree_sync(pkd);
 }
@@ -1242,7 +1242,7 @@ static void bar_pane_keywords_hide_unchecked_toggle_cb(GtkWidget *UNUSED(menu_wi
  */
 static void bar_pane_keywords_add_to_selected_cb(GtkWidget *UNUSED(menu_widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        GtkTreeIter iter; /* This is the iter which initial holds the current keyword */
        GtkTreeIter child_iter;
        GtkTreeModel *model;
@@ -1285,7 +1285,7 @@ static void bar_pane_keywords_add_to_selected_cb(GtkWidget *UNUSED(menu_widget),
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                metadata_append_list(fd, KEYWORD_KEY, keywords);
                }
@@ -1410,7 +1410,7 @@ static void bar_pane_keywords_menu_popup(GtkWidget *UNUSED(widget), PaneKeywords
 
 static gboolean bar_pane_keywords_menu_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        if (bevent->button == MOUSE_BUTTON_RIGHT)
                {
                bar_pane_keywords_menu_popup(widget, pkd, bevent->x, bevent->y);
@@ -1438,7 +1438,7 @@ static gboolean bar_pane_keywords_menu_cb(GtkWidget *widget, GdkEventButton *bev
 
 static void bar_pane_keywords_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        gchar *path;
 
        path = g_build_filename(get_rc_dir(), "keywords", NULL);
@@ -1739,7 +1739,7 @@ void bar_pane_keywords_entry_add_from_config(GtkWidget *pane, const gchar **attr
 
 static gboolean autocomplete_activate_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PaneKeywordsData *pkd = static_cast<PaneKeywordsData *>(data);
+       auto pkd = static_cast<PaneKeywordsData *>(data);
        gchar *entry_text;
        GtkTextBuffer *buffer;
        GtkTextIter iter;
index 3b00532..212531d 100644 (file)
@@ -88,7 +88,7 @@ static void bar_pane_rating_write_config(GtkWidget *pane, GString *outstr, gint
 
 static void bar_pane_rating_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       PaneRatingData *prd = static_cast<PaneRatingData *>(data);
+       auto prd = static_cast<PaneRatingData *>(data);
 
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == prd->fd)
                {
@@ -99,7 +99,7 @@ static void bar_pane_rating_notify_cb(FileData *fd, NotifyType type, gpointer da
 
 static void bar_pane_rating_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PaneRatingData *prd = static_cast<PaneRatingData *>(data);
+       auto prd = static_cast<PaneRatingData *>(data);
 
        file_data_unregister_notify_func(bar_pane_rating_notify_cb, prd);
        file_data_unref(prd->fd);
@@ -109,7 +109,7 @@ static void bar_pane_rating_destroy(GtkWidget *UNUSED(widget), gpointer data)
 
 static void bar_pane_rating_selected_cb(GtkToggleButton *togglebutton, gpointer data)
 {
-       PaneRatingData *prd = static_cast<PaneRatingData *>(data);
+       auto prd = static_cast<PaneRatingData *>(data);
        GSList *list;
        gint i;
        gchar *rating;
index e44acdc..1782640 100644 (file)
@@ -152,7 +152,7 @@ static void bar_sort_mode_sync(SortData *sd, SortModeType mode)
 
 static void bar_sort_mode_cb(GtkWidget *combo, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
 
        if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == BAR_SORT_MODE_FOLDER)
                {
@@ -280,7 +280,7 @@ static void bar_sort_undo_collection(SortData *sd)
 
 static void bar_sort_undo_cb(GtkWidget *button, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
 
        if (sd->mode == BAR_SORT_MODE_FOLDER)
                {
@@ -367,7 +367,7 @@ static void bar_sort_bookmark_select_collection(SortData *sd, FileData *source,
 
 static void bar_sort_bookmark_select(const gchar *path, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
        FileData *source;
 
        source = layout_image_get_fd(sd->lw);
@@ -399,21 +399,21 @@ static void bar_sort_set_action(SortData *sd, SortActionType action, const gchar
 
 static void bar_sort_set_copy_cb(GtkWidget *button, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
        if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return;
        bar_sort_set_action(sd, BAR_SORT_COPY, NULL);
 }
 
 static void bar_sort_set_move_cb(GtkWidget *button, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
        if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return;
        bar_sort_set_action(sd, BAR_SORT_MOVE, NULL);
 }
 
 static void bar_sort_set_filter_cb(GtkWidget *button, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
        const gchar *key;
 
        if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return;
@@ -461,14 +461,14 @@ static void bar_sort_set_selection(SortData *sd, SortSelectionType selection)
 
 static void bar_sort_set_selection_image_cb(GtkWidget *button, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
        if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return;
        bar_sort_set_selection(sd, BAR_SORT_SELECTION_IMAGE);
 }
 
 static void bar_sort_set_selection_selected_cb(GtkWidget *button, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
        if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return;
        bar_sort_set_selection(sd, BAR_SORT_SELECTION_SELECTED);
 }
@@ -482,7 +482,7 @@ static void bar_sort_add_close(SortData *sd)
 
 static void bar_sort_add_ok_cb(FileDialog *fd, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
        const gchar *name = gtk_entry_get_text(GTK_ENTRY(sd->dialog_name_entry));
        gboolean empty_name = (name[0] == '\0');
 
@@ -500,7 +500,7 @@ static void bar_sort_add_ok_cb(FileDialog *fd, gpointer data)
                {
                gchar *path;
                gboolean has_extension;
-               gchar *filename = (gchar *) name;
+               auto filename = (gchar *) name;
 
                if (empty_name) return;
 
@@ -545,14 +545,14 @@ static void bar_sort_add_ok_cb(FileDialog *fd, gpointer data)
 
 static void bar_sort_add_cancel_cb(FileDialog *UNUSED(fd), gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
 
        bar_sort_add_close(sd);
 }
 
 static void bar_sort_add_cb(GtkWidget *button, gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
        GtkWidget *hbox;
        const gchar *title;
 
@@ -612,7 +612,7 @@ void bar_sort_close(GtkWidget *bar)
 
 static void bar_sort_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SortData *sd = static_cast<SortData *>(data);
+       auto sd = static_cast<SortData *>(data);
 
        bar_sort_add_close(sd);
 
@@ -700,7 +700,7 @@ static GtkWidget *bar_sort_new(LayoutWindow *lw, SortActionType action,
        while (work)
                {
                GtkWidget *button;
-               EditorDescription *editor = static_cast<EditorDescription *>(work->data);
+               auto editor = static_cast<EditorDescription *>(work->data);
                gchar *key;
                gboolean select = FALSE;
 
index b30adca..8aad11e 100644 (file)
@@ -220,7 +220,7 @@ struct _BarData
 
 static void bar_expander_move(GtkWidget *UNUSED(widget), gpointer data, gboolean up, gboolean single_step)
 {
-       GtkWidget *expander = static_cast<GtkWidget *>(data);
+       auto expander = static_cast<GtkWidget *>(data);
        GtkWidget *box;
        gint pos;
 
@@ -280,7 +280,7 @@ static void height_spin_key_press_cb(GtkEventControllerKey *UNUSED(controller),
 
 static void bar_expander_height_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GtkWidget *expander = static_cast<GtkWidget *>(data);
+       auto expander = static_cast<GtkWidget *>(data);
        GtkWidget *spin;
        GtkWidget *window;
        GtkWidget *data_box;
@@ -326,7 +326,7 @@ static void bar_expander_height_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void bar_expander_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GtkWidget *expander = static_cast<GtkWidget *>(data);
+       auto expander = static_cast<GtkWidget *>(data);
        gtk_widget_destroy(expander);
 }
 
@@ -334,7 +334,7 @@ static void bar_expander_add_cb(GtkWidget *widget, gpointer UNUSED(data))
 {
        //GtkWidget *bar = static_cast<//GtkWidget *>(data);
        const KnownPanes *pane = known_panes;
-       const gchar *id = static_cast<const gchar *>(g_object_get_data(G_OBJECT(widget), "pane_add_id"));
+       auto id = static_cast<const gchar *>(g_object_get_data(G_OBJECT(widget), "pane_add_id"));
        const gchar *config;
 
        if (!id) return;
@@ -467,7 +467,7 @@ static gboolean bar_menu_add_cb(GtkWidget *widget, GdkEventButton *UNUSED(bevent
 static void bar_pane_set_fd_cb(GtkWidget *expander, gpointer data)
 {
        GtkWidget *widget = gtk_bin_get_child(GTK_BIN(expander));
-       PaneData *pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
+       auto pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
        if (!pd) return;
        if (pd->pane_set_fd) pd->pane_set_fd(widget, static_cast<FileData *>(data));
 }
@@ -490,7 +490,7 @@ void bar_set_fd(GtkWidget *bar, FileData *fd)
 static void bar_pane_notify_selection_cb(GtkWidget *expander, gpointer data)
 {
        GtkWidget *widget = gtk_bin_get_child(GTK_BIN(expander));
-       PaneData *pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
+       auto pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
        if (!pd) return;
        if (pd->pane_notify_selection) pd->pane_notify_selection(widget, GPOINTER_TO_INT(data));
 }
@@ -519,7 +519,7 @@ gboolean bar_event(GtkWidget *bar, GdkEvent *event)
        while (work)
                {
                GtkWidget *widget = gtk_bin_get_child(GTK_BIN(work->data));
-               PaneData *pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
+               auto pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
                if (!pd) continue;
 
                if (pd->pane_event && pd->pane_event(widget, event))
@@ -550,7 +550,7 @@ GtkWidget *bar_find_pane_by_id(GtkWidget *bar, PaneType type, const gchar *id)
        while (work)
                {
                GtkWidget *widget = gtk_bin_get_child(GTK_BIN(work->data));
-               PaneData *pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
+               auto pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
                if (!pd) continue;
 
                if (type == pd->type && strcmp(id, pd->id) == 0)
@@ -577,7 +577,7 @@ void bar_clear(GtkWidget *bar)
        work = list;
        while (work)
                {
-               GtkWidget *widget = static_cast<GtkWidget *>(work->data);
+               auto widget = static_cast<GtkWidget *>(work->data);
                gtk_widget_destroy(widget);
                work = work->next;
                }
@@ -606,9 +606,9 @@ void bar_write_config(GtkWidget *bar, GString *outstr, gint indent)
        work = list;
        while (work)
                {
-               GtkWidget *expander = static_cast<GtkWidget *>(work->data);
+               auto expander = static_cast<GtkWidget *>(work->data);
                GtkWidget *widget = gtk_bin_get_child(GTK_BIN(expander));
-               PaneData *pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
+               auto pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
                if (!pd) continue;
 
                pd->expanded = gtk_expander_get_expanded(GTK_EXPANDER(expander));
@@ -625,7 +625,7 @@ void bar_write_config(GtkWidget *bar, GString *outstr, gint indent)
 
 void bar_update_expander(GtkWidget *pane)
 {
-       PaneData *pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
+       auto pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
        GtkWidget *expander;
 
        if (!pd) return;
@@ -638,8 +638,8 @@ void bar_update_expander(GtkWidget *pane)
 void bar_add(GtkWidget *bar, GtkWidget *pane)
 {
        GtkWidget *expander;
-       BarData *bd = static_cast<BarData *>(g_object_get_data(G_OBJECT(bar), "bar_data"));
-       PaneData *pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
+       auto bd = static_cast<BarData *>(g_object_get_data(G_OBJECT(bar), "bar_data"));
+       auto pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
 
        if (!bd) return;
 
@@ -684,7 +684,7 @@ void bar_populate_default(GtkWidget *UNUSED(bar))
 
 static void bar_size_allocate(GtkWidget *UNUSED(widget), GtkAllocation *UNUSED(allocation), gpointer data)
 {
-       BarData *bd = static_cast<BarData *>(data);
+       auto bd = static_cast<BarData *>(data);
 
        bd->width = gtk_paned_get_position(GTK_PANED(bd->lw->utility_paned));
 }
@@ -711,7 +711,7 @@ void bar_close(GtkWidget *bar)
 
 static void bar_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       BarData *bd = static_cast<BarData *>(data);
+       auto bd = static_cast<BarData *>(data);
 
        file_data_unref(bd->fd);
        g_free(bd);
index 943a758..d74ec81 100644 (file)
@@ -31,14 +31,14 @@ static gboolean cache_loader_phase2_idle_cb(gpointer data);
 
 static void cache_loader_phase1_done_cb(ImageLoader *UNUSED(il), gpointer data)
 {
-       CacheLoader *cl = static_cast<CacheLoader *>(data);
+       auto cl = static_cast<CacheLoader *>(data);
 
        cl->idle_id = g_idle_add(cache_loader_phase2_idle_cb, cl);
 }
 
 static void cache_loader_phase1_error_cb(ImageLoader *UNUSED(il), gpointer data)
 {
-       CacheLoader *cl = static_cast<CacheLoader *>(data);
+       auto cl = static_cast<CacheLoader *>(data);
 
        cl->error = TRUE;
        cl->idle_id = g_idle_add(cache_loader_phase2_idle_cb, cl);
@@ -204,14 +204,14 @@ static gboolean cache_loader_phase2_process(CacheLoader *cl)
 
 static gboolean cache_loader_phase1_idle_cb(gpointer data)
 {
-       CacheLoader *cl = static_cast<CacheLoader *>(data);
+       auto cl = static_cast<CacheLoader *>(data);
 
        return cache_loader_phase1_process(cl);
 }
 
 static gboolean cache_loader_phase2_idle_cb(gpointer data)
 {
-       CacheLoader *cl = static_cast<CacheLoader *>(data);
+       auto cl = static_cast<CacheLoader *>(data);
 
        return cache_loader_phase2_process(cl);
 }
index e8c8c24..5faffff 100644 (file)
@@ -190,7 +190,7 @@ static void cache_maintain_home_stop(CMData *cm)
 
 static gboolean cache_maintain_home_cb(gpointer data)
 {
-       CMData *cm = static_cast<CMData *>(data);
+       auto cm = static_cast<CMData *>(data);
        GList *dlist = NULL;
        GList *list = NULL;
        FileData *fd;
@@ -244,7 +244,7 @@ static gboolean cache_maintain_home_cb(gpointer data)
                        work = list;
                        while (work)
                                {
-                               FileData *fd_list = static_cast<FileData *>(work->data);
+                               auto fd_list = static_cast<FileData *>(work->data);
                                gchar *path_buf = g_strdup(fd_list->path);
                                gchar *dot;
 
@@ -319,7 +319,7 @@ static gboolean cache_maintain_home_cb(gpointer data)
 
 static void cache_maintain_home_close_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       CMData *cm = static_cast<CMData *>(data);
+       auto cm = static_cast<CMData *>(data);
 
        if (!gtk_widget_get_sensitive(cm->button_close)) return;
 
@@ -328,7 +328,7 @@ static void cache_maintain_home_close_cb(GenericDialog *UNUSED(gd), gpointer dat
 
 static void cache_maintain_home_stop_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       CMData *cm = static_cast<CMData *>(data);
+       auto cm = static_cast<CMData *>(data);
 
        cache_maintain_home_stop(cm);
 }
@@ -666,7 +666,7 @@ static void cache_manager_render_reset(CacheOpsData *cd)
 
 static void cache_manager_render_close_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        if (!gtk_widget_get_sensitive(cd->button_close)) return;
 
@@ -692,7 +692,7 @@ static void cache_manager_render_finish(CacheOpsData *cd)
 
 static void cache_manager_render_stop_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        gtk_entry_set_text(GTK_ENTRY(cd->progress), _("stopped"));
        cache_manager_render_finish(cd);
@@ -723,7 +723,7 @@ static gboolean cache_manager_render_file(CacheOpsData *cd);
 
 static void cache_manager_render_thumb_done_cb(ThumbLoader *UNUSED(tl), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        thumb_loader_free((ThumbLoader *)cd->tl);
        cd->tl = NULL;
@@ -797,7 +797,7 @@ static gboolean cache_manager_render_file(CacheOpsData *cd)
 
 static void cache_manager_render_start_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
        gchar *path;
        GList *list_total = NULL;
 
@@ -961,7 +961,7 @@ void cache_manager_render_remote(const gchar *path, gboolean recurse, gboolean l
 
 static void cache_manager_standard_clean_close_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        if (!gtk_widget_get_sensitive(cd->button_close)) return;
 
@@ -997,14 +997,14 @@ static void cache_manager_standard_clean_done(CacheOpsData *cd)
 
 static void cache_manager_standard_clean_stop_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        cache_manager_standard_clean_done(cd);
 }
 
 static gint cache_manager_standard_clean_clear_cb(gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        if (cd->list)
                {
@@ -1038,7 +1038,7 @@ static gint cache_manager_standard_clean_clear_cb(gpointer data)
 
 static void cache_manager_standard_clean_valid_cb(const gchar *path, gboolean valid, gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        if (path)
                {
@@ -1079,7 +1079,7 @@ static void cache_manager_standard_clean_valid_cb(const gchar *path, gboolean va
 
 static void cache_manager_standard_clean_start(GenericDialog *UNUSED(gd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
        GList *list;
        gchar *path;
        FileData *dir_fd;
@@ -1303,7 +1303,7 @@ static void cache_manager_sim_reset(CacheOpsData *cd)
 
 static void cache_manager_sim_close_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        if (!gtk_widget_get_sensitive(cd->button_close)) return;
 
@@ -1328,7 +1328,7 @@ static void cache_manager_sim_finish(CacheOpsData *cd)
 
 static void cache_manager_sim_stop_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        gtk_entry_set_text(GTK_ENTRY(cd->progress), _("stopped"));
        cache_manager_sim_finish(cd);
@@ -1357,7 +1357,7 @@ static void cache_manager_sim_folder(CacheOpsData *cd, FileData *dir_fd)
 
 static void cache_manager_sim_file_done_cb(CacheLoader *UNUSED(cl), gint UNUSED(error), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        cache_loader_free((CacheLoader *)cd->cl);
        cd->cl = NULL;
@@ -1466,7 +1466,7 @@ static gboolean cache_manager_sim_file(CacheOpsData *cd)
 
 static void cache_manager_sim_start_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
        gchar *path;
        GList *list_total = NULL;
 
@@ -1585,7 +1585,7 @@ static void cache_manager_sim_load_cb(GtkWidget *widget, gpointer UNUSED(data))
 
 static void cache_manager_cache_maintenance_close_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
 
        if (!gtk_widget_get_sensitive(cd->button_close)) return;
 
@@ -1596,7 +1596,7 @@ static void cache_manager_cache_maintenance_close_cb(GenericDialog *UNUSED(fd),
 
 static void cache_manager_cache_maintenance_start_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       CacheOpsData *cd = static_cast<CacheOpsData *>(data);
+       auto cd = static_cast<CacheOpsData *>(data);
        gchar *path;
        gchar *cmd_line;
 
index 0b70020..6c259b5 100644 (file)
@@ -553,7 +553,7 @@ static void gqv_cell_renderer_icon_get_size(GtkCellRenderer    *cell,
                                            gint               *width,
                                            gint               *height)
 {
-       GQvCellRendererIcon *cellicon = (GQvCellRendererIcon *) cell;
+       auto cellicon = (GQvCellRendererIcon *) cell;
        gint calc_width;
        gint calc_height;
        gint xpad, ypad;
@@ -632,7 +632,7 @@ static void gqv_cell_renderer_icon_render(GtkCellRenderer *cell,
 
 {
        GtkStyleContext *context = gtk_widget_get_style_context(widget);
-       GQvCellRendererIcon *cellicon = (GQvCellRendererIcon *) cell;
+       auto cellicon = (GQvCellRendererIcon *) cell;
        GdkPixbuf *pixbuf;
        const gchar *text;
        GdkRectangle cell_rect;
@@ -813,7 +813,7 @@ static gboolean gqv_cell_renderer_icon_activate(GtkCellRenderer      *cell,
                                                const GdkRectangle   *cell_area,
                                                GtkCellRendererState  UNUSED(flags))
 {
-       GQvCellRendererIcon *cellicon = (GQvCellRendererIcon *) cell;
+       auto cellicon = (GQvCellRendererIcon *) cell;
        GdkEventButton *bevent = &event->button;
 
        if (cellicon->show_marks &&
index 700a7d5..7ba599c 100644 (file)
@@ -40,8 +40,8 @@ static gboolean collection_save_confirmed(FileDialog *fd, gboolean overwrite, Co
 
 static void collection_confirm_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       FileDialog *fd = static_cast<FileDialog *>(data);
-       CollectionData *cd = static_cast<CollectionData *>(GENERIC_DIALOG(fd)->data);
+       auto fd = static_cast<FileDialog *>(data);
+       auto cd = static_cast<CollectionData *>(GENERIC_DIALOG(fd)->data);
 
        if (!collection_save_confirmed(fd, TRUE, cd))
                {
@@ -103,7 +103,7 @@ static gboolean collection_save_confirmed(FileDialog *fd, gboolean overwrite, Co
 
 static void collection_save_cb(FileDialog *fd, gpointer data)
 {
-       CollectionData *cd = static_cast<CollectionData *>(data);
+       auto cd = static_cast<CollectionData *>(data);
        const gchar *path;
 
        path = fd->dest_path;
@@ -122,7 +122,7 @@ static void collection_save_cb(FileDialog *fd, gpointer data)
 
 static void real_collection_button_pressed(FileDialog *fd, gpointer data, gint append)
 {
-       CollectionData *cd = static_cast<CollectionData *>(data);
+       auto cd = static_cast<CollectionData *>(data);
        gboolean err = FALSE;
        gchar *text = NULL;
 
@@ -177,7 +177,7 @@ static void collection_append_cb(FileDialog *fd, gpointer data)
 
 static void collection_save_or_load_dialog_close_cb(FileDialog *fd, gpointer data)
 {
-       CollectionData *cd = static_cast<CollectionData *>(data);
+       auto cd = static_cast<CollectionData *>(data);
 
        if (cd) collection_unref(cd);
        file_dialog_close(fd);
index db16195..6d69d59 100644 (file)
@@ -295,7 +295,7 @@ static void collection_load_thumb_do(CollectionData *cd)
 
 static void collection_load_thumb_error_cb(ThumbLoader *UNUSED(tl), gpointer data)
 {
-       CollectionData *cd = static_cast<CollectionData *>(data);
+       auto cd = static_cast<CollectionData *>(data);
 
        collection_load_thumb_do(cd);
        collection_load_thumb_step(cd);
@@ -303,7 +303,7 @@ static void collection_load_thumb_error_cb(ThumbLoader *UNUSED(tl), gpointer dat
 
 static void collection_load_thumb_done_cb(ThumbLoader *UNUSED(tl), gpointer data)
 {
-       CollectionData *cd = static_cast<CollectionData *>(data);
+       auto cd = static_cast<CollectionData *>(data);
 
        collection_load_thumb_do(cd);
        collection_load_thumb_step(cd);
@@ -418,7 +418,7 @@ static gboolean collection_save_private(CollectionData *cd, const gchar *path)
        work = cd->list;
        while (work && secsave_errno == SS_ERR_NONE)
                {
-               CollectInfo *ci = static_cast<CollectInfo *>(work->data);
+               auto ci = static_cast<CollectInfo *>(work->data);
                secure_fprintf(ssi, "\"%s\"\n", ci->fd->path);
                work = work->next;
                }
@@ -1020,18 +1020,18 @@ void collect_manager_notify_cb(FileData *fd, NotifyType type, gpointer UNUSED(da
 
 static gint collection_manager_sort_cb(gconstpointer a, gconstpointer b)
 {
-       const gchar *char_a = static_cast<const gchar *>(a);
-       const gchar *char_b = static_cast<const gchar *>(b);
+       auto char_a = static_cast<const gchar *>(a);
+       auto char_b = static_cast<const gchar *>(b);
 
        return g_strcmp0(char_a, char_b);
 }
+
 /**
  * @brief Creates sorted list of collections
  * @param[out] names_exc sorted list of collections names excluding extension
  * @param[out] names_inc sorted list of collections names including extension
  * @param[out] paths sorted list of collection paths
- * 
+ *
  * Lists of type gchar.
  * Used lists must be freed with string_list_free()
  */
index 81f65c2..2fb555f 100644 (file)
@@ -189,7 +189,7 @@ static guint collection_table_list_count(CollectTable *ct, gint64 *bytes)
                work = ct->cd->list;
                while (work)
                        {
-                       CollectInfo *ci = static_cast<CollectInfo *>(work->data);
+                       auto ci = static_cast<CollectInfo *>(work->data);
                        work = work->next;
                        b += ci->fd->size;
                        }
@@ -210,7 +210,7 @@ static guint collection_table_selection_count(CollectTable *ct, gint64 *bytes)
                work = ct->selection;
                while (work)
                        {
-                       CollectInfo *ci = static_cast<CollectInfo *>(work->data);
+                       auto ci = static_cast<CollectInfo *>(work->data);
                        work = work->next;
                        b += ci->fd->size;
                        }
@@ -365,7 +365,7 @@ static void collection_table_verify_selections(CollectTable *ct)
        work = ct->selection;
        while (work)
                {
-               CollectInfo *info = static_cast<CollectInfo *>(work->data);
+               auto info = static_cast<CollectInfo *>(work->data);
                work = work->next;
                if (!g_list_find(ct->cd->list, info))
                        {
@@ -418,7 +418,7 @@ static void collection_table_select_invert_all(CollectTable *ct)
        work = ct->cd->list;
        while (work)
                {
-               CollectInfo *info = static_cast<CollectInfo *>(work->data);
+               auto info = static_cast<CollectInfo *>(work->data);
 
                if (INFO_SELECTED(info))
                        {
@@ -601,7 +601,7 @@ static void tip_hide(CollectTable *ct)
 
 static gboolean tip_schedule_cb(gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        if (!ct->tip_delay_id) return FALSE;
 
@@ -675,14 +675,14 @@ static void tip_update(CollectTable *ct, CollectInfo *info)
 
 static void collection_table_popup_save_as_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_dialog_save_as(NULL, ct->cd);
 }
 
 static void collection_table_popup_save_cb(GtkWidget *widget, gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        if (!ct->cd->path)
                {
@@ -711,7 +711,7 @@ static GList *collection_table_popup_file_list(CollectTable *ct)
 static void collection_table_popup_edit_cb(GtkWidget *widget, gpointer data)
 {
        CollectTable *ct;
-       const gchar *key = static_cast<const gchar *>(data);
+       auto key = static_cast<const gchar *>(data);
 
        ct = static_cast<CollectTable *>(submenu_item_get_data(widget));
 
@@ -722,28 +722,28 @@ static void collection_table_popup_edit_cb(GtkWidget *widget, gpointer data)
 
 static void collection_table_popup_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        file_util_copy(NULL, collection_table_popup_file_list(ct), NULL, ct->listview);
 }
 
 static void collection_table_popup_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        file_util_move(NULL, collection_table_popup_file_list(ct), NULL, ct->listview);
 }
 
 static void collection_table_popup_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        file_util_rename(NULL, collection_table_popup_file_list(ct), ct->listview);
 }
 
 static void collection_table_popup_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        options->file_ops.safe_delete_enable = FALSE;
        file_util_delete(NULL, collection_table_popup_file_list(ct), ct->listview);
@@ -751,7 +751,7 @@ static void collection_table_popup_delete_cb(GtkWidget *UNUSED(widget), gpointer
 
 static void collection_table_popup_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        options->file_ops.safe_delete_enable = TRUE;
        file_util_delete(NULL, collection_table_popup_file_list(ct), ct->listview);
@@ -759,14 +759,14 @@ static void collection_table_popup_move_to_trash_cb(GtkWidget *UNUSED(widget), g
 
 static void collection_table_popup_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        file_util_copy_path_list_to_clipboard(collection_table_popup_file_list(ct), TRUE);
 }
 
 static void collection_table_popup_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        file_util_copy_path_list_to_clipboard(collection_table_popup_file_list(ct), FALSE);
 }
@@ -798,7 +798,7 @@ static void collection_table_popup_randomize_cb(GtkWidget *widget, gpointer UNUS
 
 static void collection_table_popup_view_new_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        if (ct->click_info && g_list_find(ct->cd->list, ct->click_info))
                {
@@ -808,7 +808,7 @@ static void collection_table_popup_view_new_cb(GtkWidget *UNUSED(widget), gpoint
 
 static void collection_table_popup_view_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        if (ct->click_info && g_list_find(ct->cd->list, ct->click_info))
                {
@@ -818,7 +818,7 @@ static void collection_table_popup_view_cb(GtkWidget *UNUSED(widget), gpointer d
 
 static void collection_table_popup_selectall_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_select_all(ct);
        ct->prev_selection= ct->click_info;
@@ -826,7 +826,7 @@ static void collection_table_popup_selectall_cb(GtkWidget *UNUSED(widget), gpoin
 
 static void collection_table_popup_unselectall_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_unselect_all(ct);
        ct->prev_selection= ct->click_info;
@@ -834,7 +834,7 @@ static void collection_table_popup_unselectall_cb(GtkWidget *UNUSED(widget), gpo
 
 static void collection_table_popup_select_invert_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_select_invert_all(ct);
        ct->prev_selection= ct->click_info;
@@ -847,7 +847,7 @@ static void collection_table_popup_rectangular_selection_cb(GtkWidget *UNUSED(wi
 
 static void collection_table_popup_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        GList *list;
 
        if (!ct->click_info) return;
@@ -867,7 +867,7 @@ static void collection_table_popup_remove_cb(GtkWidget *UNUSED(widget), gpointer
 
 static void collection_table_popup_add_file_selection_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        GList *list;
        LayoutWindow *lw = NULL;
 
@@ -884,14 +884,14 @@ static void collection_table_popup_add_file_selection_cb(GtkWidget *UNUSED(widge
 
 static void collection_table_popup_add_collection_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_dialog_append(NULL, ct->cd);
 }
 
 static void collection_table_popup_goto_original_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        GList *list;
        LayoutWindow *lw = NULL;
        FileData *fd;
@@ -911,7 +911,7 @@ static void collection_table_popup_goto_original_cb(GtkWidget *UNUSED(widget), g
 
 static void collection_table_popup_find_dupes_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        DupeWindow *dw;
 
        dw = dupe_window_new();
@@ -920,7 +920,7 @@ static void collection_table_popup_find_dupes_cb(GtkWidget *UNUSED(widget), gpoi
 
 static void collection_table_popup_print_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        FileData *fd;
 
        fd = (ct->click_info) ? ct->click_info->fd : NULL;
@@ -930,21 +930,21 @@ static void collection_table_popup_print_cb(GtkWidget *UNUSED(widget), gpointer
 
 static void collection_table_popup_show_names_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_toggle_filenames(ct);
 }
 
 static void collection_table_popup_show_stars_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_toggle_stars(ct);
 }
 
 static void collection_table_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_selection_remove(ct, ct->click_info, SELECTION_PRELIGHT, NULL);
        ct->click_info = NULL;
@@ -1241,7 +1241,7 @@ static gint page_height(CollectTable *ct)
 
 static gboolean collection_table_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        gint focus_row = 0;
        gint focus_col = 0;
        CollectInfo *info;
@@ -1604,7 +1604,7 @@ static void collection_table_motion_update(CollectTable *ct, gint x, gint y, gbo
 
 static gboolean collection_table_auto_scroll_idle_cb(gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        GdkWindow *window;
        gint x, y;
        gint w, h;
@@ -1631,7 +1631,7 @@ static gboolean collection_table_auto_scroll_idle_cb(gpointer data)
 
 static gboolean collection_table_auto_scroll_notify_cb(GtkWidget *UNUSED(widget), gint UNUSED(x), gint UNUSED(y), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        if (!ct->drop_idle_id)
                {
@@ -1669,7 +1669,7 @@ static void collection_table_scroll(CollectTable *ct, gboolean scroll)
 
 static gboolean collection_table_motion_cb(GtkWidget *UNUSED(widget), GdkEventMotion *event, gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_motion_update(ct, (gint)event->x, (gint)event->y, FALSE);
 
@@ -1678,7 +1678,7 @@ static gboolean collection_table_motion_cb(GtkWidget *UNUSED(widget), GdkEventMo
 
 static gboolean collection_table_press_cb(GtkWidget *UNUSED(widget), GdkEventButton *bevent, gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        GtkTreeIter iter;
        CollectInfo *info;
 
@@ -1717,7 +1717,7 @@ static gboolean collection_table_press_cb(GtkWidget *UNUSED(widget), GdkEventBut
 
 static gboolean collection_table_release_cb(GtkWidget *UNUSED(widget), GdkEventButton *bevent, gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        GtkTreeIter iter;
        CollectInfo *info = NULL;
 
@@ -1777,7 +1777,7 @@ static gboolean collection_table_release_cb(GtkWidget *UNUSED(widget), GdkEventB
 
 static gboolean collection_table_leave_cb(GtkWidget *UNUSED(widget), GdkEventCrossing *UNUSED(event), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        tip_unschedule(ct);
        return FALSE;
@@ -1974,7 +1974,7 @@ static void collection_table_sync(CollectTable *ct)
 
 static gboolean collection_table_sync_idle_cb(gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        if (!ct->sync_idle_id) return G_SOURCE_REMOVE;
        g_source_remove(ct->sync_idle_id);
@@ -2190,7 +2190,7 @@ static void confirm_dir_list_do(CollectTable *ct, GList *list, gboolean recursiv
        GList *work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                if (isdir(fd->path)) collection_table_add_dir_recursive(ct, fd, recursive);
                }
@@ -2200,21 +2200,21 @@ static void confirm_dir_list_do(CollectTable *ct, GList *list, gboolean recursiv
 
 static void confirm_dir_list_add(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        confirm_dir_list_do(ct, ct->drop_list, FALSE);
 }
 
 static void confirm_dir_list_recurse(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        confirm_dir_list_do(ct, ct->drop_list, TRUE);
 }
 
 static void confirm_dir_list_skip(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_insert_filelist(ct, ct->drop_list, ct->marker_info);
 }
@@ -2265,7 +2265,7 @@ static void collection_table_dnd_get(GtkWidget *UNUSED(widget), GdkDragContext *
                                     GtkSelectionData *selection_data, guint info,
                                     guint UNUSED(time), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        gboolean selected;
        GList *list = NULL;
        gchar *uri_text = NULL;
@@ -2317,7 +2317,7 @@ static void collection_table_dnd_receive(GtkWidget *UNUSED(widget), GdkDragConte
                                          GtkSelectionData *selection_data, guint info,
                                          guint UNUSED(time), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
        GList *list = NULL;
        GList *info_list = NULL;
        CollectionData *source;
@@ -2371,7 +2371,7 @@ static void collection_table_dnd_receive(GtkWidget *UNUSED(widget), GdkDragConte
                        work = list;
                        while (work)
                                {
-                               FileData *fd = static_cast<FileData *>(work->data);
+                               auto fd = static_cast<FileData *>(work->data);
                                if (isdir(fd->path))
                                        {
                                        GtkWidget *menu;
@@ -2399,7 +2399,7 @@ static void collection_table_dnd_receive(GtkWidget *UNUSED(widget), GdkDragConte
 
 static void collection_table_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        if (ct->click_info && ct->click_info->pixbuf)
                {
@@ -2415,7 +2415,7 @@ static void collection_table_dnd_begin(GtkWidget *widget, GdkDragContext *contex
 
 static void collection_table_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        /* apparently a leave event is not generated on a drop */
        tip_unschedule(ct);
@@ -2426,7 +2426,7 @@ static void collection_table_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *
 static gint collection_table_dnd_motion(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context),
                                        gint x, gint y, guint UNUSED(time), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_motion_update(ct, x, y, TRUE);
        collection_table_scroll(ct, TRUE);
@@ -2436,7 +2436,7 @@ static gint collection_table_dnd_motion(GtkWidget *UNUSED(widget), GdkDragContex
 
 static void collection_table_dnd_leave(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), guint UNUSED(time), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_scroll(ct, FALSE);
 }
@@ -2481,7 +2481,7 @@ struct _ColumnData
 static void collection_table_cell_data_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellRenderer *cell,
                                          GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
 {
-       ColumnData *cd = static_cast<ColumnData *>(data);
+       auto cd = static_cast<ColumnData *>(data);
        CollectTable *ct;
        GtkStyle *style;
        GList *list;
@@ -2616,7 +2616,7 @@ static void collection_table_append_column(CollectTable *ct, gint n)
 
 static void collection_table_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        /* If there is no unsaved data, save the window geometry
         */
@@ -2645,7 +2645,7 @@ static void collection_table_destroy(GtkWidget *UNUSED(widget), gpointer data)
 
 static void collection_table_sized(GtkWidget *UNUSED(widget), GtkAllocation *allocation, gpointer data)
 {
-       CollectTable *ct = static_cast<CollectTable *>(data);
+       auto ct = static_cast<CollectTable *>(data);
 
        collection_table_populate_at_new_size(ct, allocation->width, allocation->height, FALSE);
 }
index 81da781..19c7dbd 100644 (file)
 
 /**
  * @brief  List of currently open Collections.
- * 
- * Type ::_CollectionData 
+ *
+ * Type ::_CollectionData
  */
 static GList *collection_list = NULL;
 
 /**
  * @brief  List of currently open Collection windows.
- * 
+ *
  * Type ::_CollectWindow
  */
 static GList *collection_window_list = NULL;
@@ -139,8 +139,8 @@ static SortType collection_list_sort_method = SORT_NAME;
 
 static gint collection_list_sort_cb(gconstpointer a, gconstpointer b)
 {
-       const CollectInfo *cia = static_cast<const CollectInfo *>(a);
-       const CollectInfo *cib = static_cast<const CollectInfo *>(b);
+       auto cia = static_cast<const CollectInfo *>(a);
+       auto cib = static_cast<const CollectInfo *>(b);
 
        switch (collection_list_sort_method)
                {
@@ -272,7 +272,7 @@ CollectInfo *collection_list_find_fd(GList *list, FileData *fd)
 
        while (work)
                {
-               CollectInfo *ci = static_cast<CollectInfo *>(work->data);
+               auto ci = static_cast<CollectInfo *>(work->data);
                if (ci->fd == fd) return ci;
                work = work->next;
                }
@@ -287,7 +287,7 @@ GList *collection_list_to_filelist(GList *list)
 
        while (work)
                {
-               CollectInfo *info = static_cast<CollectInfo *>(work->data);
+               auto info = static_cast<CollectInfo *>(work->data);
                filelist = g_list_prepend(filelist, file_data_ref(info->fd));
                work = work->next;
                }
@@ -303,7 +303,7 @@ CollectWindow *collection_window_find(CollectionData *cd)
        work = collection_window_list;
        while (work)
                {
-               CollectWindow *cw = static_cast<CollectWindow *>(work->data);
+               auto cw = static_cast<CollectWindow *>(work->data);
                if (cw->cd == cd) return cw;
                work = work->next;
                }
@@ -320,7 +320,7 @@ CollectWindow *collection_window_find_by_path(const gchar *path)
        work = collection_window_list;
        while (work)
                {
-               CollectWindow *cw = static_cast<CollectWindow *>(work->data);
+               auto cw = static_cast<CollectWindow *>(work->data);
                if (cw->cd->path && strcmp(cw->cd->path, path) == 0) return cw;
                work = work->next;
                }
@@ -332,7 +332,7 @@ CollectWindow *collection_window_find_by_path(const gchar *path)
  * @brief Checks string for existence of Collection.
  * @param[in] param Filename, with or without extension of any collection
  * @returns full pathname if found or NULL
- * 
+ *
  * Return value must be freed with g_free()
  */
 gchar *collection_path(const gchar *param)
@@ -364,8 +364,8 @@ gchar *collection_path(const gchar *param)
  * @brief Checks input string for existence of Collection.
  * @param[in] param Filename with or without extension of any collection
  * @returns TRUE if found
- * 
- * 
+ *
+ *
  */
 gboolean is_collection(const gchar *param)
 {
@@ -384,8 +384,8 @@ gboolean is_collection(const gchar *param)
  * @brief Creates a text list of the image paths of the contents of a Collection
  * @param[in] name The name of the collection, with or without extension
  * @param[inout] contents A GString to which the image paths are appended
- * 
- * 
+ *
+ *
  */
 void collection_contents(const gchar *name, GString **contents)
 {
@@ -418,8 +418,8 @@ void collection_contents(const gchar *name, GString **contents)
 /**
  * @brief Returns a list of filedatas of the contents of a Collection
  * @param[in] name The name of the collection, with or without extension
- * 
- * 
+ *
+ *
  */
 GList *collection_contents_fd(const gchar *name)
 {
@@ -638,7 +638,7 @@ gchar *collection_info_list_to_dnd_data(CollectionData *cd, GList *list, gint *l
        while (work)
                {
                gint len;
-               gchar *text = static_cast<gchar *>(work->data);
+               auto text = static_cast<gchar *>(work->data);
 
                work = work->prev;
 
@@ -901,7 +901,7 @@ void collection_update_geometry(CollectionData *cd)
 
 static void collection_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       CollectionData *cd = static_cast<CollectionData *>(data);
+       auto cd = static_cast<CollectionData *>(data);
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
 
@@ -934,7 +934,7 @@ static void collection_notify_cb(FileData *fd, NotifyType type, gpointer data)
 
 static gboolean collection_window_keypress(GtkWidget *UNUSED(widget), GdkEventKey *event, gpointer data)
 {
-       CollectWindow *cw = static_cast<CollectWindow *>(data);
+       auto cw = static_cast<CollectWindow *>(data);
        gboolean stop_signal = FALSE;
        GList *list;
 
@@ -1131,7 +1131,7 @@ static void collection_window_update_title(CollectWindow *cw)
 
 static void collection_window_update_info(CollectionData *UNUSED(cd), CollectInfo *ci, gpointer data)
 {
-       CollectWindow *cw = static_cast<CollectWindow *>(data);
+       auto cw = static_cast<CollectWindow *>(data);
 
        collection_table_file_update(cw->table, ci);
 }
@@ -1185,7 +1185,7 @@ static void collection_window_close_final(CollectWindow *cw)
 
 static void collection_close_save_cb(GenericDialog *gd, gpointer data)
 {
-       CollectWindow *cw = static_cast<CollectWindow *>(data);
+       auto cw = static_cast<CollectWindow *>(data);
 
        cw->close_dialog = NULL;
        generic_dialog_close(gd);
@@ -1209,7 +1209,7 @@ static void collection_close_save_cb(GenericDialog *gd, gpointer data)
 
 static void collection_close_close_cb(GenericDialog *gd, gpointer data)
 {
-       CollectWindow *cw = static_cast<CollectWindow *>(data);
+       auto cw = static_cast<CollectWindow *>(data);
 
        cw->close_dialog = NULL;
        generic_dialog_close(gd);
@@ -1219,7 +1219,7 @@ static void collection_close_close_cb(GenericDialog *gd, gpointer data)
 
 static void collection_close_cancel_cb(GenericDialog *gd, gpointer data)
 {
-       CollectWindow *cw = static_cast<CollectWindow *>(data);
+       auto cw = static_cast<CollectWindow *>(data);
 
        cw->close_dialog = NULL;
        generic_dialog_close(gd);
@@ -1272,7 +1272,7 @@ void collection_window_close_by_collection(CollectionData *cd)
 /**
  * @brief Check if any Collection windows have unsaved data
  * @returns TRUE if unsaved data exists
- * 
+ *
  * Also saves window geometry for Collection windows that have
  * no unsaved data
  */
@@ -1286,7 +1286,7 @@ gboolean collection_window_modified_exists(void)
        work = collection_window_list;
        while (work)
                {
-               CollectWindow *cw = static_cast<CollectWindow *>(work->data);
+               auto cw = static_cast<CollectWindow *>(work->data);
                if (cw->cd->changed)
                        {
                        ret = TRUE;
@@ -1306,7 +1306,7 @@ gboolean collection_window_modified_exists(void)
 
 static gboolean collection_window_delete(GtkWidget *UNUSED(widget), GdkEvent *UNUSED(event), gpointer data)
 {
-       CollectWindow *cw = static_cast<CollectWindow *>(data);
+       auto cw = static_cast<CollectWindow *>(data);
        collection_window_close(cw);
 
        return TRUE;
index e0d65df..334affd 100644 (file)
@@ -39,7 +39,7 @@ static gchar *regexp = NULL;
 
 static gboolean log_msg_cb(gpointer data)
 {
-       gchar *buf = static_cast<gchar *>(data);
+       auto buf = static_cast<gchar *>(data);
        log_window_append(buf, LOG_MSG);
        g_free(buf);
        return FALSE;
@@ -55,7 +55,7 @@ static gboolean log_msg_cb(gpointer data)
  */
 static gboolean log_normal_cb(gpointer data)
 {
-       gchar *buf = static_cast<gchar *>(data);
+       auto buf = static_cast<gchar *>(data);
        gchar *buf_casefold = g_utf8_casefold(buf, -1);
        gchar *error_casefold = g_utf8_casefold(_("error"), -1);
        gchar *warning_casefold = g_utf8_casefold(_("warning"), -1);
index 9f771a8..52e575c 100644 (file)
@@ -111,7 +111,7 @@ static gboolean editor_window_save(EditorWindow *ew)
 
 static void editor_window_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       EditorWindow *ew = static_cast<EditorWindow *>(data);
+       auto ew = static_cast<EditorWindow *>(data);
 
        g_free(ew->desktop_name);
        gtk_widget_destroy(ew->window);
@@ -126,7 +126,7 @@ static gint editor_window_delete_cb(GtkWidget *w, GdkEventAny *UNUSED(event), gp
 
 static void editor_window_save_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       EditorWindow *ew = static_cast<EditorWindow *>(data);
+       auto ew = static_cast<EditorWindow *>(data);
 
        if (ew->modified)
                {
@@ -140,7 +140,7 @@ static void editor_window_save_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void editor_window_text_modified_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       EditorWindow *ew = static_cast<EditorWindow *>(data);
+       auto ew = static_cast<EditorWindow *>(data);
 
        if (gtk_text_buffer_get_modified(ew->buffer))
                {
@@ -151,7 +151,7 @@ static void editor_window_text_modified_cb(GtkWidget *UNUSED(widget), gpointer d
 
 static void editor_window_entry_changed_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       EditorWindow *ew = static_cast<EditorWindow *>(data);
+       auto ew = static_cast<EditorWindow *>(data);
        const gchar *content = gtk_entry_get_text(GTK_ENTRY(ew->entry));
        gboolean modified = ew->modified;
 
@@ -282,7 +282,7 @@ static void editor_list_window_delete_dlg_cancel(GenericDialog *gd, gpointer dat
 
 static void editor_list_window_delete_dlg_cancel(GenericDialog *UNUSED(gd), gpointer data)
 {
-       EditorWindowDel_Data *ewdl = static_cast<EditorWindowDel_Data *>(data);
+       auto ewdl = static_cast<EditorWindowDel_Data *>(data);
 
        ewdl->ewl->gd = NULL;
        g_free(ewdl->path);
@@ -291,7 +291,7 @@ static void editor_list_window_delete_dlg_cancel(GenericDialog *UNUSED(gd), gpoi
 
 static void editor_list_window_delete_dlg_ok_cb(GenericDialog *gd, gpointer data)
 {
-       EditorWindowDel_Data *ewdl = static_cast<EditorWindowDel_Data *>(data);
+       auto ewdl = static_cast<EditorWindowDel_Data *>(data);
 
        if (!unlink_file(ewdl->path))
                {
@@ -312,7 +312,7 @@ static void editor_list_window_delete_dlg_ok_cb(GenericDialog *gd, gpointer data
 
 static void editor_list_window_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       EditorListWindow *ewl = static_cast<EditorListWindow *>(data);
+       auto ewl = static_cast<EditorListWindow *>(data);
        GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(ewl->view));
        GtkTreeIter iter;
 
@@ -357,7 +357,7 @@ static void editor_list_window_delete_cb(GtkWidget *UNUSED(widget), gpointer dat
 
 static void editor_list_window_edit_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       EditorListWindow *ewl = static_cast<EditorListWindow *>(data);
+       auto ewl = static_cast<EditorListWindow *>(data);
        GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(ewl->view));
        GtkTreeIter iter;
 
@@ -388,7 +388,7 @@ static void editor_list_window_help_cb(GtkWidget *UNUSED(widget), gpointer UNUSE
 
 static void editor_list_window_selection_changed_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       EditorListWindow *ewl = static_cast<EditorListWindow *>(data);
+       auto ewl = static_cast<EditorListWindow *>(data);
        GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(ewl->view));
        GtkTreeIter iter;
 
@@ -469,7 +469,7 @@ static gint editor_list_window_sort_cb(GtkTreeModel *model, GtkTreeIter *a, GtkT
 
 static void plugin_disable_cb(GtkCellRendererToggle *UNUSED(renderer), gchar *path_str, gpointer data)
 {
-       EditorListWindow *ewl = static_cast<EditorListWindow *>(data);
+       auto ewl = static_cast<EditorListWindow *>(data);
        GtkTreePath *tpath;
        GtkTreeIter iter;
        GtkTreeModel *model;
index a518a29..114bb98 100644 (file)
@@ -171,7 +171,7 @@ void dnd_set_drag_icon(GtkWidget *widget, GdkDragContext *context, GdkPixbuf *pi
 
 static void dnd_set_drag_label_end_cb(GtkWidget *widget, GdkDragContext *UNUSED(context), gpointer data)
 {
-       GtkWidget *window = static_cast<GtkWidget *>(data);
+       auto window = static_cast<GtkWidget *>(data);
        g_signal_handlers_disconnect_by_func(widget, (gpointer)dnd_set_drag_label_end_cb, data);
        gtk_widget_destroy(window);
 }
index 33b8b93..4662197 100644 (file)
@@ -167,7 +167,7 @@ hard_coded_window_keys dupe_window_keys[] = {
  * @brief The function run in threads for similarity checks
  * @param d1 #DupeQueueItem
  * @param d2 #DupeWindow
- * 
+ *
  * Used only for similarity checks.\n
  * Search \a dqi->list for \a dqi->needle and if a match is
  * found, create a #DupeSearchMatch and add to \a dw->search_matches list\n
@@ -175,8 +175,8 @@ hard_coded_window_keys dupe_window_keys[] = {
  */
 static void dupe_comparison_func(gpointer d1, gpointer d2)
 {
-       DupeQueueItem *dqi = static_cast<DupeQueueItem *>(d1);
-       DupeWindow *dw = static_cast<DupeWindow *>(d2);
+       auto dqi = static_cast<DupeQueueItem *>(d1);
+       auto dw = static_cast<DupeWindow *>(d2);
        DupeSearchMatch *dsm;
        DupeItem *di;
        GList *matches = NULL;
@@ -235,10 +235,10 @@ static void dupe_comparison_func(gpointer d1, gpointer d2)
 
 /**
  * @brief Update display of status label
- * @param dw 
- * @param count_only 
- * 
- * 
+ * @param dw
+ * @param count_only
+ *
+ *
  */
 static void dupe_window_update_count(DupeWindow *dw, gboolean count_only)
 {
@@ -270,9 +270,9 @@ static void dupe_window_update_count(DupeWindow *dw, gboolean count_only)
 
 /**
  * @brief Returns time in Âµsec since Epoch
- * @returns 
- * 
- * 
+ * @returns
+ *
+ *
  */
 static guint64 msec_time(void)
 {
@@ -289,14 +289,14 @@ static gint dupe_iterations(gint n)
 }
 
 /**
- * @brief 
- * @param dw 
- * @param status 
- * @param value 
- * @param force 
- * 
+ * @brief
+ * @param dw
+ * @param status
+ * @param value
+ * @param force
+ *
  * If \a status is blank, clear status bar text and set progress to zero. \n
- * If \a force is not set, after 2 secs has elapsed, update time-to-go every 250 ms. 
+ * If \a force is not set, after 2 secs has elapsed, update time-to-go every 250 ms.
  */
 static void dupe_window_update_progress(DupeWindow *dw, const gchar *status, gdouble value, gboolean force)
 {
@@ -473,7 +473,7 @@ static void dupe_list_free(GList *list)
        GList *work = list;
        while (work)
                {
-               DupeItem *di = static_cast<DupeItem *>(work->data);
+               auto di = static_cast<DupeItem *>(work->data);
                work = work->next;
                dupe_item_free(di);
                }
@@ -751,7 +751,7 @@ static void dupe_listview_populate(DupeWindow *dw)
        work = g_list_last(dw->dupes);
        while (work)
                {
-               DupeItem *parent = static_cast<DupeItem *>(work->data);
+               auto parent = static_cast<DupeItem *>(work->data);
                GList *temp;
 
                dupe_listview_add(dw, parent, NULL);
@@ -759,7 +759,7 @@ static void dupe_listview_populate(DupeWindow *dw)
                temp = g_list_last(parent->group);
                while (temp)
                        {
-                       DupeMatch *dm = static_cast<DupeMatch *>(temp->data);
+                       auto dm = static_cast<DupeMatch *>(temp->data);
                        DupeItem *child;
 
                        child = dm->di;
@@ -842,7 +842,7 @@ static GList *dupe_listview_get_selection(DupeWindow *UNUSED(dw), GtkWidget *lis
        work = slist;
        while (work)
                {
-               GtkTreePath *tpath = static_cast<GtkTreePath *>(work->data);
+               auto tpath = static_cast<GtkTreePath *>(work->data);
                DupeItem *di = NULL;
                GtkTreeIter iter;
 
@@ -873,7 +873,7 @@ static gboolean dupe_listview_item_is_selected(DupeWindow *UNUSED(dw), DupeItem
        work = slist;
        while (!found && work)
                {
-               GtkTreePath *tpath = static_cast<GtkTreePath *>(work->data);
+               auto tpath = static_cast<GtkTreePath *>(work->data);
                DupeItem *di_n;
                GtkTreeIter iter;
 
@@ -934,10 +934,10 @@ static void dupe_listview_select_dupes(DupeWindow *dw, DupeSelectType parents)
 
 /**
  * @brief Search \a parent->group for \a child (#DupeItem)
- * @param child 
- * @param parent 
- * @returns 
- * 
+ * @param child
+ * @param parent
+ * @returns
+ *
  */
 static DupeMatch *dupe_match_find_match(DupeItem *child, DupeItem *parent)
 {
@@ -946,7 +946,7 @@ static DupeMatch *dupe_match_find_match(DupeItem *child, DupeItem *parent)
        work = parent->group;
        while (work)
                {
-               DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+               auto dm = static_cast<DupeMatch *>(work->data);
                if (dm->di == child) return dm;
                work = work->next;
                }
@@ -955,10 +955,10 @@ static DupeMatch *dupe_match_find_match(DupeItem *child, DupeItem *parent)
 
 /**
  * @brief Create #DupeMatch structure for \a child, and insert into \a parent->group list.
- * @param child 
- * @param parent 
- * @param rank 
- * 
+ * @param child
+ * @param parent
+ * @param rank
+ *
  */
 static void dupe_match_link_child(DupeItem *child, DupeItem *parent, gdouble rank)
 {
@@ -972,10 +972,10 @@ static void dupe_match_link_child(DupeItem *child, DupeItem *parent, gdouble ran
 
 /**
  * @brief Link \a a & \a b as both parent and child
- * @param a 
- * @param b 
- * @param rank 
- * 
+ * @param a
+ * @param b
+ * @param rank
+ *
  * Link \a a as child of \a b, and \a b as child of \a a
  */
 static void dupe_match_link(DupeItem *a, DupeItem *b, gdouble rank)
@@ -986,9 +986,9 @@ static void dupe_match_link(DupeItem *a, DupeItem *b, gdouble rank)
 
 /**
  * @brief Remove \a child #DupeMatch from \a parent->group list.
- * @param child 
- * @param parent 
- * 
+ * @param child
+ * @param parent
+ *
  */
 static void dupe_match_unlink_child(DupeItem *child, DupeItem *parent)
 {
@@ -1004,8 +1004,8 @@ static void dupe_match_unlink_child(DupeItem *child, DupeItem *parent)
 
 /**
  * @brief  Unlink \a a from \a b, and \a b from \a a
- * @param a 
- * @param b 
+ * @param a
+ * @param b
  *
  * Free the relevant #DupeMatch items from the #DupeItem group lists
  */
@@ -1016,10 +1016,10 @@ static void dupe_match_unlink(DupeItem *a, DupeItem *b)
 }
 
 /**
- * @brief 
- * @param parent 
- * @param unlink_children 
- * 
+ * @brief
+ * @param parent
+ * @param unlink_children
+ *
  * If \a unlink_children is set, unlink all entries in \a parent->group list. \n
  * Free the \a parent->group list and set group_rank to zero;
  */
@@ -1030,7 +1030,7 @@ static void dupe_match_link_clear(DupeItem *parent, gboolean unlink_children)
        work = parent->group;
        while (work)
                {
-               DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+               auto dm = static_cast<DupeMatch *>(work->data);
                work = work->next;
 
                if (unlink_children) dupe_match_unlink_child(parent, dm->di);
@@ -1045,10 +1045,10 @@ static void dupe_match_link_clear(DupeItem *parent, gboolean unlink_children)
 
 /**
  * @brief Search \a parent->group list for \a child
- * @param child 
- * @param parent 
+ * @param child
+ * @param parent
  * @returns boolean TRUE/FALSE found/not found
- * 
+ *
  */
 static gint dupe_match_link_exists(DupeItem *child, DupeItem *parent)
 {
@@ -1057,8 +1057,8 @@ static gint dupe_match_link_exists(DupeItem *child, DupeItem *parent)
 
 /**
  * @brief  Search \a parent->group for \a child, and return \a child->rank
- * @param child 
- * @param parent 
+ * @param child
+ * @param parent
  * @returns \a dm->di->rank
  *
  */
@@ -1074,9 +1074,9 @@ static gdouble dupe_match_link_rank(DupeItem *child, DupeItem *parent)
 
 /**
  * @brief Find highest rank in \a child->group
- * @param child 
- * @returns 
- * 
+ * @param child
+ * @returns
+ *
  * Search the #DupeMatch entries in the \a child->group list.
  * Return the #DupeItem with the highest rank. If more than one have
  * the same rank, the first encountered is used.
@@ -1090,7 +1090,7 @@ static DupeItem *dupe_match_highest_rank(DupeItem *child)
        work = child->group;
        while (work)
                {
-               DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+               auto dm = static_cast<DupeMatch *>(work->data);
                if (!dr || dm->rank > dr->rank)
                        {
                        dr = dm;
@@ -1101,10 +1101,10 @@ static DupeItem *dupe_match_highest_rank(DupeItem *child)
        return (dr) ? dr->di : NULL;
 }
 
-/** 
+/**
  * @brief Compute and store \a parent->group_rank
- * @param parent 
- * 
+ * @param parent
+ *
  * Group_rank = (sum of all child ranks) / n
  */
 static void dupe_match_rank_update(DupeItem *parent)
@@ -1116,7 +1116,7 @@ static void dupe_match_rank_update(DupeItem *parent)
        work = parent->group;
        while (work)
                {
-               DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+               auto dm = static_cast<DupeMatch *>(work->data);
                work = work->next;
                rank += dm->rank;
                c++;
@@ -1141,7 +1141,7 @@ static DupeItem *dupe_match_find_parent(DupeWindow *dw, DupeItem *child)
        work = child->group;
        while (work)
                {
-               DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+               auto dm = static_cast<DupeMatch *>(work->data);
                if (g_list_find(dw->dupes, dm->di)) return dm->di;
                work = work->next;
                }
@@ -1150,9 +1150,9 @@ static DupeItem *dupe_match_find_parent(DupeWindow *dw, DupeItem *child)
 }
 
 /**
- * @brief 
+ * @brief
  * @param work (#DupeItem) dw->list or dw->second_list
- * 
+ *
  * Unlink all #DupeItem-s in \a work.
  * Do not unlink children.
  */
@@ -1160,7 +1160,7 @@ static void dupe_match_reset_list(GList *work)
 {
        while (work)
                {
-               DupeItem *di = static_cast<DupeItem *>(work->data);
+               auto di = static_cast<DupeItem *>(work->data);
                work = work->next;
 
                dupe_match_link_clear(di, FALSE);
@@ -1177,7 +1177,7 @@ static void dupe_match_reparent(DupeWindow *dw, DupeItem *old_parent, DupeItem *
        work = old_parent->group;
        while (work)
                {
-               DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+               auto dm = static_cast<DupeMatch *>(work->data);
                dupe_match_unlink_child(old_parent, dm->di);
                dupe_match_link_child(new_parent, dm->di, dm->rank);
                work = work->next;
@@ -1199,7 +1199,7 @@ static void dupe_match_print_group(DupeItem *di)
        work = di->group;
        while (work)
                {
-               DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+               auto dm = static_cast<DupeMatch *>(work->data);
                work = work->next;
 
                log_printf("  %f %s\n", dm->rank, dm->di->fd->name);
@@ -1215,7 +1215,7 @@ static void dupe_match_print_list(GList *list)
        work = list;
        while (work)
                {
-               DupeItem *di = static_cast<DupeItem *>(work->data);
+               auto di = static_cast<DupeItem *>(work->data);
                dupe_match_print_group(di);
                work = work->next;
                }
@@ -1223,18 +1223,18 @@ static void dupe_match_print_list(GList *list)
 
 /* level 3, unlinking and orphan handling */
 /**
- * @brief 
- * @param child 
+ * @brief
+ * @param child
  * @param parent \a di from \a child->group
  * @param[inout] list \a dw->list sorted by rank (#DupeItem)
- * @param dw 
+ * @param dw
  * @returns modified \a list
  *
  * Called for each entry in \a child->group (#DupeMatch) with \a parent set to \a dm->di. \n
  * Find the highest rank #DupeItem of the \a parent's children. \n
  * If that is == \a child OR
  * highest rank #DupeItem of \a child == \a parent then FIXME:
- * 
+ *
  */
 static GList *dupe_match_unlink_by_rank(DupeItem *child, DupeItem *parent, GList *list, DupeWindow *dw)
 {
@@ -1251,7 +1251,7 @@ static GList *dupe_match_unlink_by_rank(DupeItem *child, DupeItem *parent, GList
                work = parent->group;
                while (work)
                        {
-                       DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+                       auto dm = static_cast<DupeMatch *>(work->data);
                        DupeItem *orphan;
 
                        work = work->next;
@@ -1285,12 +1285,12 @@ static GList *dupe_match_unlink_by_rank(DupeItem *child, DupeItem *parent, GList
 
 /* level 2 */
 /**
- * @brief 
+ * @brief
  * @param[inout] list \a dw->list sorted by rank (#DupeItem)
- * @param di 
- * @param dw 
+ * @param di
+ * @param dw
  * @returns modified \a list
- * 
+ *
  * Called for each entry in \a list.
  * Call unlink for each child in \a di->group
  */
@@ -1301,7 +1301,7 @@ static GList *dupe_match_group_filter(GList *list, DupeItem *di, DupeWindow *dw)
        work = g_list_last(di->group);
        while (work)
                {
-               DupeMatch *dm = static_cast<DupeMatch *>(work->data);
+               auto dm = static_cast<DupeMatch *>(work->data);
                work = work->prev;
                list = dupe_match_unlink_by_rank(di, dm->di, list, dw);
                }
@@ -1311,11 +1311,11 @@ static GList *dupe_match_group_filter(GList *list, DupeItem *di, DupeWindow *dw)
 
 /* level 1 (top) */
 /**
- * @brief 
+ * @brief
  * @param[inout] list \a dw->list sorted by rank (#DupeItem)
- * @param dw 
+ * @param dw
  * @returns Filtered \a list
- * 
+ *
  * Called once.
  * Call group filter for each \a di in \a list
  */
@@ -1326,7 +1326,7 @@ static GList *dupe_match_group_trim(GList *list, DupeWindow *dw)
        work = list;
        while (work)
                {
-               DupeItem *di = static_cast<DupeItem *>(work->data);
+               auto di = static_cast<DupeItem *>(work->data);
                if (!di->second) list = dupe_match_group_filter(list, di, dw);
                work = work->next;
                if (di->second) list = g_list_remove(list, di);
@@ -1337,8 +1337,8 @@ static GList *dupe_match_group_trim(GList *list, DupeWindow *dw)
 
 static gint dupe_match_sort_groups_cb(gconstpointer a, gconstpointer b)
 {
-       DupeMatch *da = (DupeMatch *)a;
-       DupeMatch *db = (DupeMatch *)b;
+       auto da = (DupeMatch *)a;
+       auto db = (DupeMatch *)b;
 
        if (da->rank > db->rank) return -1;
        if (da->rank < db->rank) return 1;
@@ -1348,7 +1348,7 @@ static gint dupe_match_sort_groups_cb(gconstpointer a, gconstpointer b)
 /**
  * @brief Sorts the children of each #DupeItem in \a list
  * @param list #DupeItem
- * 
+ *
  * Sorts the #DupeItem->group children on rank
  */
 static void dupe_match_sort_groups(GList *list)
@@ -1358,7 +1358,7 @@ static void dupe_match_sort_groups(GList *list)
        work = list;
        while (work)
                {
-               DupeItem *di = static_cast<DupeItem *>(work->data);
+               auto di = static_cast<DupeItem *>(work->data);
                di->group = g_list_sort(di->group, dupe_match_sort_groups_cb);
                work = work->next;
                }
@@ -1366,8 +1366,8 @@ static void dupe_match_sort_groups(GList *list)
 
 static gint dupe_match_totals_sort_cb(gconstpointer a, gconstpointer b)
 {
-       DupeItem *da = (DupeItem *)a;
-       DupeItem *db = (DupeItem *)b;
+       auto da = (DupeItem *)a;
+       auto db = (DupeItem *)b;
 
        if (g_list_length(da->group) > g_list_length(db->group)) return -1;
        if (g_list_length(da->group) < g_list_length(db->group)) return 1;
@@ -1380,16 +1380,16 @@ static gint dupe_match_totals_sort_cb(gconstpointer a, gconstpointer b)
 
 /**
  * @brief Callback for group_rank sort
- * @param a 
- * @param b 
- * @returns 
- * 
- * 
+ * @param a
+ * @param b
+ * @returns
+ *
+ *
  */
 static gint dupe_match_rank_sort_cb(gconstpointer a, gconstpointer b)
 {
-       DupeItem *da = (DupeItem *)a;
-       DupeItem *db = (DupeItem *)b;
+       auto da = (DupeItem *)a;
+       auto db = (DupeItem *)b;
 
        if (da->group_rank > db->group_rank) return -1;
        if (da->group_rank < db->group_rank) return 1;
@@ -1399,7 +1399,7 @@ static gint dupe_match_rank_sort_cb(gconstpointer a, gconstpointer b)
 /**
  * @brief Sorts \a source_list by group-rank
  * @param source_list #DupeItem
- * @returns 
+ * @returns
  *
  * Computes group_rank for each #DupeItem. \n
  * Items with no group list are ignored.
@@ -1413,7 +1413,7 @@ static GList *dupe_match_rank_sort(GList *source_list)
        work = source_list;
        while (work)
                {
-               DupeItem *di = static_cast<DupeItem *>(work->data);
+               auto di = static_cast<DupeItem *>(work->data);
 
                if (di->group)
                        {
@@ -1429,10 +1429,10 @@ static GList *dupe_match_rank_sort(GList *source_list)
 
 /**
  * @brief Returns allocated GList of dupes sorted by totals
- * @param source_list 
- * @returns 
- * 
- * 
+ * @param source_list
+ * @returns
+ *
+ *
  */
 static GList *dupe_match_totals_sort(GList *source_list)
 {
@@ -1443,9 +1443,9 @@ static GList *dupe_match_totals_sort(GList *source_list)
 }
 
 /**
- * @brief 
- * @param dw 
- * 
+ * @brief
+ * @param dw
+ *
  * Called once.
  */
 static void dupe_match_rank(DupeWindow *dw)
@@ -1482,14 +1482,14 @@ static void dupe_match_rank(DupeWindow *dw)
  */
 
 /**
- * @brief 
- * @param[in] a 
- * @param[in] b 
- * @param[in] mask 
- * @param[out] rank 
- * @param[in] fast 
- * @returns 
- * 
+ * @brief
+ * @param[in] a
+ * @param[in] b
+ * @param[in] mask
+ * @param[out] rank
+ * @param[in] fast
+ * @returns
+ *
  * For similarity checks, compute rank - (similarity factor between a and b). \n
  * If rank < user-set sim value, returns FALSE.
  */
@@ -1615,22 +1615,22 @@ static gboolean dupe_match(DupeItem *a, DupeItem *b, DupeMatchType mask, gdouble
 
 /**
  * @brief  Determine if there is a match
- * @param di1 
- * @param di2 
- * @param data 
+ * @param di1
+ * @param di2
+ * @param data
  * @returns DUPE_MATCH/DUPE_NO_MATCH/DUPE_NAME_MATCH
  *                     DUPE_NAME_MATCH is used for name != contents searches:
  *                                                     the name and content match i.e.
  *                                                     no match, but keep searching
- * 
+ *
  * Called when stepping down the array looking for adjacent matches,
  * and from the 2nd set search.
- * 
+ *
  * Is not used for similarity checks.
  */
 static DUPE_CHECK_RESULT dupe_match_check(DupeItem *di1, DupeItem *di2, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        DupeMatchType mask = dw->match_mask;
 
        if (mask & DUPE_MATCH_ALL)
@@ -1720,11 +1720,11 @@ static DUPE_CHECK_RESULT dupe_match_check(DupeItem *di1, DupeItem *di2, gpointer
 
 /**
  * @brief The callback for the binary search
- * @param a 
- * @param b 
+ * @param a
+ * @param b
  * @param param_match_mask
  * @returns negative/0/positive
- * 
+ *
  * Is not used for similarity checks.
  *
  * Used only when two file sets are used.
@@ -1734,7 +1734,7 @@ static DUPE_CHECK_RESULT dupe_match_check(DupeItem *di1, DupeItem *di2, gpointer
 static gint dupe_match_binary_search_cb(gconstpointer a, gconstpointer b)
 {
        const DupeItem *di1 = *((DupeItem **) a);
-       const DupeItem *di2 = static_cast<const DupeItem *>(b);
+       auto di2 = static_cast<const DupeItem *>(b);
        DupeMatchType mask = param_match_mask;
 
        if (mask & DUPE_MATCH_ALL)
@@ -1783,18 +1783,18 @@ static gint dupe_match_binary_search_cb(gconstpointer a, gconstpointer b)
 
 /**
  * @brief The callback for the array sort
- * @param a 
- * @param b 
- * @param data 
+ * @param a
+ * @param b
+ * @param data
  * @returns negative/0/positive
- * 
+ *
  * Is not used for similarity checks.
 */
 static gint dupe_match_sort_cb(gconstpointer a, gconstpointer b, gpointer data)
 {
        const DupeItem *di1 = *((DupeItem **) a);
        const DupeItem *di2 = *((DupeItem **) b);
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        DupeMatchType mask = dw->match_mask;
 
        if (mask & DUPE_MATCH_ALL)
@@ -1854,18 +1854,18 @@ static gint dupe_match_sort_cb(gconstpointer a, gconstpointer b, gpointer data)
 
 /**
  * @brief Check for duplicate matches
- * @param dw 
+ * @param dw
  *
  * Is not used for similarity checks.
  *
  * Loads the file sets into an array and sorts on the searched
  * for parameter.
- * 
+ *
  * If one file set, steps down the array looking for adjacent equal values.
- * 
+ *
  * If two file sets, steps down the first set and for each value
  * does a binary search for matches in the second set.
- */ 
+ */
 static void dupe_array_check(DupeWindow *dw )
 {
        GArray *array_set1;
@@ -1887,7 +1887,7 @@ static void dupe_array_check(DupeWindow *dw )
        work = dw->list;
        while (work)
                {
-               DupeItem *di = static_cast<DupeItem *>(work->data);
+               auto di = static_cast<DupeItem *>(work->data);
                g_array_append_val(array_set1, di);
                work = work->next;
                }
@@ -1909,7 +1909,7 @@ static void dupe_array_check(DupeWindow *dw )
 
                        for (i_set1 = 0; i_set1 <= (gint)(array_set1->len) - 1; i_set1++)
                                {
-                               DupeItem *di1 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1));
+                               auto di1 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1));
                                DupeItem *di2 = NULL;
                                /* If multiple identical entries in set 1, use the last one */
                                if (i_set1 < (gint)(array_set1->len) - 2)
@@ -1990,8 +1990,8 @@ static void dupe_array_check(DupeWindow *dw )
                        {
                        for (i_set1 = 0; i_set1 <= (gint)(array_set1->len) - 2; i_set1++)
                                {
-                               DupeItem *di1 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1));
-                               DupeItem *di2 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1 + 1));
+                               auto di1 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1));
+                               auto di2 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1 + 1));
 
                                check_result = dupe_match_check(di1, di2, dw);
                                if (check_result == DUPE_MATCH || check_result == DUPE_NAME_MATCH)
@@ -2034,10 +2034,10 @@ static void dupe_array_check(DupeWindow *dw )
 
 /**
  * @brief Look for similarity match
- * @param dw 
- * @param needle 
- * @param start 
- * 
+ * @param dw
+ * @param needle
+ * @param start
+ *
  * Only used for similarity checks.\n
  * Called from dupe_check_cb.
  * Called for each entry in the list.
@@ -2108,7 +2108,7 @@ static void dupe_thumb_do(DupeWindow *dw)
 
 static void dupe_thumb_error_cb(ThumbLoader *UNUSED(tl), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_thumb_do(dw);
        dupe_thumb_step(dw);
@@ -2116,7 +2116,7 @@ static void dupe_thumb_error_cb(ThumbLoader *UNUSED(tl), gpointer data)
 
 static void dupe_thumb_done_cb(ThumbLoader *UNUSED(tl), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_thumb_do(dw);
        dupe_thumb_step(dw);
@@ -2246,21 +2246,21 @@ static void dupe_check_stop(DupeWindow *dw)
 
 static void dupe_check_stop_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_check_stop(dw);
 }
 
 static void dupe_loader_done_cb(ImageLoader *il, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        GdkPixbuf *pixbuf;
 
        pixbuf = image_loader_get_pixbuf(il);
 
        if (dw->setup_point)
                {
-               DupeItem *di = static_cast<DupeItem *>(dw->setup_point->data);
+               auto di = static_cast<DupeItem *>(dw->setup_point->data);
 
                if (!di->simd)
                        {
@@ -2313,7 +2313,7 @@ static GList *dupe_setup_point_step(DupeWindow *dw, GList *p)
  * @brief Generates the sumcheck or dimensions
  * @param list Set1 or set2
  * @returns TRUE/FALSE = not completed/completed
- * 
+ *
  * Ensures that the DIs contain the MD5SUM or dimensions for all items in
  * the list. One item at a time. Re-enters if not completed.
  */
@@ -2328,7 +2328,7 @@ static gboolean create_checksums_dimensions(DupeWindow *dw, GList *list)
 
                        while (dw->setup_point)
                                {
-                               DupeItem *di = static_cast<DupeItem *>(dw->setup_point->data);
+                               auto di = static_cast<DupeItem *>(dw->setup_point->data);
 
                                dw->setup_point = dupe_setup_point_step(dw, dw->setup_point);
                                dw->setup_n++;
@@ -2365,7 +2365,7 @@ static gboolean create_checksums_dimensions(DupeWindow *dw, GList *list)
 
                        while (dw->setup_point)
                                {
-                               DupeItem *di = static_cast<DupeItem *>(dw->setup_point->data);
+                               auto di = static_cast<DupeItem *>(dw->setup_point->data);
 
                                dw->setup_point = dupe_setup_point_step(dw, dw->setup_point);
                                dw->setup_n++;
@@ -2402,8 +2402,8 @@ static gboolean create_checksums_dimensions(DupeWindow *dw, GList *list)
  * @brief Compare func. for sorting search matches
  * @param a #DupeSearchMatch
  * @param b #DupeSearchMatch
- * @returns 
- * 
+ * @returns
+ *
  * Used only for similarity checks\n
  * Sorts search matches on order they were inserted into the pool queue
  */
@@ -2416,7 +2416,7 @@ static gint sort_func(gconstpointer a, gconstpointer b)
  * @brief Check set 1 (and set 2) for matches
  * @param data DupeWindow
  * @returns TRUE/FALSE = not completed/completed
- * 
+ *
  * Initiated from start, loader done and item remove
  *
  * On first entry generates di->MD5SUM, di->dimensions and sim data,
@@ -2424,7 +2424,7 @@ static gint sort_func(gconstpointer a, gconstpointer b)
  */
 static gboolean dupe_check_cb(gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        DupeSearchMatch *search_match_list_item;
 
        if (!dw->idle_id)
@@ -2459,7 +2459,7 @@ static gboolean dupe_check_cb(gpointer data)
 
                        while (dw->setup_point)
                                {
-                               DupeItem *di = static_cast<DupeItem *>(dw->setup_point->data);
+                               auto di = static_cast<DupeItem *>(dw->setup_point->data);
 
                                if (!di->simd)
                                        {
@@ -2636,7 +2636,7 @@ static void dupe_check_start(DupeWindow *dw)
 
 static gboolean dupe_check_start_cb(gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_check_start(dw);
 
@@ -2752,7 +2752,7 @@ static gboolean dupe_item_remove_by_path(DupeWindow *dw, const gchar *path)
 static gboolean dupe_files_add_queue_cb(gpointer data)
 {
        DupeItem *di = NULL;
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        FileData *fd;
        GList *queue = dw->add_files_queue;
 
@@ -2933,14 +2933,14 @@ static void dupe_init_list_cache(DupeWindow *dw)
 
        for (GList *i = dw->list; i != NULL; i = i->next)
                {
-                       DupeItem *di = static_cast<DupeItem *>(i->data);
+                       auto di = static_cast<DupeItem *>(i->data);
 
                        g_hash_table_add(dw->list_cache, di->fd);
                }
 
        for (GList *i = dw->second_list; i != NULL; i = i->next)
                {
-                       DupeItem *di = static_cast<DupeItem *>(i->data);
+                       auto di = static_cast<DupeItem *>(i->data);
 
                        g_hash_table_add(dw->second_list_cache, di->fd);
                }
@@ -2954,11 +2954,11 @@ static void dupe_destroy_list_cache(DupeWindow *dw)
 
 /**
  * @brief Return true if the fd was not in the cache
- * @param dw 
- * @param fd 
- * @returns 
- * 
- * 
+ * @param dw
+ * @param fd
+ * @returns
+ *
+ *
  */
 static gboolean dupe_insert_in_list_cache(DupeWindow *dw, FileData *fd)
 {
@@ -2992,7 +2992,7 @@ void dupe_window_add_files(DupeWindow *dw, GList *list, gboolean recurse)
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                if (isdir(fd->path) && !recurse)
                        {
@@ -3085,7 +3085,7 @@ static void dupe_item_update_fd_in_list(DupeWindow *dw, FileData *fd, GList *wor
 {
        while (work)
                {
-               DupeItem *di = static_cast<DupeItem *>(work->data);
+               auto di = static_cast<DupeItem *>(work->data);
 
                if (di->fd == fd)
                        dupe_item_update(dw, di);
@@ -3252,7 +3252,7 @@ static void dupe_window_remove_selection(DupeWindow *dw, GtkWidget *listview)
        work = slist;
        while (work)
                {
-               GtkTreePath *tpath = static_cast<GtkTreePath *>(work->data);
+               auto tpath = static_cast<GtkTreePath *>(work->data);
                DupeItem *di = NULL;
 
                gtk_tree_model_get_iter(store, &iter, tpath);
@@ -3315,21 +3315,21 @@ static void dupe_window_append_file_list(DupeWindow *dw, gint on_second)
 
 static void dupe_menu_view_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        if (dw->click_item) dupe_menu_view(dw, dw->click_item, dw->listview, FALSE);
 }
 
 static void dupe_menu_viewnew_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        if (dw->click_item) dupe_menu_view(dw, dw->click_item, dw->listview, TRUE);
 }
 
 static void dupe_menu_select_all_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        GtkTreeSelection *selection;
 
        options->duplicates_select_type = DUPE_SELECT_NONE;
@@ -3339,7 +3339,7 @@ static void dupe_menu_select_all_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void dupe_menu_select_none_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        GtkTreeSelection *selection;
 
        options->duplicates_select_type = DUPE_SELECT_NONE;
@@ -3349,7 +3349,7 @@ static void dupe_menu_select_none_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void dupe_menu_select_dupes_set1_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        options->duplicates_select_type = DUPE_SELECT_GROUP1;
        dupe_listview_select_dupes(dw, DUPE_SELECT_GROUP1);
@@ -3357,7 +3357,7 @@ static void dupe_menu_select_dupes_set1_cb(GtkWidget *UNUSED(widget), gpointer d
 
 static void dupe_menu_select_dupes_set2_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        options->duplicates_select_type = DUPE_SELECT_GROUP2;
        dupe_listview_select_dupes(dw, DUPE_SELECT_GROUP2);
@@ -3366,7 +3366,7 @@ static void dupe_menu_select_dupes_set2_cb(GtkWidget *UNUSED(widget), gpointer d
 static void dupe_menu_edit_cb(GtkWidget *widget, gpointer data)
 {
        DupeWindow *dw;
-       const gchar *key = static_cast<const gchar *>(data);
+       auto key = static_cast<const gchar *>(data);
 
        dw = static_cast<DupeWindow *>(submenu_item_get_data(widget));
        if (!dw) return;
@@ -3376,7 +3376,7 @@ static void dupe_menu_edit_cb(GtkWidget *widget, gpointer data)
 
 static void dupe_menu_print_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        FileData *fd;
 
        fd = (dw->click_item) ? dw->click_item->fd : NULL;
@@ -3388,28 +3388,28 @@ static void dupe_menu_print_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void dupe_menu_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        file_util_copy(NULL, dupe_listview_get_selection(dw, dw->listview), NULL, dw->window);
 }
 
 static void dupe_menu_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        file_util_move(NULL, dupe_listview_get_selection(dw, dw->listview), NULL, dw->window);
 }
 
 static void dupe_menu_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        file_util_rename(NULL, dupe_listview_get_selection(dw, dw->listview), dw->window);
 }
 
 static void dupe_menu_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        options->file_ops.safe_delete_enable = FALSE;
        file_util_delete_notify_done(NULL, dupe_listview_get_selection(dw, dw->listview), dw->window, delete_finished_cb, dw);
@@ -3417,7 +3417,7 @@ static void dupe_menu_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void dupe_menu_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        options->file_ops.safe_delete_enable = TRUE;
        file_util_delete_notify_done(NULL, dupe_listview_get_selection(dw, dw->listview), dw->window, delete_finished_cb, dw);
@@ -3425,42 +3425,42 @@ static void dupe_menu_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void dupe_menu_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        file_util_copy_path_list_to_clipboard(dupe_listview_get_selection(dw, dw->listview), TRUE);
 }
 
 static void dupe_menu_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        file_util_copy_path_list_to_clipboard(dupe_listview_get_selection(dw, dw->listview), FALSE);
 }
 
 static void dupe_menu_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_window_remove_selection(dw, dw->listview);
 }
 
 static void dupe_menu_clear_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_window_clear(dw);
 }
 
 static void dupe_menu_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_window_close(dw);
 }
 
 static void dupe_menu_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GList *editmenu_fd_list = static_cast<GList *>(data);
+       auto editmenu_fd_list = static_cast<GList *>(data);
 
        filelist_free(editmenu_fd_list);
 }
@@ -3483,10 +3483,10 @@ static GList *dupe_window_get_fd_list(DupeWindow *dw)
 
 /**
  * @brief Add file selection list to a collection
- * @param[in] widget 
+ * @param[in] widget
  * @param[in] data Index to the collection list menu item selected, or -1 for new collection
- * 
- * 
+ *
+ *
  */
 static void dupe_pop_menu_collections_cb(GtkWidget *widget, gpointer data)
 {
@@ -3585,7 +3585,7 @@ static GtkWidget *dupe_menu_popup_main(DupeWindow *dw, DupeItem *di)
 
 static gboolean dupe_listview_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        GtkTreeModel *store;
        GtkTreePath *tpath;
        GtkTreeIter iter;
@@ -3668,7 +3668,7 @@ static gboolean dupe_listview_press_cb(GtkWidget *widget, GdkEventButton *bevent
 
 static gboolean dupe_listview_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        GtkTreeModel *store;
        GtkTreePath *tpath;
        GtkTreeIter iter;
@@ -3797,14 +3797,14 @@ static void dupe_second_clear(DupeWindow *dw)
 
 static void dupe_second_menu_view_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        if (dw->click_item) dupe_menu_view(dw, dw->click_item, dw->second_listview, FALSE);
 }
 
 static void dupe_second_menu_viewnew_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        if (dw->click_item) dupe_menu_view(dw, dw->click_item, dw->second_listview, TRUE);
 }
@@ -3812,7 +3812,7 @@ static void dupe_second_menu_viewnew_cb(GtkWidget *UNUSED(widget), gpointer data
 static void dupe_second_menu_select_all_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
        GtkTreeSelection *selection;
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dw->second_listview));
        gtk_tree_selection_select_all(selection);
@@ -3821,7 +3821,7 @@ static void dupe_second_menu_select_all_cb(GtkWidget *UNUSED(widget), gpointer d
 static void dupe_second_menu_select_none_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
        GtkTreeSelection *selection;
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dw->second_listview));
        gtk_tree_selection_unselect_all(selection);
@@ -3829,14 +3829,14 @@ static void dupe_second_menu_select_none_cb(GtkWidget *UNUSED(widget), gpointer
 
 static void dupe_second_menu_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_window_remove_selection(dw, dw->second_listview);
 }
 
 static void dupe_second_menu_clear_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_second_clear(dw);
        dupe_window_recompare(dw);
@@ -3879,7 +3879,7 @@ static GtkWidget *dupe_menu_popup_second(DupeWindow *dw, DupeItem *di)
 
 static void dupe_second_set_toggle_cb(GtkWidget *widget, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dw->second_set = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
@@ -3901,7 +3901,7 @@ static void dupe_second_set_toggle_cb(GtkWidget *widget, gpointer data)
 
 static void dupe_sort_totals_toggle_cb(GtkWidget *widget, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        options->sort_totals = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        dupe_window_recompare(dw);
@@ -3923,7 +3923,7 @@ static void dupe_listview_show_rank(GtkWidget *listview, gboolean rank);
 
 static void dupe_menu_type_cb(GtkWidget *combo, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        GtkTreeModel *store;
        GtkTreeIter iter;
 
@@ -4033,7 +4033,7 @@ static GdkColor *dupe_listview_color_shifted(GtkWidget *widget)
 static void dupe_listview_color_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellRenderer *cell,
                                   GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        gboolean set;
 
        gtk_tree_model_get(tree_model, iter, DUPE_COLUMN_COLOR, &set, -1);
@@ -4126,7 +4126,7 @@ static void dupe_listview_show_rank(GtkWidget *listview, gboolean rank)
 
 static void dupe_window_show_thumb_cb(GtkWidget *widget, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dw->show_thumbs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        options->duplicates_thumbnails = dw->show_thumbs;
@@ -4160,7 +4160,7 @@ static void dupe_window_show_thumb_cb(GtkWidget *widget, gpointer data)
 
 static void dupe_window_rotation_invariant_cb(GtkWidget *widget, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        options->rot_invariant_sim = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        dupe_window_recompare(dw);
@@ -4168,7 +4168,7 @@ static void dupe_window_rotation_invariant_cb(GtkWidget *widget, gpointer data)
 
 static void dupe_window_custom_threshold_cb(GtkWidget *widget, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        DupeMatchType match_type;
        GtkTreeModel *store;
        gboolean valid;
@@ -4195,7 +4195,7 @@ static void dupe_window_custom_threshold_cb(GtkWidget *widget, gpointer data)
 
 static gboolean dupe_window_keypress_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        gboolean stop_signal = FALSE;
        gboolean on_second;
        GtkWidget *listview;
@@ -4439,7 +4439,7 @@ void dupe_window_close(DupeWindow *dw)
 
 static gint dupe_window_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        dupe_window_close(dw);
 
@@ -4448,7 +4448,7 @@ static gint dupe_window_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static gint dupe_window_delete(GtkWidget *UNUSED(widget), GdkEvent *UNUSED(event), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        dupe_window_close(dw);
 
        return TRUE;
@@ -4466,7 +4466,7 @@ static gint default_sort_cb(GtkTreeModel *UNUSED(model), GtkTreeIter *UNUSED(a),
 
 static gint column_sort_cb(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data)
 {
-       GtkTreeSortable *sortable = static_cast<GtkTreeSortable *>(data);
+       auto sortable = static_cast<GtkTreeSortable *>(data);
        gint ret = 0;
        gchar *rank_str_a, *rank_str_b;
        gint rank_int_a;
@@ -4555,7 +4555,7 @@ static gint column_sort_cb(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b,
 
 static void column_clicked_cb(GtkWidget *UNUSED(widget),  gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        options->duplicates_match = DUPE_SELECT_NONE;
        dupe_listview_select_dupes(dw, DUPE_SELECT_NONE);
@@ -4871,7 +4871,7 @@ static void confirm_dir_list_cancel(GtkWidget *UNUSED(widget), gpointer UNUSED(d
 
 static void confirm_dir_list_add(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CDupeConfirmD *d = static_cast<CDupeConfirmD *>(data);
+       auto d = static_cast<CDupeConfirmD *>(data);
        GList *work;
 
        dupe_window_add_files(d->dw, d->list, FALSE);
@@ -4879,7 +4879,7 @@ static void confirm_dir_list_add(GtkWidget *UNUSED(widget), gpointer data)
        work = d->list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                if (isdir(fd->path))
                        {
@@ -4898,19 +4898,19 @@ static void confirm_dir_list_add(GtkWidget *UNUSED(widget), gpointer data)
 
 static void confirm_dir_list_recurse(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CDupeConfirmD *d = static_cast<CDupeConfirmD *>(data);
+       auto d = static_cast<CDupeConfirmD *>(data);
        dupe_window_add_files(d->dw, d->list, TRUE);
 }
 
 static void confirm_dir_list_skip(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CDupeConfirmD *d = static_cast<CDupeConfirmD *>(data);
+       auto d = static_cast<CDupeConfirmD *>(data);
        dupe_window_add_files(d->dw, d->list, FALSE);
 }
 
 static void confirm_dir_list_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CDupeConfirmD *d = static_cast<CDupeConfirmD *>(data);
+       auto d = static_cast<CDupeConfirmD *>(data);
        filelist_free(d->list);
        g_free(d);
 }
@@ -4961,7 +4961,7 @@ static void dupe_dnd_data_set(GtkWidget *widget, GdkDragContext *UNUSED(context)
                              GtkSelectionData *selection_data, guint info,
                              guint UNUSED(time), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        GList *list;
 
        switch (info)
@@ -4983,7 +4983,7 @@ static void dupe_dnd_data_get(GtkWidget *widget, GdkDragContext *context,
                              GtkSelectionData *selection_data, guint info,
                              guint UNUSED(time), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        GtkWidget *source;
        GList *list = NULL;
        GList *work;
@@ -5010,7 +5010,7 @@ static void dupe_dnd_data_get(GtkWidget *widget, GdkDragContext *context,
                        work = list;
                        while (work)
                                {
-                               FileData *fd = static_cast<FileData *>(work->data);
+                               auto fd = static_cast<FileData *>(work->data);
                                if (isdir(fd->path))
                                        {
                                        GtkWidget *menu;
@@ -5051,7 +5051,7 @@ static void dupe_dest_set(GtkWidget *widget, gboolean enable)
 
 static void dupe_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        dupe_dest_set(dw->listview, FALSE);
        dupe_dest_set(dw->second_listview, FALSE);
 
@@ -5091,7 +5091,7 @@ static void dupe_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer
 
 static void dupe_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
        dupe_dest_set(dw->listview, TRUE);
        dupe_dest_set(dw->second_listview, TRUE);
 }
@@ -5135,7 +5135,7 @@ static void dupe_dnd_init(DupeWindow *dw)
 
 static void dupe_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
 
@@ -5164,14 +5164,14 @@ static void dupe_notify_cb(FileData *fd, NotifyType type, gpointer data)
  * @param success (ud->phase != UTILITY_PHASE_CANCEL) #file_util_dialog_run
  * @param dest_path Not used
  * @param data #DupeWindow
- * 
+ *
  * If the window is refreshed after each file of a large set is deleted,
  * the UI slows to an unacceptable level. The #FileUtilDoneFunc is used
  * to call this function once, when the entire delete operation is completed.
  */
 static void delete_finished_cb(gboolean success, const gchar *UNUSED(dest_path), gpointer data)
 {
-       DupeWindow *dw = static_cast<DupeWindow *>(data);
+       auto dw = static_cast<DupeWindow *>(data);
 
        if (!success)
                {
@@ -5208,14 +5208,14 @@ static void export_duplicates_close(ExportDupesData *edd)
 
 static void export_duplicates_data_cancel_cb(FileDialog *UNUSED(fdlg), gpointer data)
 {
-       ExportDupesData *edd = static_cast<ExportDupesData *>(data);
+       auto edd = static_cast<ExportDupesData *>(data);
 
        export_duplicates_close(edd);
 }
 
 static void export_duplicates_data_save_cb(FileDialog *fdlg, gpointer data)
 {
-       ExportDupesData *edd = static_cast<ExportDupesData *>(data);
+       auto edd = static_cast<ExportDupesData *>(data);
        GError *error = NULL;
        GtkTreeModel *store;
        GtkTreeIter iter;
@@ -5348,7 +5348,7 @@ static void export_duplicates_data_save_cb(FileDialog *fdlg, gpointer data)
 static void pop_menu_export(GList *UNUSED(selection_list), gpointer dupe_window, gpointer data)
 {
        const gint index = GPOINTER_TO_INT(data);
-       DupeWindow *dw = static_cast<DupeWindow *>(dupe_window);
+       auto dw = static_cast<DupeWindow *>(dupe_window);
        const gchar *title = "Export duplicates data";
        const gchar *default_path = "/tmp/";
        gchar *file_extension;
index 0602f6b..afb677f 100644 (file)
@@ -380,7 +380,7 @@ gboolean editor_read_desktop_file(const gchar *path)
 
 static gboolean editor_remove_desktop_file_cb(gpointer UNUSED(key), gpointer value, gpointer UNUSED(user_data))
 {
-       EditorDescription *editor = static_cast<EditorDescription *>(value);
+       auto editor = static_cast<EditorDescription *>(value);
        return editor->hidden || editor->ignored;
 }
 
@@ -475,8 +475,8 @@ GList *editor_get_desktop_files(void)
 
 static void editor_list_add_cb(gpointer UNUSED(key), gpointer value, gpointer data)
 {
-       GList **listp = static_cast<GList **>(data);
-       EditorDescription *editor = static_cast<EditorDescription *>(value);
+       auto listp = static_cast<GList **>(data);
+       auto editor = static_cast<EditorDescription *>(value);
 
        /* do not show the special commands in any list, they are called explicitly */
        if (strcmp(editor->key, CMD_COPY) == 0 ||
@@ -495,8 +495,8 @@ static void editor_list_add_cb(gpointer UNUSED(key), gpointer value, gpointer da
 
 static gint editor_sort(gconstpointer a, gconstpointer b)
 {
-       const EditorDescription *ea = static_cast<const EditorDescription *>(a);
-       const EditorDescription *eb = static_cast<const EditorDescription *>(b);
+       auto ea = static_cast<const EditorDescription *>(a);
+       auto eb = static_cast<const EditorDescription *>(b);
        gchar *caseless_name_ea;
        gchar *caseless_name_eb;
        gchar *collate_key_ea;
@@ -551,7 +551,7 @@ static void editor_data_free(EditorData *ed)
 
 static void editor_verbose_window_close(GenericDialog *gd, gpointer data)
 {
-       EditorData *ed = static_cast<EditorData *>(data);
+       auto ed = static_cast<EditorData *>(data);
 
        generic_dialog_close(gd);
        editor_verbose_data_free(ed);
@@ -560,7 +560,7 @@ static void editor_verbose_window_close(GenericDialog *gd, gpointer data)
 
 static void editor_verbose_window_stop(GenericDialog *UNUSED(gd), gpointer data)
 {
-       EditorData *ed = static_cast<EditorData *>(data);
+       auto ed = static_cast<EditorData *>(data);
        ed->stopping = TRUE;
        ed->count = 0;
        editor_verbose_window_progress(ed, _("stopping..."));
@@ -657,7 +657,7 @@ static void editor_verbose_window_progress(EditorData *ed, const gchar *text)
 
 static gboolean editor_verbose_io_cb(GIOChannel *source, GIOCondition condition, gpointer data)
 {
-       EditorData *ed = static_cast<EditorData *>(data);
+       auto ed = static_cast<EditorData *>(data);
        gchar buf[512];
        gsize count;
 
@@ -724,7 +724,7 @@ static gchar *editor_command_path_parse(const FileData *fd, gboolean consider_si
                        while (work)
                                {
                                GList *work2;
-                               gchar *ext = static_cast<gchar *>(work->data);
+                               auto ext = static_cast<gchar *>(work->data);
                                work = work->next;
 
                                if (strcmp(ext, "*") == 0 ||
@@ -737,7 +737,7 @@ static gchar *editor_command_path_parse(const FileData *fd, gboolean consider_si
                                work2 = consider_sidecars ? fd->sidecar_files : NULL;
                                while (work2)
                                        {
-                                       FileData *sfd = static_cast<FileData *>(work2->data);
+                                       auto sfd = static_cast<FileData *>(work2->data);
                                        work2 = work2->next;
 
                                        if (g_ascii_strcasecmp(ext, sfd->extension) == 0)
@@ -810,7 +810,7 @@ static GString *append_quoted(GString *str, const char *s, gboolean single_quote
 
 EditorFlags editor_command_parse(const EditorDescription *editor, GList *list, gboolean consider_sidecars, gchar **output)
 {
-       EditorFlags flags = static_cast<EditorFlags>(0);
+       auto  flags = static_cast<EditorFlags>(0);
        const gchar *p;
        GString *result = NULL;
        gboolean escape = FALSE;
@@ -898,7 +898,7 @@ EditorFlags editor_command_parse(const EditorDescription *editor, GList *list, g
 
                                                        while (!pathl && work)
                                                                {
-                                                               FileData *fd = static_cast<FileData *>(work->data);
+                                                               auto fd = static_cast<FileData *>(work->data);
                                                                pathl = editor_command_path_parse(fd,
                                                                                                  consider_sidecars,
                                                                                                  (*p == 'f') ? PATH_FILE : PATH_FILE_URL,
@@ -937,7 +937,7 @@ EditorFlags editor_command_parse(const EditorDescription *editor, GList *list, g
 
                                                while (work)
                                                        {
-                                                       FileData *fd = static_cast<FileData *>(work->data);
+                                                       auto fd = static_cast<FileData *>(work->data);
                                                        pathl = editor_command_path_parse(fd, consider_sidecars, (*p == 'F') ? PATH_FILE : PATH_FILE_URL, editor);
                                                        if (pathl)
                                                                {
@@ -1029,7 +1029,7 @@ err:
 
 static void editor_child_exit_cb(GPid pid, gint status, gpointer data)
 {
-       EditorData *ed = static_cast<EditorData *>(data);
+       auto ed = static_cast<EditorData *>(data);
        g_spawn_close_pid(pid);
        ed->pid = -1;
 
@@ -1040,7 +1040,7 @@ static void editor_child_exit_cb(GPid pid, gint status, gpointer data)
 static EditorFlags editor_command_one(const EditorDescription *editor, GList *list, EditorData *ed)
 {
        gchar *command;
-       FileData *fd = static_cast<FileData *>((ed->flags & EDITOR_NO_PARAM) ? NULL : list->data);;
+       auto fd = static_cast<FileData *>((ed->flags & EDITOR_NO_PARAM) ? NULL : list->data);;
        GPid pid;
        gint standard_output;
        gint standard_error;
index 6c745a8..414cfab 100644 (file)
@@ -214,7 +214,7 @@ public:
                                if (!open) io.open();
                                if (io.isopen())
                                        {
-                                       unsigned char *mapped = (unsigned char*)io.mmap();
+                                       auto mapped = (unsigned char*)io.mmap();
                                        if (mapped) exif_jpeg_parse_color(this, mapped, io.size());
                                        io.munmap();
                                        }
@@ -529,21 +529,21 @@ ExifItem *exif_get_item(ExifData *exif, const gchar *key)
                Exiv2::Metadatum *item = NULL;
                try {
                        Exiv2::ExifKey ekey(key);
-                       Exiv2::ExifData::iterator pos = exif->exifData().findKey(ekey);
+                       auto pos = exif->exifData().findKey(ekey);
                        if (pos == exif->exifData().end()) return NULL;
                        item = &*pos;
                }
                catch (Exiv2::AnyError& e) {
                        try {
                                Exiv2::IptcKey ekey(key);
-                               Exiv2::IptcData::iterator pos = exif->iptcData().findKey(ekey);
+                               auto pos = exif->iptcData().findKey(ekey);
                                if (pos == exif->iptcData().end()) return NULL;
                                item = &*pos;
                        }
                        catch (Exiv2::AnyError& e) {
 #if EXIV2_TEST_VERSION(0,16,0)
                                Exiv2::XmpKey ekey(key);
-                               Exiv2::XmpData::iterator pos = exif->xmpData().findKey(ekey);
+                               auto pos = exif->xmpData().findKey(ekey);
                                if (pos == exif->xmpData().end()) return NULL;
                                item = &*pos;
 #endif
@@ -564,7 +564,7 @@ ExifItem *exif_add_item(ExifData *exif, const gchar *key)
                try {
                        Exiv2::ExifKey ekey(key);
                        exif->exifData().add(ekey, NULL);
-                       Exiv2::ExifData::iterator pos = exif->exifData().end(); // a hack, there should be a better way to get the currently added item
+                       auto pos = exif->exifData().end(); // a hack, there should be a better way to get the currently added item
                        pos--;
                        item = &*pos;
                }
@@ -572,7 +572,7 @@ ExifItem *exif_add_item(ExifData *exif, const gchar *key)
                        try {
                                Exiv2::IptcKey ekey(key);
                                exif->iptcData().add(ekey, NULL);
-                               Exiv2::IptcData::iterator pos = exif->iptcData().end();
+                               auto pos = exif->iptcData().end();
                                pos--;
                                item = &*pos;
                        }
@@ -580,7 +580,7 @@ ExifItem *exif_add_item(ExifData *exif, const gchar *key)
 #if EXIV2_TEST_VERSION(0,16,0)
                                Exiv2::XmpKey ekey(key);
                                exif->xmpData().add(ekey, NULL);
-                               Exiv2::XmpData::iterator pos = exif->xmpData().end();
+                               auto pos = exif->xmpData().end();
                                pos--;
                                item = &*pos;
 #endif
@@ -703,9 +703,9 @@ char *exif_item_get_data(ExifItem *item, guint *data_len)
 {
        try {
                if (!item) return 0;
-               Exiv2::Metadatum *md = (Exiv2::Metadatum *)item;
+               auto md = (Exiv2::Metadatum *)item;
                if (data_len) *data_len = md->size();
-               char *data = (char *)g_malloc(md->size());
+               auto data = (char *)g_malloc(md->size());
                long res = md->copy((Exiv2::byte *)data, Exiv2::littleEndian /* should not matter */);
                g_assert(res == md->size());
                return data;
@@ -792,7 +792,7 @@ gchar *exif_item_get_data_as_text(ExifItem *item)
 {
        try {
                if (!item) return NULL;
-               Exiv2::Metadatum *metadatum = (Exiv2::Metadatum *)item;
+               auto metadatum = (Exiv2::Metadatum *)item;
 #if EXIV2_TEST_VERSION(0,17,0)
                return utf8_validate_or_convert(metadatum->print().c_str());
 #else
@@ -823,7 +823,7 @@ gchar *exif_item_get_string(ExifItem *item, int idx)
 {
        try {
                if (!item) return NULL;
-               Exiv2::Metadatum *em = (Exiv2::Metadatum *)item;
+               auto em = (Exiv2::Metadatum *)item;
 #if EXIV2_TEST_VERSION(0,16,0)
                std::string str = em->toString(idx);
 #else
@@ -927,7 +927,7 @@ static gint exif_update_metadata_simple(ExifData *exif, const gchar *key, const
                try {
                        Exiv2::ExifKey ekey(key);
 
-                       Exiv2::ExifData::iterator pos = exif->exifData().findKey(ekey);
+                       auto pos = exif->exifData().findKey(ekey);
                        while (pos != exif->exifData().end())
                                {
                                exif->exifData().erase(pos);
@@ -946,7 +946,7 @@ static gint exif_update_metadata_simple(ExifData *exif, const gchar *key, const
 #endif
                        {
                                Exiv2::IptcKey ekey(key);
-                               Exiv2::IptcData::iterator pos = exif->iptcData().findKey(ekey);
+                               auto pos = exif->iptcData().findKey(ekey);
                                while (pos != exif->iptcData().end())
                                        {
                                        exif->iptcData().erase(pos);
@@ -962,7 +962,7 @@ static gint exif_update_metadata_simple(ExifData *exif, const gchar *key, const
 #if EXIV2_TEST_VERSION(0,16,0)
                        catch (Exiv2::AnyError& e) {
                                Exiv2::XmpKey ekey(key);
-                               Exiv2::XmpData::iterator pos = exif->xmpData().findKey(ekey);
+                               auto pos = exif->xmpData().findKey(ekey);
                                while (pos != exif->xmpData().end())
                                        {
                                        exif->xmpData().erase(pos);
@@ -1090,7 +1090,7 @@ static GList *exif_get_metadata_simple(ExifData *exif, const gchar *key, Metadat
        try {
                try {
                        Exiv2::ExifKey ekey(key);
-                       Exiv2::ExifData::iterator pos = exif->exifData().findKey(ekey);
+                       auto pos = exif->exifData().findKey(ekey);
                        if (pos != exif->exifData().end())
                                list = exif_add_value_to_glist(list, *pos, format, &exif->exifData());
 
@@ -1098,7 +1098,7 @@ static GList *exif_get_metadata_simple(ExifData *exif, const gchar *key, Metadat
                catch (Exiv2::AnyError& e) {
                        try {
                                Exiv2::IptcKey ekey(key);
-                               Exiv2::IptcData::iterator pos = exif->iptcData().begin();
+                               auto pos = exif->iptcData().begin();
                                while (pos != exif->iptcData().end())
                                        {
                                        if (pos->key() == key)
@@ -1110,7 +1110,7 @@ static GList *exif_get_metadata_simple(ExifData *exif, const gchar *key, Metadat
                        catch (Exiv2::AnyError& e) {
 #if EXIV2_TEST_VERSION(0,16,0)
                                Exiv2::XmpKey ekey(key);
-                               Exiv2::XmpData::iterator pos = exif->xmpData().findKey(ekey);
+                               auto pos = exif->xmpData().findKey(ekey);
                                if (pos != exif->xmpData().end())
                                        list = exif_add_value_to_glist(list, *pos, format, NULL);
 #endif
@@ -1212,7 +1212,7 @@ guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width,
                if (!list.empty())
                        {
                        Exiv2::PreviewPropertiesList::iterator pos;
-                       Exiv2::PreviewPropertiesList::iterator last = --list.end();
+                       auto last = --list.end();
 
                        if (requested_width == 0)
                                {
index 6819a93..c4a63c3 100644 (file)
@@ -44,7 +44,7 @@ static void file_cache_remove_fd(FileCacheData *fc, FileData *fd);
 
 FileCacheData *file_cache_new(FileCacheReleaseFunc release, gulong max_size)
 {
-       FileCacheData *fc = g_new(FileCacheData, 1);
+       auto fc = g_new(FileCacheData, 1);
 
        fc->release = release;
        fc->list = NULL;
@@ -65,7 +65,7 @@ gboolean file_cache_get(FileCacheData *fc, FileData *fd)
        work = fc->list;
        while (work)
                {
-               FileCacheEntry *fce = static_cast<FileCacheEntry *>(work->data);
+               auto fce = static_cast<FileCacheEntry *>(work->data);
                if (fce->fd == fd)
                        {
                        /* entry exists */
@@ -182,7 +182,7 @@ void file_cache_dump(FileCacheData *fc)
 
        while (work)
                {
-               FileCacheEntry *fe = static_cast<FileCacheEntry *>(work->data);
+               auto fe = static_cast<FileCacheEntry *>(work->data);
                work = work->next;
                DEBUG_1("cache entry: fc=%p [%lu] %s %ld", (void *)fc, ++n, fe->fd->path, fe->size);
                }
@@ -190,7 +190,7 @@ void file_cache_dump(FileCacheData *fc)
 
 static void file_cache_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       FileCacheData *fc = static_cast<FileCacheData *>(data);
+       auto fc = static_cast<FileCacheData *>(data);
 
        if (type & (NOTIFY_REREAD | NOTIFY_CHANGE)) /* invalidate the entry on each file change */
                {
index 065f870..8781179 100644 (file)
@@ -196,7 +196,7 @@ static gboolean file_data_check_changed_files_recursive(FileData *fd, struct sta
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
                struct stat st;
                work = work->next;
 
@@ -688,8 +688,8 @@ FileData *file_data_ref(FileData *fd)
 
 /**
  * @brief Print ref. count and image name
- * @param  
- * 
+ * @param
+ *
  * Print image ref. count and full path name of all images in
  * the file_data_pool.
  *
@@ -779,7 +779,7 @@ static void file_data_consider_free(FileData *fd)
        work = parent->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
                if (file_data_check_has_ref(sfd)) return;
                work = work->next;
                }
@@ -791,7 +791,7 @@ static void file_data_consider_free(FileData *fd)
        work = parent->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
                file_data_free(sfd);
                work = work->next;
                }
@@ -882,7 +882,7 @@ void file_data_lock_list(GList *list)
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                file_data_lock(fd);
                }
@@ -900,7 +900,7 @@ void file_data_unlock_list(GList *list)
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                file_data_unlock(fd);
                }
@@ -914,8 +914,8 @@ void file_data_unlock_list(GList *list)
 
 static gint file_data_sort_by_ext(gconstpointer a, gconstpointer b)
 {
-       const FileData *fda = static_cast<const FileData *>(a);
-       const FileData *fdb = static_cast<const FileData *>(b);
+       auto fda = static_cast<const FileData *>(a);
+       auto fdb = static_cast<const FileData *>(b);
 
        if (fda->sidecar_priority < fdb->sidecar_priority) return -1;
        if (fda->sidecar_priority > fdb->sidecar_priority) return 1;
@@ -935,7 +935,7 @@ static gint sidecar_file_priority(const gchar *extension)
        work = sidecar_ext_get_list();
 
        while (work) {
-               gchar *ext = static_cast<gchar *>(work->data);
+               auto ext = static_cast<gchar *>(work->data);
 
                work = work->next;
                if (g_ascii_strcasecmp(extension, ext) == 0) return i;
@@ -960,7 +960,7 @@ static void file_data_check_sidecars(const GList *basename_list)
        work = basename_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                g_assert(fd->magick == FD_MAGICK);
                DEBUG_2("basename: %p %s", (void *)fd, fd->name);
@@ -972,7 +972,7 @@ static void file_data_check_sidecars(const GList *basename_list)
                s_work = fd->sidecar_files;
                while (s_work)
                        {
-                       FileData *sfd = static_cast<FileData *>(s_work->data);
+                       auto sfd = static_cast<FileData *>(s_work->data);
                        s_work = s_work->next;
                        g_assert(sfd->magick == FD_MAGICK);
                        DEBUG_2("                  sidecar: %p %s", (void *)sfd, sfd->name);
@@ -1008,7 +1008,7 @@ static void file_data_check_sidecars(const GList *basename_list)
        work = basename_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                g_assert(fd->parent == NULL || fd->sidecar_files == NULL);
 
@@ -1024,7 +1024,7 @@ static void file_data_check_sidecars(const GList *basename_list)
 
                while (fd->sidecar_files)
                        {
-                       FileData *sfd = static_cast<FileData *>(fd->sidecar_files->data);
+                       auto sfd = static_cast<FileData *>(fd->sidecar_files->data);
                        g_assert(sfd->parent == NULL || sfd->sidecar_files == NULL);
                        file_data_ref(sfd);
                        file_data_disconnect_sidecar_file(fd, sfd);
@@ -1041,7 +1041,7 @@ static void file_data_check_sidecars(const GList *basename_list)
        new_sidecars = NULL;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
                g_assert(sfd->magick == FD_MAGICK);
                g_assert(sfd->parent == NULL && sfd->sidecar_files == NULL);
                sfd->parent = parent_fd;
@@ -1098,7 +1098,7 @@ void file_data_disable_grouping(FileData *fd, gboolean disable)
                        GList *work = sidecar_files;
                        while (work)
                                {
-                               FileData *sfd = static_cast<FileData *>(work->data);
+                               auto sfd = static_cast<FileData *>(work->data);
                                work = work->next;
                                file_data_disconnect_sidecar_file(fd, sfd);
                                file_data_send_notification(sfd, NOTIFY_GROUPING);
@@ -1126,7 +1126,7 @@ void file_data_disable_grouping_list(GList *fd_list, gboolean disable)
        work = fd_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                file_data_disable_grouping(fd, disable);
                work = work->next;
@@ -1273,7 +1273,7 @@ static GList * file_data_basename_hash_insert(GHashTable *basename_hash, FileDat
                        DEBUG_1("TG: parent extension %s",parent_extension);
                        gchar *parent_basename = g_strndup(basename, parent_extension - basename);
                        DEBUG_1("TG: parent basename %s",parent_basename);
-                       FileData *parent_fd = static_cast<FileData *>(g_hash_table_lookup(file_data_pool, basename));
+                       auto parent_fd = static_cast<FileData *>(g_hash_table_lookup(file_data_pool, basename));
                        if (parent_fd)
                                {
                                DEBUG_1("TG: parent fd found");
@@ -1335,7 +1335,7 @@ static GList *filelist_filter_out_sidecars(GList *flist)
 
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                work = work->next;
                if (fd->parent) /* remove fd's that are children */
@@ -1350,7 +1350,7 @@ static GList *filelist_filter_out_sidecars(GList *flist)
 
 static void file_data_basename_hash_to_sidecars(gpointer UNUSED(key), gpointer value, gpointer UNUSED(data))
 {
-       GList *basename_list = (GList *)value;
+       auto basename_list = (GList *)value;
        file_data_check_sidecars(basename_list);
 }
 
@@ -1603,7 +1603,7 @@ GList *filelist_filter(GList *list, gboolean is_dir_list)
        work = list;
        while (work)
                {
-               FileData *fd = (FileData *)(work->data);
+               auto fd = (FileData *)(work->data);
                const gchar *name = fd->name;
 
                if ((!options->file_filter.show_hidden_files && is_hidden_file(name)) ||
@@ -1647,7 +1647,7 @@ static void filelist_recursive_append(GList **list, GList *dirs)
        work = dirs;
        while (work)
                {
-               FileData *fd = (FileData *)(work->data);
+               auto fd = (FileData *)(work->data);
                GList *f;
                GList *d;
 
@@ -1674,7 +1674,7 @@ static void filelist_recursive_append_full(GList **list, GList *dirs, SortType m
        work = dirs;
        while (work)
                {
-               FileData *fd = (FileData *)(work->data);
+               auto fd = (FileData *)(work->data);
                GList *f;
                GList *d;
 
@@ -1770,7 +1770,7 @@ gchar *file_data_get_sidecar_path(FileData *fd, gboolean existing_only)
        gchar *extended_extension = g_strconcat(fd->parent ? fd->parent->extension : fd->extension, ".xmp", NULL);
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
                work = work->next;
                if (g_ascii_strcasecmp(sfd->extension, ".xmp") == 0 || g_ascii_strcasecmp(sfd->extension, extended_extension) == 0)
                        {
@@ -1880,7 +1880,7 @@ GList *file_data_filter_marks_list(GList *list, guint filter)
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                GList *link = work;
                work = work->next;
 
@@ -1907,7 +1907,7 @@ GList *file_data_filter_file_filter_list(GList *list, GRegex *filter)
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                GList *link = work;
                work = work->next;
 
@@ -1947,7 +1947,7 @@ GList *file_data_filter_class_list(GList *list, guint filter)
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                GList *link = work;
                work = work->next;
 
@@ -1964,7 +1964,7 @@ GList *file_data_filter_class_list(GList *list, guint filter)
 
 static void file_data_notify_mark_func(gpointer UNUSED(key), gpointer value, gpointer UNUSED(user_data))
 {
-       FileData *fd = static_cast<FileData *>(value);
+       auto fd = static_cast<FileData *>(value);
        file_data_increment_version(fd);
        file_data_send_notification(fd, NOTIFY_MARKS);
 }
@@ -2026,7 +2026,7 @@ gchar *file_data_sc_list_to_string(FileData *fd)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                result = g_string_append(result, "+ ");
                result = g_string_append(result, sfd->extension);
@@ -2141,7 +2141,7 @@ static gboolean file_data_sc_add_ci(FileData *fd, FileDataChangeType type)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                if (sfd->change) return FALSE;
                work = work->next;
@@ -2152,7 +2152,7 @@ static gboolean file_data_sc_add_ci(FileData *fd, FileDataChangeType type)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                file_data_add_ci(sfd, type, NULL, NULL);
                work = work->next;
@@ -2172,7 +2172,7 @@ static gboolean file_data_sc_check_ci(FileData *fd, FileDataChangeType type)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                if (!sfd->change || sfd->change->type != type) return FALSE;
                work = work->next;
@@ -2231,7 +2231,7 @@ void file_data_sc_free_ci(FileData *fd)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                file_data_free_ci(sfd);
                work = work->next;
@@ -2246,7 +2246,7 @@ gboolean file_data_sc_add_ci_delete_list(GList *fd_list)
        work = fd_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                if (!file_data_sc_add_ci_delete(fd)) ret = FALSE;
                work = work->next;
@@ -2262,7 +2262,7 @@ static void file_data_sc_revert_ci_list(GList *fd_list)
        work = fd_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                file_data_sc_free_ci(fd);
                work = work->prev;
@@ -2276,7 +2276,7 @@ static gboolean file_data_sc_add_ci_list_call_func(GList *fd_list, const gchar *
        work = fd_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                if (!func(fd, dest))
                        {
@@ -2317,7 +2317,7 @@ gboolean file_data_add_ci_write_metadata_list(GList *fd_list)
        work = fd_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                if (!file_data_add_ci_write_metadata(fd)) ret = FALSE;
                work = work->next;
@@ -2333,7 +2333,7 @@ void file_data_free_ci_list(GList *fd_list)
        work = fd_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                file_data_free_ci(fd);
                work = work->next;
@@ -2347,7 +2347,7 @@ void file_data_sc_free_ci_list(GList *fd_list)
        work = fd_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                file_data_sc_free_ci(fd);
                work = work->next;
@@ -2446,7 +2446,7 @@ static void file_data_sc_update_ci(FileData *fd, const gchar *dest_path)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                file_data_update_ci_dest_preserve_ext(sfd, dest_path);
                work = work->next;
@@ -2492,7 +2492,7 @@ static gboolean file_data_sc_update_ci_list_call_func(GList *fd_list,
        work = fd_list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
 
                if (!func(fd, dest)) ret = FALSE;
                work = work->next;
@@ -2779,7 +2779,7 @@ gint file_data_sc_verify_ci(FileData *fd, GList *list)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                ret |= file_data_verify_ci(sfd, list);
                work = work->next;
@@ -3012,7 +3012,7 @@ gboolean file_data_sc_perform_ci(FileData *fd)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                if (!file_data_perform_ci(sfd)) ret = FALSE;
                work = work->next;
@@ -3068,7 +3068,7 @@ gboolean file_data_sc_apply_ci(FileData *fd)
        work = fd->sidecar_files;
        while (work)
                {
-               FileData *sfd = static_cast<FileData *>(work->data);
+               auto sfd = static_cast<FileData *>(work->data);
 
                file_data_apply_ci(sfd);
                work = work->next;
@@ -3104,7 +3104,7 @@ GList *file_data_process_groups_in_selection(GList *list, gboolean ungroup, GLis
                {
                while (work)
                        {
-                       FileData *fd = static_cast<FileData *>(work->data);
+                       auto fd = static_cast<FileData *>(work->data);
                        work = work->next;
 
                        if (!file_data_list_contains_whole_group(list, fd))
@@ -3123,7 +3123,7 @@ GList *file_data_process_groups_in_selection(GList *list, gboolean ungroup, GLis
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
 
                if (!fd->parent ||
@@ -3172,8 +3172,8 @@ static GList *notify_func_list = NULL;
 
 static gint file_data_notify_sort(gconstpointer a, gconstpointer b)
 {
-       NotifyData *nda = (NotifyData *)a;
-       NotifyData *ndb = (NotifyData *)b;
+       auto nda = (NotifyData *)a;
+       auto ndb = (NotifyData *)b;
 
        if (nda->priority < ndb->priority) return -1;
        if (nda->priority > ndb->priority) return 1;
@@ -3187,7 +3187,7 @@ gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data,
 
        while (work)
                {
-               NotifyData *nd = (NotifyData *)work->data;
+               auto nd = (NotifyData *)work->data;
 
                if (nd->func == func && nd->data == data)
                        {
@@ -3214,7 +3214,7 @@ gboolean file_data_unregister_notify_func(FileDataNotifyFunc func, gpointer data
 
        while (work)
                {
-               NotifyData *nd = (NotifyData *)work->data;
+               auto nd = (NotifyData *)work->data;
 
                if (nd->func == func && nd->data == data)
                        {
@@ -3254,7 +3254,7 @@ void file_data_send_notification(FileData *fd, NotifyType type)
 
        while (work)
                {
-               NotifyData *nd = (NotifyData *)work->data;
+               auto nd = (NotifyData *)work->data;
 
                nd->func(fd, type, nd->data);
                work = work->next;
@@ -3272,7 +3272,7 @@ static guint realtime_monitor_id = 0; /* event source id */
 
 static void realtime_monitor_check_cb(gpointer key, gpointer UNUSED(value), gpointer UNUSED(data))
 {
-       FileData *fd = static_cast<FileData *>(key);
+       auto fd = static_cast<FileData *>(key);
 
        file_data_check_changed_files(fd);
 
@@ -3350,8 +3350,8 @@ gboolean file_data_unregister_real_time_monitor(FileData *fd)
 
 static void marks_get_files(gpointer key, gpointer value, gpointer userdata)
 {
-       gchar *file_name = static_cast<gchar *>(key);
-       GString *result = static_cast<GString *>(userdata);
+       auto file_name = static_cast<gchar *>(key);
+       auto result = static_cast<GString *>(userdata);
        FileData *fd;
 
        if (isfile(file_name))
@@ -3441,7 +3441,7 @@ gboolean marks_list_save(gchar *path, gboolean save)
 
 static void marks_clear(gpointer key, gpointer value, gpointer UNUSED(userdata))
 {
-       gchar *file_name = static_cast<gchar *>(key);
+       auto file_name = static_cast<gchar *>(key);
        gint mark_no;
        gint n;
        FileData *fd;
index e7f259a..4a501bb 100644 (file)
@@ -92,7 +92,7 @@ static FilterEntry *filter_get_by_key(const gchar *key)
        work = filter_list;
        while (work)
                {
-               FilterEntry *fe = static_cast<FilterEntry *>(work->data);
+               auto fe = static_cast<FilterEntry *>(work->data);
                work = work->next;
 
                if (strcmp(fe->key, key) == 0) return fe;
@@ -139,7 +139,7 @@ static void filter_add_if_missing(const gchar *key, const gchar *description, co
        work = filter_list;
        while (work)
                {
-               FilterEntry *fe = static_cast<FilterEntry *>(work->data);
+               auto fe = static_cast<FilterEntry *>(work->data);
                work = work->next;
                if (fe->key && strcmp(fe->key, key) == 0)
                        {
@@ -165,7 +165,7 @@ void filter_reset(void)
        work = filter_list;
        while (work)
                {
-               FilterEntry *fe = static_cast<FilterEntry *>(work->data);
+               auto fe = static_cast<FilterEntry *>(work->data);
                work = work->next;
                filter_entry_free(fe);
                }
@@ -358,8 +358,8 @@ GList *filter_to_list(const gchar *extensions)
 
 static gint filter_sort_ext_len_cb(gconstpointer a, gconstpointer b)
 {
-       gchar *sa = (gchar *)a;
-       gchar *sb = (gchar *)b;
+       auto sa = (gchar *)a;
+       auto sb = (gchar *)b;
 
        gint len_a = strlen(sa);
        gint len_b = strlen(sb);
@@ -445,7 +445,7 @@ static const gchar *filter_name_find(GList *filter, const gchar *name)
        work = filter;
        while (work)
                {
-               gchar *filter = static_cast<gchar *>(work->data);
+               auto filter = static_cast<gchar *>(work->data);
                guint lf = strlen(filter);
 
                if (ln >= lf)
@@ -513,7 +513,7 @@ void filter_write_list(GString *outstr, gint indent)
        work = filter_list;
        while (work)
                {
-               FilterEntry *fe = static_cast<FilterEntry *>(work->data);
+               auto fe = static_cast<FilterEntry *>(work->data);
                work = work->next;
 
                WRITE_NL(); WRITE_STRING("<file_type ");
@@ -583,7 +583,7 @@ static void sidecar_ext_free_list(void)
        work = sidecar_ext_list;
        while (work)
                {
-               gchar *ext = static_cast<gchar *>(work->data);
+               auto ext = static_cast<gchar *>(work->data);
                work = work->next;
                g_free(ext);
                }
index 89931e8..1047245 100644 (file)
@@ -71,7 +71,7 @@ static void clear_mouse_cursor(GtkWidget *widget, gint state)
 
 static gboolean fullscreen_hide_mouse_cb(gpointer data)
 {
-       FullScreenData *fs = static_cast<FullScreenData *>(data);
+       auto fs = static_cast<FullScreenData *>(data);
 
        if (!fs->hide_mouse_id) return FALSE;
 
@@ -100,7 +100,7 @@ static void fullscreen_hide_mouse_reset(FullScreenData *fs)
 
 static gboolean fullscreen_mouse_moved(GtkWidget *UNUSED(widget), GdkEventMotion *UNUSED(event), gpointer data)
 {
-       FullScreenData *fs = static_cast<FullScreenData *>(data);
+       auto fs = static_cast<FullScreenData *>(data);
 
        if (!(fs->cursor_state & FULLSCREEN_CURSOR_NORMAL))
                {
@@ -141,7 +141,7 @@ static void fullscreen_mouse_set_busy(FullScreenData *fs, gboolean busy)
 
 static gboolean fullscreen_mouse_set_busy_cb(gpointer data)
 {
-       FullScreenData *fs = static_cast<FullScreenData *>(data);
+       auto fs = static_cast<FullScreenData *>(data);
 
        fs->busy_mouse_id = 0;
        fullscreen_mouse_set_busy(fs, TRUE);
@@ -159,7 +159,7 @@ static void fullscreen_mouse_set_busy_idle(FullScreenData *fs)
 
 static void fullscreen_image_update_cb(ImageWindow *UNUSED(imd), gpointer data)
 {
-       FullScreenData *fs = static_cast<FullScreenData *>(data);
+       auto fs = static_cast<FullScreenData *>(data);
 
        if (fs->imd->il &&
            image_loader_get_pixbuf(fs->imd->il) != image_get_pixbuf(fs->imd))
@@ -170,7 +170,7 @@ static void fullscreen_image_update_cb(ImageWindow *UNUSED(imd), gpointer data)
 
 static void fullscreen_image_complete_cb(ImageWindow *UNUSED(imd), gboolean preload, gpointer data)
 {
-       FullScreenData *fs = static_cast<FullScreenData *>(data);
+       auto fs = static_cast<FullScreenData *>(data);
 
        if (!preload) fullscreen_mouse_set_busy(fs, FALSE);
 }
@@ -207,7 +207,7 @@ static gboolean fullscreen_saver_block_cb(gpointer UNUSED(data))
 
 static gboolean fullscreen_delete_cb(GtkWidget *UNUSED(widget), GdkEventAny *UNUSED(event), gpointer data)
 {
-       FullScreenData *fs = static_cast<FullScreenData *>(data);
+       auto fs = static_cast<FullScreenData *>(data);
 
        fullscreen_stop(fs);
        return TRUE;
@@ -461,7 +461,7 @@ void fullscreen_prefs_list_free(GList *list)
        work = list;
        while (work)
                {
-               ScreenData *sd = static_cast<ScreenData *>(work->data);
+               auto sd = static_cast<ScreenData *>(work->data);
                work = work->next;
 
                g_free(sd->description);
@@ -478,7 +478,7 @@ ScreenData *fullscreen_prefs_list_find(GList *list, gint screen)
        work = list;
        while (work)
                {
-               ScreenData *sd = static_cast<ScreenData *>(work->data);
+               auto sd = static_cast<ScreenData *>(work->data);
                work = work->next;
 
                if (sd->number == screen) return sd;
@@ -615,7 +615,7 @@ enum {
 
 static void fullscreen_prefs_selection_cb(GtkWidget *combo, gpointer data)
 {
-       gint *value = static_cast<gint *>(data);
+       auto value = static_cast<gint *>(data);
        GtkTreeModel *store;
        GtkTreeIter iter;
        GtkWidget *button;
@@ -681,7 +681,7 @@ GtkWidget *fullscreen_prefs_selection_new(const gchar *text, gint *screen_value,
        work = list;
        while (work)
                {
-               ScreenData *sd = static_cast<ScreenData *>(work->data);
+               auto sd = static_cast<ScreenData *>(work->data);
 
                fullscreen_prefs_selection_add(store, sd->description, sd->number);
                if (*screen_value == sd->number) current = n;
index 3832089..cbc7266 100644 (file)
@@ -138,7 +138,7 @@ const gchar *histogram_label(Histogram *histogram)
 
 static HistMap *histmap_new(void)
 {
-       HistMap *histmap = g_new0(HistMap, 1);
+       auto histmap = g_new0(HistMap, 1);
        return histmap;
 }
 
@@ -204,7 +204,7 @@ const HistMap *histmap_get(FileData *fd)
 
 static gboolean histmap_idle_cb(gpointer data)
 {
-       FileData *fd = static_cast<FileData *>(data);
+       auto fd = static_cast<FileData *>(data);
        if (histmap_read(fd->histmap, FALSE))
                {
                /* finished */
index 90312b9..3673edb 100644 (file)
@@ -356,7 +356,7 @@ static HistoryData *history_list_find_by_key(const gchar *key)
 
        while (work)
                {
-               HistoryData *hd = static_cast<HistoryData *>(work->data);
+               auto hd = static_cast<HistoryData *>(work->data);
                if (strcmp(hd->key, key) == 0) return hd;
                work = work->next;
                }
@@ -403,7 +403,7 @@ void history_list_add_to_key(const gchar *key, const gchar *path, gint max)
        work = hd->list;
        while (work)
                {
-               gchar *buf = static_cast<gchar *>(work->data);
+               auto buf = static_cast<gchar *>(work->data);
 
                if (strcmp(buf, path) == 0)
                        {
@@ -459,7 +459,7 @@ void history_list_item_change(const gchar *key, const gchar *oldpath, const gcha
        work = hd->list;
        while (work)
                {
-               gchar *buf = static_cast<gchar *>(work->data);
+               auto buf = static_cast<gchar *>(work->data);
 
                if (!(g_str_has_prefix(buf, ".") && !newpath))
                        {
@@ -500,7 +500,7 @@ void history_list_item_move(const gchar *key, const gchar *path, gint direction)
        work = hd->list;
        while (work)
                {
-               gchar *buf = static_cast<gchar *>(work->data);
+               auto buf = static_cast<gchar *>(work->data);
                if (strcmp(buf, path) == 0)
                        {
                        p += direction;
index 55d60b4..4bea593 100644 (file)
@@ -40,8 +40,8 @@ struct _ImageLoaderCOLLECTION {
 
 static gboolean image_loader_collection_load(gpointer loader, const guchar *UNUSED(buf), gsize UNUSED(count), GError **UNUSED(error))
 {
-       ImageLoaderCOLLECTION *ld = (ImageLoaderCOLLECTION *) loader;
-       ImageLoader *il = static_cast<ImageLoader *>(ld->data);
+       auto ld = (ImageLoaderCOLLECTION *) loader;
+       auto il = static_cast<ImageLoader *>(ld->data);
 
        #define LINE_LENGTH 1000
 
@@ -116,7 +116,7 @@ static gboolean image_loader_collection_load(gpointer loader, const guchar *UNUS
 
 static gpointer image_loader_collection_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
 {
-       ImageLoaderCOLLECTION *loader = g_new0(ImageLoaderCOLLECTION, 1);
+       auto loader = g_new0(ImageLoaderCOLLECTION, 1);
        loader->area_updated_cb = area_updated_cb;
        loader->size_cb = size_cb;
        loader->area_prepared_cb = area_prepared_cb;
@@ -126,14 +126,14 @@ static gpointer image_loader_collection_new(ImageLoaderBackendCbAreaUpdated area
 
 static void image_loader_collection_set_size(gpointer loader, int width, int height)
 {
-       ImageLoaderCOLLECTION *ld = (ImageLoaderCOLLECTION *) loader;
+       auto ld = (ImageLoaderCOLLECTION *) loader;
        ld->requested_width = width;
        ld->requested_height = height;
 }
 
 static GdkPixbuf* image_loader_collection_get_pixbuf(gpointer loader)
 {
-       ImageLoaderCOLLECTION *ld = (ImageLoaderCOLLECTION *) loader;
+       auto ld = (ImageLoaderCOLLECTION *) loader;
        return ld->pixbuf;
 }
 
@@ -154,13 +154,13 @@ static gboolean image_loader_collection_close(gpointer UNUSED(loader), GError **
 
 static void image_loader_collection_abort(gpointer loader)
 {
-       ImageLoaderCOLLECTION *ld = (ImageLoaderCOLLECTION *) loader;
+       auto ld = (ImageLoaderCOLLECTION *) loader;
        ld->abort = TRUE;
 }
 
 static void image_loader_collection_free(gpointer loader)
 {
-       ImageLoaderCOLLECTION *ld = (ImageLoaderCOLLECTION *) loader;
+       auto ld = (ImageLoaderCOLLECTION *) loader;
        if (ld->pixbuf) g_object_unref(ld->pixbuf);
        g_free(ld);
 }
index 797262d..f55bb9b 100644 (file)
@@ -129,7 +129,7 @@ convert_cmyk_to_rgb (struct jpeg_decompress_struct *cinfo,
 
 static gpointer image_loader_cr3_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
 {
-        ImageLoaderJpeg *loader = g_new0(ImageLoaderJpeg, 1);
+        auto loader = g_new0(ImageLoaderJpeg, 1);
 
        loader->area_updated_cb = area_updated_cb;
        loader->size_cb = size_cb;
@@ -216,7 +216,7 @@ static boolean fill_input_buffer (j_decompress_ptr cinfo)
 }
 static void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
 {
-       struct jpeg_source_mgr* src = (struct jpeg_source_mgr*) cinfo->src;
+       auto  src = (struct jpeg_source_mgr*) cinfo->src;
 
        if ((gulong)num_bytes > src->bytes_in_buffer)
                {
@@ -253,7 +253,7 @@ static void set_mem_src (j_decompress_ptr cinfo, void* buffer, long nbytes)
 
 static gboolean image_loader_cr3_load (gpointer loader, const guchar *buf, gsize count, GError **error)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        struct jpeg_decompress_struct cinfo;
        struct jpeg_decompress_struct cinfo2;
        guchar *dptr, *dptr2;
@@ -467,14 +467,14 @@ static gboolean image_loader_cr3_load (gpointer loader, const guchar *buf, gsize
 
 static void image_loader_cr3_set_size(gpointer loader, int width, int height)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        lj->requested_width = width;
        lj->requested_height = height;
 }
 
 static GdkPixbuf* image_loader_cr3_get_pixbuf(gpointer loader)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        return lj->pixbuf;
 }
 
@@ -495,13 +495,13 @@ static gboolean image_loader_cr3_close(gpointer UNUSED(loader), GError **UNUSED(
 
 static void image_loader_cr3_abort(gpointer loader)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        lj->abort = TRUE;
 }
 
 static void image_loader_cr3_free(gpointer loader)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        if (lj->pixbuf) g_object_unref(lj->pixbuf);
        g_free(lj);
 }
index fb348d1..4d46698 100644 (file)
@@ -229,7 +229,7 @@ uint ddsGetDXTColor(uint c0, uint c1, uint a, uint t) {
 }
 
 guchar *ddsDecodeDXT1(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        uint w = (width + 3) / 4;
@@ -258,7 +258,7 @@ guchar *ddsDecodeDXT1(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsDecodeDXT3(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        uint w = (width + 3) / 4;
@@ -326,7 +326,7 @@ int ddsGetDXT5Alpha(uint a0, uint a1, uint t) {
 }
 
 guchar *ddsDecodeDXT5(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        uint w = (width + 3) / 4;
@@ -381,7 +381,7 @@ guchar *ddsDecodeDXT4(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadA1R5G5B5(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -396,7 +396,7 @@ guchar *ddsReadA1R5G5B5(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadX1R5G5B5(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -411,7 +411,7 @@ guchar *ddsReadX1R5G5B5(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadA4R4G4B4(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -426,7 +426,7 @@ guchar *ddsReadA4R4G4B4(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadX4R4G4B4(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -441,7 +441,7 @@ guchar *ddsReadX4R4G4B4(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadR5G6B5(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -456,7 +456,7 @@ guchar *ddsReadR5G6B5(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadR8G8B8(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -470,7 +470,7 @@ guchar *ddsReadR8G8B8(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadA8B8G8R8(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -484,7 +484,7 @@ guchar *ddsReadA8B8G8R8(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadX8B8G8R8(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -498,7 +498,7 @@ guchar *ddsReadX8B8G8R8(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadA8R8G8B8(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -512,7 +512,7 @@ guchar *ddsReadA8R8G8B8(uint width, uint height, const unsigned char *buffer) {
 }
 
 guchar *ddsReadX8R8G8B8(uint width, uint height, const unsigned char *buffer) {
-       uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
+       auto pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
        if (pixels == NULL) return NULL;
        uint index = 128;
        for (uint i = 0; i<height*width; i++) {
@@ -527,7 +527,7 @@ guchar *ddsReadX8R8G8B8(uint width, uint height, const unsigned char *buffer) {
 
 static gboolean image_loader_dds_load (gpointer loader, const guchar *buf, gsize UNUSED(count), GError **UNUSED(error))
 {
-       ImageLoaderDDS *ld = (ImageLoaderDDS *) loader;
+       auto ld = (ImageLoaderDDS *) loader;
        uint width = ddsGetWidth(buf);
        uint height = ddsGetHeight(buf);
        uint type = ddsGetType(buf);
@@ -560,7 +560,7 @@ static gboolean image_loader_dds_load (gpointer loader, const guchar *buf, gsize
 
 static gpointer image_loader_dds_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
 {
-       ImageLoaderDDS *loader = g_new0(ImageLoaderDDS, 1);
+       auto loader = g_new0(ImageLoaderDDS, 1);
        loader->area_updated_cb = area_updated_cb;
        loader->size_cb = size_cb;
        loader->area_prepared_cb = area_prepared_cb;
@@ -570,14 +570,14 @@ static gpointer image_loader_dds_new(ImageLoaderBackendCbAreaUpdated area_update
 
 static void image_loader_dds_set_size(gpointer loader, int width, int height)
 {
-       ImageLoaderDDS *ld = (ImageLoaderDDS *) loader;
+       auto ld = (ImageLoaderDDS *) loader;
        ld->requested_width = width;
        ld->requested_height = height;
 }
 
 static GdkPixbuf* image_loader_dds_get_pixbuf(gpointer loader)
 {
-       ImageLoaderDDS *ld = (ImageLoaderDDS *) loader;
+       auto ld = (ImageLoaderDDS *) loader;
        return ld->pixbuf;
 }
 
@@ -598,13 +598,13 @@ static gboolean image_loader_dds_close(gpointer UNUSED(loader), GError **UNUSED(
 
 static void image_loader_dds_abort(gpointer loader)
 {
-       ImageLoaderDDS *ld = (ImageLoaderDDS *) loader;
+       auto ld = (ImageLoaderDDS *) loader;
        ld->abort = TRUE;
 }
 
 static void image_loader_dds_free(gpointer loader)
 {
-       ImageLoaderDDS *ld = (ImageLoaderDDS *) loader;
+       auto ld = (ImageLoaderDDS *) loader;
        if (ld->pixbuf) g_object_unref(ld->pixbuf);
        g_free(ld);
 }
index 8e3ed22..c4f6d3a 100644 (file)
@@ -40,8 +40,8 @@ struct _ImageLoaderExternal {
 
 static gboolean image_loader_external_load(gpointer loader, const guchar *UNUSED(buf), gsize UNUSED(count), GError **UNUSED(error))
 {
-       ImageLoaderExternal *ld = (ImageLoaderExternal *) loader;
-       ImageLoader *il = static_cast<ImageLoader *>(ld->data);
+       auto ld = (ImageLoaderExternal *) loader;
+       auto il = static_cast<ImageLoader *>(ld->data);
        gchar *cmd_line;
        gchar *randname;
        gchar *tilde_filename;
@@ -69,7 +69,7 @@ static gboolean image_loader_external_load(gpointer loader, const guchar *UNUSED
 
 static gpointer image_loader_external_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
 {
-       ImageLoaderExternal *loader = g_new0(ImageLoaderExternal, 1);
+       auto loader = g_new0(ImageLoaderExternal, 1);
        loader->area_updated_cb = area_updated_cb;
        loader->size_cb = size_cb;
        loader->area_prepared_cb = area_prepared_cb;
@@ -79,14 +79,14 @@ static gpointer image_loader_external_new(ImageLoaderBackendCbAreaUpdated area_u
 
 static void image_loader_external_set_size(gpointer loader, int width, int height)
 {
-       ImageLoaderExternal *ld = (ImageLoaderExternal *) loader;
+       auto ld = (ImageLoaderExternal *) loader;
        ld->requested_width = width;
        ld->requested_height = height;
 }
 
 static GdkPixbuf* image_loader_external_get_pixbuf(gpointer loader)
 {
-       ImageLoaderExternal *ld = (ImageLoaderExternal *) loader;
+       auto ld = (ImageLoaderExternal *) loader;
        return ld->pixbuf;
 }
 
@@ -108,13 +108,13 @@ static gboolean image_loader_external_close(gpointer UNUSED(loader), GError **UN
 
 static void image_loader_external_abort(gpointer loader)
 {
-       ImageLoaderExternal *ld = (ImageLoaderExternal *) loader;
+       auto ld = (ImageLoaderExternal *) loader;
        ld->abort = TRUE;
 }
 
 static void image_loader_external_free(gpointer loader)
 {
-       ImageLoaderExternal *ld = (ImageLoaderExternal *) loader;
+       auto ld = (ImageLoaderExternal *) loader;
        if (ld->pixbuf) g_object_unref(ld->pixbuf);
        g_free(ld);
 }
index 29bd396..36b4ecb 100644 (file)
@@ -54,7 +54,7 @@ static void image_loader_ft_log_cb(ThumbnailerLogLevel log_level, const char* ms
 
 void image_loader_ft_destroy_image_data(guchar *UNUSED(pixels), gpointer data)
 {
-       image_data *image = (image_data *) data;
+       auto image = (image_data *) data;
 
        video_thumbnailer_destroy_image_data (image);
 }
@@ -72,7 +72,7 @@ static gchar** image_loader_ft_get_format_mime_types(gpointer UNUSED(loader))
 
 static gpointer image_loader_ft_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
 {
-       ImageLoaderFT *loader = g_new0(ImageLoaderFT, 1);
+       auto loader = g_new0(ImageLoaderFT, 1);
 
        loader->area_updated_cb = area_updated_cb;
        loader->size_cb = size_cb;
@@ -91,7 +91,7 @@ static gpointer image_loader_ft_new(ImageLoaderBackendCbAreaUpdated area_updated
 
 static void image_loader_ft_set_size(gpointer loader, int width, int height)
 {
-       ImageLoaderFT *lft = (ImageLoaderFT *) loader;
+       auto lft = (ImageLoaderFT *) loader;
        lft->requested_width = width;
        lft->requested_height = height;
        DEBUG_1("TG: setting size, w=%d, h=%d", width, height);
@@ -100,8 +100,8 @@ static void image_loader_ft_set_size(gpointer loader, int width, int height)
 // static gboolean image_loader_ft_loadfromdisk(gpointer loader, const gchar *path, GError **error)
 static gboolean image_loader_ft_load (gpointer loader, const guchar *UNUSED(buf), gsize UNUSED(count), GError **UNUSED(error))
 {
-       ImageLoaderFT *lft = (ImageLoaderFT *) loader;
-       ImageLoader *il = static_cast<ImageLoader *>(lft->data);
+       auto lft = (ImageLoaderFT *) loader;
+       auto il = static_cast<ImageLoader *>(lft->data);
 
        image_data *image = video_thumbnailer_create_image_data();
 
@@ -163,7 +163,7 @@ static gboolean image_loader_ft_load (gpointer loader, const guchar *UNUSED(buf)
 
 static GdkPixbuf* image_loader_ft_get_pixbuf(gpointer loader)
 {
-       ImageLoaderFT *lft = (ImageLoaderFT *) loader;
+       auto lft = (ImageLoaderFT *) loader;
        return lft->pixbuf;
 }
 
@@ -178,7 +178,7 @@ static gboolean image_loader_ft_close(gpointer UNUSED(loader), GError **UNUSED(e
 
 static void image_loader_ft_free(gpointer loader)
 {
-       ImageLoaderFT *lft = (ImageLoaderFT *) loader;
+       auto lft = (ImageLoaderFT *) loader;
        if (lft->pixbuf) g_object_unref(lft->pixbuf);
        video_thumbnailer_destroy (lft->vt);
 
index b200a89..45f19f3 100644 (file)
@@ -132,7 +132,7 @@ convert_cmyk_to_rgb (struct jpeg_decompress_struct *cinfo,
 
 static gpointer image_loader_jpeg_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
 {
-        ImageLoaderJpeg *loader = g_new0(ImageLoaderJpeg, 1);
+        auto loader = g_new0(ImageLoaderJpeg, 1);
 
        loader->area_updated_cb = area_updated_cb;
        loader->size_cb = size_cb;
@@ -219,7 +219,7 @@ static boolean fill_input_buffer (j_decompress_ptr cinfo)
 }
 static void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
 {
-       struct jpeg_source_mgr* src = (struct jpeg_source_mgr*) cinfo->src;
+       auto  src = (struct jpeg_source_mgr*) cinfo->src;
 
        if ((gulong)num_bytes > src->bytes_in_buffer)
                {
@@ -256,7 +256,7 @@ static void set_mem_src (j_decompress_ptr cinfo, void* buffer, long nbytes)
 
 static gboolean image_loader_jpeg_load (gpointer loader, const guchar *buf, gsize count, GError **error)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        struct jpeg_decompress_struct cinfo;
        struct jpeg_decompress_struct cinfo2;
        guchar *dptr, *dptr2;
@@ -429,14 +429,14 @@ static gboolean image_loader_jpeg_load (gpointer loader, const guchar *buf, gsiz
 
 static void image_loader_jpeg_set_size(gpointer loader, int width, int height)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        lj->requested_width = width;
        lj->requested_height = height;
 }
 
 static GdkPixbuf* image_loader_jpeg_get_pixbuf(gpointer loader)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        return lj->pixbuf;
 }
 
@@ -457,13 +457,13 @@ static gboolean image_loader_jpeg_close(gpointer UNUSED(loader), GError **UNUSED
 
 static void image_loader_jpeg_abort(gpointer loader)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        lj->abort = TRUE;
 }
 
 static void image_loader_jpeg_free(gpointer loader)
 {
-       ImageLoaderJpeg *lj = (ImageLoaderJpeg *) loader;
+       auto lj = (ImageLoaderJpeg *) loader;
        if (lj->pixbuf) g_object_unref(lj->pixbuf);
        g_free(lj);
 }
index cc390c8..5da048d 100644 (file)
@@ -286,8 +286,8 @@ static void free_context(PsdContext *ctx)
 
 static gboolean image_loader_psd_load(gpointer loader, const guchar *buf, gsize count, GError **UNUSED(error))
 {
-       ImageLoaderPSD *ld = (ImageLoaderPSD *) loader;
-       PsdContext* ctx = g_new0(PsdContext, 1);
+       auto ld = (ImageLoaderPSD *) loader;
+       auto  ctx = g_new0(PsdContext, 1);
        guint i;
        guint32 j;
        guint size = count;
@@ -529,7 +529,7 @@ static gboolean image_loader_psd_load(gpointer loader, const guchar *buf, gsize
 
 static gpointer image_loader_psd_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
 {
-       ImageLoaderPSD *loader = g_new0(ImageLoaderPSD, 1);
+       auto loader = g_new0(ImageLoaderPSD, 1);
        loader->area_updated_cb = area_updated_cb;
        loader->size_cb = size_cb;
        loader->area_prepared_cb = area_prepared_cb;
@@ -539,14 +539,14 @@ static gpointer image_loader_psd_new(ImageLoaderBackendCbAreaUpdated area_update
 
 static void image_loader_psd_set_size(gpointer loader, int width, int height)
 {
-       ImageLoaderPSD *ld = (ImageLoaderPSD *) loader;
+       auto ld = (ImageLoaderPSD *) loader;
        ld->requested_width = width;
        ld->requested_height = height;
 }
 
 static GdkPixbuf* image_loader_psd_get_pixbuf(gpointer loader)
 {
-       ImageLoaderPSD *ld = (ImageLoaderPSD *) loader;
+       auto ld = (ImageLoaderPSD *) loader;
        return ld->pixbuf;
 }
 
@@ -568,13 +568,13 @@ static gboolean image_loader_psd_close(gpointer UNUSED(loader), GError **UNUSED(
 
 static void image_loader_psd_abort(gpointer loader)
 {
-       ImageLoaderPSD *ld = (ImageLoaderPSD *) loader;
+       auto ld = (ImageLoaderPSD *) loader;
        ld->abort = TRUE;
 }
 
 static void image_loader_psd_free(gpointer loader)
 {
-       ImageLoaderPSD *ld = (ImageLoaderPSD *) loader;
+       auto ld = (ImageLoaderPSD *) loader;
        if (ld->pixbuf) g_object_unref(ld->pixbuf);
        g_free(ld);
 }
index 2787f57..35b4555 100644 (file)
@@ -64,7 +64,7 @@ static void free_buffer(guchar *pixels, gpointer UNUSED(data))
 
 static gboolean image_loader_zxscr_load(gpointer loader, const guchar *buf, gsize count, GError **UNUSED(error))
 {
-       ImageLoaderZXSCR *ld = (ImageLoaderZXSCR *) loader;
+       auto ld = (ImageLoaderZXSCR *) loader;
        guint8 *pixels;
        gint width, height;
        gint row, col, mrow, pxs, i;
@@ -146,7 +146,7 @@ static gboolean image_loader_zxscr_load(gpointer loader, const guchar *buf, gsiz
 
 static gpointer image_loader_zxscr_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
 {
-       ImageLoaderZXSCR *loader = g_new0(ImageLoaderZXSCR, 1);
+       auto loader = g_new0(ImageLoaderZXSCR, 1);
        loader->area_updated_cb = area_updated_cb;
        loader->size_cb = size_cb;
        loader->area_prepared_cb = area_prepared_cb;
@@ -156,14 +156,14 @@ static gpointer image_loader_zxscr_new(ImageLoaderBackendCbAreaUpdated area_upda
 
 static void image_loader_zxscr_set_size(gpointer loader, int width, int height)
 {
-       ImageLoaderZXSCR *ld = (ImageLoaderZXSCR *) loader;
+       auto ld = (ImageLoaderZXSCR *) loader;
        ld->requested_width = width;
        ld->requested_height = height;
 }
 
 static GdkPixbuf *image_loader_zxscr_get_pixbuf(gpointer loader)
 {
-       ImageLoaderZXSCR *ld = (ImageLoaderZXSCR *) loader;
+       auto ld = (ImageLoaderZXSCR *) loader;
        return ld->pixbuf;
 }
 
@@ -185,13 +185,13 @@ static gboolean image_loader_zxscr_close(gpointer UNUSED(loader), GError **UNUSE
 
 static void image_loader_zxscr_abort(gpointer loader)
 {
-       ImageLoaderZXSCR *ld = (ImageLoaderZXSCR *) loader;
+       auto ld = (ImageLoaderZXSCR *) loader;
        ld->abort = TRUE;
 }
 
 static void image_loader_zxscr_free(gpointer loader)
 {
-       ImageLoaderZXSCR *ld = (ImageLoaderZXSCR *) loader;
+       auto ld = (ImageLoaderZXSCR *) loader;
        if (ld->pixbuf) g_object_unref(ld->pixbuf);
        g_free(ld);
 }
index 5288ced..a5b38ae 100644 (file)
@@ -95,7 +95,7 @@ GType image_loader_get_type(void)
 
 static void image_loader_init(GTypeInstance *instance, gpointer UNUSED(g_class))
 {
-       ImageLoader *il = (ImageLoader *)instance;
+       auto il = (ImageLoader *)instance;
 
        il->pixbuf = NULL;
        il->idle_id = 0;
@@ -200,7 +200,7 @@ static void image_loader_class_init(ImageLoaderClass *loader_class)
 
 static void image_loader_finalize(GObject *object)
 {
-       ImageLoader *il = (ImageLoader *)object;
+       auto il = (ImageLoader *)object;
 
        image_loader_stop(il);
 
@@ -280,7 +280,7 @@ struct _ImageLoaderAreaParam {
 
 static gboolean image_loader_emit_area_ready_cb(gpointer data)
 {
-       ImageLoaderAreaParam *par = static_cast<ImageLoaderAreaParam *>(data);
+       auto par = static_cast<ImageLoaderAreaParam *>(data);
        ImageLoader *il = par->il;
        guint x, y, w, h;
        g_mutex_lock(il->data_mutex);
@@ -299,21 +299,21 @@ static gboolean image_loader_emit_area_ready_cb(gpointer data)
 
 static gboolean image_loader_emit_done_cb(gpointer data)
 {
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
        g_signal_emit(il, signals[SIGNAL_DONE], 0);
        return G_SOURCE_REMOVE;
 }
 
 static gboolean image_loader_emit_error_cb(gpointer data)
 {
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
        g_signal_emit(il, signals[SIGNAL_ERROR], 0);
        return G_SOURCE_REMOVE;
 }
 
 static gboolean image_loader_emit_percent_cb(gpointer data)
 {
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
        g_signal_emit(il, signals[SIGNAL_PERCENT], 0, image_loader_get_percent(il));
        return G_SOURCE_REMOVE;
 }
@@ -321,7 +321,7 @@ static gboolean image_loader_emit_percent_cb(gpointer data)
 static gboolean image_loader_emit_size_cb(gpointer data)
 {
        gint width, height;
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
        g_mutex_lock(il->data_mutex);
        width = il->actual_width;
        height = il->actual_height;
@@ -359,7 +359,7 @@ static ImageLoaderAreaParam *image_loader_queue_area_ready(ImageLoader *il, GLis
 {
        if (*list)
                {
-               ImageLoaderAreaParam *prev_par = static_cast<ImageLoaderAreaParam *>((*list)->data);
+               auto prev_par = static_cast<ImageLoaderAreaParam *>((*list)->data);
                if (prev_par->x == x && prev_par->w == w &&
                    prev_par->y + prev_par->h == y)
                        {
@@ -392,7 +392,7 @@ static ImageLoaderAreaParam *image_loader_queue_area_ready(ImageLoader *il, GLis
                        }
                }
 
-       ImageLoaderAreaParam *par = g_new0(ImageLoaderAreaParam, 1);
+       auto par = g_new0(ImageLoaderAreaParam, 1);
        par->il = il;
        par->x = x;
        par->y = y;
@@ -475,7 +475,7 @@ static void image_loader_area_updated_cb(gpointer UNUSED(loader),
                                 guint x, guint y, guint w, guint h,
                                 gpointer data)
 {
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
 
        if (!image_loader_get_pixbuf(il))
                {
@@ -499,7 +499,7 @@ static void image_loader_area_updated_cb(gpointer UNUSED(loader),
 
 static void image_loader_area_prepared_cb(gpointer loader, gpointer data)
 {
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
        GdkPixbuf *pb;
        guchar *pix;
        size_t h, rs;
@@ -531,7 +531,7 @@ static void image_loader_area_prepared_cb(gpointer loader, gpointer data)
 static void image_loader_size_cb(gpointer loader,
                                 gint width, gint height, gpointer data)
 {
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
        gchar **mime_types;
        gboolean scale = FALSE;
        gint n;
@@ -1137,7 +1137,7 @@ void image_loader_delay_area_ready(ImageLoader *il, gboolean enable)
 
                while (work)
                        {
-                       ImageLoaderAreaParam *par = static_cast<ImageLoaderAreaParam *>(work->data);
+                       auto par = static_cast<ImageLoaderAreaParam *>(work->data);
                        work = work->next;
 
                        g_signal_emit(il, signals[SIGNAL_AREA_READY], 0, par->x, par->y, par->w, par->h);
@@ -1159,7 +1159,7 @@ void image_loader_delay_area_ready(ImageLoader *il, gboolean enable)
 static gboolean image_loader_idle_cb(gpointer data)
 {
        gboolean ret = G_SOURCE_REMOVE;
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
 
        if (il->idle_id)
                {
@@ -1229,7 +1229,7 @@ static void image_loader_thread_wait_high(void)
 
 static void image_loader_thread_run(gpointer data, gpointer UNUSED(user_data))
 {
-       ImageLoader *il = static_cast<ImageLoader *>(data);
+       auto il = static_cast<ImageLoader *>(data);
        gboolean cont;
        gboolean err;
 
index 10ed72f..c3de3a2 100644 (file)
@@ -611,7 +611,7 @@ static void image_osd_info_hide(OverlayStateData *osd)
 
 static gboolean image_osd_update_cb(gpointer data)
 {
-       OverlayStateData *osd = static_cast<OverlayStateData *>(data);
+       auto osd = static_cast<OverlayStateData *>(data);
 
        if (osd->show & OSD_SHOW_INFO)
                {
@@ -699,7 +699,7 @@ void image_osd_update(ImageWindow *imd)
 
 static gboolean image_osd_timer_cb(gpointer data)
 {
-       OverlayStateData *osd = static_cast<OverlayStateData *>(data);
+       auto osd = static_cast<OverlayStateData *>(data);
        gboolean done = TRUE;
        gboolean changed = FALSE;
        gint i;
@@ -742,7 +742,7 @@ static void image_osd_timer_schedule(OverlayStateData *osd)
 
 static void image_osd_state_cb(ImageWindow *UNUSED(imd), ImageState state, gpointer data)
 {
-       OverlayStateData *osd = static_cast<OverlayStateData *>(data);
+       auto osd = static_cast<OverlayStateData *>(data);
 
        osd->changed_states = static_cast<ImageState>(osd->changed_states | state);
        image_osd_update_schedule(osd, FALSE);
@@ -750,7 +750,7 @@ static void image_osd_state_cb(ImageWindow *UNUSED(imd), ImageState state, gpoin
 
 static void image_osd_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       OverlayStateData *osd = static_cast<OverlayStateData *>(data);
+       auto osd = static_cast<OverlayStateData *>(data);
 
        if ((type & (NOTIFY_HISTMAP)) && osd->imd && fd == osd->imd->image_fd)
                {
@@ -788,7 +788,7 @@ static void image_osd_free(OverlayStateData *osd)
 
 static void image_osd_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       OverlayStateData *osd = static_cast<OverlayStateData *>(data);
+       auto osd = static_cast<OverlayStateData *>(data);
 
        osd->imd = NULL;
        image_osd_free(osd);
index 06b394a..25ab0c3 100644 (file)
@@ -59,7 +59,7 @@ static gint rect_id = 0;
 
 static void image_click_cb(PixbufRenderer *UNUSED(pr), GdkEventButton *event, gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
        if (!options->image_lm_click_nav && event->button == MOUSE_BUTTON_MIDDLE)
                {
                imd->mouse_wheel_mode = !imd->mouse_wheel_mode;
@@ -139,7 +139,7 @@ static void switch_coords_orientation(ImageWindow *imd, gint x, gint y, gint wid
 
 static void image_press_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
        LayoutWindow *lw;
        gint x_pixel, y_pixel;
 
@@ -189,7 +189,7 @@ static void image_press_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer d
 
 static void image_drag_cb(PixbufRenderer *pr, GdkEventMotion *event, gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
        gint width, height;
        gint rect_width;
        gint rect_height;
@@ -258,7 +258,7 @@ static void image_drag_cb(PixbufRenderer *pr, GdkEventMotion *event, gpointer da
 
 static void image_scroll_notify_cb(PixbufRenderer *pr, gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
 
        if (imd->func_scroll_notify && pr->scale)
                {
@@ -292,7 +292,7 @@ static void image_complete_util(ImageWindow *imd, gboolean preload)
 
 static void image_render_complete_cb(PixbufRenderer *UNUSED(pr), gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
 
        image_complete_util(imd, FALSE);
 }
@@ -318,7 +318,7 @@ static void image_state_unset(ImageWindow *imd, ImageState state)
 
 static void image_zoom_cb(PixbufRenderer *UNUSED(pr), gdouble UNUSED(zoom), gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
 
        if (imd->title_show_zoom) image_update_title(imd);
        image_state_set(imd, IMAGE_STATE_IMAGE);
@@ -569,7 +569,7 @@ static gboolean image_post_process_color(ImageWindow *imd, gint start_row, gbool
 
 static void image_post_process_tile_color_cb(PixbufRenderer *UNUSED(pr), GdkPixbuf **pixbuf, gint x, gint y, gint w, gint h, gpointer data)
 {
-       ImageWindow *imd = (ImageWindow *)data;
+       auto imd = (ImageWindow *)data;
        if (imd->cm) color_man_correct_region(static_cast<ColorMan *>(imd->cm), *pixbuf, x, y, w, h);
        if (imd->desaturate) pixbuf_desaturate_rect(*pixbuf, x, y, w, h);
        if (imd->overunderexposed) pixbuf_highlight_overunderexposed(*pixbuf, x, y, w, h);
@@ -735,7 +735,7 @@ static void image_read_ahead_cancel(ImageWindow *imd)
 
 static void image_read_ahead_done_cb(ImageLoader *UNUSED(il), gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
 
        if (!imd->read_ahead_fd || !imd->read_ahead_il) return;
 
@@ -857,7 +857,7 @@ static void image_load_pixbuf_ready(ImageWindow *imd)
 
 static void image_load_area_cb(ImageLoader *il, guint x, guint y, guint w, guint h, gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
        PixbufRenderer *pr;
 
        pr = (PixbufRenderer *)imd->pr;
@@ -875,7 +875,7 @@ static void image_load_area_cb(ImageLoader *il, guint x, guint y, guint w, guint
 
 static void image_load_done_cb(ImageLoader *UNUSED(il), gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
 
        DEBUG_1("%s image done", get_exec_time());
 
@@ -938,7 +938,7 @@ static void image_load_done_cb(ImageLoader *UNUSED(il), gpointer data)
 
 static void image_load_size_cb(ImageLoader *UNUSED(il), guint width, guint height, gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
 
        DEBUG_1("image_load_size_cb: %dx%d", width, height);
        pixbuf_renderer_set_size_early((PixbufRenderer *)imd->pr, width, height);
@@ -1186,7 +1186,7 @@ static void image_change_real(ImageWindow *imd, FileData *fd,
 
 static gboolean image_focus_in_cb(GtkWidget *UNUSED(widget), GdkEventFocus *UNUSED(event), gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
 
        if (imd->func_focus_in)
                {
@@ -1198,7 +1198,7 @@ static gboolean image_focus_in_cb(GtkWidget *UNUSED(widget), GdkEventFocus *UNUS
 
 static gboolean image_scroll_cb(GtkWidget *UNUSED(widget), GdkEventScroll *event, gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
        gboolean in_lw = FALSE;
        gint i = 0;
        LayoutWindow *lw = NULL;
@@ -1854,7 +1854,7 @@ void image_prebuffer_set(ImageWindow *imd, FileData *fd)
 
 static void image_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
 
        if (!imd || !image_get_pixbuf(imd) ||
            /* imd->il || */ /* loading in progress - do not check - it should start from the beginning anyway */
@@ -2114,7 +2114,7 @@ static void image_free(ImageWindow *imd)
 
 static void image_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ImageWindow *imd = static_cast<ImageWindow *>(data);
+       auto imd = static_cast<ImageWindow *>(data);
        image_free(imd);
 }
 
index f6f0b75..928dac3 100644 (file)
@@ -79,7 +79,7 @@ static void view_window_notify_cb(FileData *fd, NotifyType type, gpointer data);
  * This array must be kept in sync with the contents of:\n
  *  @link view_popup_menu() @endlink \n
  *  @link view_window_key_press_cb() @endlink
- * 
+ *
  * See also @link hard_coded_window_keys @endlink
  **/
 hard_coded_window_keys image_window_keys[] = {
@@ -294,7 +294,7 @@ static void view_list_step(ViewWindow *vw, gboolean next)
 
        if (options->image.enable_read_ahead && work_ahead)
                {
-               FileData *next_fd = static_cast<FileData *>(work_ahead->data);
+               auto next_fd = static_cast<FileData *>(work_ahead->data);
                image_prebuffer_set(imd, next_fd);
                }
 }
@@ -325,7 +325,7 @@ static void view_list_step_to_end(ViewWindow *vw, gboolean last)
 
        if (options->image.enable_read_ahead && work_ahead)
                {
-               FileData *next_fd = static_cast<FileData *>(work_ahead->data);
+               auto next_fd = static_cast<FileData *>(work_ahead->data);
                image_prebuffer_set(imd, next_fd);
                }
 }
@@ -399,7 +399,7 @@ static void view_window_press_cb(GtkWidget *UNUSED(widget), GdkEventButton *beve
 
 static gboolean view_window_key_press_cb(GtkWidget * (widget), GdkEventKey *event, gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
        gint stop_signal;
        GtkWidget *menu;
@@ -650,7 +650,7 @@ static gboolean view_window_key_press_cb(GtkWidget * (widget), GdkEventKey *even
  */
 static void button_cb(ImageWindow *imd, GdkEventButton *event, gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        GtkWidget *menu;
        gchar *dest_dir;
        LayoutWindow *lw_new;
@@ -694,7 +694,7 @@ static void button_cb(ImageWindow *imd, GdkEventButton *event, gpointer data)
 
 static void scroll_cb(ImageWindow *imd, GdkEventScroll *event, gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        if ((event->state & GDK_CONTROL_MASK) ||
                                (imd->mouse_wheel_mode && !options->image_lm_click_nav))
@@ -755,7 +755,7 @@ static void view_image_set_buttons(ViewWindow *vw, ImageWindow *imd)
 
 static void view_fullscreen_stop_func(FullScreenData *UNUSED(fs), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        vw->fs = NULL;
 
@@ -812,7 +812,7 @@ static void view_slideshow_prev(ViewWindow *vw)
 
 static void view_slideshow_stop_func(SlideShowData *UNUSED(fs), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        GList *work;
        FileData *fd;
 
@@ -869,7 +869,7 @@ static void view_slideshow_stop(ViewWindow *vw)
 
 static void view_window_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        view_window_list = g_list_remove(view_window_list, vw);
 
@@ -892,7 +892,7 @@ static void view_window_close(ViewWindow *vw)
 
 static gboolean view_window_delete_cb(GtkWidget *UNUSED(w), GdkEventAny *UNUSED(event), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        view_window_close(vw);
        return TRUE;
@@ -1019,7 +1019,7 @@ static ViewWindow *real_view_window_new(FileData *fd, GList *list, CollectionDat
 
 static void view_window_collection_unref_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CollectionData *cd = static_cast<CollectionData *>(data);
+       auto cd = static_cast<CollectionData *>(data);
 
        collection_unref(cd);
 }
@@ -1091,7 +1091,7 @@ void view_window_colors_update(void)
        work = view_window_list;
        while (work)
                {
-               ViewWindow *vw = static_cast<ViewWindow *>(work->data);
+               auto vw = static_cast<ViewWindow *>(work->data);
                work = work->next;
 
                image_background_set_color_from_options(vw->imd, !!vw->fs);
@@ -1105,7 +1105,7 @@ gboolean view_window_find_image(ImageWindow *imd, gint *index, gint *total)
        work = view_window_list;
        while (work)
                {
-               ViewWindow *vw = static_cast<ViewWindow *>(work->data);
+               auto vw = static_cast<ViewWindow *>(work->data);
                work = work->next;
 
                if (vw->imd == imd ||
@@ -1142,7 +1142,7 @@ gboolean view_window_find_image(ImageWindow *imd, gint *index, gint *total)
 
 static void view_new_window_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        CollectionData *cd;
        CollectInfo *info;
 
@@ -1162,7 +1162,7 @@ static void view_edit_cb(GtkWidget *widget, gpointer data)
 {
        ViewWindow *vw;
        ImageWindow *imd;
-       const gchar *key = static_cast<const gchar *>(data);
+       auto key = static_cast<const gchar *>(data);
 
        vw = static_cast<ViewWindow *>(submenu_item_get_data(widget));
        if (!vw) return;
@@ -1190,35 +1190,35 @@ static void view_alter_cb(GtkWidget *widget, gpointer data)
 
 static void view_zoom_in_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        image_zoom_adjust(view_window_active_image(vw), get_zoom_increment());
 }
 
 static void view_zoom_out_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        image_zoom_adjust(view_window_active_image(vw), -get_zoom_increment());
 }
 
 static void view_zoom_1_1_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        image_zoom_set(view_window_active_image(vw), 1.0);
 }
 
 static void view_zoom_fit_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        image_zoom_set(view_window_active_image(vw), 0.0);
 }
 
 static void view_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
 
        imd = view_window_active_image(vw);
@@ -1227,7 +1227,7 @@ static void view_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void view_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
 
        imd = view_window_active_image(vw);
@@ -1236,7 +1236,7 @@ static void view_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void view_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
 
        imd = view_window_active_image(vw);
@@ -1245,7 +1245,7 @@ static void view_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void view_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
 
        imd = view_window_active_image(vw);
@@ -1255,7 +1255,7 @@ static void view_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void view_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
 
        imd = view_window_active_image(vw);
@@ -1265,7 +1265,7 @@ static void view_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void view_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
 
        imd = view_window_active_image(vw);
@@ -1274,7 +1274,7 @@ static void view_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void view_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
 
        imd = view_window_active_image(vw);
@@ -1283,35 +1283,35 @@ static void view_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void view_fullscreen_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        view_fullscreen_toggle(vw, FALSE);
 }
 
 static void view_slideshow_start_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        view_slideshow_start(vw);
 }
 
 static void view_slideshow_stop_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        view_slideshow_stop(vw);
 }
 
 static void view_slideshow_pause_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        slideshow_pause_toggle(vw->ss);
 }
 
 static void view_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        view_window_close(vw);
 }
@@ -1329,7 +1329,7 @@ static LayoutWindow *view_new_layout_with_fd(FileData *fd)
 
 static void view_set_layout_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        LayoutWindow *lw;
        ImageWindow *imd;
 
@@ -1347,7 +1347,7 @@ static void view_set_layout_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void view_popup_menu_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GList *editmenu_fd_list = static_cast<GList *>(data);
+       auto editmenu_fd_list = static_cast<GList *>(data);
 
        filelist_free(editmenu_fd_list);
 }
@@ -1368,10 +1368,10 @@ static GList *view_window_get_fd_list(ViewWindow *vw)
 
 /**
  * @brief Add file selection list to a collection
- * @param[in] widget 
+ * @param[in] widget
  * @param[in] data Index to the collection list menu item selected, or -1 for new collection
- * 
- * 
+ *
+ *
  */
 static void image_pop_menu_collections_cb(GtkWidget *widget, gpointer data)
 {
@@ -1507,7 +1507,7 @@ static void view_dir_list_do(ViewWindow *vw, GList *list, gboolean skip, gboolea
        work = list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
 
                if (isdir(fd->path))
@@ -1559,25 +1559,25 @@ static void view_dir_list_do(ViewWindow *vw, GList *list, gboolean skip, gboolea
 
 static void view_dir_list_add(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CViewConfirmD *d = static_cast<CViewConfirmD *>(data);
+       auto d = static_cast<CViewConfirmD *>(data);
        view_dir_list_do(d->vw, d->list, FALSE, FALSE);
 }
 
 static void view_dir_list_recurse(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CViewConfirmD *d = static_cast<CViewConfirmD *>(data);
+       auto d = static_cast<CViewConfirmD *>(data);
        view_dir_list_do(d->vw, d->list, FALSE, TRUE);
 }
 
 static void view_dir_list_skip(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CViewConfirmD *d = static_cast<CViewConfirmD *>(data);
+       auto d = static_cast<CViewConfirmD *>(data);
        view_dir_list_do(d->vw, d->list, TRUE, FALSE);
 }
 
 static void view_dir_list_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       CViewConfirmD *d = static_cast<CViewConfirmD *>(data);
+       auto d = static_cast<CViewConfirmD *>(data);
        filelist_free(d->list);
        g_free(d);
 }
@@ -1617,7 +1617,7 @@ static void view_window_get_dnd_data(GtkWidget *UNUSED(widget), GdkDragContext *
                                     GtkSelectionData *selection_data, guint info,
                                     guint UNUSED(time), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        ImageWindow *imd;
 
        if (gtk_drag_get_source_widget(context) == vw->imd->pr) return;
@@ -1639,7 +1639,7 @@ static void view_window_get_dnd_data(GtkWidget *UNUSED(widget), GdkDragContext *
                        work = list;
                        while (work)
                                {
-                               FileData *fd = static_cast<FileData *>(work->data);
+                               auto fd = static_cast<FileData *>(work->data);
                                if (isdir(fd->path))
                                        {
                                        GtkWidget *menu;
@@ -1696,7 +1696,7 @@ static void view_window_set_dnd_data(GtkWidget *UNUSED(widget), GdkDragContext *
                                     GtkSelectionData *selection_data, guint UNUSED(info),
                                     guint UNUSED(time), gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
        FileData *fd;
 
        fd = image_get_fd(vw->imd);
@@ -1825,7 +1825,7 @@ static void view_real_removed(ViewWindow *vw, FileData *fd)
 
 static void view_window_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       ViewWindow *vw = static_cast<ViewWindow *>(data);
+       auto vw = static_cast<ViewWindow *>(data);
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
 
index 2ab6d42..9071c2e 100644 (file)
@@ -202,7 +202,7 @@ static gint mpo_parse_Index_IFD_entry(const guchar *tiff, guint offset,
        guint data_offset;
        guint data_length;
 
-       MPOData *mpo = static_cast<MPOData *>(data);
+       auto mpo = static_cast<MPOData *>(data);
 
        tag = tiff_byte_get_int16(tiff + offset + TIFF_TIFD_OFFSET_TAG, bo);
        format = tiff_byte_get_int16(tiff + offset + TIFF_TIFD_OFFSET_FORMAT, bo);
@@ -272,7 +272,7 @@ static gint mpo_parse_Attributes_IFD_entry(const guchar *tiff, guint offset,
        guint count;
        guint data_val;
 
-       MPOEntry *mpe = static_cast<MPOEntry *>(data);
+       auto mpe = static_cast<MPOEntry *>(data);
 
        tag = tiff_byte_get_int16(tiff + offset + TIFF_TIFD_OFFSET_TAG, bo);
        format = tiff_byte_get_int16(tiff + offset + TIFF_TIFD_OFFSET_FORMAT, bo);
index 369a82f..b2b83a4 100644 (file)
@@ -66,7 +66,7 @@ static const gchar *layout_titles[] = { N_("Tools"), N_("Files"), N_("Image") };
 
 static void layout_config_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutConfig * lc = static_cast<LayoutConfig *>(data);
+       auto  lc = static_cast<LayoutConfig *>(data);
 
        g_list_free(lc->style_widgets);
        g_free(lc);
index f0b4aa8..dabc88f 100644 (file)
@@ -72,7 +72,7 @@ static void layout_image_animate_update_image(LayoutWindow *lw);
 
 static void layout_image_full_screen_stop_func(FullScreenData *fs, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        /* restore image window */
        if (lw->image == fs->imd)
@@ -164,7 +164,7 @@ static void layout_image_slideshow_prev(LayoutWindow *lw)
 
 static void layout_image_slideshow_stop_func(SlideShowData *UNUSED(ss), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        lw->slideshow = NULL;
        layout_status_update_info(lw, NULL);
@@ -301,7 +301,7 @@ static gboolean animation_should_continue(AnimationData *fd)
 
 static gboolean show_next_frame(gpointer data)
 {
-       AnimationData *fd = (AnimationData*)data;
+       auto fd = (AnimationData*)data;
        int delay;
        PixbufRenderer *pr;
 
@@ -381,7 +381,7 @@ static void layout_image_animate_update_image(LayoutWindow *lw)
 static void animation_async_ready_cb(GObject *UNUSED(source_object), GAsyncResult *res, gpointer data)
 {
        GError *error = NULL;
-       AnimationData *animation = static_cast<AnimationData *>(data);
+       auto animation = static_cast<AnimationData *>(data);
 
        if (animation)
                {
@@ -481,27 +481,27 @@ void layout_image_animate_toggle(LayoutWindow *lw)
 
 static void li_pop_menu_zoom_in_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_adjust(lw, get_zoom_increment(), FALSE);
 }
 
 static void li_pop_menu_zoom_out_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        layout_image_zoom_adjust(lw, -get_zoom_increment(), FALSE);
 }
 
 static void li_pop_menu_zoom_1_1_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 1.0, FALSE);
 }
 
 static void li_pop_menu_zoom_fit_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 0.0, FALSE);
 }
@@ -509,7 +509,7 @@ static void li_pop_menu_zoom_fit_cb(GtkWidget *UNUSED(widget), gpointer data)
 static void li_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
 {
        LayoutWindow *lw;
-       const gchar *key = static_cast<const gchar *>(data);
+       auto key = static_cast<const gchar *>(data);
 
        lw = static_cast<LayoutWindow *>(submenu_item_get_data(widget));
 
@@ -522,7 +522,7 @@ static void li_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
 
 static void li_pop_menu_alter_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        AlterType type;
 
        lw = static_cast<LayoutWindow *>(submenu_item_get_data(widget));
@@ -533,7 +533,7 @@ static void li_pop_menu_alter_cb(GtkWidget *widget, gpointer data)
 
 static void li_pop_menu_new_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        view_window_new(layout_image_get_fd(lw));
 }
@@ -558,7 +558,7 @@ static GtkWidget *li_pop_menu_click_parent(GtkWidget *widget, LayoutWindow *lw)
 
 static void li_pop_menu_copy_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_copy(layout_image_get_fd(lw), NULL, NULL,
                       li_pop_menu_click_parent(widget, lw));
@@ -566,21 +566,21 @@ static void li_pop_menu_copy_cb(GtkWidget *widget, gpointer data)
 
 static void li_pop_menu_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_copy_path_to_clipboard(layout_image_get_fd(lw), TRUE);
 }
 
 static void li_pop_menu_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_copy_path_to_clipboard(layout_image_get_fd(lw), FALSE);
 }
 
 static void li_pop_menu_copy_image_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        ImageWindow *imd = lw->image;
 
        GdkPixbuf *pixbuf;
@@ -591,7 +591,7 @@ static void li_pop_menu_copy_image_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void li_pop_menu_move_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_move(layout_image_get_fd(lw), NULL, NULL,
                       li_pop_menu_click_parent(widget, lw));
@@ -599,7 +599,7 @@ static void li_pop_menu_move_cb(GtkWidget *widget, gpointer data)
 
 static void li_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_rename(layout_image_get_fd(lw), NULL,
                         li_pop_menu_click_parent(widget, lw));
@@ -607,7 +607,7 @@ static void li_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
 
 static void li_pop_menu_delete_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        options->file_ops.safe_delete_enable = FALSE;
        file_util_delete(layout_image_get_fd(lw), NULL,
@@ -616,7 +616,7 @@ static void li_pop_menu_delete_cb(GtkWidget *widget, gpointer data)
 
 static void li_pop_menu_move_to_trash_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        options->file_ops.safe_delete_enable = TRUE;
        file_util_delete(layout_image_get_fd(lw), NULL,
@@ -625,49 +625,49 @@ static void li_pop_menu_move_to_trash_cb(GtkWidget *widget, gpointer data)
 
 static void li_pop_menu_slide_start_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_slideshow_start(lw);
 }
 
 static void li_pop_menu_slide_stop_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_slideshow_stop(lw);
 }
 
 static void li_pop_menu_slide_pause_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_slideshow_pause_toggle(lw);
 }
 
 static void li_pop_menu_full_screen_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_full_screen_toggle(lw);
 }
 
 static void li_pop_menu_animate_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_animate_toggle(lw);
 }
 
 static void li_pop_menu_hide_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_tools_hide_toggle(lw);
 }
 
 static void li_set_layout_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        FileData *fd;
 
        if (!layout_valid(&lw)) return;
@@ -678,7 +678,7 @@ static void li_set_layout_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void li_open_archive_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        LayoutWindow *lw_new;
        gchar *dest_dir;
 
@@ -712,7 +712,7 @@ static gboolean li_check_if_current_path(LayoutWindow *lw, const gchar *path)
 
 static void layout_image_popup_menu_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GList *editmenu_fd_list = static_cast<GList *>(data);
+       auto editmenu_fd_list = static_cast<GList *>(data);
 
        filelist_free(editmenu_fd_list);
 }
@@ -736,10 +736,10 @@ static GList *layout_image_get_fd_list(LayoutWindow *lw)
 
 /**
  * @brief Add file selection list to a collection
- * @param[in] widget 
+ * @param[in] widget
  * @param[in] data Index to the collection list menu item selected, or -1 for new collection
- * 
- * 
+ *
+ *
  */
 static void layout_pop_menu_collections_cb(GtkWidget *widget, gpointer data)
 {
@@ -891,7 +891,7 @@ static void layout_image_dnd_receive(GtkWidget *widget, GdkDragContext *UNUSED(c
                                     GtkSelectionData *selection_data, guint info,
                                     guint UNUSED(time), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint i;
        gchar *url;
 
@@ -932,7 +932,7 @@ static void layout_image_dnd_receive(GtkWidget *widget, GdkDragContext *UNUSED(c
 
                if (list)
                        {
-                       FileData *fd = static_cast<FileData *>(list->data);
+                       auto fd = static_cast<FileData *>(list->data);
 
                        if (isfile(fd->path))
                                {
@@ -979,7 +979,7 @@ static void layout_image_dnd_get(GtkWidget *widget, GdkDragContext *UNUSED(conte
                                 GtkSelectionData *selection_data, guint UNUSED(info),
                                 guint UNUSED(time), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        FileData *fd;
        gint i;
 
@@ -1014,7 +1014,7 @@ static void layout_image_dnd_get(GtkWidget *widget, GdkDragContext *UNUSED(conte
 
 static void layout_image_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *context, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE)
                {
                FileData *fd;
@@ -1851,7 +1851,7 @@ static gint image_idx(LayoutWindow *lw, ImageWindow *imd)
 
 static void layout_image_focus_in_cb(ImageWindow *imd, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        gint i = image_idx(lw, imd);
 
@@ -1865,7 +1865,7 @@ static void layout_image_focus_in_cb(ImageWindow *imd, gpointer data)
 
 static void layout_image_button_cb(ImageWindow *imd, GdkEventButton *event, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkWidget *menu;
        LayoutWindow *lw_new;
        gchar *dest_dir;
@@ -1918,7 +1918,7 @@ static void layout_image_button_cb(ImageWindow *imd, GdkEventButton *event, gpoi
 
 static void layout_image_scroll_cb(ImageWindow *imd, GdkEventScroll *event, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        gint i = image_idx(lw, imd);
 
@@ -1983,7 +1983,7 @@ static void layout_image_scroll_cb(ImageWindow *imd, GdkEventScroll *event, gpoi
 static void layout_image_drag_cb(ImageWindow *imd, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer data)
 {
        gint i;
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gdouble sx, sy;
 
        if (lw->full_screen && lw->image != lw->full_screen->imd &&
@@ -2026,7 +2026,7 @@ static void layout_image_drag_cb(ImageWindow *imd, GdkEventMotion *event, gdoubl
 
 static void layout_image_button_inactive_cb(ImageWindow *imd, GdkEventButton *event, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkWidget *menu;
        gint i = image_idx(lw, imd);
 
@@ -2053,7 +2053,7 @@ static void layout_image_button_inactive_cb(ImageWindow *imd, GdkEventButton *ev
 
 static void layout_image_drag_inactive_cb(ImageWindow *imd, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint i = image_idx(lw, imd);
 
        if (i != -1)
@@ -2093,7 +2093,7 @@ static gint num_length(gint num)
 
 void layout_status_update_pixel_cb(PixbufRenderer *pr, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint x_pixel, y_pixel;
        gint width, height;
        gchar *text;
@@ -2144,7 +2144,7 @@ void layout_status_update_pixel_cb(PixbufRenderer *pr, gpointer data)
 
 static void layout_image_update_cb(ImageWindow *UNUSED(imd), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        layout_status_update_image(lw);
 }
 
@@ -2259,7 +2259,7 @@ static void layout_image_setup_split_common(LayoutWindow *lw, gint n)
 
                                while (work && j < i)
                                        {
-                                       FileData *fd = static_cast<FileData *>(work->data);
+                                       auto fd = static_cast<FileData *>(work->data);
                                        work = work->prev;
 
                                        if (!fd || !*fd->path || fd->parent ||
@@ -2511,7 +2511,7 @@ static void layout_image_maint_removed(LayoutWindow *lw, FileData *fd)
 
 void layout_image_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
 
index dfa538a..8c70c7d 100644 (file)
@@ -97,7 +97,7 @@ static gboolean layout_key_match(guint keyval)
 
 gboolean layout_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkWidget *focused;
        gboolean stop_signal = FALSE;
        gint x = 0;
@@ -251,7 +251,7 @@ static void layout_menu_clear_marks_cb(GtkAction *UNUSED(action), gpointer UNUSE
 
 static void layout_menu_new_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        collection_window_new(NULL);
@@ -259,7 +259,7 @@ static void layout_menu_new_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_open_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        collection_dialog_load(NULL);
@@ -267,7 +267,7 @@ static void layout_menu_open_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_search_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        search_new(lw->dir_fd, layout_image_get_fd(lw));
@@ -275,7 +275,7 @@ static void layout_menu_search_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_dupes_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        dupe_window_new();
@@ -283,7 +283,7 @@ static void layout_menu_dupes_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_pan_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        pan_window_new(lw->dir_fd);
@@ -291,56 +291,56 @@ static void layout_menu_pan_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_print_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        print_window_new(layout_image_get_fd(lw), layout_selection_list(lw), layout_list(lw), layout_window(lw));
 }
 
 static void layout_menu_dir_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (lw->vd) vd_new_folder(lw->vd, lw->dir_fd);
 }
 
 static void layout_menu_copy_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_copy(NULL, layout_selection_list(lw), NULL, layout_window(lw));
 }
 
 static void layout_menu_copy_path_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_copy_path_list_to_clipboard(layout_selection_list(lw), TRUE);
 }
 
 static void layout_menu_copy_path_unquoted_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_copy_path_list_to_clipboard(layout_selection_list(lw), FALSE);
 }
 
 static void layout_menu_move_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_move(NULL, layout_selection_list(lw), NULL, layout_window(lw));
 }
 
 static void layout_menu_rename_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_util_rename(NULL, layout_selection_list(lw), layout_window(lw));
 }
 
 static void layout_menu_delete_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        options->file_ops.safe_delete_enable = FALSE;
        file_util_delete(NULL, layout_selection_list(lw), layout_window(lw));
@@ -348,7 +348,7 @@ static void layout_menu_delete_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_move_to_trash_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        options->file_ops.safe_delete_enable = TRUE;
        file_util_delete(NULL, layout_selection_list(lw), layout_window(lw));
@@ -356,7 +356,7 @@ static void layout_menu_move_to_trash_cb(GtkAction *UNUSED(action), gpointer dat
 
 static void layout_menu_move_to_trash_key_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (options->file_ops.enable_delete_key)
                {
@@ -367,21 +367,21 @@ static void layout_menu_move_to_trash_key_cb(GtkAction *UNUSED(action), gpointer
 
 static void layout_menu_disable_grouping_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_data_disable_grouping_list(layout_selection_list(lw), TRUE);
 }
 
 static void layout_menu_enable_grouping_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        file_data_disable_grouping_list(layout_selection_list(lw), FALSE);
 }
 
 void layout_menu_close_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        layout_close(lw);
@@ -394,98 +394,98 @@ static void layout_menu_exit_cb(GtkAction *UNUSED(action), gpointer UNUSED(data)
 
 static void layout_menu_alter_90_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_alter_orientation(lw, ALTER_ROTATE_90);
 }
 
 static void layout_menu_rating_0_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_rating(lw, "0");
 }
 
 static void layout_menu_rating_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_rating(lw, "1");
 }
 
 static void layout_menu_rating_2_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_rating(lw, "2");
 }
 
 static void layout_menu_rating_3_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_rating(lw, "3");
 }
 
 static void layout_menu_rating_4_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_rating(lw, "4");
 }
 
 static void layout_menu_rating_5_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_rating(lw, "5");
 }
 
 static void layout_menu_rating_m1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_rating(lw, "-1");
 }
 
 static void layout_menu_alter_90cc_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_alter_orientation(lw, ALTER_ROTATE_90_CC);
 }
 
 static void layout_menu_alter_180_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_alter_orientation(lw, ALTER_ROTATE_180);
 }
 
 static void layout_menu_alter_mirror_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_alter_orientation(lw, ALTER_MIRROR);
 }
 
 static void layout_menu_alter_flip_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_alter_orientation(lw, ALTER_FLIP);
 }
 
 static void layout_menu_alter_desaturate_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_set_desaturate(lw, gtk_toggle_action_get_active(action));
 }
 
 static void layout_menu_alter_ignore_alpha_cb(GtkToggleAction *action, gpointer data)
 {
-   LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+   auto lw = static_cast<LayoutWindow *>(data);
 
        if (lw->options.ignore_alpha == gtk_toggle_action_get_active(action)) return;
 
@@ -494,14 +494,14 @@ static void layout_menu_alter_ignore_alpha_cb(GtkToggleAction *action, gpointer
 
 static void layout_menu_alter_none_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_alter_orientation(lw, ALTER_NONE);
 }
 
 static void layout_menu_exif_rotate_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        options->image.exif_rotate_enable = gtk_toggle_action_get_active(action);
        layout_image_reset_orientation(lw);
@@ -514,21 +514,21 @@ static void layout_menu_select_rectangle_cb(GtkToggleAction *action, gpointer UN
 
 static void layout_menu_split_pane_sync_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        lw->options.split_pane_sync = gtk_toggle_action_get_active(action);
 }
 
 static void layout_menu_select_overunderexposed_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_set_overunderexposed(lw, gtk_toggle_action_get_active(action));
 }
 
 static void layout_menu_write_rotate(GtkToggleAction *UNUSED(action), gpointer data, gboolean keep_date)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkTreeModel *store;
        GList *work;
        GtkTreeSelection *selection;
@@ -629,7 +629,7 @@ static void layout_menu_write_rotate_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_config_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        show_config_window(lw);
@@ -637,7 +637,7 @@ static void layout_menu_config_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_editors_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        show_editor_list_window();
@@ -645,7 +645,7 @@ static void layout_menu_editors_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_layout_config_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        layout_show_config_window(lw);
@@ -653,7 +653,7 @@ static void layout_menu_layout_config_cb(GtkAction *UNUSED(action), gpointer dat
 
 static void layout_menu_remove_thumb_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        cache_manager_show();
@@ -661,7 +661,7 @@ static void layout_menu_remove_thumb_cb(GtkAction *UNUSED(action), gpointer data
 
 static void layout_menu_wallpaper_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_to_root(lw);
 }
@@ -669,83 +669,83 @@ static void layout_menu_wallpaper_cb(GtkAction *UNUSED(action), gpointer data)
 /* single window zoom */
 static void layout_menu_zoom_in_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_adjust(lw, get_zoom_increment(), FALSE);
 }
 
 static void layout_menu_zoom_out_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_adjust(lw, -get_zoom_increment(), FALSE);
 }
 
 static void layout_menu_zoom_1_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 1.0, FALSE);
 }
 
 static void layout_menu_zoom_fit_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 0.0, FALSE);
 }
 
 static void layout_menu_zoom_fit_hor_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set_fill_geometry(lw, FALSE, FALSE);
 }
 
 static void layout_menu_zoom_fit_vert_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set_fill_geometry(lw, TRUE, FALSE);
 }
 
 static void layout_menu_zoom_2_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 2.0, FALSE);
 }
 
 static void layout_menu_zoom_3_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 3.0, FALSE);
 }
 static void layout_menu_zoom_4_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 4.0, FALSE);
 }
 
 static void layout_menu_zoom_1_2_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, -2.0, FALSE);
 }
 
 static void layout_menu_zoom_1_3_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, -3.0, FALSE);
 }
 
 static void layout_menu_zoom_1_4_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, -4.0, FALSE);
 }
@@ -753,83 +753,83 @@ static void layout_menu_zoom_1_4_cb(GtkAction *UNUSED(action), gpointer data)
 /* connected zoom */
 static void layout_menu_connect_zoom_in_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_adjust(lw, get_zoom_increment(), TRUE);
 }
 
 static void layout_menu_connect_zoom_out_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_adjust(lw, -get_zoom_increment(), TRUE);
 }
 
 static void layout_menu_connect_zoom_1_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 1.0, TRUE);
 }
 
 static void layout_menu_connect_zoom_fit_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 0.0, TRUE);
 }
 
 static void layout_menu_connect_zoom_fit_hor_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set_fill_geometry(lw, FALSE, TRUE);
 }
 
 static void layout_menu_connect_zoom_fit_vert_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set_fill_geometry(lw, TRUE, TRUE);
 }
 
 static void layout_menu_connect_zoom_2_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 2.0, TRUE);
 }
 
 static void layout_menu_connect_zoom_3_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 3.0, TRUE);
 }
 static void layout_menu_connect_zoom_4_1_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, 4.0, TRUE);
 }
 
 static void layout_menu_connect_zoom_1_2_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, -2.0, TRUE);
 }
 
 static void layout_menu_connect_zoom_1_3_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, -3.0, TRUE);
 }
 
 static void layout_menu_connect_zoom_1_4_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_zoom_set(lw, -4.0, TRUE);
 }
@@ -837,7 +837,7 @@ static void layout_menu_connect_zoom_1_4_cb(GtkAction *UNUSED(action), gpointer
 
 static void layout_menu_split_cb(GtkRadioAction *action, GtkRadioAction *UNUSED(current), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        ImageSplitMode mode;
 
        layout_exit_fullscreen(lw);
@@ -848,7 +848,7 @@ static void layout_menu_split_cb(GtkRadioAction *action, GtkRadioAction *UNUSED(
 
 static void layout_menu_thumb_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_thumb_set(lw, gtk_toggle_action_get_active(action));
 }
@@ -856,7 +856,7 @@ static void layout_menu_thumb_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_list_cb(GtkRadioAction *action, GtkRadioAction *UNUSED(current), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        layout_views_set(lw, lw->options.dir_view_type, (FileViewType) gtk_radio_action_get_current_value(action));
@@ -864,7 +864,7 @@ static void layout_menu_list_cb(GtkRadioAction *action, GtkRadioAction *UNUSED(c
 
 static void layout_menu_view_dir_as_cb(GtkToggleAction *action,  gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
 
@@ -880,7 +880,7 @@ static void layout_menu_view_dir_as_cb(GtkToggleAction *action,  gpointer data)
 
 static void layout_menu_view_in_new_window_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        view_window_new(layout_image_get_fd(lw));
@@ -888,7 +888,7 @@ static void layout_menu_view_in_new_window_cb(GtkAction *UNUSED(action), gpointe
 
 static void layout_menu_open_archive_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        LayoutWindow *lw_new;
        gchar *dest_dir;
        FileData *fd;
@@ -914,21 +914,21 @@ static void layout_menu_open_archive_cb(GtkAction *UNUSED(action), gpointer data
 
 static void layout_menu_fullscreen_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_full_screen_toggle(lw);
 }
 
 static void layout_menu_escape_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
 }
 
 static void layout_menu_overlay_toggle_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        image_osd_toggle(lw->image);
        layout_util_sync_views(lw);
@@ -937,7 +937,7 @@ static void layout_menu_overlay_toggle_cb(GtkAction *UNUSED(action), gpointer da
 
 static void layout_menu_overlay_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (gtk_toggle_action_get_active(action))
                {
@@ -957,7 +957,7 @@ static void layout_menu_overlay_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_histogram_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (gtk_toggle_action_get_active(action))
                {
@@ -974,7 +974,7 @@ static void layout_menu_histogram_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_animate_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (lw->options.animate == gtk_toggle_action_get_active(action)) return;
        layout_image_animate_toggle(lw);
@@ -987,7 +987,7 @@ static void layout_menu_rectangular_selection_cb(GtkToggleAction *action, gpoint
 
 static void layout_menu_histogram_toggle_channel_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        image_osd_histogram_toggle_channel(lw->image);
        layout_util_sync_views(lw);
@@ -995,7 +995,7 @@ static void layout_menu_histogram_toggle_channel_cb(GtkAction *UNUSED(action), g
 
 static void layout_menu_histogram_toggle_mode_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        image_osd_histogram_toggle_mode(lw->image);
        layout_util_sync_views(lw);
@@ -1003,7 +1003,7 @@ static void layout_menu_histogram_toggle_mode_cb(GtkAction *UNUSED(action), gpoi
 
 static void layout_menu_histogram_channel_cb(GtkRadioAction *action, GtkRadioAction *UNUSED(current), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint channel = gtk_radio_action_get_current_value(action);
        GtkToggleAction *histogram_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(lw->action_group, "ImageHistogram"));
 
@@ -1015,7 +1015,7 @@ static void layout_menu_histogram_channel_cb(GtkRadioAction *action, GtkRadioAct
 
 static void layout_menu_histogram_mode_cb(GtkRadioAction *action, GtkRadioAction *UNUSED(current), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mode = gtk_radio_action_get_current_value(action);
        GtkToggleAction *histogram_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(lw->action_group, "ImageHistogram"));
 
@@ -1027,14 +1027,14 @@ static void layout_menu_histogram_mode_cb(GtkRadioAction *action, GtkRadioAction
 
 static void layout_menu_refresh_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_refresh(lw);
 }
 
 static void layout_menu_bar_exif_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        layout_exif_window_new(lw);
@@ -1042,7 +1042,7 @@ static void layout_menu_bar_exif_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_search_and_run_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        layout_search_and_run_window_new(lw);
@@ -1051,7 +1051,7 @@ static void layout_menu_search_and_run_cb(GtkAction *UNUSED(action), gpointer da
 
 static void layout_menu_float_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (lw->options.tools_float == gtk_toggle_action_get_active(action)) return;
 
@@ -1061,7 +1061,7 @@ static void layout_menu_float_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_hide_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        layout_tools_hide_toggle(lw);
@@ -1069,7 +1069,7 @@ static void layout_menu_hide_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_toolbar_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (lw->options.toolbar_hidden == gtk_toggle_action_get_active(action)) return;
 
@@ -1079,7 +1079,7 @@ static void layout_menu_toolbar_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_info_pixel_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (lw->options.show_info_pixel == gtk_toggle_action_get_active(action)) return;
 
@@ -1090,7 +1090,7 @@ static void layout_menu_info_pixel_cb(GtkToggleAction *action, gpointer data)
 /* NOTE: these callbacks are called also from layout_util_sync_views */
 static void layout_menu_bar_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (layout_bar_enabled(lw) == gtk_toggle_action_get_active(action)) return;
 
@@ -1100,7 +1100,7 @@ static void layout_menu_bar_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_bar_sort_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (layout_bar_sort_enabled(lw) == gtk_toggle_action_get_active(action)) return;
 
@@ -1110,7 +1110,7 @@ static void layout_menu_bar_sort_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_hide_bars_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (lw->options.bars_state.hidden == gtk_toggle_action_get_active(action))
                {
@@ -1121,7 +1121,7 @@ static void layout_menu_hide_bars_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_slideshow_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (layout_image_slideshow_active(lw) == gtk_toggle_action_get_active(action)) return;
        layout_image_slideshow_toggle(lw);
@@ -1129,7 +1129,7 @@ static void layout_menu_slideshow_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_slideshow_pause_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_image_slideshow_pause_toggle(lw);
 }
@@ -1151,7 +1151,7 @@ static void layout_menu_slideshow_faster_cb(GtkAction *UNUSED(action), gpointer
 
 static void layout_menu_stereo_mode_next_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mode = layout_image_stereo_pixbuf_get(lw);
 
        /* 0->1, 1->2, 2->3, 3->1 - disable auto, then cycle */
@@ -1169,14 +1169,14 @@ static void layout_menu_stereo_mode_next_cb(GtkAction *UNUSED(action), gpointer
 
 static void layout_menu_stereo_mode_cb(GtkRadioAction *action, GtkRadioAction *UNUSED(current), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mode = gtk_radio_action_get_current_value(action);
        layout_image_stereo_pixbuf_set(lw, mode);
 }
 
 static void layout_menu_help_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        help_window_show("index.html");
@@ -1184,7 +1184,7 @@ static void layout_menu_help_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_help_search_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        help_search_window_show();
@@ -1192,7 +1192,7 @@ static void layout_menu_help_search_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_help_keys_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        help_window_show("GuideReferenceKeyboardShortcuts.html");
@@ -1200,7 +1200,7 @@ static void layout_menu_help_keys_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_notes_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        help_window_show("release_notes");
@@ -1208,7 +1208,7 @@ static void layout_menu_notes_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_changelog_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        help_window_show("changelog");
@@ -1255,7 +1255,7 @@ static void layout_menu_foreach_func(
        gchar *key_name, *menu_name;
        gchar **subset_lt_arr, **subset_gt_arr;
        gchar *subset_lt, *converted_name;
-       GPtrArray *array = static_cast<GPtrArray *>(data);
+       auto array = static_cast<GPtrArray *>(data);
 
        path = g_strescape(accel_path, NULL);
        name = gtk_accelerator_name(accel_key, accel_mods);
@@ -1379,7 +1379,7 @@ static void layout_menu_kbd_map_cb(GtkAction *UNUSED(action), gpointer UNUSED(da
 
 static void layout_menu_about_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        show_about_window(lw);
@@ -1387,7 +1387,7 @@ static void layout_menu_about_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_log_window_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_exit_fullscreen(lw);
        log_window_new(lw);
@@ -1402,35 +1402,35 @@ static void layout_menu_log_window_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_select_all_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_select_all(lw);
 }
 
 static void layout_menu_unselect_all_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_select_none(lw);
 }
 
 static void layout_menu_invert_selection_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_select_invert(lw);
 }
 
 static void layout_menu_file_filter_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_file_filter_set(lw, gtk_toggle_action_get_active(action));
 }
 
 static void layout_menu_marks_cb(GtkToggleAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_marks_set(lw, gtk_toggle_action_get_active(action));
 }
@@ -1438,7 +1438,7 @@ static void layout_menu_marks_cb(GtkToggleAction *action, gpointer data)
 
 static void layout_menu_set_mark_sel_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num"));
        g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);
 
@@ -1447,7 +1447,7 @@ static void layout_menu_set_mark_sel_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_res_mark_sel_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num"));
        g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);
 
@@ -1456,7 +1456,7 @@ static void layout_menu_res_mark_sel_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_toggle_mark_sel_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num"));
        g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);
 
@@ -1465,7 +1465,7 @@ static void layout_menu_toggle_mark_sel_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_sel_mark_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num"));
        g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);
 
@@ -1474,7 +1474,7 @@ static void layout_menu_sel_mark_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_sel_mark_or_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num"));
        g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);
 
@@ -1483,7 +1483,7 @@ static void layout_menu_sel_mark_or_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_sel_mark_and_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num"));
        g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);
 
@@ -1492,7 +1492,7 @@ static void layout_menu_sel_mark_and_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_sel_mark_minus_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num"));
        g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);
 
@@ -1501,7 +1501,7 @@ static void layout_menu_sel_mark_minus_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_mark_filter_toggle_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num"));
        g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);
 
@@ -1518,13 +1518,13 @@ static void layout_menu_mark_filter_toggle_cb(GtkAction *action, gpointer data)
 
 static void layout_menu_image_first_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        layout_image_first(lw);
 }
 
 static void layout_menu_image_prev_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint i;
 
        if (lw->options.split_pane_sync)
@@ -1550,7 +1550,7 @@ static void layout_menu_image_prev_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_image_next_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint i;
 
        if (lw->options.split_pane_sync)
@@ -1576,7 +1576,7 @@ static void layout_menu_image_next_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_page_first_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        FileData *fd = layout_image_get_fd(lw);
 
        if (fd->page_total > 0)
@@ -1587,7 +1587,7 @@ static void layout_menu_page_first_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_page_last_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        FileData *fd = layout_image_get_fd(lw);
 
        if (fd->page_total > 0)
@@ -1598,7 +1598,7 @@ static void layout_menu_page_last_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_page_next_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        FileData *fd = layout_image_get_fd(lw);
 
        if (fd->page_total > 0)
@@ -1609,7 +1609,7 @@ static void layout_menu_page_next_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_page_previous_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        FileData *fd = layout_image_get_fd(lw);
 
        if (fd->page_total > 0)
@@ -1620,7 +1620,7 @@ static void layout_menu_page_previous_cb(GtkAction *UNUSED(action), gpointer dat
 
 static void layout_menu_image_forward_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        /* Obtain next image */
        layout_set_path(lw, image_chain_forward());
@@ -1628,7 +1628,7 @@ static void layout_menu_image_forward_cb(GtkAction *UNUSED(action), gpointer dat
 
 static void layout_menu_image_back_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        /* Obtain previous image */
        layout_set_path(lw, image_chain_back());
@@ -1636,7 +1636,7 @@ static void layout_menu_image_back_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_split_pane_next_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint active_frame;
 
        active_frame = lw->active_split_image;
@@ -1654,7 +1654,7 @@ static void layout_menu_split_pane_next_cb(GtkAction *UNUSED(action), gpointer d
 
 static void layout_menu_split_pane_prev_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint active_frame;
 
        active_frame = lw->active_split_image;
@@ -1676,7 +1676,7 @@ static void layout_menu_split_pane_prev_cb(GtkAction *UNUSED(action), gpointer d
 
 static void layout_menu_split_pane_updown_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint active_frame;
 
        active_frame = lw->active_split_image;
@@ -1694,13 +1694,13 @@ static void layout_menu_split_pane_updown_cb(GtkAction *UNUSED(action), gpointer
 
 static void layout_menu_image_last_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        layout_image_last(lw);
 }
 
 static void layout_menu_back_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        FileData *dir_fd;
 
        /* Obtain previous path */
@@ -1711,7 +1711,7 @@ static void layout_menu_back_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_forward_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        FileData *dir_fd;
 
        /* Obtain next path */
@@ -1722,7 +1722,7 @@ static void layout_menu_forward_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_home_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        const gchar *path;
 
        if (lw->options.home_path && *lw->options.home_path)
@@ -1740,7 +1740,7 @@ static void layout_menu_home_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_up_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        ViewDir *vd = lw->vd;
        gchar *path;
 
@@ -1766,7 +1766,7 @@ static void layout_menu_up_cb(GtkAction *UNUSED(action), gpointer data)
 
 static void layout_menu_edit_cb(GtkAction *action, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        const gchar *key = gtk_action_get_name(action);
 
        if (!editor_window_flag_set(key))
@@ -1784,7 +1784,7 @@ static void layout_menu_metadata_write_cb(GtkAction *UNUSED(action), gpointer UN
 static GtkWidget *last_focussed = NULL;
 static void layout_menu_keyword_autocomplete_cb(GtkAction *UNUSED(action), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkWidget *tmp;
        gboolean auto_has_focus;
 
@@ -1944,7 +1944,7 @@ void layout_recent_update_all(void)
        work = layout_window_list;
        while (work)
                {
-               LayoutWindow *lw = static_cast<LayoutWindow *>(work->data);
+               auto lw = static_cast<LayoutWindow *>(work->data);
                work = work->next;
 
                layout_menu_recent_update(lw);
@@ -1995,8 +1995,8 @@ struct _DeleteWindow
 
 static gint layout_window_menu_list_sort_cb(gconstpointer a, gconstpointer b)
 {
-       const WindowNames *wna = static_cast<const WindowNames *>(a);
-       const WindowNames *wnb = static_cast<const WindowNames *>(b);
+       auto wna = static_cast<const WindowNames *>(a);
+       auto wnb = static_cast<const WindowNames *>(b);
 
        return g_strcmp0((gchar *)wna->name, (gchar *)wnb->name);
 }
@@ -2066,7 +2066,7 @@ static void layout_menu_new_window_cb(GtkWidget *UNUSED(widget), gpointer data)
        GList *menulist = NULL;
 
        menulist = layout_window_menu_list(menulist);
-       WindowNames *wn = static_cast<WindowNames *>(g_list_nth(menulist, n )->data);
+       auto wn = static_cast<WindowNames *>(g_list_nth(menulist, n )->data);
 
        if (wn->path)
                {
@@ -2124,7 +2124,7 @@ static void layout_menu_new_window_update(LayoutWindow *lw)
 
 static void window_rename_cancel_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       RenameWindow *rw = static_cast<RenameWindow *>(data);
+       auto rw = static_cast<RenameWindow *>(data);
 
        generic_dialog_close(rw->gd);
        g_free(rw);
@@ -2132,7 +2132,7 @@ static void window_rename_cancel_cb(GenericDialog *UNUSED(gd), gpointer data)
 
 static void window_rename_ok(GenericDialog *UNUSED(gd), gpointer data)
 {
-       RenameWindow *rw = static_cast<RenameWindow *>(data);
+       auto rw = static_cast<RenameWindow *>(data);
        gchar *path;
        gboolean window_layout_name_exists = FALSE;
        GList *list = NULL;
@@ -2144,7 +2144,7 @@ static void window_rename_ok(GenericDialog *UNUSED(gd), gpointer data)
        list = layout_window_menu_list(list);
        while (list)
                {
-               WindowNames *ln = static_cast<WindowNames *>(list->data);
+               auto ln = static_cast<WindowNames *>(list->data);
                if (g_strcmp0(ln->name, new_id) == 0)
                        {
                        gchar *buf;
@@ -2185,28 +2185,28 @@ static void window_rename_ok(GenericDialog *UNUSED(gd), gpointer data)
 
 static void window_rename_ok_cb(GenericDialog *gd, gpointer data)
 {
-       RenameWindow *rw = static_cast<RenameWindow *>(data);
+       auto rw = static_cast<RenameWindow *>(data);
 
        window_rename_ok(gd, rw);
 }
 
 static void window_rename_entry_activate_cb(GenericDialog *gd, gpointer data)
 {
-       RenameWindow *rw = static_cast<RenameWindow *>(data);
+       auto rw = static_cast<RenameWindow *>(data);
 
        window_rename_ok(gd, rw);
 }
 
 static void window_delete_cancel_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       DeleteWindow *dw = static_cast<DeleteWindow *>(data);
+       auto dw = static_cast<DeleteWindow *>(data);
 
        g_free(dw);
 }
 
 static void window_delete_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       DeleteWindow *dw = static_cast<DeleteWindow *>(data);
+       auto dw = static_cast<DeleteWindow *>(data);
        gchar *path;
        gchar *xml_name;
 
@@ -2231,7 +2231,7 @@ static void layout_menu_window_default_cb(GtkWidget *UNUSED(widget), gpointer UN
 
 static void layout_menu_windows_menu_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkWidget *menu;
        GtkWidget *sub_menu;
        gchar *menu_label;
@@ -2261,7 +2261,7 @@ static void layout_menu_windows_menu_cb(GtkWidget *UNUSED(widget), gpointer data
 
 static void layout_menu_view_menu_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkWidget *menu;
        GtkWidget *sub_menu;
        gchar *menu_label;
@@ -2348,7 +2348,7 @@ static void change_window_id(const gchar *infile, const gchar *outfile)
 
 static void layout_menu_window_from_current_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gint fd_in = -1;
        gint fd_out = -1;
        char * tmp_file_in;
@@ -2384,14 +2384,14 @@ static void layout_menu_window_from_current_cb(GtkWidget *UNUSED(widget), gpoint
 
 static void layout_menu_window_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_menu_new_window_update(lw);
 }
 
 static void layout_menu_window_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        RenameWindow *rw;
        GtkWidget *hbox;
 
@@ -2422,7 +2422,7 @@ static void layout_menu_window_rename_cb(GtkWidget *UNUSED(widget), gpointer dat
 
 static void layout_menu_window_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        DeleteWindow *dw;
        GtkWidget *hbox;
 
@@ -2483,7 +2483,7 @@ static GtkActionEntry menu_entries[] = {
   { "Delete",  PIXBUF_INLINE_ICON_TRASH,       N_("Move to Trash..."),         "<control>D",   N_("Move to Trash..."),         CB(layout_menu_move_to_trash_cb) },
   { "DeleteAlt1",      PIXBUF_INLINE_ICON_TRASH,N_("Move to Trash..."),        "Delete",               N_("Move to Trash..."),         CB(layout_menu_move_to_trash_key_cb) },
   { "DeleteAlt2",      PIXBUF_INLINE_ICON_TRASH,N_("Move to Trash..."),        "KP_Delete",    N_("Move to Trash..."),         CB(layout_menu_move_to_trash_key_cb) },
-  { "PermanentDelete", GTK_STOCK_DELETE,       N_("Delete..."),                        "<shift>Delete",N_("Delete..."),                        CB(layout_menu_delete_cb) }, 
+  { "PermanentDelete", GTK_STOCK_DELETE,       N_("Delete..."),                        "<shift>Delete",N_("Delete..."),                        CB(layout_menu_delete_cb) },
   { "SelectAll",       PIXBUF_INLINE_ICON_SELECT_ALL,                  N_("Select _all"),                      "<control>A",           N_("Select all"),                       CB(layout_menu_select_all_cb) },
   { "SelectNone",      PIXBUF_INLINE_ICON_SELECT_NONE,                 N_("Select _none"),                     "<control><shift>A",    N_("Select none"),                      CB(layout_menu_unselect_all_cb) },
   { "SelectInvert",    PIXBUF_INLINE_ICON_SELECT_INVERT,                       N_("_Invert Selection"),                "<control><shift>I",    N_("Invert Selection"),                 CB(layout_menu_invert_selection_cb) },
@@ -3113,7 +3113,7 @@ static void layout_actions_editor_add(GString *desc, GList *path, GList *old_pat
 
        for (i =  0; i < to_close; i++)
                {
-               gchar *name = static_cast<gchar *>(old_path->data);
+               auto name = static_cast<gchar *>(old_path->data);
                if (g_str_has_suffix(name, "Section"))
                        {
                        g_string_append(desc,   "      </placeholder>");
@@ -3131,7 +3131,7 @@ static void layout_actions_editor_add(GString *desc, GList *path, GList *old_pat
 
        for (i =  0; i < to_open; i++)
                {
-               gchar *name = static_cast<gchar *>(path->data);
+               auto name = static_cast<gchar *>(path->data);
                if (g_str_has_suffix(name, "Section"))
                        {
                        g_string_append_printf(desc,    "      <placeholder name='%s'>", name);
@@ -3184,7 +3184,7 @@ static void layout_actions_setup_editors(LayoutWindow *lw)
        while (work)
                {
                GList *path;
-               EditorDescription *editor = static_cast<EditorDescription *>(work->data);
+               auto editor = static_cast<EditorDescription *>(work->data);
                GtkActionEntry entry = { editor->key,
                                         NULL,
                                         editor->name,
@@ -3323,7 +3323,7 @@ static gboolean layout_editors_reload_idle_cb(gpointer UNUSED(data))
                work = layout_window_list;
                while (work)
                        {
-                       LayoutWindow *lw = static_cast<LayoutWindow *>(work->data);
+                       auto lw = static_cast<LayoutWindow *>(work->data);
                        work = work->next;
                        layout_actions_setup_editors(lw);
                        if (lw->bar_sort_enabled)
@@ -3504,7 +3504,7 @@ void layout_toolbar_add_default(LayoutWindow *lw, ToolbarType type)
                                        work_action = lw_first->toolbar_actions[type];
                                        while (work_action)
                                                {
-                                               gchar *action = static_cast<gchar *>(work_action->data);
+                                               auto action = static_cast<gchar *>(work_action->data);
                                                work_action = work_action->next;
                                                layout_toolbar_add(lw, type, action);
                                                }
@@ -3550,7 +3550,7 @@ void layout_toolbar_add_default(LayoutWindow *lw, ToolbarType type)
                                        work_action = lw_first->toolbar_actions[type];
                                        while (work_action)
                                                {
-                                               gchar *action = static_cast<gchar *>(work_action->data);
+                                               auto action = static_cast<gchar *>(work_action->data);
                                                work_action = work_action->next;
                                                layout_toolbar_add(lw, type, action);
                                                }
@@ -3600,7 +3600,7 @@ void layout_toolbar_write_config(LayoutWindow *lw, ToolbarType type, GString *ou
        WRITE_NL(); WRITE_STRING("<clear/>");
        while (work)
                {
-               gchar *action = static_cast<gchar *>(work->data);
+               auto action = static_cast<gchar *>(work->data);
                work = work->next;
                WRITE_NL(); WRITE_STRING("<toolitem ");
                write_char_option(outstr, indent + 1, "action", action);
@@ -3659,7 +3659,7 @@ void layout_util_status_update_write_all(void)
        work = layout_window_list;
        while (work)
                {
-               LayoutWindow *lw = static_cast<LayoutWindow *>(work->data);
+               auto lw = static_cast<LayoutWindow *>(work->data);
                work = work->next;
 
                layout_util_status_update_write(lw);
@@ -3892,12 +3892,12 @@ void layout_util_sync(LayoutWindow *lw)
 
 /**
  * @brief Checks if event key is mapped to Help
- * @param event 
- * @returns 
- * 
+ * @param event
+ * @returns
+ *
  * Used to check if the user has re-mapped the Help key
  * in Preferences/Keyboard
- * 
+ *
  * Note: help_key.accel_mods and event->state
  * differ in the higher bits
  */
@@ -3932,7 +3932,7 @@ static gboolean layout_bar_enabled(LayoutWindow *lw)
 
 static void layout_bar_destroyed(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        lw->bar = NULL;
 /*
@@ -4027,7 +4027,7 @@ static gboolean layout_bar_sort_enabled(LayoutWindow *lw)
 
 static void layout_bar_sort_destroyed(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        lw->bar_sort = NULL;
 
@@ -4176,7 +4176,7 @@ void layout_bars_close(LayoutWindow *lw)
 
 static gboolean layout_exif_window_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        lw->exif_window = NULL;
 
        return TRUE;
index 034dcdf..74e707f 100644 (file)
@@ -95,7 +95,7 @@ LayoutWindow *layout_find_by_image(ImageWindow *imd)
        work = layout_window_list;
        while (work)
                {
-               LayoutWindow *lw = static_cast<LayoutWindow *>(work->data);
+               auto lw = static_cast<LayoutWindow *>(work->data);
                work = work->next;
 
                if (lw->image == imd) return lw;
@@ -111,7 +111,7 @@ LayoutWindow *layout_find_by_image_fd(ImageWindow *imd)
        work = layout_window_list;
        while (work)
                {
-               LayoutWindow *lw = static_cast<LayoutWindow *>(work->data);
+               auto lw = static_cast<LayoutWindow *>(work->data);
                work = work->next;
 
                if (lw->image->image_fd == imd->image_fd)
@@ -137,7 +137,7 @@ LayoutWindow *layout_find_by_layout_id(const gchar *id)
        work = layout_window_list;
        while (work)
                {
-               LayoutWindow *lw = static_cast<LayoutWindow *>(work->data);
+               auto lw = static_cast<LayoutWindow *>(work->data);
                work = work->next;
 
                if (lw->options.id && strcmp(id, lw->options.id) == 0)
@@ -188,7 +188,7 @@ static void layout_set_unique_id(LayoutWindow *lw)
 
 static gboolean layout_set_current_cb(GtkWidget *UNUSED(widget), GdkEventFocus *UNUSED(event), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        current_lw = lw;
        return FALSE;
 }
@@ -216,7 +216,7 @@ static void layout_box_folders_changed_cb(GtkWidget *widget, gpointer UNUSED(dat
 
 static void layout_path_entry_changed_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gchar *buf;
 
        if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) < 0) return;
@@ -232,7 +232,7 @@ static void layout_path_entry_changed_cb(GtkWidget *widget, gpointer data)
 
 static void layout_path_entry_tab_cb(const gchar *path, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gchar *buf;
 
        buf = g_strdup(path);
@@ -266,7 +266,7 @@ static void layout_path_entry_tab_cb(const gchar *path, gpointer data)
 
 static void layout_path_entry_cb(const gchar *path, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gchar *buf;
 
        buf = g_strdup(path);
@@ -283,14 +283,14 @@ static void layout_path_entry_cb(const gchar *path, gpointer data)
 
 static void layout_vd_select_cb(ViewDir *UNUSED(vd), FileData *fd, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_set_fd(lw, fd);
 }
 
 static void layout_path_entry_tab_append_cb(const gchar *UNUSED(path), gpointer data, gint n)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        if (!lw || !lw->back_button) return;
        if (!layout_valid(&lw)) return;
@@ -422,7 +422,7 @@ static void layout_sort_menu_cb(GtkWidget *widget, gpointer data)
 
 static void layout_sort_menu_ascend_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_sort_set(lw, lw->sort_method, !lw->sort_ascend);
 }
@@ -435,7 +435,7 @@ static void layout_sort_menu_hide_cb(GtkWidget *widget, gpointer UNUSED(data))
 
 static void layout_sort_button_press_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkWidget *menu;
 
        menu = submenu_add_sort(NULL, G_CALLBACK(layout_sort_menu_cb), lw, FALSE, FALSE, TRUE, lw->sort_method);
@@ -515,7 +515,7 @@ static void layout_zoom_menu_hide_cb(GtkWidget *widget, gpointer UNUSED(data))
 
 static void layout_zoom_button_press_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkWidget *menu;
 
        menu = submenu_add_zoom(NULL, G_CALLBACK(layout_zoom_menu_cb),
@@ -916,14 +916,14 @@ static GtkWidget *layout_tools_new(LayoutWindow *lw)
 
 static void layout_list_status_cb(ViewFile *UNUSED(vf), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_status_update_info(lw, NULL);
 }
 
 static void layout_list_thumb_cb(ViewFile *UNUSED(vf), gdouble val, const gchar *text, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_status_update_progress(lw, val, text);
 }
@@ -1568,7 +1568,7 @@ static void layout_tools_hide(LayoutWindow *lw, gboolean hide)
 
 static gboolean layout_tools_delete_cb(GtkWidget *UNUSED(widget), GdkEventAny *UNUSED(event), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_tools_float_toggle(lw);
 
@@ -2014,7 +2014,7 @@ void layout_colors_update(void)
        while (work)
                {
                gint i;
-               LayoutWindow *lw = static_cast<LayoutWindow *>(work->data);
+               auto lw = static_cast<LayoutWindow *>(work->data);
                work = work->next;
 
                if (!lw->image) continue;
@@ -2163,7 +2163,7 @@ static gint layout_config_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer d
 
 static void layout_config_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutConfig *lc = static_cast<LayoutConfig *>(data);
+       auto lc = static_cast<LayoutConfig *>(data);
 
        gtk_widget_destroy(lc->configwindow);
        free_layout_options_content(&lc->options);
@@ -2178,7 +2178,7 @@ static gint layout_config_delete_cb(GtkWidget *w, GdkEventAny *UNUSED(event), gp
 
 static void layout_config_apply_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutConfig *lc = static_cast<LayoutConfig *>(data);
+       auto lc = static_cast<LayoutConfig *>(data);
 
        g_free(lc->options.order);
        lc->options.order = layout_config_get(lc->layout_widget, &lc->options.style);
@@ -2195,20 +2195,20 @@ static void layout_config_help_cb(GtkWidget *UNUSED(widget), gpointer UNUSED(dat
 
 static void layout_config_ok_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutConfig *lc = static_cast<LayoutConfig *>(data);
+       auto lc = static_cast<LayoutConfig *>(data);
        layout_config_apply_cb(widget, lc);
        layout_config_close_cb(widget, lc);
 }
 
 static void home_path_set_current_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LayoutConfig *lc = static_cast<LayoutConfig *>(data);
+       auto lc = static_cast<LayoutConfig *>(data);
        gtk_entry_set_text(GTK_ENTRY(lc->home_path_entry), layout_get_path(lc->lw));
 }
 
 static void startup_path_set_current_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutConfig *lc = static_cast<LayoutConfig *>(data);
+       auto lc = static_cast<LayoutConfig *>(data);
        if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
                {
                return;
@@ -2218,7 +2218,7 @@ static void startup_path_set_current_cb(GtkWidget *widget, gpointer data)
 
 static void startup_path_set_last_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutConfig *lc = static_cast<LayoutConfig *>(data);
+       auto lc = static_cast<LayoutConfig *>(data);
        if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
                {
                return;
@@ -2228,7 +2228,7 @@ static void startup_path_set_last_cb(GtkWidget *widget, gpointer data)
 
 static void startup_path_set_home_cb(GtkWidget *widget, gpointer data)
 {
-       LayoutConfig *lc = static_cast<LayoutConfig *>(data);
+       auto lc = static_cast<LayoutConfig *>(data);
        if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
                {
                return;
@@ -2512,7 +2512,7 @@ void layout_free(LayoutWindow *lw)
 
 static gboolean layout_delete_cb(GtkWidget *UNUSED(widget), GdkEventAny *UNUSED(event), gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
 
        layout_close(lw);
        return TRUE;
@@ -2531,7 +2531,7 @@ gboolean release_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
 static gboolean move_window_to_workspace_cb(gpointer data)
 {
 #ifdef GDK_WINDOWING_X11
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GdkWindow *window;
        GdkDisplay *display;
 
index 0d8e0f1..529dd97 100644 (file)
@@ -151,7 +151,7 @@ static void log_window_pause_cb(GtkWidget *UNUSED(widget), gpointer UNUSED(data)
 
 static void log_window_line_wrap_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       LogWindow *logwin = static_cast<LogWindow *>(data);
+       auto logwin = static_cast<LogWindow *>(data);
 
        options->log_window.line_wrap = !options->log_window.line_wrap;
 
@@ -353,7 +353,7 @@ static gboolean debug_changed_cb(GtkSpinButton *widget, LogWindow *UNUSED(logwin
 
 static void search_entry_icon_cb(GtkEntry *UNUSED(entry), GtkEntryIconPosition pos, GdkEvent *UNUSED(event), gpointer userdata)
 {
-       LogWindow *logwin = static_cast<LogWindow *>(userdata);
+       auto logwin = static_cast<LogWindow *>(userdata);
        GtkTextIter start_find;
        GtkTextIter end_find;
        GtkTextBuffer *buffer;
@@ -633,7 +633,7 @@ void log_window_append(const gchar *str, LogType type)
        if (logwindow == NULL)
                {
                if (*str) {
-                       LogMsg *msg = g_new(LogMsg, 1);
+                       auto msg = g_new(LogMsg, 1);
 
                        msg->text = g_strdup(str);
                        msg->type = type;
@@ -643,7 +643,7 @@ void log_window_append(const gchar *str, LogType type)
                        while (g_list_length(memory) >= (guint)options->log_window_lines)
                                {
                                GList *work = g_list_last(memory);
-                               LogMsg *oldest_msg = static_cast<LogMsg *>(work->data);
+                               auto oldest_msg = static_cast<LogMsg *>(work->data);
 
                                g_free(oldest_msg->text);
                                memory = g_list_delete_link(memory, work);
@@ -673,7 +673,7 @@ void log_window_append(const gchar *str, LogType type)
        while (work)
                {
                GList *prev;
-               LogMsg *oldest_msg = static_cast<LogMsg *>(work->data);
+               auto oldest_msg = static_cast<LogMsg *>(work->data);
 
                log_window_insert_text(buffer, &iter, oldest_msg->text,
                                                                        logwindow->color_tags[oldest_msg->type]);
index 7f41329..910d6c7 100644 (file)
@@ -613,7 +613,7 @@ static void parse_command_line(gint argc, gchar *argv[])
 
                        while (work)
                                {
-                               gchar *opt = static_cast<gchar *>(work->data);
+                               auto opt = static_cast<gchar *>(work->data);
 
                                command_line_errors = g_string_append(command_line_errors, opt);
                                command_line_errors = g_string_append(command_line_errors, "\n");
@@ -896,7 +896,7 @@ static void gq_accel_map_print(
                    gboolean    changed)
 {
        GString *gstring = g_string_new(changed ? NULL : "; ");
-       SecureSaveInfo *ssi = static_cast<SecureSaveInfo *>(data);
+       auto ssi = static_cast<SecureSaveInfo *>(data);
        gchar *tmp, *name;
 
        g_string_append(gstring, "(gtk_accel_path \"");
index 3487195..ddc9b76 100644 (file)
@@ -76,7 +76,7 @@ static void add_edit_items(GtkWidget *menu, GCallback func, GList *fd_list)
 
        while (work)
                {
-               const EditorDescription *editor = static_cast<const EditorDescription *>(work->data);
+               auto editor = static_cast<const EditorDescription *>(work->data);
                work = work->next;
                gboolean active = TRUE;
 
@@ -416,11 +416,11 @@ GtkWidget *submenu_add_alter(GtkWidget *menu, GCallback func, gpointer data)
 
 /**
  * @brief Add submenu consisting of "New collection", and list of existing collections to a right-click menu.
- * @param[in] menu 
- * @param[in] func 
+ * @param[in] menu
+ * @param[in] func
  * @param[in] collection_list Type gchar
- * @param[in] data 
- * 
+ * @param[in] data
+ *
  *  Used by all image windows
  */
 static void add_collection_list(GtkWidget *menu, GCallback func,
@@ -432,7 +432,7 @@ static void add_collection_list(GtkWidget *menu, GCallback func,
        work = collection_list;
        while (work)
                {
-               const gchar *collection_name = static_cast<const gchar *>(work->data);
+               auto collection_name = static_cast<const gchar *>(work->data);
 
                menu_item_add(menu, collection_name, func,
                                                                                                        GINT_TO_POINTER(index));
@@ -472,8 +472,8 @@ GtkWidget *submenu_add_collections(GtkWidget *menu, GtkWidget **menu_item,
  * @brief Add file selection list to a collection
  * @param[in] selection_list Selection list of ::_FileData
  * @param[in] data Index to the collection list menu item selected, or -1 for new collection
- * 
- * 
+ *
+ *
  */
 void pop_menu_collections(GList *selection_list, gpointer data)
 {
index b142de2..851bd57 100644 (file)
@@ -91,8 +91,8 @@ static void metadata_cache_update(FileData *fd, const gchar *key, const GList *v
        work = fd->cached_metadata;
        while (work)
                {
-               GList *entry = static_cast<GList *>(work->data);
-               gchar *entry_key = static_cast<gchar *>(entry->data);
+               auto entry = static_cast<GList *>(work->data);
+               auto entry_key = static_cast<gchar *>(entry->data);
 
                if (strcmp(entry_key, key) == 0)
                        {
@@ -122,8 +122,8 @@ static const GList *metadata_cache_get(FileData *fd, const gchar *key)
        work = fd->cached_metadata;
        while (work)
                {
-               GList *entry = static_cast<GList *>(work->data);
-               gchar *entry_key = static_cast<gchar *>(entry->data);
+               auto entry = static_cast<GList *>(work->data);
+               auto entry_key = static_cast<gchar *>(entry->data);
 
                if (strcmp(entry_key, key) == 0)
                        {
@@ -144,8 +144,8 @@ static void metadata_cache_remove(FileData *fd, const gchar *key)
        work = fd->cached_metadata;
        while (work)
                {
-               GList *entry = static_cast<GList *>(work->data);
-               gchar *entry_key = static_cast<gchar *>(entry->data);
+               auto entry = static_cast<GList *>(work->data);
+               auto entry_key = static_cast<gchar *>(entry->data);
 
                if (strcmp(entry_key, key) == 0)
                        {
@@ -168,7 +168,7 @@ void metadata_cache_free(FileData *fd)
        work = fd->cached_metadata;
        while (work)
                {
-               GList *entry = static_cast<GList *>(work->data);
+               auto entry = static_cast<GList *>(work->data);
                string_list_free(entry);
 
                work = work->next;
@@ -271,7 +271,7 @@ gboolean metadata_write_queue_confirm(gboolean force_dialog, FileUtilDoneFunc do
        work = metadata_write_queue;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
 
                if (!isname(fd->path))
@@ -400,7 +400,7 @@ gboolean metadata_write_list(FileData *fd, const gchar *key, const GList *values
 
                while (work)
                        {
-                       FileData *sfd = static_cast<FileData *>(work->data);
+                       auto sfd = static_cast<FileData *>(work->data);
                        work = work->next;
 
                        if (sfd->format_class == FORMAT_CLASS_META) continue;
@@ -447,7 +447,7 @@ static gboolean metadata_file_write(gchar *path, const GList *keywords, const gc
        secure_fprintf(ssi, "[keywords]\n");
        while (keywords && secsave_errno == SS_ERR_NONE)
                {
-               const gchar *word = static_cast<const gchar *>(keywords->data);
+               auto word = static_cast<const gchar *>(keywords->data);
                keywords = keywords->next;
 
                secure_fprintf(ssi, "%s\n", word);
@@ -651,7 +651,7 @@ static GList *remove_duplicate_strings_from_list(GList *list)
 
        while (work)
                {
-               gchar *key = static_cast<gchar *>(work->data);
+               auto key = static_cast<gchar *>(work->data);
 
                if (g_hash_table_lookup(hashtable, key) == NULL)
                        {
@@ -740,7 +740,7 @@ gchar *metadata_read_string(FileData *fd, const gchar *key, MetadataFormat forma
        GList *string_list = metadata_read_list(fd, key, format);
        if (string_list)
                {
-               gchar *str = static_cast<gchar *>(string_list->data);
+               auto str = static_cast<gchar *>(string_list->data);
                string_list->data = NULL;
                string_list_free(string_list);
                return str;
@@ -939,7 +939,7 @@ gchar *find_string_in_list_utf8nocase(GList *list, const gchar *string)
 
        while (list)
                {
-               gchar *haystack = static_cast<gchar *>(list->data);
+               auto haystack = static_cast<gchar *>(list->data);
 
                if (haystack)
                        {
@@ -970,7 +970,7 @@ gchar *find_string_in_list_utf8case(GList *list, const gchar *string)
 {
        while (list)
                {
-               gchar *haystack = static_cast<gchar *>(list->data);
+               auto haystack = static_cast<gchar *>(list->data);
 
                if (haystack && strcmp(haystack, string) == 0)
                        return haystack;
@@ -1050,7 +1050,7 @@ GList *string_to_keywords_list(const gchar *text)
 gboolean meta_data_get_keyword_mark(FileData *fd, gint UNUSED(n), gpointer data)
 {
        /** @FIXME do not use global keyword_tree */
-       GList *path = static_cast<GList *>(data);
+       auto path = static_cast<GList *>(data);
        GList *keywords;
        gboolean found = FALSE;
        keywords = metadata_read_list(fd, KEYWORD_KEY, METADATA_PLAIN);
@@ -1067,7 +1067,7 @@ gboolean meta_data_get_keyword_mark(FileData *fd, gint UNUSED(n), gpointer data)
 
 gboolean meta_data_set_keyword_mark(FileData *fd, gint UNUSED(n), gboolean value, gpointer data)
 {
-       GList *path = static_cast<GList *>(data);
+       auto path = static_cast<GList *>(data);
        GList *keywords = NULL;
        GtkTreeIter iter;
 
@@ -1109,7 +1109,7 @@ void meta_data_connect_mark_with_keyword(GtkTreeModel *keyword_tree, GtkTreeIter
                if (get_mark_func == meta_data_get_keyword_mark)
                        {
                        GtkTreeIter old_kw_iter;
-                       GList *old_path = static_cast<GList *>(mark_func_data);
+                       auto old_path = static_cast<GList *>(mark_func_data);
 
                        if (keyword_tree_get_iter(keyword_tree, &old_kw_iter, old_path) &&
                            (i == mark || /* release any previous connection of given mark */
@@ -1385,7 +1385,7 @@ static gboolean keyword_tree_is_set_casefold(GtkTreeModel *keyword_tree, GtkTree
                        gchar *iter_casefold = keyword_get_casefold(keyword_tree, &iter);
                        while (work)
                                {
-                               const gchar *casefold = static_cast<const gchar *>(work->data);
+                               auto casefold = static_cast<const gchar *>(work->data);
                                work = work->next;
 
                                if (strcmp(iter_casefold, casefold) == 0)
@@ -1432,7 +1432,7 @@ static gboolean keyword_tree_is_set_casefull(GtkTreeModel *keyword_tree, GtkTree
                        gchar *iter_name = keyword_get_name(keyword_tree, &iter);
                        while (work)
                                {
-                               const gchar *name = static_cast<const gchar *>(work->data);
+                               auto name = static_cast<const gchar *>(work->data);
                                work = work->next;
 
                                if (strcmp(iter_name, name) == 0)
@@ -1465,7 +1465,7 @@ gboolean keyword_tree_is_set(GtkTreeModel *keyword_tree, GtkTreeIter *iter, GLis
                work = kw_list;
                while (work)
                        {
-                       const gchar *kw = static_cast<const gchar *>(work->data);
+                       auto kw = static_cast<const gchar *>(work->data);
                        work = work->next;
 
                        casefold_list = g_list_prepend(casefold_list, g_utf8_casefold(kw, -1));
@@ -1688,7 +1688,7 @@ void keyword_hide_unset_in(GtkTreeStore *keyword_tree, gpointer id, GList *keywo
 static gboolean keyword_show_set_in_cb(GtkTreeModel *model, GtkTreePath *UNUSED(path), GtkTreeIter *iter_ptr, gpointer data)
 {
        GtkTreeIter iter = *iter_ptr;
-       GList *keywords = static_cast<GList *>(data);
+       auto keywords = static_cast<GList *>(data);
        gpointer id = keywords->data;
        keywords = keywords->next; /* hack */
        if (keyword_tree_is_set(model, &iter, keywords))
index ab1fd4b..80d5def 100644 (file)
@@ -93,7 +93,7 @@ struct _TagData
 
 static void tag_button_cb(GtkWidget *widget, gpointer data)
 {
-       GtkTextView *image_overlay_template_view = static_cast<GtkTextView *>(data);
+       auto image_overlay_template_view = static_cast<GtkTextView *>(data);
        GtkTextBuffer *buffer;
        TagData *td;
 
@@ -109,7 +109,7 @@ static void osd_dnd_get_cb(GtkWidget *btn, GdkDragContext *UNUSED(context),
                                                                guint UNUSED(time), gpointer data)
 {
        TagData *td;
-       GtkTextView *image_overlay_template_view = static_cast<GtkTextView *>(data);
+       auto image_overlay_template_view = static_cast<GtkTextView *>(data);
 
        td = static_cast<TagData *>(g_object_get_data(G_OBJECT(btn), "tag_data"));
        gtk_selection_data_set_text(selection_data, td->key, -1);
@@ -218,7 +218,7 @@ static gchar *keywords_to_string(FileData *fd)
 
                while (work)
                        {
-                       gchar *kw = static_cast<gchar *>(work->data);
+                       auto kw = static_cast<gchar *>(work->data);
                        work = work->next;
 
                        if (!kw) continue;
index ce07c5b..14e3ed0 100644 (file)
@@ -244,7 +244,7 @@ void pan_calendar_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *he
 
        if (list)
                {
-               FileData *fd = static_cast<FileData *>(list->data);
+               auto fd = static_cast<FileData *>(list->data);
 
                year = pan_date_value(fd->date, PAN_DATE_LENGTH_YEAR);
                month = pan_date_value(fd->date, PAN_DATE_LENGTH_MONTH);
@@ -253,7 +253,7 @@ void pan_calendar_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *he
        work = g_list_last(list);
        if (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                end_year = pan_date_value(fd->date, PAN_DATE_LENGTH_YEAR);
                end_month = pan_date_value(fd->date, PAN_DATE_LENGTH_MONTH);
                }
index 2829433..ded9f9c 100644 (file)
@@ -365,7 +365,7 @@ void pan_flower_compute(PanWindow *pw, FileData *dir_fd,
        list = pan_item_find_by_fd(pw, PAN_ITEM_BOX, dir_fd, FALSE, FALSE);
        if (list)
                {
-               PanItem *pi = static_cast<PanItem *>(list->data);
+               auto pi = static_cast<PanItem *>(list->data);
                *scroll_x = pi->x + pi->width / 2;
                *scroll_y = pi->y + pi->height / 2;
                }
index 4cc17dc..1d59d9c 100644 (file)
@@ -308,7 +308,7 @@ gint pan_item_tri_draw(PanWindow *UNUSED(pw), PanItem *pi, GdkPixbuf *pixbuf, Pi
                             pi->x, pi->y, pi->width, pi->height,
                             &rx, &ry, &rw, &rh) && pi->data)
                {
-               gint *coord = static_cast<gint *>(pi->data);
+               auto coord = static_cast<gint *>(pi->data);
                pixbuf_draw_triangle(pixbuf,
                                     rx - x, ry - y, rw, rh,
                                     coord[0] - x, coord[1] - y,
index 642c492..8f385ac 100644 (file)
@@ -29,7 +29,7 @@
 
 PanViewFilterUi *pan_filter_ui_new(PanWindow *pw)
 {
-       PanViewFilterUi *ui = g_new0(PanViewFilterUi, 1);
+       auto ui = g_new0(PanViewFilterUi, 1);
        GtkWidget *combo;
        GtkWidget *hbox;
        gint i;
@@ -141,7 +141,7 @@ static void pan_filter_status(PanWindow *pw, const gchar *text)
 
 static void pan_filter_kw_button_cb(GtkButton *widget, gpointer data)
 {
-       PanFilterCallbackState *cb_state = (PanFilterCallbackState *)data;
+       auto cb_state = (PanFilterCallbackState *)data;
        PanWindow *pw = cb_state->pw;
        PanViewFilterUi *ui = pw->filter_ui;
 
@@ -157,7 +157,7 @@ static void pan_filter_kw_button_cb(GtkButton *widget, gpointer data)
 void pan_filter_activate_cb(const gchar *text, gpointer data)
 {
        GtkWidget *kw_button;
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        PanViewFilterUi *ui = pw->filter_ui;
        GtkTreeIter iter;
 
@@ -169,7 +169,7 @@ void pan_filter_activate_cb(const gchar *text, gpointer data)
        tab_completion_append_to_history(ui->filter_entry, text);
 
        // Add new filter element.
-       PanViewFilterElement *element = g_new0(PanViewFilterElement, 1);
+       auto element = g_new0(PanViewFilterElement, 1);
        gtk_tree_model_get(GTK_TREE_MODEL(ui->filter_mode_model), &iter, 0, &element->mode, -1);
        element->keyword = g_strdup(text);
        if (g_strcmp0(text, g_regex_escape_string(text, -1)))
@@ -192,7 +192,7 @@ void pan_filter_activate_cb(const gchar *text, gpointer data)
        gtk_box_pack_start(GTK_BOX(ui->filter_kw_hbox), kw_button, FALSE, FALSE, 0);
        gtk_widget_show(kw_button);
 
-       PanFilterCallbackState *cb_state = g_new0(PanFilterCallbackState, 1);
+       auto cb_state = g_new0(PanFilterCallbackState, 1);
        cb_state->pw = pw;
        cb_state->filter_element = g_list_last(ui->filter_elements);
 
@@ -213,7 +213,7 @@ void pan_filter_activate_cb(const gchar *text, gpointer data)
 
 void pan_filter_toggle_cb(GtkWidget *button, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        PanViewFilterUi *ui = pw->filter_ui;
        gboolean visible;
        GtkWidget *parent;
@@ -283,7 +283,7 @@ void pan_filter_toggle_cb(GtkWidget *button, gpointer data)
 
 void pan_filter_toggle_button_cb(GtkWidget *UNUSED(button), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        PanViewFilterUi *ui = pw->filter_ui;
 
        gint old_classes = ui->filter_classes;
@@ -306,7 +306,7 @@ static gboolean pan_view_list_contains_kw_pattern(GList *haystack, PanViewFilter
                GList *work = g_list_first(haystack);
                while (work)
                        {
-                       gchar *keyword = static_cast<gchar *>(work->data);
+                       auto keyword = static_cast<gchar *>(work->data);
                        work = work->next;
                        if (g_regex_match(filter->kw_regex, keyword, GRegexMatchFlags(0), NULL))
                                {
@@ -340,7 +340,7 @@ gboolean pan_filter_fd_list(GList **fd_list, GList *filter_elements, gint filter
        work = *fd_list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                GList *last_work = work;
                work = work->next;
 
@@ -361,7 +361,7 @@ gboolean pan_filter_fd_list(GList **fd_list, GList *filter_elements, gint filter
 
                        while (filter_element)
                                {
-                               PanViewFilterElement *filter = static_cast<PanViewFilterElement *>(filter_element->data);
+                               auto filter = static_cast<PanViewFilterElement *>(filter_element->data);
                                filter_element = filter_element->next;
                                gchar *found_kw = NULL;
                                gboolean has_kw = pan_view_list_contains_kw_pattern(img_keywords, filter, &found_kw);
index fd6a153..7aa94a5 100644 (file)
@@ -30,7 +30,7 @@
 
 PanViewSearchUi *pan_search_ui_new(PanWindow *pw)
 {
-       PanViewSearchUi *ui = g_new0(PanViewSearchUi, 1);
+       auto ui = g_new0(PanViewSearchUi, 1);
        GtkWidget *combo;
        GtkWidget *hbox;
 
@@ -386,7 +386,7 @@ static gboolean pan_search_by_date(PanWindow *pw, const gchar *text)
 
 void pan_search_activate_cb(const gchar *text, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        if (!text) return;
 
@@ -417,7 +417,7 @@ void pan_search_activate(PanWindow *pw)
 
 void pan_search_toggle_cb(GtkWidget *button, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        PanViewSearchUi *ui = pw->search_ui;
        gboolean visible;
        GtkWidget *parent;
index 623024e..9eef4c0 100644 (file)
@@ -139,7 +139,7 @@ static gboolean pan_queue_step(PanWindow *pw);
 
 static void pan_queue_thumb_done_cb(ThumbLoader *tl, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        if (pw->queue_pi)
                {
@@ -167,7 +167,7 @@ static void pan_queue_thumb_done_cb(ThumbLoader *tl, gpointer data)
 
 static void pan_queue_image_done_cb(ImageLoader *il, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        GdkPixbuf *rotated = NULL;
 
        if (pw->queue_pi)
@@ -322,7 +322,7 @@ static void pan_queue_add(PanWindow *pw, PanItem *pi)
 static gboolean pan_window_request_tile_cb(PixbufRenderer *pr, gint x, gint y,
                                           gint width, gint height, GdkPixbuf *pixbuf, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        GList *list;
        GList *work;
        gint i;
@@ -403,7 +403,7 @@ static gboolean pan_window_request_tile_cb(PixbufRenderer *pr, gint x, gint y,
 static void pan_window_dispose_tile_cb(PixbufRenderer *UNUSED(pr), gint x, gint y,
                                       gint width, gint height, GdkPixbuf *UNUSED(pixbuf), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        GList *list;
        GList *work;
 
@@ -557,8 +557,8 @@ static void pan_window_zoom_limit(PanWindow *pw)
 
 static gint pan_cache_sort_file_cb(gpointer a, gpointer b)
 {
-       PanCacheData *pca = static_cast<PanCacheData *>(a);
-       PanCacheData *pcb = static_cast<PanCacheData *>(b);
+       auto pca = static_cast<PanCacheData *>(a);
+       auto pcb = static_cast<PanCacheData *>(b);
        return filelist_sort_compare_filedata(pca->fd, pcb->fd);
 }
 GList *pan_cache_sort(GList *list, SortType method, gboolean ascend)
@@ -612,7 +612,7 @@ static void pan_cache_fill(PanWindow *pw, FileData *dir_fd)
 
 static void pan_cache_step_done_cb(CacheLoader *cl, gint UNUSED(error), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        if (pw->cache_list)
                {
@@ -837,7 +837,7 @@ static void pan_window_items_free(PanWindow *pw)
        work = pw->list;
        while (work)
                {
-               PanItem *pi = (PanItem *)work->data;
+               auto pi = (PanItem *)work->data;
                work = work->next;
 
                pan_item_free(pi);
@@ -1048,7 +1048,7 @@ void pan_layout_resize(PanWindow *pw)
 
 static gint pan_layout_update_idle_cb(gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        gint width;
        gint height;
        gint scroll_x;
@@ -1172,7 +1172,7 @@ FileData *pan_menu_click_fd(PanWindow *pw)
 
 static gboolean pan_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        PixbufRenderer *pr;
        FileData *fd;
        gboolean stop_signal = FALSE;
@@ -1541,7 +1541,7 @@ void pan_info_update(PanWindow *pw, PanItem *pi)
 
 static void button_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        PanItem *pi = NULL;
        GtkWidget *menu;
        gint rx, ry;
@@ -1647,7 +1647,7 @@ static void pan_image_set_buttons(PanWindow *pw, ImageWindow *imd)
 
 static void pan_fullscreen_stop_func(FullScreenData *UNUSED(fs), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pw->fs = NULL;
        pw->imd = pw->imd_normal;
@@ -1674,7 +1674,7 @@ static void pan_fullscreen_toggle(PanWindow *pw, gboolean force_off)
 
 static void pan_window_image_zoom_cb(PixbufRenderer *UNUSED(pr), gdouble UNUSED(zoom), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        gchar *text;
 
        text = image_zoom_get_as_text(pw->imd);
@@ -1684,7 +1684,7 @@ static void pan_window_image_zoom_cb(PixbufRenderer *UNUSED(pr), gdouble UNUSED(
 
 static void pan_window_image_scroll_notify_cb(PixbufRenderer *pr, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        GtkAdjustment *adj;
        GdkRectangle rect;
        gint width, height;
@@ -1723,7 +1723,7 @@ static void pan_window_image_scroll_notify_cb(PixbufRenderer *pr, gpointer data)
 
 static void pan_window_scrollbar_h_value_cb(GtkRange *range, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        PixbufRenderer *pr;
        gint x;
 
@@ -1738,7 +1738,7 @@ static void pan_window_scrollbar_h_value_cb(GtkRange *range, gpointer data)
 
 static void pan_window_scrollbar_v_value_cb(GtkRange *range, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        PixbufRenderer *pr;
        gint y;
 
@@ -1753,7 +1753,7 @@ static void pan_window_scrollbar_v_value_cb(GtkRange *range, gpointer data)
 
 static void pan_window_layout_change_cb(GtkWidget *combo, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pw->layout = static_cast<PanLayoutType>(gtk_combo_box_get_active(GTK_COMBO_BOX(combo)));
        pan_layout_update(pw);
@@ -1761,7 +1761,7 @@ static void pan_window_layout_change_cb(GtkWidget *combo, gpointer data)
 
 static void pan_window_layout_size_cb(GtkWidget *combo, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pw->size = static_cast<PanImageSize>(gtk_combo_box_get_active(GTK_COMBO_BOX(combo)));
        pan_layout_update(pw);
@@ -1769,7 +1769,7 @@ static void pan_window_layout_size_cb(GtkWidget *combo, gpointer data)
 
 static void pan_window_entry_activate_cb(const gchar *new_text, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        gchar *path;
 
        path = remove_trailing_slash(new_text);
@@ -1821,7 +1821,7 @@ static void pan_window_close(PanWindow *pw)
 
 static gboolean pan_window_delete_cb(GtkWidget *UNUSED(w), GdkEventAny *UNUSED(event), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pan_window_close(pw);
        return TRUE;
@@ -2028,7 +2028,7 @@ static void pan_window_new_real(FileData *dir_fd)
 
 static void pan_warning_ok_cb(GenericDialog *gd, gpointer data)
 {
-       FileData *dir_fd = (FileData *)data;
+       auto dir_fd = (FileData *)data;
 
        generic_dialog_close(gd);
 
@@ -2121,7 +2121,7 @@ void pan_window_new(FileData *dir_fd)
 
 static void pan_new_window_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
@@ -2135,7 +2135,7 @@ static void pan_new_window_cb(GtkWidget *UNUSED(widget), gpointer data)
 static void pan_go_to_original_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
        LayoutWindow *lw = NULL;
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        if (!layout_valid(&lw)) return;
@@ -2151,7 +2151,7 @@ static void pan_edit_cb(GtkWidget *widget, gpointer data)
 {
        PanWindow *pw;
        FileData *fd;
-       const gchar *key = static_cast<const gchar *>(data);
+       auto key = static_cast<const gchar *>(data);
 
        pw = static_cast<PanWindow *>(submenu_item_get_data(widget));
        if (!pw) return;
@@ -2169,28 +2169,28 @@ static void pan_edit_cb(GtkWidget *widget, gpointer data)
 
 static void pan_zoom_in_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        image_zoom_adjust(pw->imd, ZOOM_INCREMENT);
 }
 
 static void pan_zoom_out_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        image_zoom_adjust(pw->imd, -ZOOM_INCREMENT);
 }
 
 static void pan_zoom_1_1_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        image_zoom_set(pw->imd, 1.0);
 }
 
 static void pan_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
@@ -2199,7 +2199,7 @@ static void pan_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void pan_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
@@ -2208,7 +2208,7 @@ static void pan_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void pan_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
@@ -2217,7 +2217,7 @@ static void pan_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void pan_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
@@ -2230,7 +2230,7 @@ static void pan_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void pan_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
@@ -2243,7 +2243,7 @@ static void pan_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void pan_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
@@ -2252,7 +2252,7 @@ static void pan_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void pan_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
@@ -2261,7 +2261,7 @@ static void pan_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void pan_exif_date_toggle_cb(GtkWidget *widget, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pw->exif_date_enable = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
        pan_layout_update(pw);
@@ -2269,7 +2269,7 @@ static void pan_exif_date_toggle_cb(GtkWidget *widget, gpointer data)
 
 static void pan_info_toggle_exif_cb(GtkWidget *widget, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pw->info_includes_exif = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
        /** @FIXME sync info now */
@@ -2277,7 +2277,7 @@ static void pan_info_toggle_exif_cb(GtkWidget *widget, gpointer data)
 
 static void pan_info_toggle_image_cb(GtkWidget *widget, gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pw->info_image_size = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), INFO_IMAGE_SIZE_KEY));
        /** @FIXME sync info now */
@@ -2285,28 +2285,28 @@ static void pan_info_toggle_image_cb(GtkWidget *widget, gpointer data)
 
 static void pan_fullscreen_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pan_fullscreen_toggle(pw, FALSE);
 }
 
 static void pan_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        pan_window_close(pw);
 }
 
 static void pan_popup_menu_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GList *editmenu_fd_list = (GList *)data;
+       auto editmenu_fd_list = (GList *)data;
 
        filelist_free(editmenu_fd_list);
 }
 
 static void pan_play_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        start_editor_from_file(options->image_l_click_video_editor, pw->click_pi->fd);
 }
@@ -2323,10 +2323,10 @@ static GList *pan_view_get_fd_list(PanWindow *pw)
 
 /**
  * @brief Add file selection list to a collection
- * @param[in] widget 
+ * @param[in] widget
  * @param[in] data Index to the collection list menu item selected, or -1 for new collection
- * 
- * 
+ *
+ *
  */
 static void pan_pop_menu_collections_cb(GtkWidget *widget, gpointer data)
 {
@@ -2480,7 +2480,7 @@ static void pan_window_get_dnd_data(GtkWidget *UNUSED(widget), GdkDragContext *c
                                    GtkSelectionData *selection_data, guint info,
                                    guint UNUSED(time), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
 
        if (gtk_drag_get_source_widget(context) == pw->imd->pr) return;
 
@@ -2491,7 +2491,7 @@ static void pan_window_get_dnd_data(GtkWidget *UNUSED(widget), GdkDragContext *c
                list = uri_filelist_from_gtk_selection_data(selection_data);
                if (list && isdir(((FileData *)list->data)->path))
                        {
-                       FileData *fd = static_cast<FileData *>(list->data);
+                       auto fd = static_cast<FileData *>(list->data);
 
                        pan_layout_set_fd(pw, fd);
                        }
@@ -2504,7 +2504,7 @@ static void pan_window_set_dnd_data(GtkWidget *UNUSED(widget), GdkDragContext *U
                                    GtkSelectionData *selection_data, guint UNUSED(info),
                                    guint UNUSED(time), gpointer data)
 {
-       PanWindow *pw = (PanWindow *)data;
+       auto pw = (PanWindow *)data;
        FileData *fd;
 
        fd = pan_menu_click_fd(pw);
index 471b44a..319463e 100644 (file)
@@ -778,7 +778,7 @@ void pixbuf_renderer_overlay_remove(PixbufRenderer *pr, gint id)
 
 static gboolean pr_scroller_update_cb(gpointer data)
 {
-       PixbufRenderer *pr = static_cast<PixbufRenderer *>(data);
+       auto pr = static_cast<PixbufRenderer *>(data);
        gint x, y;
        gint xinc, yinc;
 
@@ -1099,7 +1099,7 @@ static SourceTile *pr_source_tile_find(PixbufRenderer *pr, gint x, gint y)
        work = pr->source_tiles;
        while (work)
                {
-               SourceTile *st = static_cast<SourceTile *>(work->data);
+               auto st = static_cast<SourceTile *>(work->data);
 
                if (x >= st->x && x < st->x + pr->source_tile_width &&
                    y >= st->y && y < st->y + pr->source_tile_height)
@@ -1944,7 +1944,7 @@ static void pr_size_sync(PixbufRenderer *pr, gint new_width, gint new_height)
 
 static void pr_size_cb(GtkWidget *UNUSED(widget), GtkAllocation *allocation, gpointer data)
 {
-       PixbufRenderer *pr = static_cast<PixbufRenderer *>(data);
+       auto pr = static_cast<PixbufRenderer *>(data);
 
        pr_size_sync(pr, allocation->width, allocation->height);
 }
index bce3d50..078742d 100644 (file)
@@ -524,7 +524,7 @@ static void config_window_close_cb(GtkWidget *UNUSED(widget), gpointer UNUSED(da
 
 static void config_window_help_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GtkWidget *notebook = static_cast<GtkWidget *>(data);
+       auto notebook = static_cast<GtkWidget *>(data);
        gint i;
 
        static const gchar *html_section[] =
@@ -558,7 +558,7 @@ static gboolean config_window_delete(GtkWidget *UNUSED(widget), GdkEventAny *UNU
 static void config_window_ok_cb(GtkWidget *widget, gpointer data)
 {
        LayoutWindow *lw;
-       GtkNotebook *notebook = static_cast<GtkNotebook *>(data);
+       auto notebook = static_cast<GtkNotebook *>(data);
        GdkWindow *window;
        gint x;
        gint y;
@@ -594,7 +594,7 @@ static void config_window_ok_cb(GtkWidget *widget, gpointer data)
 
 static void quality_menu_cb(GtkWidget *combo, gpointer data)
 {
-       gint *option = static_cast<gint *>(data);
+       auto option = static_cast<gint *>(data);
 
        switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
                {
@@ -613,7 +613,7 @@ static void quality_menu_cb(GtkWidget *combo, gpointer data)
 
 static void dnd_default_action_selection_menu_cb(GtkWidget *combo, gpointer data)
 {
-       gint *option = static_cast<gint *>(data);
+       auto option = static_cast<gint *>(data);
 
        switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
                {
@@ -631,7 +631,7 @@ static void dnd_default_action_selection_menu_cb(GtkWidget *combo, gpointer data
 }
 static void clipboard_selection_menu_cb(GtkWidget *combo, gpointer data)
 {
-       gint *option = static_cast<gint *>(data);
+       auto option = static_cast<gint *>(data);
 
        switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
                {
@@ -734,7 +734,7 @@ static void add_clipboard_selection_menu(GtkWidget *table, gint column, gint row
 
 static void zoom_style_selection_menu_cb(GtkWidget *combo, gpointer data)
 {
-       gint *option = static_cast<gint *>(data);
+       auto option = static_cast<gint *>(data);
 
        switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
                {
@@ -857,7 +857,7 @@ static const UseableMouseItems useable_mouse_items[] = {
 
 static void mouse_buttons_selection_menu_cb(GtkWidget *combo, gpointer data)
 {
-       gchar **option = static_cast<gchar **>(data);
+       auto option = static_cast<gchar **>(data);
        gchar *label;
 
        label = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(combo));
@@ -982,7 +982,7 @@ static void add_thumb_size_menu(GtkWidget *table, gint column, gint row, gchar *
 
 static void stereo_mode_menu_cb(GtkWidget *combo, gpointer data)
 {
-       gint *option = static_cast<gint *>(data);
+       auto option = static_cast<gint *>(data);
 
        switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
                {
@@ -1101,16 +1101,16 @@ static void add_stereo_mode_menu(GtkWidget *table, gint column, gint row, const
 
 static void video_menu_cb(GtkWidget *combo, gpointer data)
 {
-       gchar **option = static_cast<gchar **>(data);
+       auto option = static_cast<gchar **>(data);
 
-       EditorDescription *ed = static_cast<EditorDescription *>(g_list_nth_data(editor_list_get(), gtk_combo_box_get_active(GTK_COMBO_BOX(combo))));
+       auto ed = static_cast<EditorDescription *>(g_list_nth_data(editor_list_get(), gtk_combo_box_get_active(GTK_COMBO_BOX(combo))));
        *option = ed->key;
 }
 
 static void video_menu_populate(gpointer data, gpointer user_data)
 {
-       GtkWidget *combo = static_cast<GtkWidget *>(user_data);
-       EditorDescription *ed = static_cast<EditorDescription *>(data);
+       auto combo = static_cast<GtkWidget *>(user_data);
+       auto ed = static_cast<EditorDescription *>(data);
 
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), ed->name);
 }
@@ -1165,8 +1165,8 @@ static void filter_store_populate(void)
 static void filter_store_ext_edit_cb(GtkCellRendererText *UNUSED(cell), gchar *path_str,
                                     gchar *new_text, gpointer data)
 {
-       GtkWidget *model = static_cast<GtkWidget *>(data);
-       FilterEntry *fe = static_cast<FilterEntry *>(data);
+       auto model = static_cast<GtkWidget *>(data);
+       auto fe = static_cast<FilterEntry *>(data);
        GtkTreePath *tpath;
        GtkTreeIter iter;
 
@@ -1186,8 +1186,8 @@ static void filter_store_ext_edit_cb(GtkCellRendererText *UNUSED(cell), gchar *p
 static void filter_store_class_edit_cb(GtkCellRendererText *UNUSED(cell), gchar *path_str,
                                       gchar *new_text, gpointer data)
 {
-       GtkWidget *model = static_cast<GtkWidget *>(data);
-       FilterEntry *fe = static_cast<FilterEntry *>(data);
+       auto model = static_cast<GtkWidget *>(data);
+       auto fe = static_cast<FilterEntry *>(data);
        GtkTreePath *tpath;
        GtkTreeIter iter;
        gint i;
@@ -1214,7 +1214,7 @@ static void filter_store_class_edit_cb(GtkCellRendererText *UNUSED(cell), gchar
 static void filter_store_desc_edit_cb(GtkCellRendererText *UNUSED(cell), gchar *path_str,
                                      gchar *new_text, gpointer data)
 {
-       GtkWidget *model = static_cast<GtkWidget *>(data);
+       auto model = static_cast<GtkWidget *>(data);
        FilterEntry *fe;
        GtkTreePath *tpath;
        GtkTreeIter iter;
@@ -1234,7 +1234,7 @@ static void filter_store_desc_edit_cb(GtkCellRendererText *UNUSED(cell), gchar *
 static void filter_store_enable_cb(GtkCellRendererToggle *UNUSED(renderer),
                                   gchar *path_str, gpointer data)
 {
-       GtkWidget *model = static_cast<GtkWidget *>(data);
+       auto model = static_cast<GtkWidget *>(data);
        FilterEntry *fe;
        GtkTreePath *tpath;
        GtkTreeIter iter;
@@ -1252,7 +1252,7 @@ static void filter_store_enable_cb(GtkCellRendererToggle *UNUSED(renderer),
 static void filter_store_writable_cb(GtkCellRendererToggle *UNUSED(renderer),
                                     gchar *path_str, gpointer data)
 {
-       GtkWidget *model = static_cast<GtkWidget *>(data);
+       auto model = static_cast<GtkWidget *>(data);
        FilterEntry *fe;
        GtkTreePath *tpath;
        GtkTreeIter iter;
@@ -1271,7 +1271,7 @@ static void filter_store_writable_cb(GtkCellRendererToggle *UNUSED(renderer),
 static void filter_store_sidecar_cb(GtkCellRendererToggle *UNUSED(renderer),
                                    gchar *path_str, gpointer data)
 {
-       GtkWidget *model = static_cast<GtkWidget *>(data);
+       auto model = static_cast<GtkWidget *>(data);
        FilterEntry *fe;
        GtkTreePath *tpath;
        GtkTreeIter iter;
@@ -1380,7 +1380,7 @@ static void filter_add_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void filter_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GtkWidget *filter_view = static_cast<GtkWidget *>(data);
+       auto filter_view = static_cast<GtkWidget *>(data);
        GtkTreeSelection *selection;
        GtkTreeIter iter;
        FilterEntry *fe;
@@ -1445,7 +1445,7 @@ static void filter_default_cb(GtkWidget *widget, gpointer data)
 
 static void filter_disable_cb(GtkWidget *widget, gpointer data)
 {
-       GtkWidget *frame = static_cast<GtkWidget *>(data);
+       auto frame = static_cast<GtkWidget *>(data);
 
        gtk_widget_set_sensitive(frame,
                                 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
@@ -1499,7 +1499,7 @@ static void image_overlay_template_view_changed_cb(GtkWidget *UNUSED(widget), gp
 
 static void image_overlay_default_template_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       GtkTextView *text_view = static_cast<GtkTextView *>(data);
+       auto text_view = static_cast<GtkTextView *>(data);
        GtkTextBuffer *buffer;
 
        set_default_image_overlay_template_string(&options->image_overlay.template_string);
@@ -1665,7 +1665,7 @@ static void accel_store_cleared_cb(GtkCellRendererAccel *UNUSED(accel), gchar *U
 
 static gboolean accel_remove_key_cb(GtkTreeModel *model, GtkTreePath *UNUSED(path), GtkTreeIter *iter, gpointer data)
 {
-       gchar *accel1 = static_cast<gchar *>(data);
+       auto accel1 = static_cast<gchar *>(data);
        gchar *accel2;
        GtkAccelKey key1;
        GtkAccelKey key2;
@@ -1689,7 +1689,7 @@ static gboolean accel_remove_key_cb(GtkTreeModel *model, GtkTreePath *UNUSED(pat
 
 static void accel_store_edited_cb(GtkCellRendererAccel *UNUSED(accel), gchar *path_string, guint accel_key, GdkModifierType accel_mods, guint UNUSED(hardware_keycode), gpointer UNUSED(user_data))
 {
-       GtkTreeModel *model = (GtkTreeModel *)accel_store;
+       auto model = (GtkTreeModel *)accel_store;
        GtkTreeIter iter;
        gchar *acc;
        gchar *accel_path;
@@ -1891,7 +1891,7 @@ static void star_rating_rejected_icon_cb(GtkEntry *UNUSED(entry), GtkEntryIconPo
 
 static guint star_rating_symbol_test(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GtkContainer *hbox = static_cast<GtkContainer *>(data);
+       auto hbox = static_cast<GtkContainer *>(data);
        GString *str = g_string_new(NULL);
        GtkEntry *hex_code_entry;
        gchar *hex_code_full;
@@ -2371,7 +2371,7 @@ static void save_default_window_layout_cb(GtkWidget *UNUSED(widget), gpointer UN
 
 static gboolean popover_cb(gpointer data)
 {
-       GtkPopover *popover = static_cast<GtkPopover *>(data);
+       auto popover = static_cast<GtkPopover *>(data);
 
        gtk_popover_popdown(popover);
 
@@ -3047,7 +3047,7 @@ static void keywords_find_reset(KeywordFindData *kfd)
 
 static void keywords_find_close_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       KeywordFindData *kfd = static_cast<KeywordFindData *>(data);
+       auto kfd = static_cast<KeywordFindData *>(data);
 
        if (!gtk_widget_get_sensitive(kfd->button_close)) return;
 
@@ -3071,7 +3071,7 @@ static void keywords_find_finish(KeywordFindData *kfd)
 
 static void keywords_find_stop_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       KeywordFindData *kfd = static_cast<KeywordFindData *>(data);
+       auto kfd = static_cast<KeywordFindData *>(data);
 
        g_idle_remove_by_data(kfd);
 
@@ -3080,7 +3080,7 @@ static void keywords_find_stop_cb(GenericDialog *UNUSED(fd), gpointer data)
 
 static gboolean keywords_find_file(gpointer data)
 {
-       KeywordFindData *kfd = static_cast<KeywordFindData *>(data);
+       auto kfd = static_cast<KeywordFindData *>(data);
        GtkTextIter iter;
        GtkTextBuffer *buffer;
        gchar *tmp;
@@ -3132,7 +3132,7 @@ static gboolean keywords_find_file(gpointer data)
 
 static void keywords_find_start_cb(GenericDialog *UNUSED(fd), gpointer data)
 {
-       KeywordFindData *kfd = static_cast<KeywordFindData *>(data);
+       auto kfd = static_cast<KeywordFindData *>(data);
        gchar *path;
 
        if (kfd->list || !gtk_widget_get_sensitive(kfd->button_start)) return;
@@ -4243,7 +4243,7 @@ static void image_overlay_set_text_colours()
 static void timezone_async_ready_cb(GObject *source_object, GAsyncResult *res, gpointer data)
 {
        GError *error = NULL;
-       TZData *tz = static_cast<TZData *>(data);
+       auto tz = static_cast<TZData *>(data);
        gchar *tmp_filename;
        gchar *timezone_bin;
        gchar *tmp_dir = NULL;
@@ -4297,7 +4297,7 @@ static void timezone_async_ready_cb(GObject *source_object, GAsyncResult *res, g
 
 static void timezone_progress_cb(goffset current_num_bytes, goffset total_num_bytes, gpointer data)
 {
-       TZData *tz = static_cast<TZData *>(data);
+       auto tz = static_cast<TZData *>(data);
 
        if (!g_cancellable_is_cancelled(tz->cancellable))
                {
@@ -4307,14 +4307,14 @@ static void timezone_progress_cb(goffset current_num_bytes, goffset total_num_by
 
 static void timezone_cancel_button_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       TZData *tz = static_cast<TZData *>(data);
+       auto tz = static_cast<TZData *>(data);
 
        g_cancellable_cancel(tz->cancellable);
 }
 
 static void timezone_database_install_cb(GtkWidget *widget, gpointer data)
 {
-       TZData *tz = static_cast<TZData *>(data);
+       auto tz = static_cast<TZData *>(data);
        GError *error = NULL;
        GFileIOStream *io_stream;
 
index 3d8981f..3a49fea 100644 (file)
@@ -79,7 +79,7 @@ static gboolean print_job_render_image(PrintWindow *pw);
 
 static void print_job_render_image_loader_done(ImageLoader *il, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        GdkPixbuf *pixbuf;
 
        pixbuf = image_loader_get_pixbuf(il);
@@ -175,7 +175,7 @@ static gint set_toggle(GSList *list, TextPosition pos)
 
 static void image_text_position_h1_cb(GtkWidget *widget, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        gint new_set;
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
@@ -191,7 +191,7 @@ static void image_text_position_h1_cb(GtkWidget *widget, gpointer data)
 
 static void image_text_position_h2_cb(GtkWidget *widget, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        gint new_set;
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
@@ -207,7 +207,7 @@ static void image_text_position_h2_cb(GtkWidget *widget, gpointer data)
 
 static void image_text_position_f1_cb(GtkWidget *widget, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        gint new_set;
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
@@ -223,7 +223,7 @@ static void image_text_position_f1_cb(GtkWidget *widget, gpointer data)
 
 static void image_text_position_f2_cb(GtkWidget *widget, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        gint new_set;
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
@@ -239,7 +239,7 @@ static void image_text_position_f2_cb(GtkWidget *widget, gpointer data)
 
 static void page_text_position_h1_cb(GtkWidget *widget, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        gint new_set;
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
@@ -255,7 +255,7 @@ static void page_text_position_h1_cb(GtkWidget *widget, gpointer data)
 
 static void page_text_position_h2_cb(GtkWidget *widget, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        gint new_set;
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
@@ -271,7 +271,7 @@ static void page_text_position_h2_cb(GtkWidget *widget, gpointer data)
 
 static void page_text_position_f1_cb(GtkWidget *widget, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        gint new_set;
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
@@ -287,7 +287,7 @@ static void page_text_position_f1_cb(GtkWidget *widget, gpointer data)
 
 static void page_text_position_f2_cb(GtkWidget *widget, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        gint new_set;
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
@@ -464,7 +464,7 @@ static gboolean paginate_cb(GtkPrintOperation *UNUSED(operation),
                                                                        GtkPrintContext *UNUSED(context),
                                                                        gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
 
        if (pw->job_render_finished)
                {
@@ -542,7 +542,7 @@ gchar *form_image_text(const gchar *template_string, FileData *fd, PrintWindow *
 static void draw_page(GtkPrintOperation *UNUSED(operation), GtkPrintContext *context,
                                                                        gint page_nr, gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        FileData *fd;
        cairo_t *cr;
        gdouble context_width, context_height;
@@ -757,7 +757,7 @@ static void begin_print(GtkPrintOperation *operation,
                                                GtkPrintContext *UNUSED(context),
                                                gpointer user_data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(user_data);
+       auto pw = static_cast<PrintWindow *>(user_data);
        gint page_count;
 
        page_count = print_layout_page_count(pw);
@@ -769,7 +769,7 @@ static void begin_print(GtkPrintOperation *operation,
 
 GObject *option_tab_cb(GtkPrintOperation *UNUSED(operation), gpointer user_data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(user_data);
+       auto pw = static_cast<PrintWindow *>(user_data);
 
        return G_OBJECT(pw->vbox);
 }
@@ -789,7 +789,7 @@ static void print_pref_store(PrintWindow *pw)
 static void end_print_cb(GtkPrintOperation *operation,
                                                                GtkPrintContext *UNUSED(context), gpointer data)
 {
-       PrintWindow *pw = static_cast<PrintWindow *>(data);
+       auto pw = static_cast<PrintWindow *>(data);
        GList *work;
        GdkPixbuf *pixbuf;
        gchar *path;
index 39e6a7d..e0c531e 100644 (file)
@@ -711,7 +711,7 @@ gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options, Layou
                        work = layout_window_list;
                        while (work)
                                {
-                               LayoutWindow *lw = static_cast<LayoutWindow *>(work->data);
+                               auto lw = static_cast<LayoutWindow *>(work->data);
                                layout_write_config(lw, outstr, indent);
                                work = work->next;
                                }
@@ -1288,14 +1288,14 @@ static void options_parse_filter_end(GQParserData *parser_data, GMarkupParseCont
 
 static void options_parse_keyword_end(GQParserData *UNUSED(parser_data), GMarkupParseContext *UNUSED(context), const gchar *UNUSED(element_name), gpointer data, GError **UNUSED(error))
 {
-       GtkTreeIter *iter_ptr = static_cast<GtkTreeIter *>(data);
+       auto iter_ptr = static_cast<GtkTreeIter *>(data);
        gtk_tree_iter_free(iter_ptr);
 }
 
 
 static void options_parse_keyword(GQParserData *parser_data, GMarkupParseContext *UNUSED(context), const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **UNUSED(error))
 {
-       GtkTreeIter *iter_ptr = static_cast<GtkTreeIter *>(data);
+       auto iter_ptr = static_cast<GtkTreeIter *>(data);
        if (g_ascii_strcasecmp(element_name, "keyword") == 0)
                {
                GtkTreeIter *child = keyword_add_from_config(keyword_tree, iter_ptr, attribute_names, attribute_values);
@@ -1375,7 +1375,7 @@ static void options_parse_global_end(GQParserData *UNUSED(parser_data), GMarkupP
 
 static void options_parse_pane_exif(GQParserData *parser_data, GMarkupParseContext *UNUSED(context), const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **UNUSED(error))
 {
-       GtkWidget *pane = static_cast<GtkWidget *>(data);
+       auto pane = static_cast<GtkWidget *>(data);
        if (g_ascii_strcasecmp(element_name, "entry") == 0)
                {
                bar_pane_exif_entry_add_from_config(pane, attribute_names, attribute_values);
@@ -1390,7 +1390,7 @@ static void options_parse_pane_exif(GQParserData *parser_data, GMarkupParseConte
 
 static void options_parse_pane_keywords(GQParserData *parser_data, GMarkupParseContext *UNUSED(context), const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **UNUSED(error))
 {
-       GtkWidget *pane = static_cast<GtkWidget *>(data);
+       auto pane = static_cast<GtkWidget *>(data);
 
        if (g_ascii_strcasecmp(element_name, "expanded") == 0)
                {
@@ -1406,7 +1406,7 @@ static void options_parse_pane_keywords(GQParserData *parser_data, GMarkupParseC
 
 static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *UNUSED(context), const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **UNUSED(error))
 {
-       GtkWidget *bar = static_cast<GtkWidget *>(data);
+       auto bar = static_cast<GtkWidget *>(data);
        if (g_ascii_strcasecmp(element_name, "pane_comment") == 0)
                {
                GtkWidget *pane = bar_find_pane_by_id(bar, PANE_COMMENT, options_get_id(attribute_names, attribute_values));
@@ -1513,7 +1513,7 @@ static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *UN
 
 static void options_parse_toolbar(GQParserData *parser_data, GMarkupParseContext *UNUSED(context), const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **UNUSED(error))
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        if (g_ascii_strcasecmp(element_name, "toolitem") == 0)
                {
                layout_toolbar_add_from_config(lw, TOOLBAR_MAIN, attribute_names, attribute_values);
@@ -1533,7 +1533,7 @@ static void options_parse_toolbar(GQParserData *parser_data, GMarkupParseContext
 
 static void options_parse_statusbar(GQParserData *parser_data, GMarkupParseContext *UNUSED(context), const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **UNUSED(error))
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        if (g_ascii_strcasecmp(element_name, "toolitem") == 0)
                {
                layout_toolbar_add_from_config(lw, TOOLBAR_STATUS, attribute_names, attribute_values);
@@ -1567,7 +1567,7 @@ static void options_parse_dialogs(GQParserData *parser_data, GMarkupParseContext
 
 static void options_parse_layout(GQParserData *parser_data, GMarkupParseContext *UNUSED(context), const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **UNUSED(error))
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        if (g_ascii_strcasecmp(element_name, "bar") == 0)
                {
                if (!lw->bar)
@@ -1608,7 +1608,7 @@ static void options_parse_layout(GQParserData *parser_data, GMarkupParseContext
 
 static void options_parse_layout_end(GQParserData *UNUSED(parser_data), GMarkupParseContext *UNUSED(context), const gchar *UNUSED(element_name), gpointer data, GError **UNUSED(error))
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        //~ LayoutWindow *lw = (LayoutWindow *)data;
        //~ LayoutWindow *lw = data;
        layout_util_sync(lw);
@@ -1670,7 +1670,7 @@ struct _GQParserFuncData
 
 void options_parse_func_push(GQParserData *parser_data, GQParserStartFunc start_func, GQParserEndFunc end_func, gpointer data)
 {
-       GQParserFuncData *func_data = g_new0(GQParserFuncData, 1);
+       auto func_data = g_new0(GQParserFuncData, 1);
        func_data->start_func = start_func;
        func_data->end_func = end_func;
        func_data->data = data;
@@ -1686,7 +1686,7 @@ void options_parse_func_pop(GQParserData *parser_data)
 
 void options_parse_func_set_data(GQParserData *parser_data, gpointer data)
 {
-       GQParserFuncData *func = static_cast<GQParserFuncData *>(parser_data->parse_func_stack->data);
+       auto func = static_cast<GQParserFuncData *>(parser_data->parse_func_stack->data);
        func->data = data;
 }
 
@@ -1698,8 +1698,8 @@ static void start_element(GMarkupParseContext *context,
                          gpointer user_data,
                          GError **error)
 {
-       GQParserData *parser_data = static_cast<GQParserData *>(user_data);
-       GQParserFuncData *func = static_cast<GQParserFuncData *>(parser_data->parse_func_stack->data);
+       auto parser_data = static_cast<GQParserData *>(user_data);
+       auto func = static_cast<GQParserFuncData *>(parser_data->parse_func_stack->data);
        DEBUG_2("start %s", element_name);
 
        if (func->start_func)
@@ -1711,8 +1711,8 @@ static void end_element(GMarkupParseContext *context,
                          gpointer user_data,
                          GError **error)
 {
-       GQParserData *parser_data = static_cast<GQParserData *>(user_data);
-       GQParserFuncData *func = static_cast<GQParserFuncData *>(parser_data->parse_func_stack->data);
+       auto parser_data = static_cast<GQParserData *>(user_data);
+       auto func = static_cast<GQParserFuncData *>(parser_data->parse_func_stack->data);
        DEBUG_2("end %s", element_name);
 
        if (func->end_func)
index f7ffc29..4c24106 100644 (file)
@@ -91,11 +91,11 @@ static gchar *pwd = NULL;
  * @brief Ensures file path is absolute.
  * @param[in] filename Filepath, absolute or relative to calling directory
  * @returns absolute path
- * 
+ *
  * If first character of input filepath is not the directory
  * separator, assume it as a relative path and prepend
  * the directory the remote command was initiated from
- * 
+ *
  * Return value must be freed with g_free()
  */
 static gchar *set_pwd(gchar *filename)
@@ -116,7 +116,7 @@ static gchar *set_pwd(gchar *filename)
 
 static gboolean remote_server_client_cb(GIOChannel *source, GIOCondition condition, gpointer data)
 {
-       RemoteClient *client = static_cast<RemoteClient *>(data);
+       auto client = static_cast<RemoteClient *>(data);
        RemoteConnection *rc;
        GIOStatus status = G_IO_STATUS_NORMAL;
 
@@ -199,7 +199,7 @@ static void remote_server_clients_close(RemoteConnection *rc)
 {
        while (rc->clients)
                {
-               RemoteClient *client = static_cast<RemoteClient *>(rc->clients->data);
+               auto client = static_cast<RemoteClient *>(rc->clients->data);
 
                rc->clients = g_list_remove(rc->clients, client);
 
@@ -211,7 +211,7 @@ static void remote_server_clients_close(RemoteConnection *rc)
 
 static gboolean remote_server_read_cb(GIOChannel *UNUSED(source), GIOCondition UNUSED(condition), gpointer data)
 {
-       RemoteConnection *rc = static_cast<RemoteConnection *>(data);
+       auto rc = static_cast<RemoteConnection *>(data);
        gint fd;
        guint alen;
 
@@ -932,7 +932,7 @@ static void gr_get_selection(const gchar *UNUSED(text), GIOChannel *channel, gpo
        GList *work = selected;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                g_assert(fd->magick == FD_MAGICK);
 
                g_string_append_printf(out_string, "%s    %s\n",
@@ -970,7 +970,7 @@ static void gr_selection_add(const gchar *text, GIOChannel *UNUSED(channel), gpo
                GList *file_list = layout_list(lw_id);
                for (GList *work = file_list; work && !fd_to_select; work = work->next)
                        {
-                       FileData *fd = static_cast<FileData *>(work->data);
+                       auto fd = static_cast<FileData *>(work->data);
                        if (!strcmp(path, fd->path) || g_str_has_suffix(fd->path, slash_plus_filename))
                                {
                                fd_to_select = file_data_ref(fd);
@@ -979,7 +979,7 @@ static void gr_selection_add(const gchar *text, GIOChannel *UNUSED(channel), gpo
 
                        for (GList *sidecar = fd->sidecar_files; sidecar && !fd_to_select; sidecar = sidecar->next)
                                {
-                               FileData *side_fd = static_cast<FileData *>(sidecar->data);
+                               auto side_fd = static_cast<FileData *>(sidecar->data);
                                if (!strcmp(path, side_fd->path)
                                    || g_str_has_suffix(side_fd->path, slash_plus_filename))
                                        {
@@ -1054,7 +1054,7 @@ static void gr_selection_remove(const gchar *text, GIOChannel *UNUSED(channel),
        GList *link_to_remove = NULL;
        for (GList *work = selected; work; prior_link = work, work = work->next)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                if (fd_to_deselect)
                        {
                        if (fd == fd_to_deselect)
@@ -1147,7 +1147,7 @@ static void gr_collection_list(const gchar *UNUSED(text), GIOChannel *channel, g
        work = collection_list;
        while (work)
                {
-               const gchar *collection_name = static_cast<const gchar *>(work->data);
+               auto collection_name = static_cast<const gchar *>(work->data);
                out_string = g_string_append(out_string, g_strdup(collection_name));
                out_string = g_string_append(out_string, "\n");
 
@@ -1431,7 +1431,7 @@ static void gr_file_view(const gchar *text, GIOChannel *UNUSED(channel), gpointe
 
 static void gr_list_clear(const gchar *UNUSED(text), GIOChannel *UNUSED(channel), gpointer data)
 {
-       RemoteData *remote_data = static_cast<RemoteData *>(data);
+       auto remote_data = static_cast<RemoteData *>(data);
 
        remote_data->command_collection = NULL;
        remote_data->file_list = NULL;
@@ -1440,7 +1440,7 @@ static void gr_list_clear(const gchar *UNUSED(text), GIOChannel *UNUSED(channel)
 
 static void gr_list_add(const gchar *text, GIOChannel *UNUSED(channel), gpointer data)
 {
-       RemoteData *remote_data = static_cast<RemoteData *>(data);
+       auto remote_data = static_cast<RemoteData *>(data);
        gboolean is_new = TRUE;
        gchar *path = NULL;
        FileData *fd;
@@ -1932,7 +1932,7 @@ void remote_control(const gchar *arg_exec, GList *remote_list, const gchar *path
 RemoteConnection *remote_server_init(gchar *path, CollectionData *command_collection)
 {
        RemoteConnection *remote_connection = remote_server_open(path);
-       RemoteData *remote_data = g_new(RemoteData, 1);
+       auto remote_data = g_new(RemoteData, 1);
 
        remote_data->command_collection = command_collection;
 
index 49ca8e8..3849e39 100644 (file)
@@ -697,7 +697,7 @@ static void rt_overlay_queue_all(RendererTiles *rt, gint x1, gint y1, gint x2, g
        work = rt->overlay_list;
        while (work)
                {
-               OverlayData *od = static_cast<OverlayData *>(work->data);
+               auto od = static_cast<OverlayData *>(work->data);
                work = work->next;
 
                rt_overlay_queue_draw(rt, od, x1, y1, x2, y2);
@@ -711,7 +711,7 @@ static void rt_overlay_update_sizes(RendererTiles *rt)
        work = rt->overlay_list;
        while (work)
                {
-               OverlayData *od = static_cast<OverlayData *>(work->data);
+               auto od = static_cast<OverlayData *>(work->data);
                work = work->next;
 
                if (!od->window) rt_overlay_init_window(rt, od);
@@ -733,7 +733,7 @@ static OverlayData *rt_overlay_find(RendererTiles *rt, gint id)
        work = rt->overlay_list;
        while (work)
                {
-               OverlayData *od = static_cast<OverlayData *>(work->data);
+               auto od = static_cast<OverlayData *>(work->data);
                work = work->next;
 
                if (od->id == id) return od;
@@ -746,7 +746,7 @@ static OverlayData *rt_overlay_find(RendererTiles *rt, gint id)
 gint renderer_tiles_overlay_add(void *renderer, GdkPixbuf *pixbuf, gint x, gint y,
                                 OverlayRendererFlags flags)
 {
-       RendererTiles *rt = (RendererTiles *) renderer;
+       auto rt = (RendererTiles *) renderer;
        PixbufRenderer *pr = rt->pr;
        OverlayData *od;
        gint id;
@@ -810,7 +810,7 @@ static void rt_overlay_list_reset_window(RendererTiles *rt)
        work = rt->overlay_list;
        while (work)
                {
-               OverlayData *od = static_cast<OverlayData *>(work->data);
+               auto od = static_cast<OverlayData *>(work->data);
                work = work->next;
                if (od->window) gdk_window_destroy(od->window);
                od->window = NULL;
@@ -819,7 +819,7 @@ static void rt_overlay_list_reset_window(RendererTiles *rt)
 
 void renderer_tiles_overlay_set(void *renderer, gint id, GdkPixbuf *pixbuf, gint UNUSED(x), gint UNUSED(y))
 {
-       RendererTiles *rc = (RendererTiles *)renderer;
+       auto rc = (RendererTiles *)renderer;
        PixbufRenderer *pr = rc->pr;
        OverlayData *od;
 
@@ -844,7 +844,7 @@ void renderer_tiles_overlay_set(void *renderer, gint id, GdkPixbuf *pixbuf, gint
 
 gboolean renderer_tiles_overlay_get(void *renderer, gint id, GdkPixbuf **pixbuf, gint *x, gint *y)
 {
-       RendererTiles *rt = (RendererTiles *) renderer;
+       auto rt = (RendererTiles *) renderer;
        PixbufRenderer *pr = rt->pr;
        OverlayData *od;
 
@@ -862,7 +862,7 @@ gboolean renderer_tiles_overlay_get(void *renderer, gint id, GdkPixbuf **pixbuf,
 
 static void rt_hierarchy_changed_cb(GtkWidget *UNUSED(widget), GtkWidget *UNUSED(previous_toplevel), gpointer data)
 {
-       RendererTiles *rt = static_cast<RendererTiles *>(data);
+       auto rt = static_cast<RendererTiles *>(data);
        rt_overlay_list_reset_window(rt);
 }
 
@@ -1580,7 +1580,7 @@ static gint rt_get_queued_area(GList *work)
 
        while (work)
                {
-               QueueData *qd = static_cast<QueueData *>(work->data);
+               auto qd = static_cast<QueueData *>(work->data);
                area += qd->w * qd->h;
                work = work->next;
                }
@@ -1636,7 +1636,7 @@ static gboolean rt_queue_schedule_next_draw(RendererTiles *rt, gboolean force_se
 
 static gboolean rt_queue_draw_idle_cb(gpointer data)
 {
-       RendererTiles *rt = static_cast<RendererTiles *>(data);
+       auto rt = static_cast<RendererTiles *>(data);
        PixbufRenderer *pr = rt->pr;
        QueueData *qd;
        gboolean fast;
@@ -1936,7 +1936,7 @@ static void rt_queue(RendererTiles *rt, gint x, gint y, gint w, gint h,
 
 static void rt_scroll(void *renderer, gint x_off, gint y_off)
 {
-       RendererTiles *rt = (RendererTiles *) renderer;
+       auto rt = (RendererTiles *) renderer;
        PixbufRenderer *pr = rt->pr;
 
        rt_sync_scroll(rt);
@@ -2020,7 +2020,7 @@ static void rt_scroll(void *renderer, gint x_off, gint y_off)
 
 static void renderer_area_changed(void *renderer, gint src_x, gint src_y, gint src_w, gint src_h)
 {
-       RendererTiles *rt = (RendererTiles *)renderer;
+       auto rt = (RendererTiles *)renderer;
        PixbufRenderer *pr = rt->pr;
        gint x, y, width, height,  x1, y1, x2, y2;
 
@@ -2074,7 +2074,7 @@ static void renderer_update_pixbuf(void *renderer, gboolean UNUSED(lazy))
 
 static void renderer_update_zoom(void *renderer, gboolean lazy)
 {
-       RendererTiles *rt = (RendererTiles *)renderer;
+       auto rt = (RendererTiles *)renderer;
        PixbufRenderer *pr = rt->pr;
 
        rt_tile_invalidate_all((RendererTiles *)renderer);
@@ -2092,7 +2092,7 @@ static void renderer_invalidate_region(void *renderer, gint x, gint y, gint w, g
 
 static void renderer_update_viewport(void *renderer)
 {
-       RendererTiles *rt = (RendererTiles *)renderer;
+       auto rt = (RendererTiles *)renderer;
 
        rt->stereo_off_x = 0;
        rt->stereo_off_y = 0;
@@ -2129,14 +2129,14 @@ static void renderer_update_viewport(void *renderer)
 
 static void renderer_stereo_set(void *renderer, gint stereo_mode)
 {
-       RendererTiles *rt = (RendererTiles *)renderer;
+       auto rt = (RendererTiles *)renderer;
 
        rt->stereo_mode = stereo_mode;
 }
 
 static void renderer_free(void *renderer)
 {
-       RendererTiles *rt = (RendererTiles *)renderer;
+       auto rt = (RendererTiles *)renderer;
        rt_queue_clear(rt);
        rt_tile_free_all(rt);
        if (rt->spare_tile) g_object_unref(rt->spare_tile);
@@ -2150,7 +2150,7 @@ static void renderer_free(void *renderer)
 
 static gboolean rt_realize_cb(GtkWidget *widget, gpointer data)
 {
-       RendererTiles *rt = (RendererTiles *)data;
+       auto rt = (RendererTiles *)data;
        cairo_t *cr;
 
        if (!rt->surface)
@@ -2168,7 +2168,7 @@ static gboolean rt_realize_cb(GtkWidget *widget, gpointer data)
 
 static gboolean rt_size_allocate_cb(GtkWidget *widget,  GdkRectangle *allocation, gpointer data)
 {
-       RendererTiles *rt = static_cast<RendererTiles *>(data);
+       auto rt = static_cast<RendererTiles *>(data);
        cairo_t *cr;
        cairo_surface_t *old_surface;
 
@@ -2194,7 +2194,7 @@ static gboolean rt_size_allocate_cb(GtkWidget *widget,  GdkRectangle *allocation
 
 static gboolean rt_draw_cb(GtkWidget *UNUSED(widget), cairo_t *cr, gpointer data)
 {
-       RendererTiles *rt = (RendererTiles *)data;
+       auto rt = (RendererTiles *)data;
        GList *work;
        OverlayData *od;
 
@@ -2254,7 +2254,7 @@ static gboolean rt_draw_cb(GtkWidget *UNUSED(widget), cairo_t *cr, gpointer data
 
 RendererFuncs *renderer_tiles_new(PixbufRenderer *pr)
 {
-       RendererTiles *rt = g_new0(RendererTiles, 1);
+       auto rt = g_new0(RendererTiles, 1);
 
        rt->pr = pr;
 
index af5a7a3..cfbddf8 100644 (file)
@@ -174,7 +174,7 @@ static void command_store_populate(SarData* sar)
 
 static gboolean search_and_run_destroy(gpointer data)
 {
-       SarData *sar = static_cast<SarData *>(data);
+       auto sar = static_cast<SarData *>(data);
 
        sar->lw->sar_window = NULL;
        gtk_widget_destroy(sar->window);
@@ -184,7 +184,7 @@ static gboolean search_and_run_destroy(gpointer data)
 
 static gboolean entry_box_activate_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SarData *sar = static_cast<SarData *>(data);
+       auto sar = static_cast<SarData *>(data);
 
        if (sar->action)
                {
@@ -198,7 +198,7 @@ static gboolean entry_box_activate_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static gboolean keypress_cb(GtkWidget *UNUSED(widget), GdkEventKey *event, gpointer data)
 {
-       SarData *sar = static_cast<SarData *>(data);
+       auto sar = static_cast<SarData *>(data);
        gboolean ret = FALSE;
 
        switch (event->keyval)
@@ -219,7 +219,7 @@ static gboolean keypress_cb(GtkWidget *UNUSED(widget), GdkEventKey *event, gpoin
 
 static gboolean match_selected_cb(GtkEntryCompletion *UNUSED(widget), GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 {
-       SarData *sar = static_cast<SarData *>(data);
+       auto sar = static_cast<SarData *>(data);
 
        gtk_tree_model_get(GTK_TREE_MODEL(model), iter, SAR_ACTION, &sar->action, -1);
 
@@ -235,7 +235,7 @@ static gboolean match_selected_cb(GtkEntryCompletion *UNUSED(widget), GtkTreeMod
 
 static gboolean match_func(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer data)
 {
-       SarData *sar = static_cast<SarData *>(data);
+       auto sar = static_cast<SarData *>(data);
        gboolean ret = FALSE;
        gchar *normalized;
        GtkTreeModel *model;
index a42a0f8..e02896c 100644 (file)
@@ -341,7 +341,7 @@ void mfd_list_free(GList *list);
  * @link search_result_press_cb @endlink \n
  * @link search_window_keypress_cb @endlink \n
  * @link search_result_menu @endlink
- * 
+ *
  * See also @link hard_coded_window_keys @endlink
  **/
 
@@ -485,7 +485,7 @@ static gboolean search_result_row_selected(SearchData *sd, FileData *fd)
        work = slist;
        while (!found && work)
                {
-               GtkTreePath *tpath = static_cast<GtkTreePath *>(work->data);
+               auto tpath = static_cast<GtkTreePath *>(work->data);
                MatchFileData *mfd_n;
                GtkTreeIter iter;
 
@@ -520,7 +520,7 @@ static gint search_result_selection_util(SearchData *sd, gint64 *bytes, GList **
 
                if (bytes || list)
                        {
-                       GtkTreePath *tpath = static_cast<GtkTreePath *>(work->data);
+                       auto tpath = static_cast<GtkTreePath *>(work->data);
                        MatchFileData *mfd;
                        GtkTreeIter iter;
 
@@ -742,7 +742,7 @@ static void search_result_remove_selection(SearchData *sd)
        work = slist;
        while (work)
                {
-               GtkTreePath *tpath = static_cast<GtkTreePath *>(work->data);
+               auto tpath = static_cast<GtkTreePath *>(work->data);
                GtkTreeIter iter;
                MatchFileData *mfd;
 
@@ -757,7 +757,7 @@ static void search_result_remove_selection(SearchData *sd)
        work = flist;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
 
                search_result_remove(sd, fd);
@@ -785,7 +785,7 @@ static void search_result_collection_from_selection(SearchData *sd)
 
 static gboolean search_result_update_idle_cb(gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        search_status_update(sd);
 
@@ -805,7 +805,7 @@ static void search_result_update_idle_cancel(SearchData *sd)
 static gboolean search_result_select_cb(GtkTreeSelection *UNUSED(selection), GtkTreeModel *UNUSED(store),
                                        GtkTreePath *UNUSED(tpath), gboolean UNUSED(selected), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!sd->update_idle_id)
                {
@@ -850,7 +850,7 @@ static void search_result_thumb_do(SearchData *sd)
 
 static void search_result_thumb_done_cb(ThumbLoader *UNUSED(tl), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        search_result_thumb_do(sd);
        search_result_thumb_step(sd);
@@ -989,14 +989,14 @@ static void search_result_thumb_enable(SearchData *sd, gboolean enable)
 
 static void sr_menu_view_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (sd->click_fd) layout_set_fd(NULL, sd->click_fd);
 }
 
 static void sr_menu_viewnew_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GList *list;
 
        list = search_result_selection_list(sd);
@@ -1006,7 +1006,7 @@ static void sr_menu_viewnew_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void sr_menu_select_all_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GtkTreeSelection *selection;
 
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(sd->result_view));
@@ -1015,7 +1015,7 @@ static void sr_menu_select_all_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void sr_menu_select_none_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GtkTreeSelection *selection;
 
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(sd->result_view));
@@ -1025,7 +1025,7 @@ static void sr_menu_select_none_cb(GtkWidget *UNUSED(widget), gpointer data)
 static void sr_menu_edit_cb(GtkWidget *widget, gpointer data)
 {
        SearchData *sd;
-       const gchar *key = static_cast<const gchar *>(data);
+       auto key = static_cast<const gchar *>(data);
 
        sd = static_cast<SearchData *>(submenu_item_get_data(widget));
        if (!sd) return;
@@ -1035,7 +1035,7 @@ static void sr_menu_edit_cb(GtkWidget *widget, gpointer data)
 
 static void sr_menu_print_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        print_window_new(sd->click_fd, search_result_selection_list(sd),
                         search_result_get_filelist(sd), sd->window);
@@ -1043,28 +1043,28 @@ static void sr_menu_print_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void sr_menu_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        file_util_copy(NULL, search_result_selection_list(sd), NULL, sd->window);
 }
 
 static void sr_menu_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        file_util_move(NULL, search_result_selection_list(sd), NULL, sd->window);
 }
 
 static void sr_menu_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        file_util_rename(NULL, search_result_selection_list(sd), sd->window);
 }
 
 static void sr_menu_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        options->file_ops.safe_delete_enable = FALSE;
        file_util_delete(NULL, search_result_selection_list(sd), sd->window);
@@ -1072,7 +1072,7 @@ static void sr_menu_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void sr_menu_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        options->file_ops.safe_delete_enable = TRUE;
        file_util_delete(NULL, search_result_selection_list(sd), sd->window);
@@ -1080,38 +1080,38 @@ static void sr_menu_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void sr_menu_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        file_util_copy_path_list_to_clipboard(search_result_selection_list(sd), TRUE);
 }
 
 static void sr_menu_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        file_util_copy_path_list_to_clipboard(search_result_selection_list(sd), FALSE);
 }
 
 static void sr_menu_play_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        start_editor_from_file(options->image_l_click_video_editor, sd->click_fd);
 }
 
 static void search_result_menu_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GList *editmenu_fd_list = static_cast<GList *>(data);
+       auto editmenu_fd_list = static_cast<GList *>(data);
 
        filelist_free(editmenu_fd_list);
 }
 
 /**
  * @brief Add file selection list to a collection
- * @param[in] widget 
+ * @param[in] widget
  * @param[in] data Index to the collection list menu item selected, or -1 for new collection
- * 
- * 
+ *
+ *
  */
 static void search_pop_menu_collections_cb(GtkWidget *widget, gpointer data)
 {
@@ -1201,7 +1201,7 @@ static GtkWidget *search_result_menu(SearchData *sd, gboolean on_row, gboolean e
 
 static gboolean search_result_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GtkTreeModel *store;
        GtkTreePath *tpath;
        GtkTreeIter iter;
@@ -1268,7 +1268,7 @@ static gboolean search_result_press_cb(GtkWidget *widget, GdkEventButton *bevent
 
 static gboolean search_result_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GtkTreeModel *store;
        GtkTreePath *tpath;
        GtkTreeIter iter;
@@ -1331,7 +1331,7 @@ static gboolean search_result_release_cb(GtkWidget *widget, GdkEventButton *beve
 
 static gboolean search_result_keypress_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        gboolean stop_signal = FALSE;
        GtkTreeModel *store;
        GtkTreeSelection *selection;
@@ -1452,7 +1452,7 @@ static gboolean search_result_keypress_cb(GtkWidget *widget, GdkEventKey *event,
 
 static gboolean search_window_keypress_cb(GtkWidget *UNUSED(widget), GdkEventKey *event, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        gboolean stop_signal = FALSE;
 
        if (event->state & GDK_CONTROL_MASK)
@@ -1506,7 +1506,7 @@ static void search_dnd_data_set(GtkWidget *UNUSED(widget), GdkDragContext *UNUSE
                                GtkSelectionData *selection_data, guint UNUSED(info),
                                guint UNUSED(time), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GList *list;
 
        list = search_result_selection_list(sd);
@@ -1518,7 +1518,7 @@ static void search_dnd_data_set(GtkWidget *UNUSED(widget), GdkDragContext *UNUSE
 
 static void search_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (sd->click_fd && !search_result_row_selected(sd, sd->click_fd))
                {
@@ -1553,7 +1553,7 @@ static void search_gps_dnd_received_cb(GtkWidget *UNUSED(pane), GdkDragContext *
                                                                                GtkSelectionData *selection_data, guint info,
                                                                                guint UNUSED(time), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GList *list;
        gdouble latitude, longitude;
        FileData *fd;
@@ -1592,7 +1592,7 @@ static void search_path_entry_dnd_received_cb(GtkWidget *UNUSED(pane), GdkDragCo
                                                                                GtkSelectionData *selection_data, guint info,
                                                                                guint UNUSED(time), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GList *list;
        FileData *fd;
 
@@ -1621,7 +1621,7 @@ static void search_image_content_dnd_received_cb(GtkWidget *UNUSED(pane), GdkDra
                                                                                GtkSelectionData *selection_data, guint info,
                                                                                guint UNUSED(time), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GList *list;
        FileData *fd;
 
@@ -1698,7 +1698,7 @@ static void search_buffer_flush(SearchData *sd)
        work = g_list_last(sd->search_buffer_list);
        while (work)
                {
-               MatchFileData *mfd = static_cast<MatchFileData *>(work->data);
+               auto mfd = static_cast<MatchFileData *>(work->data);
                work = work->prev;
 
                search_result_append(sd, mfd);
@@ -1808,7 +1808,7 @@ static void search_file_load_process(SearchData *sd, CacheData *cd)
 
 static void search_file_load_done_cb(ImageLoader *UNUSED(il), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        search_file_load_process(sd, sd->img_cd);
 }
 
@@ -2443,7 +2443,7 @@ static gboolean search_file_next(SearchData *sd)
 
 static gboolean search_step_cb(gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        FileData *fd;
 
        if (sd->search_buffer_count > SEARCH_BUFFER_FLUSH_SIZE)
@@ -2554,7 +2554,7 @@ static gboolean search_step_cb(gpointer data)
 
 static void search_similarity_load_done_cb(ImageLoader *UNUSED(il), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        search_file_load_process(sd, sd->search_similarity_cd);
 }
 
@@ -2661,7 +2661,7 @@ static void search_start(SearchData *sd)
 
 static void search_start_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        GtkTreeViewColumn *column;
        gchar *path;
        gchar *entry_text;
@@ -2829,7 +2829,7 @@ enum {
 
 static void search_thumb_toggle_cb(GtkWidget *button, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        search_result_thumb_enable(sd, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)));
 }
@@ -2952,7 +2952,7 @@ static gboolean menu_choice_get_match_type(GtkWidget *combo, MatchType *type)
 
 static void menu_choice_path_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->search_type)) return;
 
@@ -2963,14 +2963,14 @@ static void menu_choice_path_cb(GtkWidget *combo, gpointer data)
 
 static void menu_choice_name_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_name)) return;
 }
 
 static void menu_choice_size_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_size)) return;
 
@@ -2980,7 +2980,7 @@ static void menu_choice_size_cb(GtkWidget *combo, gpointer data)
 
 static void menu_choice_rating_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_rating)) return;
 
@@ -2990,21 +2990,21 @@ static void menu_choice_rating_cb(GtkWidget *combo, gpointer data)
 
 static void menu_choice_class_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_class)) return;
 }
 
 static void menu_choice_marks_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_marks)) return;
 }
 
 static void menu_choice_date_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_date)) return;
 
@@ -3014,7 +3014,7 @@ static void menu_choice_date_cb(GtkWidget *combo, gpointer data)
 
 static void menu_choice_dimensions_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_dimensions)) return;
 
@@ -3024,28 +3024,28 @@ static void menu_choice_dimensions_cb(GtkWidget *combo, gpointer data)
 
 static void menu_choice_keyword_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_keywords)) return;
 }
 
 static void menu_choice_comment_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_comment)) return;
 }
 
 static void menu_choice_spin_cb(GtkAdjustment *adjustment, gpointer data)
 {
-       gint *value = static_cast<gint *>(data);
+       auto value = static_cast<gint *>(data);
 
        *value = (gint)gtk_adjustment_get_value(adjustment);
 }
 
 static void menu_choice_gps_cb(GtkWidget *combo, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!menu_choice_get_match_type(combo, &sd->match_gps)) return;
 
@@ -3072,7 +3072,7 @@ static GtkWidget *menu_spin(GtkWidget *box, gdouble min, gdouble max, gint value
 
 static void menu_choice_check_cb(GtkWidget *button, gpointer data)
 {
-       GtkWidget *widget = static_cast<GtkWidget *>(data);
+       auto widget = static_cast<GtkWidget *>(data);
        gboolean active;
        gboolean *value;
 
@@ -3183,7 +3183,7 @@ static void search_window_close(SearchData *sd)
 
 static void search_window_close_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        search_window_close(sd);
 }
@@ -3195,7 +3195,7 @@ static void search_window_help_cb(GtkWidget *UNUSED(widget), gpointer UNUSED(dat
 
 static gboolean search_window_delete_cb(GtkWidget *UNUSED(widget), GdkEventAny *UNUSED(event), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        search_window_close(sd);
        return TRUE;
@@ -3203,7 +3203,7 @@ static gboolean search_window_delete_cb(GtkWidget *UNUSED(widget), GdkEventAny *
 
 static void search_window_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        search_window_list = g_list_remove(search_window_list, sd);
 
@@ -3242,7 +3242,7 @@ static void select_collection_dialog_close_cb(FileDialog *fdlg, gpointer UNUSED(
 
 static void select_collection_dialog_ok_cb(FileDialog *fdlg, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        gchar *path;
        gchar *path_noext;
        gchar *collection;
@@ -3261,7 +3261,7 @@ static void select_collection_dialog_ok_cb(FileDialog *fdlg, gpointer data)
 
 static void select_collection_clicked_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
        FileDialog *fdlg;
        const gchar *title;
        const gchar *btntext;
@@ -3786,7 +3786,7 @@ static void search_result_change_path(SearchData *sd, FileData *fd)
 
 static void search_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       SearchData *sd = static_cast<SearchData *>(data);
+       auto sd = static_cast<SearchData *>(data);
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
 
@@ -3813,7 +3813,7 @@ void mfd_list_free(GList *list)
        work = list;
        while (work)
                {
-               MatchFileData *mfd = static_cast<MatchFileData *>(work->data);
+               auto mfd = static_cast<MatchFileData *>(work->data);
                file_data_unref((FileData *)mfd->fd);
                work = work->next;
                }
index d2228ff..e72a6d7 100644 (file)
@@ -46,7 +46,7 @@ struct _ShortcutsData
 
 static void shortcuts_bookmark_select(const gchar *path, gpointer data)
 {
-       ShortcutsData *scd = static_cast<ShortcutsData *>(data);
+       auto scd = static_cast<ShortcutsData *>(data);
 
        if (file_extension_match(path, GQ_COLLECTION_EXT))
                {
@@ -68,7 +68,7 @@ static void shortcuts_add_close(ShortcutsData *scd)
 
 static void shortcuts_add_ok_cb(FileDialog *fd, gpointer data)
 {
-       ShortcutsData *scd = static_cast<ShortcutsData *>(data);
+       auto scd = static_cast<ShortcutsData *>(data);
        const gchar *name = gtk_entry_get_text(GTK_ENTRY(scd->dialog_name_entry));
        gboolean empty_name = (name[0] == '\0');
 
@@ -86,14 +86,14 @@ static void shortcuts_add_ok_cb(FileDialog *fd, gpointer data)
 
 static void shortcuts_add_cancel_cb(FileDialog *UNUSED(fd), gpointer data)
 {
-       ShortcutsData *scd = static_cast<ShortcutsData *>(data);
+       auto scd = static_cast<ShortcutsData *>(data);
 
        shortcuts_add_close(scd);
 }
 
 static void shortcuts_add_cb(GtkWidget *button, gpointer data)
 {
-       ShortcutsData *scd = static_cast<ShortcutsData *>(data);
+       auto scd = static_cast<ShortcutsData *>(data);
        GtkWidget *hbox;
        const gchar *title;
 
@@ -127,7 +127,7 @@ static void shortcuts_add_cb(GtkWidget *button, gpointer data)
 
 static void shortcuts_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ShortcutsData *scd = static_cast<ShortcutsData *>(data);
+       auto scd = static_cast<ShortcutsData *>(data);
 
        shortcuts_add_close(scd);
 
index 9c9a3d7..9d9fdb6 100644 (file)
@@ -69,7 +69,7 @@ void image_sim_alternate_set(gboolean enable)
 
 ImageSimilarityData *image_sim_new(void)
 {
-       ImageSimilarityData *sd = g_new0(ImageSimilarityData, 1);
+       auto sd = g_new0(ImageSimilarityData, 1);
 
        return sd;
 }
@@ -81,8 +81,8 @@ void image_sim_free(ImageSimilarityData *sd)
 
 static gint image_sim_channel_eq_sort_cb(gconstpointer a, gconstpointer b)
 {
-       gint *pa = static_cast<gint *>((gpointer)a);
-       gint *pb = static_cast<gint *>((gpointer)b);
+       auto pa = static_cast<gint *>((gpointer)a);
+       auto pb = static_cast<gint *>((gpointer)b);
        if (pa[1] < pb[1]) return -1;
        if (pa[1] > pb[1]) return 1;
        return 0;
index 2ffd3d1..f6d0517 100644 (file)
@@ -305,7 +305,7 @@ static void slideshow_timer_reset(SlideShowData *ss);
 
 static gboolean slideshow_loop_cb(gpointer data)
 {
-       SlideShowData *ss = static_cast<SlideShowData *>(data);
+       auto ss = static_cast<SlideShowData *>(data);
 
        if (ss->paused) return TRUE;
 
index e18eb00..cc6ad4d 100644 (file)
@@ -666,7 +666,7 @@ static gboolean thumb_loader_std_next_source(ThumbLoaderStd *tl, gboolean remove
 
 static void thumb_loader_std_done_cb(ImageLoader *il, gpointer data)
 {
-       ThumbLoaderStd *tl = static_cast<ThumbLoaderStd *>(data);
+       auto tl = static_cast<ThumbLoaderStd *>(data);
        GdkPixbuf *pixbuf;
 
        DEBUG_1("thumb image done: %s", tl->fd ? tl->fd->path : "???");
@@ -701,7 +701,7 @@ static void thumb_loader_std_done_cb(ImageLoader *il, gpointer data)
 
 static void thumb_loader_std_error_cb(ImageLoader *il, gpointer data)
 {
-       ThumbLoaderStd *tl = static_cast<ThumbLoaderStd *>(data);
+       auto tl = static_cast<ThumbLoaderStd *>(data);
 
        /* if at least some of the image is available, go to done */
        if (image_loader_get_pixbuf(tl->il) != NULL)
@@ -722,7 +722,7 @@ static void thumb_loader_std_error_cb(ImageLoader *il, gpointer data)
 
 static void thumb_loader_std_progress_cb(ImageLoader *UNUSED(il), gdouble percent, gpointer data)
 {
-       ThumbLoaderStd *tl = static_cast<ThumbLoaderStd *>(data);
+       auto tl = static_cast<ThumbLoaderStd *>(data);
 
        tl->progress = (gdouble)percent;
 
@@ -920,7 +920,7 @@ static void thumb_loader_std_thumb_file_validate_finish(ThumbValidate *tv, gbool
 
 static void thumb_loader_std_thumb_file_validate_done_cb(ThumbLoaderStd *UNUSED(tl), gpointer data)
 {
-       ThumbValidate *tv = static_cast<ThumbValidate *>(data);
+       auto tv = static_cast<ThumbValidate *>(data);
        GdkPixbuf *pixbuf;
        gboolean valid = FALSE;
 
@@ -978,14 +978,14 @@ static void thumb_loader_std_thumb_file_validate_done_cb(ThumbLoaderStd *UNUSED(
 
 static void thumb_loader_std_thumb_file_validate_error_cb(ThumbLoaderStd *UNUSED(tl), gpointer data)
 {
-       ThumbValidate *tv = static_cast<ThumbValidate *>(data);
+       auto tv = static_cast<ThumbValidate *>(data);
 
        thumb_loader_std_thumb_file_validate_finish(tv, FALSE);
 }
 
 static gboolean thumb_loader_std_thumb_file_validate_idle_cb(gpointer data)
 {
-       ThumbValidate *tv = static_cast<ThumbValidate *>(data);
+       auto tv = static_cast<ThumbValidate *>(data);
 
        tv->idle_id = 0;
        thumb_loader_std_thumb_file_validate_finish(tv, FALSE);
@@ -1088,7 +1088,7 @@ static gboolean thumb_std_maint_move_idle(gpointer data);
 
 static void thumb_std_maint_move_validate_cb(const gchar *UNUSED(path), gboolean UNUSED(valid), gpointer data)
 {
-       TMaintMove *tm = static_cast<TMaintMove *>(data);
+       auto tm = static_cast<TMaintMove *>(data);
        GdkPixbuf *pixbuf;
 
        /* get the original thumbnail pixbuf (unrotated, with original options)
index f32a0e9..c10b701 100644 (file)
@@ -114,7 +114,7 @@ static gboolean thumb_loader_save_thumbnail(ThumbLoader *tl, gboolean mark_failu
 
 static void thumb_loader_percent_cb(ImageLoader *UNUSED(il), gdouble percent, gpointer data)
 {
-       ThumbLoader *tl = static_cast<ThumbLoader *>(data);
+       auto tl = static_cast<ThumbLoader *>(data);
 
        tl->percent_done = percent;
 
@@ -129,7 +129,7 @@ static void thumb_loader_set_fallback(ThumbLoader *tl)
 
 static void thumb_loader_done_cb(ImageLoader *il, gpointer data)
 {
-       ThumbLoader *tl = static_cast<ThumbLoader *>(data);
+       auto tl = static_cast<ThumbLoader *>(data);
        GdkPixbuf *pixbuf;
        gint pw, ph;
        gint save;
@@ -247,7 +247,7 @@ static void thumb_loader_done_cb(ImageLoader *il, gpointer data)
 
 static void thumb_loader_error_cb(ImageLoader *il, gpointer data)
 {
-       ThumbLoader *tl = static_cast<ThumbLoader *>(data);
+       auto tl = static_cast<ThumbLoader *>(data);
 
        /* if at least some of the image is available, go to done_cb */
        if (image_loader_get_pixbuf(tl->il) != NULL)
@@ -268,7 +268,7 @@ static void thumb_loader_error_cb(ImageLoader *il, gpointer data)
 
 static gboolean thumb_loader_done_delay_cb(gpointer data)
 {
-       ThumbLoader *tl = static_cast<ThumbLoader *>(data);
+       auto tl = static_cast<ThumbLoader *>(data);
 
        tl->idle_done_id = 0;
 
index cecb045..599ee84 100644 (file)
@@ -156,12 +156,12 @@ static const UseableToolbarItems useable_toolbar_items[] = {
  * @param data Pointer to vbox list item
  * @param up Up/Down movement
  * @param single_step Move up/down one step, or to top/bottom
- * 
+ *
  */
 static void toolbar_item_move(GtkWidget *UNUSED(widget), gpointer data,
                                                                        gboolean up, gboolean single_step)
 {
-       GtkWidget *list_item = static_cast<GtkWidget *>(data);
+       auto list_item = static_cast<GtkWidget *>(data);
        GtkWidget *box;
        gint pos = 0;
 
@@ -231,7 +231,7 @@ static void toolbar_menu_popup(GtkWidget *widget)
 
 static gboolean toolbar_press_cb(GtkGesture *UNUSED(gesture), int UNUSED(n_press), double UNUSED(x), double UNUSED(y), gpointer data)
 {
-       ToolbarButtonData *button_data = static_cast<ToolbarButtonData *>(data);
+       auto button_data = static_cast<ToolbarButtonData *>(data);
 
        toolbar_menu_popup(button_data->button);
 
@@ -347,10 +347,10 @@ static void toolbarlist_add_button(const gchar *name, const gchar *label,
 
 static void toolbarlist_add_cb(GtkWidget *widget, gpointer data)
 {
-       const gchar *name = static_cast<const gchar *>(g_object_get_data(G_OBJECT(widget), "toolbar_add_name"));
-       const gchar *label = static_cast<const gchar *>(g_object_get_data(G_OBJECT(widget), "toolbar_add_label"));
-       const gchar *stock_id = static_cast<const gchar *>(g_object_get_data(G_OBJECT(widget), "toolbar_add_stock_id"));
-       ToolbarData *tbbd = static_cast<ToolbarData *>(data);
+       auto name = static_cast<const gchar *>(g_object_get_data(G_OBJECT(widget), "toolbar_add_name"));
+       auto label = static_cast<const gchar *>(g_object_get_data(G_OBJECT(widget), "toolbar_add_label"));
+       auto stock_id = static_cast<const gchar *>(g_object_get_data(G_OBJECT(widget), "toolbar_add_stock_id"));
+       auto tbbd = static_cast<ToolbarData *>(data);
 
        toolbarlist_add_button(name, label, stock_id, GTK_BOX(tbbd->vbox));
 }
@@ -366,7 +366,7 @@ static void get_desktop_data(const gchar *name, gchar **label, gchar **stock_id)
        work = editors_list;
        while (work)
                {
-               const EditorDescription *editor = static_cast<const EditorDescription *>(work->data);
+               auto editor = static_cast<const EditorDescription *>(work->data);
 
                if (g_strcmp0(name, editor->key) == 0)
                        {
@@ -384,7 +384,7 @@ static void toolbar_menu_add_popup(GtkWidget *UNUSED(widget), gpointer data)
        GtkWidget *menu;
        GList *editors_list;
        GList *work;
-       ToolbarData *toolbarlist = static_cast<ToolbarData *>(data);
+       auto toolbarlist = static_cast<ToolbarData *>(data);
        const UseableToolbarItems *list = useable_toolbar_items;
 
        menu = popup_menu_short_lived();
@@ -407,7 +407,7 @@ static void toolbar_menu_add_popup(GtkWidget *UNUSED(widget), gpointer data)
        work = editors_list;
        while (work)
                {
-               const EditorDescription *editor = static_cast<const EditorDescription *>(work->data);
+               auto editor = static_cast<const EditorDescription *>(work->data);
 
                GtkWidget *item;
                gchar *icon = g_strconcat(editor->icon, ".desktop", NULL);
@@ -427,7 +427,7 @@ static void toolbar_menu_add_popup(GtkWidget *UNUSED(widget), gpointer data)
 
 static gboolean toolbar_menu_add_cb(GtkWidget *widget, gpointer data)
 {
-       ToolbarData *toolbarlist = static_cast<ToolbarData *>(data);
+       auto toolbarlist = static_cast<ToolbarData *>(data);
 
        toolbar_menu_add_popup(widget, toolbarlist);
        return TRUE;
@@ -436,7 +436,7 @@ static gboolean toolbar_menu_add_cb(GtkWidget *widget, gpointer data)
 /**
  * @brief For each layoutwindow, clear toolbar and reload with current selection
  * @param bar Main or Status toolbar
- * 
+ *
  */
 void toolbar_apply(ToolbarType bar)
 {
@@ -454,7 +454,7 @@ void toolbar_apply(ToolbarType bar)
                work_toolbar = gtk_container_get_children(GTK_CONTAINER(toolbarlist[bar]->vbox));
                while (work_toolbar)
                        {
-                       GtkButton *button = static_cast<GtkButton *>(work_toolbar->data);
+                       auto button = static_cast<GtkButton *>(work_toolbar->data);
                        ToolbarButtonData *tbbd;
 
                        tbbd = static_cast<ToolbarButtonData *>(g_object_get_data(G_OBJECT(button),"toolbarbuttondata"));
@@ -471,10 +471,10 @@ void toolbar_apply(ToolbarType bar)
 
 /**
  * @brief Load the current toolbar items into the vbox
- * @param lw 
+ * @param lw
  * @param box The vbox displayed in the preferences Toolbar tab
  * @param bar Main or Status toolbar
- * 
+ *
  * Get the current contents of the toolbar, both menu items
  * and desktop items, and load them into the vbox
  */
@@ -484,7 +484,7 @@ static void toolbarlist_populate(LayoutWindow *lw, GtkBox *box, ToolbarType bar)
 
        while (work)
                {
-               gchar *name = static_cast<gchar *>(work->data);
+               auto name = static_cast<gchar *>(work->data);
                gchar *label;
                gchar *icon;
                work = work->next;
index 8794898..387db57 100644 (file)
@@ -198,7 +198,7 @@ static gchar *bookmark_string(const gchar *name, const gchar *path, const gchar
 
 static void bookmark_select_cb(GtkWidget *button, gpointer data)
 {
-       BookMarkData *bm = static_cast<BookMarkData *>(data);
+       auto bm = static_cast<BookMarkData *>(data);
        BookButtonData *b;
 
        b = static_cast<BookButtonData *>(g_object_get_data(G_OBJECT(button), "bookbuttondata"));
@@ -209,7 +209,7 @@ static void bookmark_select_cb(GtkWidget *button, gpointer data)
 
 static void bookmark_edit_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       BookPropData *p = static_cast<BookPropData *>(data);
+       auto p = static_cast<BookPropData *>(data);
 
        bookmark_free(p->bb);
        g_free(p);
@@ -221,7 +221,7 @@ static void bookmark_edit_cancel_cb(GenericDialog *UNUSED(gd), gpointer UNUSED(d
 
 static void bookmark_edit_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       BookPropData *p = static_cast<BookPropData *>(data);
+       auto p = static_cast<BookPropData *>(data);
        const gchar *name;
        gchar *path;
        const gchar *icon;
@@ -341,7 +341,7 @@ static void bookmark_move(BookMarkData *bm, GtkWidget *button, gint direction)
 
 static void bookmark_menu_prop_cb(GtkWidget *widget, gpointer data)
 {
-       BookMarkData *bm = static_cast<BookMarkData *>(data);
+       auto bm = static_cast<BookMarkData *>(data);
 
        if (!bm->active_button) return;
 
@@ -367,7 +367,7 @@ static void bookmark_menu_down_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void bookmark_menu_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       BookMarkData *bm = static_cast<BookMarkData *>(data);
+       auto bm = static_cast<BookMarkData *>(data);
 
        if (!bm->active_button) return;
 
@@ -408,7 +408,7 @@ static void bookmark_menu_popup(BookMarkData *bm, GtkWidget *button,
 
 static gboolean bookmark_press_cb(GtkWidget *button, GdkEventButton *event, gpointer data)
 {
-       BookMarkData *bm = static_cast<BookMarkData *>(data);
+       auto bm = static_cast<BookMarkData *>(data);
 
        if (event->button != MOUSE_BUTTON_RIGHT) return FALSE;
 
@@ -419,7 +419,7 @@ static gboolean bookmark_press_cb(GtkWidget *button, GdkEventButton *event, gpoi
 
 static gboolean bookmark_keypress_cb(GtkWidget *button, GdkEventKey *event, gpointer data)
 {
-       BookMarkData *bm = static_cast<BookMarkData *>(data);
+       auto bm = static_cast<BookMarkData *>(data);
 
        switch (event->keyval)
                {
@@ -453,7 +453,7 @@ static void bookmark_drag_set_data(GtkWidget *button,
                                   GdkDragContext *context, GtkSelectionData *selection_data,
                                   guint UNUSED(info), guint UNUSED(time), gpointer data)
 {
-       BookMarkData *bm = static_cast<BookMarkData *>(data);
+       auto bm = static_cast<BookMarkData *>(data);
        BookButtonData *b;
        GList *list = NULL;
 
@@ -721,7 +721,7 @@ static void bookmark_dnd_get_data(GtkWidget *UNUSED(widget),
                                  GtkSelectionData *selection_data, guint UNUSED(info),
                                  guint UNUSED(time), gpointer data)
 {
-       BookMarkData *bm = static_cast<BookMarkData *>(data);
+       auto bm = static_cast<BookMarkData *>(data);
        GList *list = NULL;
        GList *errors = NULL;
        GList *work;
@@ -744,7 +744,7 @@ static void bookmark_dnd_get_data(GtkWidget *UNUSED(widget),
                work = list;
                while (work)
                        {
-                       gchar *path = static_cast<gchar *>(work->data);
+                       auto path = static_cast<gchar *>(work->data);
                        gchar *buf;
 
                        work = work->next;
@@ -778,7 +778,7 @@ static void bookmark_dnd_get_data(GtkWidget *UNUSED(widget),
 
 static void bookmark_list_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       BookMarkData *bm = static_cast<BookMarkData *>(data);
+       auto bm = static_cast<BookMarkData *>(data);
 
        bookmark_widget_list = g_list_remove(bookmark_widget_list, bm);
 
@@ -946,7 +946,7 @@ struct _HistoryComboData
 
 static void history_combo_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       HistoryComboData *hc = static_cast<HistoryComboData *>(data);
+       auto hc = static_cast<HistoryComboData *>(data);
 
        g_free(hc->history_key);
        g_free(data);
index eeeb856..2a5fc5b 100644 (file)
@@ -735,7 +735,7 @@ void string_list_free(GList *list)
 GList *string_list_copy(const GList *list)
 {
        GList *new_list = NULL;
-       GList *work = (GList *) list;
+       auto work = (GList *) list;
 
        while (work)
                {
@@ -1018,7 +1018,7 @@ struct _WebData
 static void web_file_async_ready_cb(GObject *source_object, GAsyncResult *res, gpointer data)
 {
        GError *error = NULL;
-       WebData *web = static_cast<WebData *>(data);
+       auto web = static_cast<WebData *>(data);
        gchar *tmp_filename;
 
        if (!g_cancellable_is_cancelled(web->cancellable))
@@ -1045,7 +1045,7 @@ static void web_file_async_ready_cb(GObject *source_object, GAsyncResult *res, g
 
 static void web_file_progress_cb(goffset current_num_bytes, goffset total_num_bytes, gpointer data)
 {
-       WebData *web = static_cast<WebData *>(data);
+       auto web = static_cast<WebData *>(data);
 
        if (!g_cancellable_is_cancelled(web->cancellable))
                {
@@ -1055,7 +1055,7 @@ static void web_file_progress_cb(goffset current_num_bytes, goffset total_num_by
 
 static void download_web_file_cancel_button_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       WebData *web = static_cast<WebData *>(data);
+       auto web = static_cast<WebData *>(data);
 
        g_cancellable_cancel(web->cancellable);
 }
@@ -1063,7 +1063,7 @@ static void download_web_file_cancel_button_cb(GenericDialog *UNUSED(gd), gpoint
 gboolean download_web_file(const gchar *text, gboolean minimized, gpointer data)
 {
        gchar *scheme;
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        gchar *tmp_dir;
        GError *error = NULL;
        WebData *web;
index dc8a6a3..1e692ec 100644 (file)
@@ -151,7 +151,7 @@ static gboolean help_window_delete_cb(GtkWidget *widget, GdkEventAny *UNUSED(eve
 
 static void help_window_close(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GtkWidget *window = static_cast<GtkWidget *>(data);
+       auto window = static_cast<GtkWidget *>(data);
        gtk_widget_destroy(window);
 }
 
index 901364f..895144e 100644 (file)
@@ -346,7 +346,7 @@ GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean
 
 static void pref_checkbox_int_cb(GtkWidget *widget, gpointer data)
 {
-       gboolean *result = static_cast<gboolean *>(data);
+       auto result = static_cast<gboolean *>(data);
 
        *result = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 }
@@ -365,7 +365,7 @@ GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gbool
 
 static void pref_checkbox_link_sensitivity_cb(GtkWidget *button, gpointer data)
 {
-       GtkWidget *widget = static_cast<GtkWidget *>(data);
+       auto widget = static_cast<GtkWidget *>(data);
 
        gtk_widget_set_sensitive(widget, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)));
 }
@@ -535,7 +535,7 @@ GtkWidget *pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *
 
 static void pref_spin_int_cb(GtkWidget *widget, gpointer data)
 {
-       gint *var = static_cast<gint *>(data);
+       auto var = static_cast<gint *>(data);
        *var = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
 }
 
@@ -552,7 +552,7 @@ GtkWidget *pref_spin_new_int(GtkWidget *parent_box, const gchar *text, const gch
 
 static void pref_link_sensitivity_cb(GtkWidget *watch, GtkStateType UNUSED(prev_state), gpointer data)
 {
-       GtkWidget *widget = static_cast<GtkWidget *>(data);
+       auto widget = static_cast<GtkWidget *>(data);
 
        gtk_widget_set_sensitive(widget, gtk_widget_is_sensitive(watch));
 }
@@ -847,7 +847,7 @@ static void date_selection_popup_hide(DateSelection *ds)
 
 static gboolean date_selection_popup_release_cb(GtkWidget *UNUSED(widget), GdkEventButton *UNUSED(event), gpointer data)
 {
-       DateSelection *ds = static_cast<DateSelection *>(data);
+       auto ds = static_cast<DateSelection *>(data);
 
        date_selection_popup_hide(ds);
        return TRUE;
@@ -855,7 +855,7 @@ static gboolean date_selection_popup_release_cb(GtkWidget *UNUSED(widget), GdkEv
 
 static gboolean date_selection_popup_press_cb(GtkWidget *UNUSED(widget), GdkEventButton *event, gpointer data)
 {
-       DateSelection *ds = static_cast<DateSelection *>(data);
+       auto ds = static_cast<DateSelection *>(data);
        gint x, y;
        gint w, h;
        gint xr, yr;
@@ -889,7 +889,7 @@ static void date_selection_popup_sync(DateSelection *ds)
 
 static gboolean date_selection_popup_keypress_cb(GtkWidget *UNUSED(widget), GdkEventKey *event, gpointer data)
 {
-       DateSelection *ds = static_cast<DateSelection *>(data);
+       auto ds = static_cast<DateSelection *>(data);
 
        switch (event->keyval)
                {
@@ -912,14 +912,14 @@ static gboolean date_selection_popup_keypress_cb(GtkWidget *UNUSED(widget), GdkE
 
 static void date_selection_day_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DateSelection *ds = static_cast<DateSelection *>(data);
+       auto ds = static_cast<DateSelection *>(data);
 
        date_selection_popup_sync(ds);
 }
 
 static void date_selection_doubleclick_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DateSelection *ds = static_cast<DateSelection *>(data);
+       auto ds = static_cast<DateSelection *>(data);
 
        date_selection_popup_hide(ds);
 }
@@ -986,7 +986,7 @@ static void date_selection_popup(DateSelection *ds)
 
 static void date_selection_button_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DateSelection *ds = static_cast<DateSelection *>(data);
+       auto ds = static_cast<DateSelection *>(data);
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ds->button)) == (!ds->window))
                {
@@ -996,7 +996,7 @@ static void date_selection_button_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void button_size_allocate_cb(GtkWidget *button, GtkAllocation *allocation, gpointer data)
 {
-       GtkWidget *spin = static_cast<GtkWidget *>(data);
+       auto spin = static_cast<GtkWidget *>(data);
        GtkRequisition spin_requisition;
        gtk_widget_get_requisition(spin, &spin_requisition);
 
@@ -1024,7 +1024,7 @@ static void spin_increase(GtkWidget *spin, gint value)
 
 static void date_selection_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       DateSelection *ds = static_cast<DateSelection *>(data);
+       auto ds = static_cast<DateSelection *>(data);
 
        date_selection_popup_hide(ds);
 
@@ -1169,7 +1169,7 @@ static GList *pref_list_find(const gchar *group, const gchar *token)
        work = history_list_get_by_key(group);
        while (work)
                {
-               const gchar *text = static_cast<const gchar *>(work->data);
+               auto text = static_cast<const gchar *>(work->data);
 
                if (strncmp(text, token, l) == 0) return work;
 
@@ -1225,7 +1225,7 @@ static void pref_list_set(const gchar *group, const gchar *key, const gchar *mar
        work = pref_list_find(group, token);
        if (work)
                {
-               gchar *old_path = static_cast<gchar *>(work->data);
+               auto old_path = static_cast<gchar *>(work->data);
 
                if (text)
                        {
@@ -1318,7 +1318,7 @@ gboolean pref_list_int_get(const gchar *group, const gchar *key, gint *result)
 
 void pref_color_button_set_cb(GtkWidget *widget, gpointer data)
 {
-       GdkColor *color = static_cast<GdkColor *>(data);
+       auto color = static_cast<GdkColor *>(data);
 
        gtk_color_button_get_color(GTK_COLOR_BUTTON(widget), color);
 }
@@ -1423,7 +1423,7 @@ gchar *text_widget_text_pull_selected(GtkWidget *text_widget)
 
 gboolean defined_mouse_buttons(GtkWidget *UNUSED(widget), GdkEventButton *event, gpointer data)
 {
-       LayoutWindow *lw = static_cast<LayoutWindow *>(data);
+       auto lw = static_cast<LayoutWindow *>(data);
        GtkAction *action;
        gboolean ret = FALSE;
 
index 83e124d..2f1e5f2 100644 (file)
@@ -95,7 +95,7 @@ static void dest_view_delete_dlg_cancel(GenericDialog *gd, gpointer data);
 
 static void dest_free_data(GtkWidget *UNUSED(widget), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
 
        if (dd->gd)
                {
@@ -252,7 +252,7 @@ static void dest_populate(Dest_Data *dd, const gchar *path)
                        {
                        GtkTreeIter iter;
                        gchar *filepath;
-                       const gchar *name = static_cast<const gchar *>(list->data);
+                       auto name = static_cast<const gchar *>(list->data);
 
                        filepath = g_build_filename(path, name, NULL);
 
@@ -398,7 +398,7 @@ static void dest_view_store_selection(Dest_Data *dd, GtkTreeView *view)
 
 static gint dest_view_rename_cb(TreeEditData *ted, const gchar *old_name, const gchar *new_name, gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        GtkTreeModel *model;
        GtkTreeIter iter;
        gchar *buf;
@@ -466,7 +466,7 @@ static void dest_view_rename(Dest_Data *dd, GtkTreeView *view)
 
 static void dest_view_delete_dlg_cancel(GenericDialog *UNUSED(gd), gpointer data)
 {
-       DestDel_Data *dl = static_cast<DestDel_Data *>(data);
+       auto dl = static_cast<DestDel_Data *>(data);
 
        dl->dd->gd = NULL;
        g_free(dl->path);
@@ -475,7 +475,7 @@ static void dest_view_delete_dlg_cancel(GenericDialog *UNUSED(gd), gpointer data
 
 static void dest_view_delete_dlg_ok_cb(GenericDialog *gd, gpointer data)
 {
-       DestDel_Data *dl = static_cast<DestDel_Data *>(data);
+       auto dl = static_cast<DestDel_Data *>(data);
 
        if (!unlink_file(dl->path))
                {
@@ -554,31 +554,31 @@ static void dest_view_bookmark(Dest_Data *dd, GtkTreeView *view)
 
 static void dest_popup_dir_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        dest_view_rename(dd, GTK_TREE_VIEW(dd->d_view));
 }
 
 static void dest_popup_dir_bookmark_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        dest_view_bookmark(dd, GTK_TREE_VIEW(dd->d_view));
 }
 
 static void dest_popup_file_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        dest_view_rename(dd, GTK_TREE_VIEW(dd->f_view));
 }
 
 static void dest_popup_file_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        dest_view_delete(dd, GTK_TREE_VIEW(dd->f_view));
 }
 
 static void dest_popup_file_bookmark_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        dest_view_bookmark(dd, GTK_TREE_VIEW(dd->f_view));
 }
 
@@ -637,7 +637,7 @@ static gboolean dest_popup_menu(Dest_Data *dd, GtkTreeView *view,
 
 static gboolean dest_press_cb(GtkWidget *view, GdkEventButton *event, gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        GtkTreePath *tpath;
        GtkTreeViewColumn *column;
        gint cell_x, cell_y;
@@ -666,7 +666,7 @@ static gboolean dest_press_cb(GtkWidget *view, GdkEventButton *event, gpointer d
 
 static gboolean dest_keypress_cb(GtkWidget *view, GdkEventKey *event, gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
 
        switch (event->keyval)
                {
@@ -706,7 +706,7 @@ static gboolean dest_keypress_cb(GtkWidget *view, GdkEventKey *event, gpointer d
 
 static void dest_new_dir_cb(GtkWidget *widget, gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        gchar *path;
        GtkWidget *dialog_window;
 
@@ -766,7 +766,7 @@ static void dest_new_dir_cb(GtkWidget *widget, gpointer data)
 
 static void dest_select_cb(GtkTreeSelection *selection, gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        GtkTreeView *view;
        GtkTreeModel *store;
        GtkTreeIter iter;
@@ -792,7 +792,7 @@ static void dest_select_cb(GtkTreeSelection *selection, gpointer data)
 
 static void dest_activate_cb(GtkWidget *view, GtkTreePath *tpath, GtkTreeViewColumn *UNUSED(column), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        GtkTreeModel *store;
        GtkTreeIter iter;
        gchar *path;
@@ -818,14 +818,14 @@ static void dest_activate_cb(GtkWidget *view, GtkTreePath *tpath, GtkTreeViewCol
 
 static void dest_home_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
 
        dest_change_dir(dd, homedir(), (dd->f_view != NULL));
 }
 
 static void dest_show_hidden_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        gchar *buf;
 
        dd->show_hidden = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dd->hidden_button));
@@ -837,7 +837,7 @@ static void dest_show_hidden_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void dest_entry_changed_cb(GtkEditable *UNUSED(editable), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        const gchar *path;
        gchar *buf;
 
@@ -916,7 +916,7 @@ static void dest_filter_add(Dest_Data *dd, const gchar *filter, const gchar *des
        work = dd->filter_list;
        while (work)
                {
-               gchar *f = static_cast<gchar *>(work->data);
+               auto f = static_cast<gchar *>(work->data);
 
                if (strcmp(f, filter) == 0)
                        {
@@ -956,7 +956,7 @@ static void dest_filter_clear(Dest_Data *dd)
 
 static void dest_filter_changed_cb(GtkEditable *UNUSED(editable), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
        GtkWidget *entry;
        const gchar *buf;
        gchar *path;
@@ -975,7 +975,7 @@ static void dest_filter_changed_cb(GtkEditable *UNUSED(editable), gpointer data)
 
 static void dest_bookmark_select_cb(const gchar *path, gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(data);
+       auto dd = static_cast<Dest_Data *>(data);
 
        if (isdir(path))
                {
@@ -1245,7 +1245,7 @@ GtkWidget *path_selection_new_with_files(GtkWidget *entry, const gchar *path,
 void path_selection_add_select_func(GtkWidget *entry,
                                    void (*func)(const gchar *, gpointer), gpointer data)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(g_object_get_data(G_OBJECT(entry), "destination_data"));
+       auto dd = static_cast<Dest_Data *>(g_object_get_data(G_OBJECT(entry), "destination_data"));
 
        if (!dd) return;
 
@@ -1255,7 +1255,7 @@ void path_selection_add_select_func(GtkWidget *entry,
 
 void path_selection_add_filter(GtkWidget *entry, const gchar *filter, const gchar *description, gboolean set)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(g_object_get_data(G_OBJECT(entry), "destination_data"));
+       auto dd = static_cast<Dest_Data *>(g_object_get_data(G_OBJECT(entry), "destination_data"));
 
        if (!dd) return;
        if (!filter) return;
@@ -1265,7 +1265,7 @@ void path_selection_add_filter(GtkWidget *entry, const gchar *filter, const gcha
 
 void path_selection_clear_filter(GtkWidget *entry)
 {
-       Dest_Data *dd = static_cast<Dest_Data *>(g_object_get_data(G_OBJECT(entry), "destination_data"));
+       auto dd = static_cast<Dest_Data *>(g_object_get_data(G_OBJECT(entry), "destination_data"));
 
        if (!dd) return;
 
index 3911dbd..f119fd8 100644 (file)
@@ -62,7 +62,7 @@ static void spinner_increment_frame(SpinnerData *sp)
 
 static gboolean spinner_loop_cb(gpointer data)
 {
-       SpinnerData *sp = static_cast<SpinnerData *>(data);
+       auto sp = static_cast<SpinnerData *>(data);
 
        if (sp->list) spinner_increment_frame(sp);
 
@@ -93,7 +93,7 @@ static void spinner_set_timeout(SpinnerData *sp, gint interval)
 
 static void spinner_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       SpinnerData *sp = static_cast<SpinnerData *>(data);
+       auto sp = static_cast<SpinnerData *>(data);
        GList *work;
 
        spinner_set_timeout(sp, 0);
@@ -101,7 +101,7 @@ static void spinner_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
        work = sp->list;
        while (work)
                {
-               GdkPixbuf *pb = static_cast<GdkPixbuf *>(work->data);
+               auto pb = static_cast<GdkPixbuf *>(work->data);
                work = work->next;
 
                g_object_unref(pb);
index d9961e6..2f5e772 100644 (file)
@@ -153,7 +153,7 @@ static void tab_completion_read_dir(TabCompData *td, const gchar *path)
 
 static void tab_completion_destroy(GtkWidget *UNUSED(widget), gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(data);
+       auto td = static_cast<TabCompData *>(data);
 
        tab_completion_free_list(td);
        g_free(td->history_key);
@@ -208,7 +208,7 @@ static void tab_completion_emit_tab_signal(TabCompData *td)
 #ifdef TAB_COMPLETION_ENABLE_POPUP_MENU
 void tab_completion_iter_menu_items(GtkWidget *widget, gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(data);
+       auto td = static_cast<TabCompData *>(data);
        GtkWidget *child;
 
        if (!gtk_widget_get_visible(widget)) return;
@@ -235,7 +235,7 @@ void tab_completion_iter_menu_items(GtkWidget *widget, gpointer data)
 
 static gboolean tab_completion_popup_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(data);
+       auto td = static_cast<TabCompData *>(data);
 
        if (event->keyval == GDK_KEY_Tab ||
            event->keyval == GDK_KEY_BackSpace ||
@@ -270,7 +270,7 @@ static gboolean tab_completion_popup_key_press(GtkWidget *widget, GdkEventKey *e
 
 static void tab_completion_popup_cb(GtkWidget *widget, gpointer data)
 {
-       gchar *name = static_cast<gchar *>(data);
+       auto name = static_cast<gchar *>(data);
        TabCompData *td;
        gchar *buf;
 
@@ -307,7 +307,7 @@ static void tab_completion_popup_list(TabCompData *td, GList *list)
        work = list;
        while (work && count < TAB_COMP_POPUP_MAX)
                {
-               gchar *name = static_cast<gchar *>(work->data);
+               auto name = static_cast<gchar *>(work->data);
                GtkWidget *item;
 
                item = menu_item_add_simple(menu, name, G_CALLBACK(tab_completion_popup_cb), name);
@@ -452,7 +452,7 @@ static gboolean tab_completion_do(TabCompData *td)
                list = td->file_list;
                while (list)
                        {
-                       gchar *file = static_cast<gchar *>(list->data);
+                       auto file = static_cast<gchar *>(list->data);
                        if (strncmp(entry_file, file, l) == 0)
                                {
                                poss = g_list_prepend(poss, file);
@@ -464,7 +464,7 @@ static gboolean tab_completion_do(TabCompData *td)
                        {
                        if (!poss->next)
                                {
-                               gchar *file = static_cast<gchar *>(poss->data);
+                               auto file = static_cast<gchar *>(poss->data);
                                gchar *buf;
 
                                buf = g_build_filename(entry_dir, file, NULL);
@@ -479,7 +479,7 @@ static gboolean tab_completion_do(TabCompData *td)
                                {
                                gsize c = strlen(entry_file);
                                gboolean done = FALSE;
-                               gchar *test_file = static_cast<gchar *>(poss->data);
+                               auto test_file = static_cast<gchar *>(poss->data);
 
                                while (!done)
                                        {
@@ -487,7 +487,7 @@ static gboolean tab_completion_do(TabCompData *td)
                                        if (!list) done = TRUE;
                                        while (list && !done)
                                                {
-                                               gchar *file = static_cast<gchar *>(list->data);
+                                               auto file = static_cast<gchar *>(list->data);
                                                if (strlen(file) < c || strncmp(test_file, file, c) != 0)
                                                        {
                                                        done = TRUE;
@@ -532,7 +532,7 @@ static gboolean tab_completion_do(TabCompData *td)
 
 static gboolean tab_completion_key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(data);
+       auto td = static_cast<TabCompData *>(data);
        gboolean stop_signal = FALSE;
 
        switch (event->keyval)
@@ -571,7 +571,7 @@ static gboolean tab_completion_key_pressed(GtkWidget *widget, GdkEventKey *event
 static void tab_completion_button_pressed(GtkWidget *UNUSED(widget), gpointer data)
 {
        TabCompData *td;
-       GtkWidget *entry = static_cast<GtkWidget *>(data);
+       auto entry = static_cast<GtkWidget *>(data);
 
        td = static_cast<TabCompData *>(g_object_get_data(G_OBJECT(entry), "tab_completion_data"));
 
@@ -590,7 +590,7 @@ static void tab_completion_button_pressed(GtkWidget *UNUSED(widget), gpointer da
 
 static void tab_completion_button_size_allocate(GtkWidget *button, GtkAllocation *allocation, gpointer data)
 {
-       GtkWidget *parent = static_cast<GtkWidget *>(data);
+       auto parent = static_cast<GtkWidget *>(data);
        GtkAllocation parent_allocation;
        gtk_widget_get_allocation(parent, &parent_allocation);
 
@@ -694,7 +694,7 @@ GtkWidget *tab_completion_new_with_history(GtkWidget **entry, const gchar *text,
 
 const gchar *tab_completion_set_to_last_history(GtkWidget *entry)
 {
-       TabCompData *td = static_cast<TabCompData *>(g_object_get_data(G_OBJECT(entry), "tab_completion_data"));
+       auto td = static_cast<TabCompData *>(g_object_get_data(G_OBJECT(entry), "tab_completion_data"));
        const gchar *buf;
 
        if (!td || !td->has_history) return NULL;
@@ -791,7 +791,7 @@ void tab_completion_add_to_entry(GtkWidget *entry, void (*enter_func)(const gcha
 
 void tab_completion_add_tab_func(GtkWidget *entry, void (*tab_func)(const gchar *, gpointer), gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(g_object_get_data(G_OBJECT(entry), "tab_completion_data"));
+       auto td = static_cast<TabCompData *>(g_object_get_data(G_OBJECT(entry), "tab_completion_data"));
 
        if (!td) return;
 
@@ -802,7 +802,7 @@ void tab_completion_add_tab_func(GtkWidget *entry, void (*tab_func)(const gchar
 /* Add a callback function called when a new entry is appended to the list */
 void tab_completion_add_append_func(GtkWidget *entry, void (*tab_append_func)(const gchar *, gpointer, gint), gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(g_object_get_data(G_OBJECT(entry), "tab_completion_data"));
+       auto td = static_cast<TabCompData *>(g_object_get_data(G_OBJECT(entry), "tab_completion_data"));
 
        if (!td) return;
 
@@ -824,7 +824,7 @@ gchar *remove_trailing_slash(const gchar *path)
 
 static void tab_completion_select_cancel_cb(FileDialog *fd, gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(data);
+       auto td = static_cast<TabCompData *>(data);
 
        td->fd = NULL;
        file_dialog_close(fd);
@@ -832,7 +832,7 @@ static void tab_completion_select_cancel_cb(FileDialog *fd, gpointer data)
 
 static void tab_completion_select_ok_cb(FileDialog *fd, gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(data);
+       auto td = static_cast<TabCompData *>(data);
 
        gtk_entry_set_text(GTK_ENTRY(td->entry), gtk_entry_get_text(GTK_ENTRY(fd->entry)));
 
@@ -895,7 +895,7 @@ static void tab_completion_select_show(TabCompData *td)
 
 static void tab_completion_select_pressed(GtkWidget *UNUSED(widget), gpointer data)
 {
-       TabCompData *td = static_cast<TabCompData *>(data);
+       auto td = static_cast<TabCompData *>(data);
 
        tab_completion_select_show(td);
 }
index 2895ebf..3e578cf 100644 (file)
@@ -63,7 +63,7 @@ static void tree_edit_do(TreeEditData *ted)
 
 static gboolean tree_edit_click_end_cb(GtkWidget *UNUSED(widget), GdkEventButton *UNUSED(event), gpointer data)
 {
-       TreeEditData *ted = static_cast<TreeEditData *>(data);
+       auto ted = static_cast<TreeEditData *>(data);
 
        tree_edit_do(ted);
        tree_edit_close(ted);
@@ -73,7 +73,7 @@ static gboolean tree_edit_click_end_cb(GtkWidget *UNUSED(widget), GdkEventButton
 
 static gboolean tree_edit_click_cb(GtkWidget *UNUSED(widget), GdkEventButton *event, gpointer data)
 {
-       TreeEditData *ted = static_cast<TreeEditData *>(data);
+       auto ted = static_cast<TreeEditData *>(data);
        GdkWindow *window = gtk_widget_get_window(ted->window);
 
        gint x, y;
@@ -100,7 +100,7 @@ static gboolean tree_edit_click_cb(GtkWidget *UNUSED(widget), GdkEventButton *ev
 
 static gboolean tree_edit_key_press_cb(GtkWidget *UNUSED(widget), GdkEventKey *event, gpointer data)
 {
-       TreeEditData *ted = static_cast<TreeEditData *>(data);
+       auto ted = static_cast<TreeEditData *>(data);
 
        switch (event->keyval)
                {
@@ -130,7 +130,7 @@ static gboolean tree_edit_key_press_cb(GtkWidget *UNUSED(widget), GdkEventKey *e
 
 static gboolean tree_edit_by_path_idle_cb(gpointer data)
 {
-       TreeEditData *ted = static_cast<TreeEditData *>(data);
+       auto ted = static_cast<TreeEditData *>(data);
        GdkRectangle rect;
        gint x, y, w, h;        /* geometry of cell within tree */
        gint wx, wy;            /* geometry of tree from root window */
@@ -555,7 +555,7 @@ void widget_auto_scroll_stop(GtkWidget *widget)
 
 static gboolean widget_auto_scroll_cb(gpointer data)
 {
-       AutoScrollData *sd = static_cast<AutoScrollData *>(data);
+       auto sd = static_cast<AutoScrollData *>(data);
        GdkWindow *window;
        gint x, y;
        gint w, h;
index 9f8db91..0ac7222 100644 (file)
@@ -58,7 +58,7 @@ static void generic_dialog_save_window(const gchar *title, const gchar *role, gi
        work = g_list_first(dialog_windows);
        while (work)
                {
-               DialogWindow *dw = static_cast<DialogWindow *>(work->data);
+               auto dw = static_cast<DialogWindow *>(work->data);
                if (g_strcmp0(dw->title ,title) == 0 && g_strcmp0(dw->role, role) == 0)
                        {
                        dw->x = x;
@@ -70,7 +70,7 @@ static void generic_dialog_save_window(const gchar *title, const gchar *role, gi
                work = work->next;
                }
 
-       DialogWindow *dw = g_new0(DialogWindow, 1);
+       auto dw = g_new0(DialogWindow, 1);
        dw->title = g_strdup(title);
        dw->role = g_strdup(role);
        dw->x = x;
@@ -88,7 +88,7 @@ static gboolean generic_dialog_find_window(const gchar *title, const gchar *role
        work = g_list_first(dialog_windows);
        while (work)
                {
-               DialogWindow *dw = static_cast<DialogWindow *>(work->data);
+               auto dw = static_cast<DialogWindow *>(work->data);
 
                if (g_strcmp0(dw->title,title) == 0 && g_strcmp0(dw->role, role) == 0)
                        {
@@ -132,7 +132,7 @@ void generic_dialog_close(GenericDialog *gd)
 
 static void generic_dialog_click_cb(GtkWidget *widget, gpointer data)
 {
-       GenericDialog *gd = static_cast<GenericDialog *>(data);
+       auto gd = static_cast<GenericDialog *>(data);
        void (*func)(GenericDialog *, gpointer);
        gboolean auto_close;
 
@@ -145,7 +145,7 @@ static void generic_dialog_click_cb(GtkWidget *widget, gpointer data)
 
 static gboolean generic_dialog_default_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       GenericDialog *gd = static_cast<GenericDialog *>(data);
+       auto gd = static_cast<GenericDialog *>(data);
 
        if (event->keyval == GDK_KEY_Return && gtk_widget_has_focus(widget)
            && gd->default_cb)
@@ -170,7 +170,7 @@ void generic_dialog_attach_default(GenericDialog *gd, GtkWidget *widget)
 
 static gboolean generic_dialog_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       GenericDialog *gd = static_cast<GenericDialog *>(data);
+       auto gd = static_cast<GenericDialog *>(data);
        gboolean auto_close = gd->auto_close;
 
        if (event->keyval == GDK_KEY_Escape)
@@ -191,7 +191,7 @@ static gboolean generic_dialog_key_press_cb(GtkWidget *widget, GdkEventKey *even
 
 static gboolean generic_dialog_delete_cb(GtkWidget *UNUSED(w), GdkEventAny *UNUSED(event), gpointer data)
 {
-       GenericDialog *gd = static_cast<GenericDialog *>(data);
+       auto gd = static_cast<GenericDialog *>(data);
        gboolean auto_close;
 
        auto_close = gd->auto_close;
@@ -204,7 +204,7 @@ static gboolean generic_dialog_delete_cb(GtkWidget *UNUSED(w), GdkEventAny *UNUS
 
 static void generic_dialog_show_cb(GtkWidget *widget, gpointer data)
 {
-       GenericDialog *gd = static_cast<GenericDialog *>(data);
+       auto gd = static_cast<GenericDialog *>(data);
        if (gd->cancel_button)
                {
                gtk_box_reorder_child(GTK_BOX(gd->hbox), gd->cancel_button, -1);
@@ -314,7 +314,7 @@ GtkWidget *generic_dialog_add_message(GenericDialog *gd, const gchar *icon_stock
 
 void generic_dialog_windows_load_config(const gchar **attribute_names, const gchar **attribute_values)
 {
-       DialogWindow *dw =  g_new0(DialogWindow, 1);
+       auto dw =  g_new0(DialogWindow, 1);
        gchar *title = NULL;
        gchar *role = NULL;
        gint x = 0;
@@ -361,7 +361,7 @@ void generic_dialog_windows_write_config(GString *outstr, gint indent)
                work = g_list_first(dialog_windows);
                while (work)
                        {
-                       DialogWindow *dw = static_cast<DialogWindow *>(work->data);
+                       auto dw = static_cast<DialogWindow *>(work->data);
                        WRITE_NL(); WRITE_STRING("<window ");
                        write_char_option(outstr, indent + 1, "title", dw->title);
                        write_char_option(outstr, indent + 1, "role", dw->role);
@@ -532,7 +532,7 @@ struct _AppImageData
 
 static gboolean appimage_notification_close_cb(gpointer data)
 {
-       AppImageData *appimage_data = static_cast<AppImageData *>(data);
+       auto appimage_data = static_cast<AppImageData *>(data);
 
        if (appimage_data->window && gtk_window_get_opacity(GTK_WINDOW(appimage_data->window)) != 0)
                {
@@ -555,7 +555,7 @@ static gboolean appimage_notification_close_cb(gpointer data)
 
 static gboolean appimage_notification_fade_cb(gpointer data)
 {
-       AppImageData *appimage_data = static_cast<AppImageData *>(data);
+       auto appimage_data = static_cast<AppImageData *>(data);
 
        gtk_window_set_opacity(GTK_WINDOW(appimage_data->window), (gtk_window_get_opacity(GTK_WINDOW(appimage_data->window)) - 0.02));
 
@@ -571,7 +571,7 @@ static gboolean appimage_notification_fade_cb(gpointer data)
 
 static gboolean user_close_cb(GtkWidget *UNUSED(widget), GdkEvent *UNUSED(event), gpointer data)
 {
-       AppImageData *appimage_data = static_cast<AppImageData *>(data);
+       auto appimage_data = static_cast<AppImageData *>(data);
 
        g_idle_add(appimage_notification_close_cb, appimage_data);
 
@@ -620,7 +620,7 @@ static void show_notification_message(gchar *version_string_from_file, AppImageD
 #ifdef __arm__
 static void appimage_data_arm_read_line_async_ready_cb(GObject *source_object, GAsyncResult *res, gpointer data)
 {
-       AppImageData *appimage_data = static_cast<AppImageData *>(data);
+       auto appimage_data = static_cast<AppImageData *>(data);
        gsize length;
        gchar *result;
 
@@ -641,7 +641,7 @@ static void appimage_data_arm_read_line_async_ready_cb(GObject *source_object, G
 
 static void appimage_data_x86_read_line_async_ready_cb(GObject *UNUSED(source_object), GAsyncResult *res, gpointer data)
 {
-       AppImageData *appimage_data = static_cast<AppImageData *>(data);
+       auto appimage_data = static_cast<AppImageData *>(data);
        gsize length;
        gchar *result;
 
@@ -667,7 +667,7 @@ static void appimage_data_x86_read_line_async_ready_cb(GObject *UNUSED(source_ob
 
 static void appimage_notification_func(gpointer data, gpointer UNUSED(user_data))
 {
-       AppImageData *appimage_data = static_cast<AppImageData *>(data);
+       auto appimage_data = static_cast<AppImageData *>(data);
        GNetworkMonitor *net_mon;
        GSocketConnectable *geeqie_github_io;
        gboolean internet_available = FALSE;
@@ -745,14 +745,14 @@ GtkWidget *file_dialog_add_button(FileDialog *fdlg, const gchar *stock_id, const
 
 static void file_dialog_entry_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       FileDialog *fdlg = static_cast<FileDialog *>(data);
+       auto fdlg = static_cast<FileDialog *>(data);
        g_free(fdlg->dest_path);
        fdlg->dest_path = remove_trailing_slash(gtk_entry_get_text(GTK_ENTRY(fdlg->entry)));
 }
 
 static void file_dialog_entry_enter_cb(const gchar *UNUSED(path), gpointer data)
 {
-       GenericDialog *gd = static_cast<GenericDialog *>(data);
+       auto gd = static_cast<GenericDialog *>(data);
 
        file_dialog_entry_cb(NULL, data);
 
index f067d41..5545039 100644 (file)
@@ -49,12 +49,12 @@ gchar **uris_from_pathlist(GList *list)
        GList *work;
        guint i = 0;
        guint num = g_list_length(list);
-       gchar **uris = g_new0(gchar *, num + 1);
+       auto uris = g_new0(gchar *, num + 1);
 
        work = list;
        while (work)
                {
-               const gchar *path = static_cast<const gchar *>(work->data);
+               auto path = static_cast<const gchar *>(work->data);
                gchar *local_path = path_from_utf8(path);
                uris[i] = g_filename_to_uri(local_path, NULL, NULL);
                g_free(local_path);
index 27c2eec..151548c 100644 (file)
@@ -522,7 +522,7 @@ static GtkWidget *file_util_dialog_add_list(GtkWidget *box, GList *list, gboolea
 
        while (list)
                {
-               FileData *fd = static_cast<FileData *>(list->data);
+               auto fd = static_cast<FileData *>(list->data);
                GtkTreeIter iter;
                gchar *sidecars;
 
@@ -556,7 +556,7 @@ static gint file_util_perform_ci_cb(gpointer resume_data, EditorFlags flags, GLi
 
 static void file_util_resume_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        if (ud->external)
                editor_resume(ud->resume_data);
        else
@@ -565,7 +565,7 @@ static void file_util_resume_cb(GenericDialog *UNUSED(gd), gpointer data)
 
 static void file_util_abort_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        if (ud->external)
                editor_skip(ud->resume_data);
        else
@@ -576,7 +576,7 @@ static void file_util_abort_cb(GenericDialog *UNUSED(gd), gpointer data)
 
 static gint file_util_perform_ci_cb(gpointer resume_data, EditorFlags flags, GList *list, gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        gint ret = EDITOR_CB_CONTINUE;
 
        ud->resume_data = resume_data;
@@ -590,7 +590,7 @@ static gint file_util_perform_ci_cb(gpointer resume_data, EditorFlags flags, GLi
                g_string_append(msg, "\n");
                while (list)
                        {
-                       FileData *fd = static_cast<FileData *>(list->data);
+                       auto fd = static_cast<FileData *>(list->data);
 
                        g_string_append(msg, fd->path);
                        g_string_append(msg, "\n");
@@ -620,7 +620,7 @@ static gint file_util_perform_ci_cb(gpointer resume_data, EditorFlags flags, GLi
 
        while (list)  /* be careful, file_util_perform_ci_internal can pass ud->flist as list */
                {
-               FileData *fd = static_cast<FileData *>(list->data);
+               auto fd = static_cast<FileData *>(list->data);
                list = list->next;
 
                if (!EDITOR_ERRORS(flags)) /* files were successfully deleted, call the maint functions */
@@ -663,7 +663,7 @@ static gint file_util_perform_ci_cb(gpointer resume_data, EditorFlags flags, GLi
 
 static gboolean file_util_perform_ci_internal(gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
 
        if (!ud->perform_idle_id)
                {
@@ -863,7 +863,7 @@ static void file_util_perform_ci_dir(UtilityData *ud, gboolean internal, gboolea
 
 static gint file_util_perform_ci_dir_cb(gpointer UNUSED(resume_data), EditorFlags flags, GList *UNUSED(list), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        file_util_perform_ci_dir(ud, FALSE, !EDITOR_ERRORS_BUT_SKIPPED(flags));
        return EDITOR_CB_CONTINUE; /* does not matter, there was just single directory */
 }
@@ -987,14 +987,14 @@ static GdkPixbuf *file_util_get_error_icon(FileData *fd, GList *list, GtkWidget
 
 static void file_util_check_resume_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        ud->phase = UTILITY_PHASE_CHECKED;
        file_util_dialog_run(ud);
 }
 
 static void file_util_check_abort_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        ud->phase = UTILITY_PHASE_START;
        file_util_dialog_run(ud);
 }
@@ -1078,7 +1078,7 @@ void file_util_check_ci(UtilityData *ud)
 
 static void file_util_cancel_cb(GenericDialog *gd, gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
 
        generic_dialog_close(gd);
 
@@ -1090,7 +1090,7 @@ static void file_util_cancel_cb(GenericDialog *gd, gpointer data)
 
 static void file_util_discard_cb(GenericDialog *gd, gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
 
        generic_dialog_close(gd);
 
@@ -1102,7 +1102,7 @@ static void file_util_discard_cb(GenericDialog *gd, gpointer data)
 
 static void file_util_ok_cb(GenericDialog *gd, gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
 
        generic_dialog_close(gd);
 
@@ -1113,7 +1113,7 @@ static void file_util_ok_cb(GenericDialog *gd, gpointer data)
 
 static void file_util_fdlg_cancel_cb(FileDialog *fdlg, gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
 
        file_dialog_close(fdlg);
 
@@ -1156,7 +1156,7 @@ static void file_util_dest_folder_update_path(UtilityData *ud)
 
 static void file_util_fdlg_rename_cb(FileDialog *fdlg, gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        gchar *desc = NULL;
        GenericDialog *d = NULL;
 
@@ -1192,7 +1192,7 @@ static void file_util_fdlg_rename_cb(FileDialog *fdlg, gpointer data)
 
 static void file_util_fdlg_ok_cb(FileDialog *fdlg, gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
 
        file_util_dest_folder_update_path(ud);
        if (isdir(ud->dest_path)) file_dialog_sync_history(fdlg, TRUE);
@@ -1208,7 +1208,7 @@ static void file_util_fdlg_ok_cb(FileDialog *fdlg, gpointer data)
 
 static void file_util_dest_folder_entry_cb(GtkWidget *UNUSED(entry), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        file_util_dest_folder_update_path(ud);
 }
 
@@ -1429,19 +1429,19 @@ static void file_util_rename_preview_update(UtilityData *ud)
 
 static void file_util_rename_preview_entry_cb(GtkWidget *UNUSED(entry), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        file_util_rename_preview_update(ud);
 }
 
 static void file_util_rename_preview_adj_cb(GtkWidget *UNUSED(spin), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        file_util_rename_preview_update(ud);
 }
 
 static gboolean file_util_rename_idle_cb(gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
 
        file_util_rename_preview_update(ud);
 
@@ -1452,7 +1452,7 @@ static gboolean file_util_rename_idle_cb(gpointer data)
 static void file_util_rename_preview_order_cb(GtkTreeModel *UNUSED(treemodel), GtkTreePath *UNUSED(tpath),
                                              GtkTreeIter *UNUSED(iter), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
 
        if (ud->update_idle_id) return;
 
@@ -1464,7 +1464,7 @@ static gboolean file_util_preview_cb(GtkTreeSelection *UNUSED(selection), GtkTre
                                     GtkTreePath *tpath, gboolean path_currently_selected,
                                     gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        GtkTreeIter iter;
        FileData *fd = NULL;
 
@@ -1509,7 +1509,7 @@ static void box_append_safe_delete_status(GenericDialog *gd)
 
 static void file_util_details_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        if (ud->details_func && ud->sel_fd)
                {
                ud->details_func(ud, ud->sel_fd);
@@ -1808,7 +1808,7 @@ static void file_util_finalize_all(UtilityData *ud)
 
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
                if (ud->phase == UTILITY_PHASE_DONE) ud->finalize_func(fd);
                else if (ud->phase == UTILITY_PHASE_DISCARD) ud->discard_func(fd);
@@ -1942,7 +1942,7 @@ static void file_util_details_dialog_close_cb(GtkWidget *UNUSED(widget), gpointe
 
 static void file_util_details_dialog_destroy_cb(GtkWidget *widget, gpointer data)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
+       auto ud = static_cast<UtilityData *>(data);
        g_signal_handlers_disconnect_by_func(ud->gd->dialog, (gpointer)(file_util_details_dialog_close_cb), widget);
 }
 
@@ -1954,8 +1954,8 @@ static void file_util_details_dialog_ok_cb(GenericDialog *UNUSED(gd), gpointer U
 
 static void file_util_details_dialog_exclude(GenericDialog *gd, gpointer data, gboolean discard)
 {
-       UtilityData *ud = static_cast<UtilityData *>(data);
-       FileData *fd = static_cast<FileData *>(g_object_get_data(G_OBJECT(gd->dialog), "file_data"));
+       auto ud = static_cast<UtilityData *>(data);
+       auto fd = static_cast<FileData *>(g_object_get_data(G_OBJECT(gd->dialog), "file_data"));
 
        if (!fd) return;
        file_util_exclude_fd(ud, fd);
@@ -1996,7 +1996,7 @@ static gchar *file_util_details_get_message(UtilityData *ud, FileData *fd, const
 
                while (work)
                        {
-                       FileData *sfd = static_cast<FileData *>(work->data);
+                       auto sfd = static_cast<FileData *>(work->data);
                        work =work->next;
                        g_string_append_printf(message, _(" '%s'\n"), sfd->path);
                        }
@@ -2111,7 +2111,7 @@ static void file_util_write_metadata_details_dialog(UtilityData *ud, FileData *f
        i = 0;
        while (work)
                {
-               const gchar *key = static_cast<const gchar *>(work->data);
+               auto key = static_cast<const gchar *>(work->data);
                gchar *title = exif_get_description_by_key(key);
                gchar *title_f = g_strdup_printf("%s:", title);
                gchar *value = metadata_read_string(fd, key, METADATA_FORMATTED);
@@ -2162,7 +2162,7 @@ static void file_util_mark_ungrouped_files(GList *work)
 {
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                file_data_set_regroup_when_finished(fd, TRUE);
                work = work->next;
                }
@@ -2935,7 +2935,7 @@ static void file_util_create_dir_full(FileData *fd, const gchar *dest_path, GtkW
 
 static gboolean file_util_write_metadata_first_after_done(gpointer data)
 {
-       UtilityDelayData *dd = static_cast<UtilityDelayData *>(data);
+       auto dd = static_cast<UtilityDelayData *>(data);
 
        /* start the delayed operation with original arguments */
        switch (dd->type)
@@ -2958,7 +2958,7 @@ static gboolean file_util_write_metadata_first_after_done(gpointer data)
 
 static void file_util_write_metadata_first_done(gboolean success, const gchar *UNUSED(done_path), gpointer data)
 {
-       UtilityDelayData *dd = static_cast<UtilityDelayData *>(data);
+       auto dd = static_cast<UtilityDelayData *>(data);
 
        if (success)
                {
@@ -2983,7 +2983,7 @@ static gboolean file_util_write_metadata_first(UtilityType type, UtilityPhase ph
        work = flist;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                work = work->next;
 
                if (fd->change)
@@ -3116,7 +3116,7 @@ void file_util_rename_dir(FileData *source_fd, const gchar *new_path, GtkWidget
  */
 static void clipboard_get_func(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, gpointer data)
 {
-       ClipboardData *cbd = static_cast<ClipboardData *>(data);
+       auto cbd = static_cast<ClipboardData *>(data);
        gchar *file_path;
        gchar *file_path_quoted = NULL;
        gchar *file_path_uri;
@@ -3180,7 +3180,7 @@ static void clipboard_get_func(GtkClipboard *clipboard, GtkSelectionData *select
  */
 static void clipboard_clear_func(GtkClipboard *UNUSED(clipboard), gpointer data)
 {
-       ClipboardData *cbd = static_cast<ClipboardData *>(data);
+       auto cbd = static_cast<ClipboardData *>(data);
 
        string_list_free(cbd->path_list);
        g_free(cbd);
@@ -3272,7 +3272,7 @@ void file_util_copy_path_list_to_clipboard(GList *fd_list, gboolean quoted)
 
 static void new_folder_entry_activate_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       GtkDialog *dialog = static_cast<GtkDialog *>(data);
+       auto dialog = static_cast<GtkDialog *>(data);
 
        gtk_dialog_response(dialog, GTK_RESPONSE_ACCEPT);
 }
index a513a05..9dc7b66 100644 (file)
@@ -71,7 +71,7 @@ FileData *vdlist_row_by_path(ViewDir *vd, const gchar *path, gint *row)
        work = VDLIST(vd)->list;
        while (work)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                if (strcmp(fd->path, path) == 0)
                        {
                        if (row) *row = n;
@@ -344,7 +344,7 @@ gboolean vdlist_set_fd(ViewDir *vd, FileData *dir_fd)
        work = VDLIST(vd)->list;
        while (work && !found)
                {
-               FileData *fd = static_cast<FileData *>(work->data);
+               auto fd = static_cast<FileData *>(work->data);
                if (!old_path || strcmp(old_path, fd->name) == 0) found = fd;
                work = work->next;
                }
@@ -363,7 +363,7 @@ void vdlist_refresh(ViewDir *vd)
 
 gboolean vdlist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreePath *tpath;
 
        if (event->keyval != GDK_KEY_Menu) return FALSE;
@@ -396,7 +396,7 @@ gboolean vdlist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer dat
 
 gboolean vdlist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreePath *tpath;
        GtkTreeIter iter;
        FileData *fd = NULL;
@@ -430,7 +430,7 @@ gboolean vdlist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer dat
 
 void vdlist_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        vd_dnd_drop_scroll_cancel(vd);
        widget_auto_scroll_stop(vd->view);
index af0dde8..e8dec8d 100644 (file)
@@ -182,7 +182,7 @@ static void vdtree_node_free(NodeData *nd)
 
 static gboolean vdtree_dnd_drop_expand_cb(gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreeIter iter;
 
        if (vd->drop_fd && vd_find_row(vd, vd->drop_fd, &iter))
@@ -259,7 +259,7 @@ static void parts_list_free(GList *list)
        GList *work = list;
        while (work)
                {
-               PathData *pd = static_cast<PathData *>(work->data);
+               auto pd = static_cast<PathData *>(work->data);
                g_free(pd->name);
                g_free(pd);
                work = work->next;
@@ -595,7 +595,7 @@ gboolean vdtree_populate_path_by_iter(ViewDir *vd, GtkTreeIter *iter, gboolean f
        work = old;
        while (work)
                {
-               NodeData *cnd = static_cast<NodeData *>(work->data);
+               auto cnd = static_cast<NodeData *>(work->data);
                work = work->next;
 
                if (vd->click_fd == cnd->fd) vd->click_fd = NULL;
@@ -637,7 +637,7 @@ FileData *vdtree_populate_path(ViewDir *vd, FileData *target_fd, gboolean expand
        work = list;
        while (work)
                {
-               PathData *pd = static_cast<PathData *>(work->data);
+               auto pd = static_cast<PathData *>(work->data);
                if (pd->node == NULL)
                        {
                        PathData *parent_pd;
@@ -695,7 +695,7 @@ FileData *vdtree_populate_path(ViewDir *vd, FileData *target_fd, gboolean expand
        work = g_list_last(list);
        if (work)
                {
-               PathData *pd = static_cast<PathData *>(work->data);
+               auto pd = static_cast<PathData *>(work->data);
                fd = pd->node;
                }
        parts_list_free(list);
@@ -787,7 +787,7 @@ const gchar *vdtree_row_get_path(ViewDir *UNUSED(vd), gint UNUSED(row))
 
 gboolean vdtree_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreePath *tpath;
        GtkTreeIter iter;
        FileData *fd = NULL;
@@ -866,7 +866,7 @@ static gboolean vdtree_clicked_on_expander(GtkTreeView *treeview, GtkTreePath *t
 
 gboolean vdtree_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreePath *tpath;
        GtkTreeViewColumn *column;
        GtkTreeIter iter;
@@ -929,7 +929,7 @@ gboolean vdtree_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer dat
 
 static void vdtree_row_expanded(GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *tpath, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreeModel *store;
        NodeData *nd = NULL;
        FileData *fd;
@@ -955,7 +955,7 @@ static void vdtree_row_expanded(GtkTreeView *treeview, GtkTreeIter *iter, GtkTre
 
 static void vdtree_row_collapsed(GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *tpath, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreeModel *store;
        NodeData *nd = NULL;
        FileData *fd;
@@ -1026,7 +1026,7 @@ static gboolean vdtree_destroy_node_cb(GtkTreeModel *store, GtkTreePath *UNUSED(
 
 void vdtree_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreeModel *store;
 
        vdtree_dnd_drop_expand_cancel(vd);
index 1048819..58c1779 100644 (file)
@@ -40,7 +40,7 @@
 /* Folders icons to be used in tree or list directory view */
 static PixmapFolders *folder_icons_new(GtkWidget *widget)
 {
-       PixmapFolders *pf = g_new0(PixmapFolders, 1);
+       auto pf = g_new0(PixmapFolders, 1);
        GError *error = NULL;
        GdkPixbuf *icon;
        gint scale;
@@ -153,7 +153,7 @@ static void vd_notify_cb(FileData *fd, NotifyType type, gpointer data);
 
 static void vd_destroy_cb(GtkWidget *widget, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        file_data_unregister_notify_func(vd_notify_cb, vd);
 
@@ -181,7 +181,7 @@ static void vd_destroy_cb(GtkWidget *widget, gpointer data)
 
 ViewDir *vd_new(LayoutWindow *lw)
 {
-       ViewDir *vd = g_new0(ViewDir, 1);
+       auto vd = g_new0(ViewDir, 1);
 
        vd->widget = gtk_scrolled_window_new(NULL, NULL);
        gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(vd->widget), GTK_SHADOW_IN);
@@ -324,7 +324,7 @@ FileData *vd_get_fd_from_tree_path(ViewDir *vd, GtkTreeView *tview, GtkTreePath
 
 static void vd_rename_finished_cb(gboolean success, const gchar *new_path, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        if (success)
                {
                FileData *fd = file_data_new_dir(new_path);
@@ -341,7 +341,7 @@ static void vd_rename_finished_cb(gboolean success, const gchar *new_path, gpoin
 
 static gboolean vd_rename_cb(TreeEditData *td, const gchar *UNUSED(old_name), const gchar *new_name, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        FileData *fd;
        gchar *new_path;
        gchar *base;
@@ -397,7 +397,7 @@ void vd_color_set(ViewDir *vd, FileData *fd, gint color_set)
 
 void vd_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        vd_color_set(vd, vd->click_fd, FALSE);
        vd->click_fd = NULL;
@@ -417,7 +417,7 @@ void vd_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vd_drop_menu_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        const gchar *path;
        GList *list;
 
@@ -432,7 +432,7 @@ static void vd_drop_menu_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vd_drop_menu_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        const gchar *path;
        GList *list;
 
@@ -448,7 +448,7 @@ static void vd_drop_menu_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vd_drop_menu_filter_cb(GtkWidget *widget, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        const gchar *path;
        GList *list;
        const gchar *key;
@@ -487,7 +487,7 @@ GtkWidget *vd_drop_menu(ViewDir *vd, gint active)
        while (work)
                {
                GtkWidget *item;
-               const EditorDescription *editor = static_cast<const EditorDescription *>(work->data);
+               auto editor = static_cast<const EditorDescription *>(work->data);
                gchar *key;
                work = work->next;
 
@@ -513,7 +513,7 @@ GtkWidget *vd_drop_menu(ViewDir *vd, gint active)
 
 static void vd_pop_menu_up_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        gchar *path;
 
        if (!vd->dir_fd || strcmp(vd->dir_fd->path, G_DIR_SEPARATOR_S) == 0) return;
@@ -531,7 +531,7 @@ static void vd_pop_menu_up_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vd_pop_menu_slide_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        if (!vd->layout) return;
        if (!vd->click_fd) return;
@@ -544,7 +544,7 @@ static void vd_pop_menu_slide_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vd_pop_menu_slide_rec_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GList *list;
 
        if (!vd->layout) return;
@@ -581,19 +581,19 @@ static void vd_pop_menu_dupe(ViewDir *vd, gint recursive)
 
 static void vd_pop_menu_dupe_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        vd_pop_menu_dupe(vd, FALSE);
 }
 
 static void vd_pop_menu_dupe_rec_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        vd_pop_menu_dupe(vd, TRUE);
 }
 
 static void vd_pop_menu_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        if (!vd->click_fd) return;
        file_util_delete_dir(vd->click_fd, vd->widget);
@@ -601,7 +601,7 @@ static void vd_pop_menu_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vd_pop_menu_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        if (!vd->click_fd) return;
 
@@ -610,7 +610,7 @@ static void vd_pop_menu_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vd_pop_menu_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        if (!vd->click_fd) return;
 
@@ -619,22 +619,22 @@ static void vd_pop_menu_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointe
 
 static void vd_pop_submenu_dir_view_as_cb(GtkWidget *widget, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
-       DirViewType new_type = static_cast<DirViewType>(GPOINTER_TO_INT((g_object_get_data(G_OBJECT(widget), "menu_item_radio_data"))));
+       auto  new_type = static_cast<DirViewType>(GPOINTER_TO_INT((g_object_get_data(G_OBJECT(widget), "menu_item_radio_data"))));
        layout_views_set(vd->layout, new_type, vd->layout->options.file_view_type);
 }
 
 static void vd_pop_menu_refresh_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        if (vd->layout) layout_refresh(vd->layout);
 }
 
 static void vd_toggle_show_hidden_files_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        options->file_filter.show_hidden_files = !options->file_filter.show_hidden_files;
        if (vd->layout) layout_refresh(vd->layout);
@@ -642,7 +642,7 @@ static void vd_toggle_show_hidden_files_cb(GtkWidget *UNUSED(widget), gpointer d
 
 static void vd_pop_menu_new_folder_cb(gboolean success, const gchar *new_path, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        FileData *fd = NULL;
        GtkTreeIter iter;
        GtkTreePath *tpath;
@@ -677,7 +677,7 @@ static void vd_pop_menu_new_folder_cb(gboolean success, const gchar *new_path, g
 
 static void vd_pop_menu_new_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        FileData *dir_fd = NULL;
 
        switch (vd->type)
@@ -701,14 +701,14 @@ static void vd_pop_menu_new_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vd_pop_menu_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        vd_rename_by_data(vd, vd->click_fd);
 }
 
 static void vd_pop_menu_sort_ascend_cb(GtkWidget *widget, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        gboolean ascend;
 
        if (!vd) return;
@@ -878,7 +878,7 @@ static void vd_dnd_get(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context
                           GtkSelectionData *selection_data, guint info,
                           guint UNUSED(time), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GList *list;
 
        if (!vd->click_fd) return;
@@ -896,7 +896,7 @@ static void vd_dnd_get(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context
 
 static void vd_dnd_begin(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        vd_color_set(vd, vd->click_fd, TRUE);
        vd_dest_set(vd, FALSE);
@@ -904,7 +904,7 @@ static void vd_dnd_begin(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(conte
 
 static void vd_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *context, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        vd_color_set(vd, vd->click_fd, FALSE);
 
@@ -920,7 +920,7 @@ static void vd_dnd_drop_receive(GtkWidget *widget,
                                GtkSelectionData *selection_data, guint info,
                                guint UNUSED(time), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreePath *tpath;
        FileData *fd = NULL;
        GdkDragAction action = GDK_ACTION_ASK;
@@ -1037,7 +1037,7 @@ void vd_dnd_drop_scroll_cancel(ViewDir *vd)
 
 static gboolean vd_auto_scroll_idle_cb(gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GdkSeat *seat;
        GdkDevice *device;
 
@@ -1066,7 +1066,7 @@ static gboolean vd_auto_scroll_idle_cb(gpointer data)
 
 static gboolean vd_auto_scroll_notify_cb(GtkWidget *UNUSED(widget), gint UNUSED(x), gint UNUSED(y), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        if (!vd->drop_fd || vd->drop_list) return FALSE;
 
@@ -1078,7 +1078,7 @@ static gboolean vd_auto_scroll_notify_cb(GtkWidget *UNUSED(widget), gint UNUSED(
 static gboolean vd_dnd_drop_motion(GtkWidget *UNUSED(widget), GdkDragContext *context,
                                   gint x, gint y, guint time, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        vd->click_fd = NULL;
 
@@ -1106,7 +1106,7 @@ static gboolean vd_dnd_drop_motion(GtkWidget *UNUSED(widget), GdkDragContext *co
 
 static void vd_dnd_drop_leave(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), guint UNUSED(time), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
 
        if (vd->drop_fd != vd->click_fd) vd_color_set(vd, vd->drop_fd, FALSE);
 
@@ -1161,7 +1161,7 @@ void vd_dnd_init(ViewDir *vd)
 
 void vd_activate_cb(GtkTreeView *tview, GtkTreePath *tpath, GtkTreeViewColumn *UNUSED(column), gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        FileData *fd = vd_get_fd_from_tree_path(vd, tview, tpath);
 
        vd_select_row(vd, fd);
@@ -1188,7 +1188,7 @@ static GdkColor *vd_color_shifted(GtkWidget *widget)
 void vd_color_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellRenderer *cell,
                 GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        gboolean set;
 
        gtk_tree_model_get(tree_model, iter, DIR_COLUMN_COLOR, &set, -1);
@@ -1199,7 +1199,7 @@ void vd_color_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellRenderer *cell,
 
 gboolean vd_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        GtkTreePath *tpath;
        FileData *fd = NULL;
 
@@ -1234,7 +1234,7 @@ gboolean vd_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 
 gboolean vd_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        gboolean ret = FALSE;
 
        switch (vd->type)
@@ -1248,7 +1248,7 @@ gboolean vd_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 
 gboolean vd_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        gboolean ret = FALSE;
        FileData *fd;
        GtkTreePath *tpath;
@@ -1297,7 +1297,7 @@ gboolean vd_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 
 static void vd_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       ViewDir *vd = static_cast<ViewDir *>(data);
+       auto vd = static_cast<ViewDir *>(data);
        gboolean refresh;
        gchar *base;
 
index dc80025..1275546 100644 (file)
@@ -83,7 +83,7 @@ GList *vficon_pop_menu_file_list(ViewFile *vf)
 
 void vficon_pop_menu_view_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        if (!VFICON(vf)->click_fd) return;
 
@@ -103,14 +103,14 @@ void vficon_pop_menu_view_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 void vficon_pop_menu_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        file_util_rename(NULL, vf_pop_menu_file_list(vf), vf->listview);
 }
 
 void vficon_pop_menu_show_names_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vficon_toggle_filenames(vf);
 }
@@ -127,21 +127,21 @@ static void vficon_toggle_star_rating(ViewFile *vf)
 
 void vficon_pop_menu_show_star_rating_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vficon_toggle_star_rating(vf);
 }
 
 void vficon_pop_menu_refresh_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vf_refresh(vf);
 }
 
 void vficon_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vficon_selection_remove(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, NULL);
        VFICON(vf)->click_fd = NULL;
        vf->popup = NULL;
@@ -297,7 +297,7 @@ static FileData *vficon_find_data_by_coord(ViewFile *vf, gint x, gint y, GtkTree
 
 static void vficon_mark_toggled_cb(GtkCellRendererToggle *cell, gchar *path_str, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkTreeModel *store;
        GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
        GtkTreeIter row;
@@ -374,7 +374,7 @@ static void tip_hide(ViewFile *vf)
 
 static gboolean tip_schedule_cb(gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkWidget *window;
 
        if (!VFICON(vf)->tip_delay_id) return FALSE;
@@ -465,7 +465,7 @@ static void vficon_dnd_get(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(con
                           GtkSelectionData *selection_data, guint UNUSED(info),
                           guint UNUSED(time), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GList *list = NULL;
 
        if (!VFICON(vf)->click_fd) return;
@@ -488,14 +488,14 @@ static void vficon_drag_data_received(GtkWidget *UNUSED(entry_widget), GdkDragCo
                                      int x, int y, GtkSelectionData *selection,
                                      guint info, guint UNUSED(time), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        if (info == TARGET_TEXT_PLAIN) {
                FileData *fd = vficon_find_data_by_coord(vf, x, y, NULL);
 
                if (fd) {
                        /* Add keywords to file */
-                       gchar *str = (gchar *) gtk_selection_data_get_text(selection);
+                       auto str = (gchar *) gtk_selection_data_get_text(selection);
                        GList *kw_list = string_to_keywords_list(str);
 
                        metadata_append_list(fd, KEYWORD_KEY, kw_list);
@@ -507,7 +507,7 @@ static void vficon_drag_data_received(GtkWidget *UNUSED(entry_widget), GdkDragCo
 
 static void vficon_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        tip_unschedule(vf);
 
@@ -526,7 +526,7 @@ static void vficon_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointe
 
 static void vficon_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *context, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vficon_selection_remove(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, NULL);
 
@@ -632,7 +632,7 @@ static void vficon_verify_selections(ViewFile *vf)
        work = VFICON(vf)->selection;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                work = work->next;
 
                if (vficon_index_by_fd(vf, fd) >= 0) continue;
@@ -651,7 +651,7 @@ void vficon_select_all(ViewFile *vf)
        work = vf->list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                work = work->next;
 
                VFICON(vf)->selection = g_list_append(VFICON(vf)->selection, fd);
@@ -668,7 +668,7 @@ void vficon_select_none(ViewFile *vf)
        work = VFICON(vf)->selection;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                work = work->next;
 
                vficon_selection_remove(vf, fd, SELECTION_SELECTED, NULL);
@@ -687,7 +687,7 @@ void vficon_select_invert(ViewFile *vf)
        work = vf->list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                work = work->next;
 
                if (fd->selected & SELECTION_SELECTED)
@@ -767,7 +767,7 @@ static void vficon_select_region_util(ViewFile *vf, FileData *start, FileData *e
                work = g_list_find(vf->list, start);
                while (work)
                        {
-                       FileData *fd = (FileData *)work->data;
+                       auto fd = (FileData *)work->data;
                        vficon_select_util(vf, fd, select);
 
                        if (work->data != end)
@@ -823,7 +823,7 @@ guint vficon_selection_count(ViewFile *vf, gint64 *bytes)
                work = VFICON(vf)->selection;
                while (work)
                        {
-                       FileData *fd = (FileData *)work->data;
+                       auto fd = (FileData *)work->data;
                        g_assert(fd->magick == FD_MAGICK);
                        b += fd->size;
 
@@ -844,7 +844,7 @@ GList *vficon_selection_get_list(ViewFile *vf)
        work = VFICON(vf)->selection;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                g_assert(fd->magick == FD_MAGICK);
 
                list = g_list_prepend(list, file_data_ref(fd));
@@ -924,7 +924,7 @@ void vficon_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode)
        work = vf->list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                gboolean mark_val, selected;
 
                g_assert(fd->magick == FD_MAGICK);
@@ -962,7 +962,7 @@ void vficon_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode)
        work = slist;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
 
                switch (mode)
                        {
@@ -1179,7 +1179,7 @@ static gint page_height(ViewFile *vf)
 
 gboolean vficon_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gint focus_row = 0;
        gint focus_col = 0;
        FileData *fd;
@@ -1311,7 +1311,7 @@ gboolean vficon_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer dat
 
 static gboolean vficon_motion_cb(GtkWidget *UNUSED(widget), GdkEventMotion *event, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        FileData *fd;
 
        fd = vficon_find_data_by_coord(vf, (gint)event->x, (gint)event->y, NULL);
@@ -1322,7 +1322,7 @@ static gboolean vficon_motion_cb(GtkWidget *UNUSED(widget), GdkEventMotion *even
 
 gboolean vficon_press_cb(GtkWidget *UNUSED(widget), GdkEventButton *bevent, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkTreeIter iter;
        FileData *fd;
 
@@ -1367,7 +1367,7 @@ gboolean vficon_press_cb(GtkWidget *UNUSED(widget), GdkEventButton *bevent, gpoi
 
 gboolean vficon_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkTreeIter iter;
        FileData *fd = NULL;
        gboolean was_selected;
@@ -1448,7 +1448,7 @@ gboolean vficon_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer d
 
 static gboolean vficon_leave_cb(GtkWidget *UNUSED(widget), GdkEventCrossing *UNUSED(event), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        tip_unschedule(vf);
        return FALSE;
@@ -1661,7 +1661,7 @@ static void vficon_populate_at_new_size(ViewFile *vf, gint w, gint UNUSED(h), gb
 
 static void vficon_sized_cb(GtkWidget *UNUSED(widget), GtkAllocation *allocation, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vficon_populate_at_new_size(vf, allocation->width, allocation->height, FALSE);
 }
@@ -1695,7 +1695,7 @@ void vficon_thumb_progress_count(GList *list, gint *count, gint *done)
        GList *work = list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                work = work->next;
 
                if (fd->thumb_pixbuf) (*done)++;
@@ -1708,7 +1708,7 @@ void vficon_read_metadata_progress_count(GList *list, gint *count, gint *done)
        GList *work = list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                work = work->next;
 
                if (fd->metadata_in_idle_loaded) (*done)++;
@@ -1756,7 +1756,7 @@ FileData *vficon_thumb_next_fd(ViewFile *vf)
                        /** @todo (xsdg): for loop here. */
                        for (; list; list = list->next)
                                {
-                               FileData *fd = static_cast<FileData *>(list->data);
+                               auto fd = static_cast<FileData *>(list->data);
                                if (fd && !fd->thumb_pixbuf) return fd;
                                }
 
@@ -1768,7 +1768,7 @@ FileData *vficon_thumb_next_fd(ViewFile *vf)
        GList *work;
        for (work = vf->list; work; work = work->next)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
 
                // Note: This implementation differs from view-file-list.cc because sidecar files are not
                // distinct list elements here, as they are in the list view.
@@ -1817,7 +1817,7 @@ FileData *vficon_star_next_fd(ViewFile *vf)
 
                        for (; list; list = list->next)
                                {
-                               FileData *fd = static_cast<FileData *>(list->data);
+                               auto fd = static_cast<FileData *>(list->data);
                                if (fd && fd->rating == STAR_RATING_NOT_READ)
                                        {
                                        vf->stars_filedata = fd;
@@ -1840,7 +1840,7 @@ FileData *vficon_star_next_fd(ViewFile *vf)
        GList *work;
        for (work = vf->list; work; work = work->next)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
 
                if (fd && fd->rating == STAR_RATING_NOT_READ)
                        {
@@ -1874,7 +1874,7 @@ gint vficon_index_by_fd(ViewFile *vf, FileData *in_fd)
        work = vf->list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                if (fd == in_fd) return p;
                work = work->next;
                p++;
@@ -2069,7 +2069,7 @@ static void vficon_cell_data_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellR
 {
        GList *list;
        FileData *fd;
-       ColumnData *cd = (ColumnData *)data;
+       auto cd = (ColumnData *)data;
        ViewFile *vf = cd->vf;
        gchar *star_rating;
 
@@ -2235,7 +2235,7 @@ gboolean vficon_set_fd(ViewFile *vf, FileData *dir_fd)
 
 void vficon_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vf_refresh_idle_cancel(vf);
 
index 73ceb5a..bf2ea1a 100644 (file)
@@ -92,7 +92,7 @@ typedef struct {
 
 static gboolean vflist_find_row_cb(GtkTreeModel *model, GtkTreePath *UNUSED(path), GtkTreeIter *iter, gpointer data)
 {
-       ViewFileFindRowData *find = (ViewFileFindRowData *)data;
+       auto find = (ViewFileFindRowData *)data;
        FileData *fd;
        gtk_tree_model_get(model, iter, FILE_COLUMN_POINTER, &fd, -1);
        if (fd == find->fd)
@@ -167,7 +167,7 @@ static void vflist_store_clear(ViewFile *vf, gboolean unlock_files)
                filelist_read(vf->dir_fd, &files, NULL);
                while (files)
                        {
-                       FileData *fd = static_cast<FileData *>(files->data);
+                       auto fd = static_cast<FileData *>(files->data);
                        files = files->next;
                        file_data_unlock(fd);
                        file_data_unref(fd);  // undo the ref that got added in filelist_read
@@ -213,7 +213,7 @@ static void vflist_dnd_get(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(con
                           GtkSelectionData *selection_data, guint UNUSED(info),
                           guint UNUSED(time), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GList *list = NULL;
 
        if (!VFLIST(vf)->click_fd) return;
@@ -234,7 +234,7 @@ static void vflist_dnd_get(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(con
 
 static void vflist_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE);
 
@@ -254,7 +254,7 @@ static void vflist_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointe
 
 static void vflist_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *context, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
 
@@ -268,14 +268,14 @@ static void vflist_drag_data_received(GtkWidget *UNUSED(entry_widget), GdkDragCo
                                      int x, int y, GtkSelectionData *selection,
                                      guint info, guint UNUSED(time), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        if (info == TARGET_TEXT_PLAIN) {
                FileData *fd = vflist_find_data_by_coord(vf, x, y, NULL);
 
                if (fd) {
                        /* Add keywords to file */
-                       gchar *str = (gchar *) gtk_selection_data_get_text(selection);
+                       auto str = (gchar *) gtk_selection_data_get_text(selection);
                        GList *kw_list = string_to_keywords_list(str);
 
                        metadata_append_list(fd, KEYWORD_KEY, kw_list);
@@ -332,7 +332,7 @@ GList *vflist_selection_get_one(ViewFile *vf, FileData *fd)
                                GList *work = fd->sidecar_files;
                                while (work)
                                        {
-                                       FileData *sfd = (FileData *)work->data;
+                                       auto sfd = (FileData *)work->data;
                                        list = g_list_prepend(list, file_data_ref(sfd));
                                        work = work->next;
                                        }
@@ -359,7 +359,7 @@ GList *vflist_pop_menu_file_list(ViewFile *vf)
 
 void vflist_pop_menu_view_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        if (vflist_row_is_selected(vf, VFLIST(vf)->click_fd))
                {
@@ -377,7 +377,7 @@ void vflist_pop_menu_view_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 void vflist_pop_menu_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GList *list;
 
        list = vf_pop_menu_file_list(vf);
@@ -408,7 +408,7 @@ void vflist_pop_menu_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 void vflist_pop_menu_thumbs_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
        if (vf->layout)
@@ -430,7 +430,7 @@ void vflist_star_rating_set(ViewFile *vf, gboolean enable)
        work = columns;
        while (work)
                {
-               GtkTreeViewColumn *column = (GtkTreeViewColumn *)work->data;
+               auto column = (GtkTreeViewColumn *)work->data;
                gint col_idx = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_store_idx"));
                work = work->next;
 
@@ -458,7 +458,7 @@ void vflist_star_rating_set(ViewFile *vf, gboolean enable)
 
 void vflist_pop_menu_show_star_rating_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        options->show_star_rating = !options->show_star_rating;
 
@@ -470,7 +470,7 @@ void vflist_pop_menu_show_star_rating_cb(GtkWidget *UNUSED(widget), gpointer dat
 
 void vflist_pop_menu_refresh_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
        vf_refresh(vf);
@@ -479,7 +479,7 @@ void vflist_pop_menu_refresh_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 void vflist_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
        VFLIST(vf)->click_fd = NULL;
        vf->popup = NULL;
@@ -494,7 +494,7 @@ void vflist_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static gboolean vflist_row_rename_cb(TreeEditData *UNUSED(td), const gchar *old_name, const gchar *new_name, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gchar *new_path;
 
        if (!new_name || !new_name[0]) return FALSE;
@@ -523,7 +523,7 @@ static gboolean vflist_row_rename_cb(TreeEditData *UNUSED(td), const gchar *old_
 
 gboolean vflist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkTreePath *tpath;
 
        if (event->keyval != GDK_KEY_Menu) return FALSE;
@@ -552,7 +552,7 @@ gboolean vflist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer dat
 
 gboolean vflist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkTreePath *tpath;
        GtkTreeIter iter;
        FileData *fd = NULL;
@@ -636,7 +636,7 @@ gboolean vflist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer dat
 
 gboolean vflist_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkTreePath *tpath;
        GtkTreeIter iter;
        FileData *fd = NULL;
@@ -735,7 +735,7 @@ static void vflist_select_image(ViewFile *vf, FileData *sel_fd)
 
 static gboolean vflist_select_idle_cb(gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        if (!vf->layout)
                {
@@ -766,7 +766,7 @@ static void vflist_select_idle_cancel(ViewFile *vf)
 
 static gboolean vflist_select_cb(GtkTreeSelection *UNUSED(selection), GtkTreeModel *store, GtkTreePath *tpath, gboolean path_currently_selected, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkTreeIter iter;
        GtkTreePath *cursor_path;
 
@@ -794,13 +794,13 @@ static gboolean vflist_select_cb(GtkTreeSelection *UNUSED(selection), GtkTreeMod
 
 static void vflist_expand_cb(GtkTreeView *UNUSED(tree_view), GtkTreeIter *iter, GtkTreePath *UNUSED(path), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vflist_set_expanded(vf, iter, TRUE);
 }
 
 static void vflist_collapse_cb(GtkTreeView *UNUSED(tree_view), GtkTreeIter *iter, GtkTreePath *UNUSED(path), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vflist_set_expanded(vf, iter, FALSE);
 }
 
@@ -963,7 +963,7 @@ static void vflist_setup_iter_recursive(ViewFile *vf, GtkTreeStore *store, GtkTr
        while (work)
                {
                gint match;
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                gboolean done = FALSE;
 
                while (!done)
@@ -1066,7 +1066,7 @@ static void vflist_setup_iter_recursive(ViewFile *vf, GtkTreeStore *store, GtkTr
                {
                gint i;
                gint num_total = num_prepended + num_ordered;
-               gint *new_order = static_cast<gint *>(g_malloc(num_total * sizeof(gint)));
+               auto new_order = static_cast<gint *>(g_malloc(num_total * sizeof(gint)));
 
                for (i = 0; i < num_total; i++)
                        {
@@ -1096,7 +1096,7 @@ void vflist_sort_set(ViewFile *vf, SortType type, gboolean ascend)
        i = 0;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                g_hash_table_insert(fd_idx_hash, fd, GINT_TO_POINTER(i));
                i++;
                work = work->next;
@@ -1113,7 +1113,7 @@ void vflist_sort_set(ViewFile *vf, SortType type, gboolean ascend)
        i = 0;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                new_order[i] = GPOINTER_TO_INT(g_hash_table_lookup(fd_idx_hash, fd));
                i++;
                work = work->next;
@@ -1138,7 +1138,7 @@ void vflist_thumb_progress_count(GList *list, gint *count, gint *done)
        GList *work = list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                work = work->next;
 
                if (fd->thumb_pixbuf) (*done)++;
@@ -1156,7 +1156,7 @@ void vflist_read_metadata_progress_count(GList *list, gint *count, gint *done)
        GList *work = list;
        while (work)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                work = work->next;
 
                if (fd->metadata_in_idle_loaded) (*done)++;
@@ -1217,7 +1217,7 @@ FileData *vflist_thumb_next_fd(ViewFile *vf)
                GList *work = vf->list;
                while (work && !fd)
                        {
-                       FileData *fd_p = (FileData *)work->data;
+                       auto fd_p = (FileData *)work->data;
                        if (!fd_p->thumb_pixbuf)
                                fd = fd_p;
                        else
@@ -1325,7 +1325,7 @@ FileData *vflist_star_next_fd(ViewFile *vf)
 
                while (work && !fd)
                        {
-                       FileData *fd_p = (FileData *)work->data;
+                       auto fd_p = (FileData *)work->data;
 
                        if (fd_p && fd_p->rating == STAR_RATING_NOT_READ)
                                {
@@ -1367,7 +1367,7 @@ gint vflist_index_by_fd(ViewFile *vf, FileData *fd)
        work = vf->list;
        while (work)
                {
-               FileData *list_fd = (FileData *)work->data;
+               auto list_fd = (FileData *)work->data;
                if (list_fd == fd) return p;
 
                work2 = list_fd->sidecar_files;
@@ -1377,7 +1377,7 @@ gint vflist_index_by_fd(ViewFile *vf, FileData *fd)
                           it is sufficient for next/prev navigation but it should be rewritten
                           without using indexes at all
                        */
-                       FileData *sidecar_fd = static_cast<FileData *>(work2->data);
+                       auto sidecar_fd = static_cast<FileData *>(work2->data);
                        if (sidecar_fd == fd) return p;
                        work2 = work2->next;
                        }
@@ -1408,7 +1408,7 @@ static gboolean vflist_row_is_selected(ViewFile *vf, FileData *fd)
        work = slist;
        while (!found && work)
                {
-               GtkTreePath *tpath = (GtkTreePath *)work->data;
+               auto tpath = (GtkTreePath *)work->data;
                FileData *fd_n;
                GtkTreeIter iter;
 
@@ -1449,7 +1449,7 @@ guint vflist_selection_count(ViewFile *vf, gint64 *bytes)
                work = slist;
                while (work)
                        {
-                       GtkTreePath *tpath = (GtkTreePath *)work->data;
+                       auto tpath = (GtkTreePath *)work->data;
                        GtkTreeIter iter;
                        FileData *fd;
 
@@ -1483,7 +1483,7 @@ GList *vflist_selection_get_list(ViewFile *vf)
        work = slist;
        while (work)
                {
-               GtkTreePath *tpath = (GtkTreePath *)work->data;
+               auto tpath = (GtkTreePath *)work->data;
                FileData *fd;
                GtkTreeIter iter;
 
@@ -1498,7 +1498,7 @@ GList *vflist_selection_get_list(ViewFile *vf)
                        GList *work2 = fd->sidecar_files;
                        while (work2)
                                {
-                               FileData *sfd = static_cast<FileData *>(work2->data);
+                               auto sfd = static_cast<FileData *>(work2->data);
                                list = g_list_prepend(list, file_data_ref(sfd));
                                work2 = work2->next;
                                }
@@ -1525,7 +1525,7 @@ GList *vflist_selection_get_list_by_index(ViewFile *vf)
        work = slist;
        while (work)
                {
-               GtkTreePath *tpath = (GtkTreePath *)work->data;
+               auto tpath = (GtkTreePath *)work->data;
                FileData *fd;
                GtkTreeIter iter;
 
@@ -1753,7 +1753,7 @@ void vflist_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode)
        work = slist;
        while (work)
                {
-               GtkTreePath *tpath = (GtkTreePath *)work->data;
+               auto tpath = (GtkTreePath *)work->data;
                FileData *fd;
                GtkTreeIter iter;
 
@@ -1992,7 +1992,7 @@ static GdkColor *vflist_listview_color_shifted(GtkWidget *widget)
 static void vflist_listview_color_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellRenderer *cell,
                                     GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gboolean set;
 
        gtk_tree_model_get(tree_model, iter, FILE_COLUMN_COLOR, &set, -1);
@@ -2041,7 +2041,7 @@ static void vflist_listview_add_column(ViewFile *vf, gint n, const gchar *title,
 
 static void vflist_listview_mark_toggled_cb(GtkCellRendererToggle *cell, gchar *path_str, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkTreeStore *store;
        GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
        GtkTreeIter iter;
@@ -2128,7 +2128,7 @@ gboolean vflist_set_fd(ViewFile *vf, FileData *dir_fd)
 
 void vflist_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        file_data_unregister_notify_func(vf_notify_cb, vf);
 
@@ -2248,7 +2248,7 @@ void vflist_marks_set(ViewFile *vf, gboolean enable)
        work = columns;
        while (work)
                {
-               GtkTreeViewColumn *column = (GtkTreeViewColumn *)work->data;
+               auto column = (GtkTreeViewColumn *)work->data;
                gint col_idx = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_store_idx"));
                work = work->next;
 
index b97ac28..971d5e9 100644 (file)
@@ -97,7 +97,7 @@ guint vf_count(ViewFile *vf, gint64 *bytes)
                work = vf->list;
                while (work)
                        {
-                       FileData *fd = (FileData *)work->data;
+                       auto fd = (FileData *)work->data;
                        work = work->next;
 
                        b += fd->size;
@@ -115,7 +115,7 @@ GList *vf_get_list(ViewFile *vf)
        GList *work;
        for (work = vf->list; work; work = work->next)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                list = g_list_prepend(list, file_data_ref(fd));
                }
 
@@ -130,7 +130,7 @@ GList *vf_get_list(ViewFile *vf)
 
 static gboolean vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gboolean ret;
 
        switch (vf->type)
@@ -151,7 +151,7 @@ static gboolean vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer
 
 static gboolean vf_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gboolean ret;
 
        switch (vf->type)
@@ -166,7 +166,7 @@ static gboolean vf_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer
 
 static gboolean vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gboolean ret;
 
        switch (vf->type)
@@ -344,7 +344,7 @@ GList *vf_selection_get_one(ViewFile *vf, FileData *fd)
 static void vf_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
 {
        ViewFile *vf;
-       const gchar *key = static_cast<const gchar *>(data);
+       auto key = static_cast<const gchar *>(data);
 
        vf = static_cast<ViewFile *>(submenu_item_get_data(widget));
 
@@ -355,7 +355,7 @@ static void vf_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
 
 static void vf_pop_menu_view_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        switch (vf->type)
        {
@@ -366,7 +366,7 @@ static void vf_pop_menu_view_cb(GtkWidget *widget, gpointer data)
 
 static void vf_pop_menu_open_archive_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        LayoutWindow *lw_new;
        FileData *fd = NULL;
        gchar *dest_dir;
@@ -396,21 +396,21 @@ static void vf_pop_menu_open_archive_cb(GtkWidget *UNUSED(widget), gpointer data
 
 static void vf_pop_menu_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        file_util_copy(NULL, vf_pop_menu_file_list(vf), NULL, vf->listview);
 }
 
 static void vf_pop_menu_move_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        file_util_move(NULL, vf_pop_menu_file_list(vf), NULL, vf->listview);
 }
 
 static void vf_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        switch (vf->type)
        {
@@ -421,7 +421,7 @@ static void vf_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
 
 static void vf_pop_menu_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        options->file_ops.safe_delete_enable = FALSE;
        file_util_delete(NULL, vf_pop_menu_file_list(vf), vf->listview);
@@ -429,7 +429,7 @@ static void vf_pop_menu_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vf_pop_menu_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        options->file_ops.safe_delete_enable = TRUE;
        file_util_delete(NULL, vf_pop_menu_file_list(vf), vf->listview);
@@ -437,28 +437,28 @@ static void vf_pop_menu_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer dat
 
 static void vf_pop_menu_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        file_util_copy_path_list_to_clipboard(vf_pop_menu_file_list(vf), TRUE);
 }
 
 static void vf_pop_menu_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        file_util_copy_path_list_to_clipboard(vf_pop_menu_file_list(vf), FALSE);
 }
 
 static void vf_pop_menu_enable_grouping_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        file_data_disable_grouping_list(vf_pop_menu_file_list(vf), FALSE);
 }
 
 static void vf_pop_menu_duplicates_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        DupeWindow *dw;
 
        dw = dupe_window_new();
@@ -467,7 +467,7 @@ static void vf_pop_menu_duplicates_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vf_pop_menu_disable_grouping_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        file_data_disable_grouping_list(vf_pop_menu_file_list(vf), TRUE);
 }
@@ -501,7 +501,7 @@ static void vf_pop_menu_sort_cb(GtkWidget *widget, gpointer data)
 
 static void vf_pop_menu_sort_ascend_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        if (vf->layout)
                {
@@ -515,50 +515,50 @@ static void vf_pop_menu_sort_ascend_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vf_pop_menu_sel_mark_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf_mark_to_selection(vf, vf->active_mark, MTS_MODE_SET);
 }
 
 static void vf_pop_menu_sel_mark_and_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf_mark_to_selection(vf, vf->active_mark, MTS_MODE_AND);
 }
 
 static void vf_pop_menu_sel_mark_or_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf_mark_to_selection(vf, vf->active_mark, MTS_MODE_OR);
 }
 
 static void vf_pop_menu_sel_mark_minus_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf_mark_to_selection(vf, vf->active_mark, MTS_MODE_MINUS);
 }
 
 static void vf_pop_menu_set_mark_sel_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf_selection_to_mark(vf, vf->active_mark, STM_MODE_SET);
 }
 
 static void vf_pop_menu_res_mark_sel_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf_selection_to_mark(vf, vf->active_mark, STM_MODE_RESET);
 }
 
 static void vf_pop_menu_toggle_mark_sel_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf_selection_to_mark(vf, vf->active_mark, STM_MODE_TOGGLE);
 }
 
 static void vf_pop_menu_toggle_view_type_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
-       FileViewType new_type = static_cast<FileViewType>(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "menu_item_radio_data")));
+       auto vf = (ViewFile *)data;
+       auto  new_type = static_cast<FileViewType>(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "menu_item_radio_data")));
        if (!vf->layout) return;
 
        layout_views_set(vf->layout, vf->layout->options.dir_view_type, new_type);
@@ -566,7 +566,7 @@ static void vf_pop_menu_toggle_view_type_cb(GtkWidget *widget, gpointer data)
 
 static void vf_pop_menu_refresh_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        switch (vf->type)
        {
@@ -577,7 +577,7 @@ static void vf_pop_menu_refresh_cb(GtkWidget *widget, gpointer data)
 
 static void vf_popup_destroy_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        switch (vf->type)
        {
@@ -591,10 +591,10 @@ static void vf_popup_destroy_cb(GtkWidget *widget, gpointer data)
 
 /**
  * @brief Add file selection list to a collection
- * @param[in] widget 
+ * @param[in] widget
  * @param[in] data Index to the collection list menu item selected, or -1 for new collection
- * 
- * 
+ *
+ *
  */
 static void vf_pop_menu_collections_cb(GtkWidget *widget, gpointer data)
 {
@@ -808,7 +808,7 @@ gboolean vf_set_fd(ViewFile *vf, FileData *dir_fd)
 
 static void vf_destroy_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        switch (vf->type)
        {
@@ -834,7 +834,7 @@ static void vf_destroy_cb(GtkWidget *widget, gpointer data)
 
 static void vf_marks_filter_toggle_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf_refresh_idle(vf);
 }
 
@@ -849,7 +849,7 @@ struct _MarksTextEntry {
 
 static void vf_marks_tooltip_cancel_cb(GenericDialog *gd, gpointer data)
 {
-       MarksTextEntry *mte = (MarksTextEntry *)data;
+       auto mte = (MarksTextEntry *)data;
 
        g_free(mte->text_entry);
        generic_dialog_close(gd);
@@ -857,7 +857,7 @@ static void vf_marks_tooltip_cancel_cb(GenericDialog *gd, gpointer data)
 
 static void vf_marks_tooltip_ok_cb(GenericDialog *gd, gpointer data)
 {
-       MarksTextEntry *mte = (MarksTextEntry *)data;
+       auto mte = (MarksTextEntry *)data;
 
        g_free(options->marks_tooltips[mte->mark_no]);
        options->marks_tooltips[mte->mark_no] = g_strdup(gtk_entry_get_text(GTK_ENTRY(mte->edit_widget)));
@@ -871,7 +871,7 @@ static void vf_marks_tooltip_ok_cb(GenericDialog *gd, gpointer data)
 void vf_marks_filter_on_icon_press(GtkEntry *UNUSED(entry), GtkEntryIconPosition UNUSED(pos),
                                                                        GdkEvent *UNUSED(event), gpointer userdata)
 {
-       MarksTextEntry *mte = static_cast<MarksTextEntry *>(userdata);
+       auto mte = static_cast<MarksTextEntry *>(userdata);
 
        g_free(mte->text_entry);
        mte->text_entry = g_strdup("");
@@ -938,7 +938,7 @@ static gboolean vf_marks_tooltip_cb(GtkWidget *widget,
 
 static void vf_file_filter_save_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gchar *entry_text;
        gchar *remove_text = NULL;
        gchar *index_text = NULL;
@@ -997,14 +997,14 @@ static void vf_file_filter_save_cb(GtkWidget *UNUSED(widget), gpointer data)
 
 static void vf_file_filter_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vf_refresh(vf);
 }
 
 static gboolean vf_file_filter_press_cb(GtkWidget *widget, GdkEventButton *UNUSED(bevent), gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        vf->file_filter.last_selected = gtk_combo_box_get_active(GTK_COMBO_BOX(vf->file_filter.combo));
 
        gtk_widget_grab_focus(widget);
@@ -1055,7 +1055,7 @@ void vf_file_filter_set(ViewFile *vf, gboolean enable)
 
 static gboolean vf_file_filter_class_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gint i;
 
        gboolean state = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
@@ -1074,7 +1074,7 @@ static gboolean vf_file_filter_class_cb(GtkWidget *widget, gpointer data)
 
 static gboolean vf_file_filter_class_set_all_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GtkWidget *parent;
        GList *children;
        GtkWidget *child;
@@ -1146,7 +1146,7 @@ static GtkWidget *class_filter_menu (ViewFile *vf)
 
 static void case_sensitive_cb(GtkWidget *widget, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vf->file_filter.case_sensitive = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        vf_refresh(vf);
@@ -1197,7 +1197,7 @@ static GtkWidget *vf_file_filter_init(ViewFile *vf)
 
        g_signal_connect(G_OBJECT(combo_entry), "activate",
                G_CALLBACK(vf_file_filter_save_cb), vf);
-               
+
        g_signal_connect(G_OBJECT(vf->file_filter.combo), "changed",
                G_CALLBACK(vf_file_filter_cb), vf);
 
@@ -1392,7 +1392,7 @@ void vf_thumb_stop(ViewFile *vf)
 
 static void vf_thumb_common_cb(ThumbLoader *tl, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        if (vf->thumbs_filedata && vf->thumbs_loader == tl)
                {
@@ -1464,7 +1464,7 @@ static void vf_thumb_reset_all(ViewFile *vf)
 
        for (work = vf->list; work; work = work->next)
                {
-               FileData *fd = (FileData *)work->data;
+               auto fd = (FileData *)work->data;
                if (fd->thumb_pixbuf)
                        {
                        g_object_unref(fd->thumb_pixbuf);
@@ -1547,7 +1547,7 @@ static gboolean vf_star_next(ViewFile *vf)
 
 gboolean vf_stars_cb(gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        FileData *fd = vf->stars_filedata;
 
        if (fd)
@@ -1699,7 +1699,7 @@ void vf_set_layout(ViewFile *vf, LayoutWindow *layout)
 
 static gboolean vf_refresh_idle_cb(gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vf_refresh(vf);
        vf->refresh_idle_id = 0;
@@ -1735,10 +1735,10 @@ void vf_refresh_idle(ViewFile *vf)
 
 void vf_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        gboolean refresh;
 
-       NotifyType interested = static_cast<NotifyType>(NOTIFY_CHANGE | NOTIFY_REREAD | NOTIFY_GROUPING);
+       auto  interested = static_cast<NotifyType>(NOTIFY_CHANGE | NOTIFY_REREAD | NOTIFY_GROUPING);
        if (vf->marks_enabled) interested = static_cast<NotifyType>(interested | NOTIFY_MARKS | NOTIFY_METADATA);
        /** @FIXME NOTIFY_METADATA should be checked by the keyword-to-mark functions and converted to NOTIFY_MARKS only if there was a change */
 
@@ -1780,7 +1780,7 @@ void vf_notify_cb(FileData *fd, NotifyType type, gpointer data)
 static gboolean vf_read_metadata_in_idle_cb(gpointer data)
 {
        FileData *fd;
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
        GList *work;
 
        vf_thumb_status(vf, vf_read_metadata_in_idle_progress(vf), _("Loading meta..."));
@@ -1819,7 +1819,7 @@ static gboolean vf_read_metadata_in_idle_cb(gpointer data)
 
 static void vf_read_metadata_in_idle_finished_cb(gpointer data)
 {
-       ViewFile *vf = (ViewFile *)data;
+       auto vf = (ViewFile *)data;
 
        vf_thumb_status(vf, 0.0, "Loading meta...");
        vf->read_metadata_in_idle_id = 0;
index 0c1da8b..f6322d6 100644 (file)
@@ -331,7 +331,7 @@ struct _HelpSearchData {
 static void help_search_window_show_icon_press(GtkEntry *UNUSED(entry), GtkEntryIconPosition UNUSED(pos),
                                                                        GdkEvent *UNUSED(event), gpointer userdata)
 {
-       HelpSearchData *hsd = static_cast<HelpSearchData *>(userdata);
+       auto hsd = static_cast<HelpSearchData *>(userdata);
 
        g_free(hsd->text_entry);
        hsd->text_entry = g_strdup("");
@@ -340,7 +340,7 @@ static void help_search_window_show_icon_press(GtkEntry *UNUSED(entry), GtkEntry
 
 static void help_search_window_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       HelpSearchData *hsd = static_cast<HelpSearchData *>(data);
+       auto hsd = static_cast<HelpSearchData *>(data);
        gchar *search_command;
 
        search_command = g_strconcat(options->help_search_engine,
@@ -354,7 +354,7 @@ static void help_search_window_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
 
 static void help_search_window_cancel_cb(GenericDialog *UNUSED(gd), gpointer data)
 {
-       HelpSearchData *hsd = static_cast<HelpSearchData *>(data);
+       auto hsd = static_cast<HelpSearchData *>(data);
 
        g_free(hsd);
 }
index 2e3f1a6..3e58830 100644 (file)
@@ -225,7 +225,7 @@ static char *ZDParseString(const ZoneDetect *library, uint32_t *index)
         }
     }
 
-    char *const str = static_cast<char *>(malloc((size_t)(strLength + 1)));
+    auto str = static_cast<char *>(malloc((size_t)(strLength + 1)));
 
     if(str) {
 #if defined(_MSC_VER)
@@ -542,7 +542,7 @@ static int32_t* ZDPolygonToListInternal(const ZoneDetect *library, uint32_t poly
     size_t listLength = 2 * 100;
     size_t listIndex = 0;
 
-    int32_t* list = static_cast<int32_t *>(malloc(sizeof(int32_t) * listLength));
+    auto  list = static_cast<int32_t *>(malloc(sizeof(int32_t) * listLength));
     if(!list) {
         goto fail;
     }
@@ -706,7 +706,7 @@ static ZDLookupResult ZDPointInPolygon(const ZoneDetect *library, uint32_t polyg
             /* Jumped two quadrants. */
             if(windingNeedCompare) {
                 /* Check if the target is on the border */
-                const int32_t intersectLon = (int32_t)(((float)latFixedPoint - b) / a);
+                const auto  intersectLon = (int32_t)(((float)latFixedPoint - b) / a);
                 if(intersectLon >= lonFixedPoint-1 && intersectLon <= lonFixedPoint+1) {
                     if(distanceSqrMin) *distanceSqrMin = 0;
                     return ZD_LOOKUP_ON_BORDER_SEGMENT;
@@ -811,7 +811,7 @@ void ZDCloseDatabase(ZoneDetect *library)
 
 ZoneDetect *ZDOpenDatabaseFromMemory(void* buffer, size_t length)
 {
-    ZoneDetect *const library = static_cast<ZoneDetect *>(malloc(sizeof *library));
+    auto library = static_cast<ZoneDetect *>(malloc(sizeof(ZoneDetect)));
 
     if(library) {
         memset(library, 0, sizeof(*library));
@@ -845,7 +845,7 @@ fail:
 
 ZoneDetect *ZDOpenDatabase(const char *path)
 {
-    ZoneDetect *const library = static_cast<ZoneDetect *>(malloc(sizeof *library));
+    auto library = static_cast<ZoneDetect *>(malloc(sizeof(ZoneDetect)));
 
     if(library) {
         memset(library, 0, sizeof(*library));
@@ -915,14 +915,14 @@ ZoneDetectResult *ZDLookup(const ZoneDetect *library, float lat, float lon, floa
     const int32_t latFixedPoint = ZDFloatToFixedPoint(lat, 90, library->precision);
     const int32_t lonFixedPoint = ZDFloatToFixedPoint(lon, 180, library->precision);
     size_t numResults = 0;
-    uint64_t distanceSqrMin = (uint64_t)-1;
+    auto  distanceSqrMin = (uint64_t)-1;
 
     /* Iterate over all polygons */
     uint32_t bboxIndex = library->bboxOffset;
     uint32_t metadataIndex = 0;
     uint32_t polygonIndex = 0;
 
-    ZoneDetectResult *results = static_cast<ZoneDetectResult *>(malloc(sizeof *results));
+    auto results = static_cast<ZoneDetectResult *>(malloc(sizeof(ZoneDetectResult)));
     if(!results) {
         return NULL;
     }
@@ -951,7 +951,7 @@ ZoneDetectResult *ZDLookup(const ZoneDetect *library, float lat, float lon, floa
                 if(lookupResult == ZD_LOOKUP_PARSE_ERROR) {
                     break;
                 } else if(lookupResult != ZD_LOOKUP_NOT_IN_ZONE) {
-                    ZoneDetectResult *const newResults = static_cast<ZoneDetectResult *>(realloc(results, sizeof *newResults * (numResults + 2)));
+                    auto newResults = static_cast<ZoneDetectResult *>(realloc(results, sizeof(ZoneDetectResult) * (numResults + 2)));
 
                     if(newResults) {
                         results = newResults;