diff options
author | rbuj <[email protected]> | 2019-03-03 10:43:16 +0100 |
---|---|---|
committer | Robert Antoni Buj Gelonch <[email protected]> | 2019-04-09 21:38:19 +0200 |
commit | 13a56b2801b8a562519d5c90fb038d3d4f5d0f74 (patch) | |
tree | 324069227f0c0ff75d56cdf66d2784362c719408 /logview/src/logview-log.c | |
parent | fccbbbcb04d5173ffae27fcbdabb00128c330c20 (diff) | |
download | mate-utils-13a56b2801b8a562519d5c90fb038d3d4f5d0f74.tar.bz2 mate-utils-13a56b2801b8a562519d5c90fb038d3d4f5d0f74.tar.xz |
Fix -Werror=cast-function-type with GCC 8
In addition, it removes unnecessary function type casts like:
(GDestroyNotify) g_object_unref
(GDestroyNotify) g_free
Diffstat (limited to 'logview/src/logview-log.c')
-rw-r--r-- | logview/src/logview-log.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/logview/src/logview-log.c b/logview/src/logview-log.c index 272fb463..2bd0224c 100644 --- a/logview/src/logview-log.c +++ b/logview/src/logview-log.c @@ -115,9 +115,8 @@ do_finalize (GObject *obj) } if (log->priv->days) { - g_slist_foreach (log->priv->days, - (GFunc) logview_utils_day_free, NULL); - g_slist_free (log->priv->days); + g_slist_free_full (log->priv->days, + (GDestroyNotify) logview_utils_day_free); log->priv->days = NULL; } @@ -256,8 +255,7 @@ new_lines_job_done (gpointer data) g_clear_object (&job->cancellable); - g_slist_foreach (job->new_days, (GFunc) logview_utils_day_free, NULL); - g_slist_free (job->new_days); + g_slist_free_full (job->new_days, (GDestroyNotify) logview_utils_day_free); /* drop the reference we acquired before */ g_object_unref (job->log); @@ -757,8 +755,7 @@ log_load (GIOSchedulerJob *io_job, if ((days = log_read_dates (parse_data, time (NULL))) != NULL) { log->priv->has_days = TRUE; - g_slist_foreach (days, (GFunc) logview_utils_day_free, NULL); - g_slist_free (days); + g_slist_free_full (days, (GDestroyNotify) logview_utils_day_free); } else { log->priv->has_days = FALSE; } |