diff options
author | rbuj <[email protected]> | 2019-03-03 10:43:16 +0100 |
---|---|---|
committer | rbuj <[email protected]> | 2019-04-09 21:40:56 +0200 |
commit | bc48c3e4443a5d7e2fc39f1cd08dd2fbb26effb3 (patch) | |
tree | 65ffd8dbdfa5abc3cd87f18d7058fafea1173915 /logview/src/logview-log.c | |
parent | dd4c5965cd3fab114440d6b01e83153acdacd155 (diff) | |
download | mate-utils-bc48c3e4443a5d7e2fc39f1cd08dd2fbb26effb3.tar.bz2 mate-utils-bc48c3e4443a5d7e2fc39f1cd08dd2fbb26effb3.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 407f49c3..a27202de 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); @@ -758,8 +756,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; } |