clang-tidy: modernize-use-auto
[geeqie.git] / src / filedata.cc
index 902e87b..c990c27 100644 (file)
@@ -397,12 +397,12 @@ static FileData *file_data_new(const gchar *path_utf8, struct stat *st, gboolean
 
        if (fd)
                {
-               gboolean changed;
-
                if (disable_sidecars) file_data_disable_grouping(fd, TRUE);
 
-
-               changed = file_data_check_changed_single_file(fd, st);
+#ifdef DEBUG_FILEDATA
+               gboolean changed =
+#endif
+               file_data_check_changed_single_file(fd, st);
 
                DEBUG_2("file_data_pool hit: '%s' %s", fd->path, changed ? "(changed)" : "");
 
@@ -586,7 +586,7 @@ void set_exif_time_data_unused(GList *files)
 
        while (files)
                {
-               FileData *file = static_cast<FileData *>(files->data);
+               auto *file = static_cast<FileData *>(files->data);
 
                read_exif_time_data(file);
                files = files->next;
@@ -599,7 +599,7 @@ void set_exif_time_digitized_data_unused(GList *files)
 
        while (files)
                {
-               FileData *file = static_cast<FileData *>(files->data);
+               auto *file = static_cast<FileData *>(files->data);
 
                read_exif_time_digitized_data(file);
                files = files->next;
@@ -613,7 +613,7 @@ void set_rating_data_unused(GList *files)
 
        while (files)
                {
-               FileData *file = static_cast<FileData *>(files->data);
+               auto *file = static_cast<FileData *>(files->data);
                rating_str = metadata_read_string(file, RATING_KEY, METADATA_PLAIN);
                if (rating_str )
                        {
@@ -1541,15 +1541,10 @@ void filelist_free(GList *list)
 GList *filelist_copy(GList *list)
 {
        GList *new_list = nullptr;
-       GList *work;
 
-       work = list;
-       while (work)
+       for (GList *work = list; work; work = work->next)
                {
-               FileData *fd;
-
-               fd = static_cast<FileData *>(work->data);
-               work = work->next;
+               auto fd = static_cast<FileData *>(work->data);
 
                new_list = g_list_prepend(new_list, file_data_ref(fd));
                }
@@ -2663,7 +2658,6 @@ gint file_data_verify_ci(FileData *fd, GList *list)
                        if (access_file(metadata_path, W_OK) || (!isname(metadata_path) && access_file(dest_dir, W_OK)))
                                {
                                file_data_update_ci_dest(fd, metadata_path);
-                               have_dest = TRUE;
                                }
                        else
                                {
@@ -3242,12 +3236,12 @@ gboolean file_data_unregister_notify_func(FileDataNotifyFunc func, gpointer data
 #pragma GCC diagnostic ignored "-Wunused-function"
 gboolean file_data_send_notification_idle_cb_unused(gpointer data)
 {
-       NotifyIdleData *nid = (NotifyIdleData *)data;
+       auto *nid = (NotifyIdleData *)data;
        GList *work = notify_func_list;
 
        while (work)
                {
-               NotifyData *nd = (NotifyData *)work->data;
+               auto *nd = (NotifyData *)work->data;
 
                nd->func(nid->fd, nid->type, nd->data);
                work = work->next;