From 616a4021e7f75a8b13e5250175ccec8731f789ac Mon Sep 17 00:00:00 2001 From: Bernd Jendrissek Date: Thu, 4 May 2017 02:37:00 +0200 Subject: [PATCH] Inline function. It only had one caller, a trivial one at that. --- libgeda/src/s_undo.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/libgeda/src/s_undo.c b/libgeda/src/s_undo.c index f824cb1c4..51fd06b14 100644 --- a/libgeda/src/s_undo.c +++ b/libgeda/src/s_undo.c @@ -34,7 +34,6 @@ #include #endif -static void s_undo_destroy_all(TOPLEVEL *toplevel, GList *head); static void s_undo_prune(TOPLEVEL *toplevel, PAGE *page); /*! \todo Finish function documentation!!! @@ -115,11 +114,11 @@ void s_undo_print_all(PAGE *page) * \par Function Description * */ -static void s_undo_destroy_all(TOPLEVEL *toplevel, GList *head) +void s_undo_free_all(TOPLEVEL *toplevel, PAGE *page) { GList *iter; - for (iter = head; iter != NULL; iter = iter->next) { + for (iter = page->undo_newest; iter != NULL; iter = iter->next) { UNDO *u_current = iter->data; g_free(u_current->filename); @@ -133,7 +132,9 @@ static void s_undo_destroy_all(TOPLEVEL *toplevel, GList *head) g_free(u_current); } - g_list_free(head); + g_list_free(page->undo_newest); + page->undo_newest = NULL; + page->undo_current = NULL; } /*! \todo Finish function documentation!!! @@ -264,15 +265,3 @@ void s_undo_init(PAGE *p_current) p_current->undo_newest = NULL; p_current->undo_current = NULL; } - -/*! \todo Finish function documentation!!! - * \brief - * \par Function Description - * - */ -void s_undo_free_all(TOPLEVEL *toplevel, PAGE *p_current) -{ - s_undo_destroy_all(toplevel, p_current->undo_newest); - p_current->undo_newest = NULL; - p_current->undo_current = NULL; -} -- 2.11.4.GIT