From 5dad419199ca57ffbed6575768d78a31d6635ad0 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Sat, 11 Jun 2005 14:04:01 +0000 Subject: [PATCH] changed argtype of stringlist_delete from ref to handle git-archimport-id: chth@gmx.net--2004/mala-glibc--devel--0.2--patch-68 --- ChangeLog | 13 +++++++++++++ engine/engine.c | 50 +++++++++++++++++++++++++------------------------- engine/stringlist.c | 9 ++++----- engine/stringlist.h | 4 ++-- 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32949b7..fc77765 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,19 @@ # arch-tag: automatic-ChangeLog--chth@gmx.net--2004/mala-glibc--devel--0.2 # +2005-06-11 14:04:01 GMT Christian Thaeter patch-68 + + Summary: + changed argtype of stringlist_delete from ref to handle + Revision: + mala-glibc--devel--0.2--patch-68 + + + modified files: + ChangeLog engine/engine.c engine/stringlist.c + engine/stringlist.h + + 2005-06-11 13:03:35 GMT Christian Thaeter patch-67 Summary: diff --git a/engine/engine.c b/engine/engine.c index 119fea7..0b17137 100644 --- a/engine/engine.c +++ b/engine/engine.c @@ -557,13 +557,13 @@ mala_engine_literal_expansion (MalaEngine self, if (!newnode2) goto ealloc_newnode2; - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr = newnode1; return 2; ealloc_newnode2: - mala_stringlist_elem_delete (list, &newnode1); + mala_stringlist_elem_delete (list, newnode1); ealloc_newnode1: self->state = MALA_EALLOC; return MALA_EXPANSION_ERROR; @@ -586,7 +586,7 @@ mala_engine_backquote_expansion (MalaEngine self, MalaStringList list, MalaStrin if (!newnode) goto ealloc_newnode; - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr = newnode; return 1; @@ -632,7 +632,7 @@ mala_engine_numsplit_expansion (MalaEngine self, MalaStringList list, MalaString if (!nb) goto ealloc_nodeb; - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr = na; mala_string_free (a); @@ -641,7 +641,7 @@ mala_engine_numsplit_expansion (MalaEngine self, MalaStringList list, MalaString return 0; ealloc_nodeb: - mala_stringlist_elem_delete (list, &na); + mala_stringlist_elem_delete (list, na); ealloc_nodea: ealloc_str: mala_string_free (a); @@ -670,7 +670,7 @@ mala_engine_exclam_expansion (MalaEngine self, MalaStringList list, MalaStringLi if (!newnode) return self->state = MALA_EALLOC; - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr= newnode; return 1; } @@ -706,12 +706,12 @@ mala_engine_no_expansion (MalaEngine self, MalaStringList list, MalaStringListNo mala_string_free (a); mala_string_free (aa); - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr = n1; return 1; ealloc_n2: - mala_stringlist_elem_delete (list, &n1); + mala_stringlist_elem_delete (list, n1); ealloc_n1: mala_string_free (a); mala_string_free (aa); @@ -752,7 +752,7 @@ mala_engine_assign_expansion (MalaEngine self, MalaStringList list, MalaStringLi if (!nb) goto ealloc_nodeb; - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr = na; mala_string_free (a); @@ -762,7 +762,7 @@ mala_engine_assign_expansion (MalaEngine self, MalaStringList list, MalaStringLi return 0; ealloc_nodeb: - mala_stringlist_elem_delete (list, &na); + mala_stringlist_elem_delete (list, na); ealloc_nodea: ealloc_str: mala_string_free (a); @@ -846,7 +846,7 @@ mala_engine_char_expansion (MalaEngine self, MalaStringList list, MalaStringList pred = *pptr; mala_stringlist_fwd (&pred); - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr= pred; return cnt; @@ -857,7 +857,7 @@ mala_engine_char_expansion (MalaEngine self, MalaStringList list, MalaStringList { // TODO use stringlist func MalaStringListNode tmp = pred->node.cqe_prev; - mala_stringlist_elem_delete (list, &pred); + mala_stringlist_elem_delete (list, pred); pred = tmp; } self->state = MALA_EALLOC; @@ -902,7 +902,7 @@ mala_engine_underscore_expansion (MalaEngine self, MalaStringList list, MalaStri free (cstr); mala_string_free (str); - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr= node; return 0; @@ -959,14 +959,14 @@ mala_engine_setenv_expansion (MalaEngine self, MalaStringList list, MalaStringLi mala_string_free (key); mala_string_free (value); - mala_stringlist_elem_delete (list, pptr); + mala_stringlist_elem_delete (list, *pptr); *pptr = n1; return 3; ealloc_n3: - mala_stringlist_elem_delete (list, &n2); + mala_stringlist_elem_delete (list, n2); ealloc_n2: - mala_stringlist_elem_delete (list, &n1); + mala_stringlist_elem_delete (list, n1); ealloc_n1: mala_string_free (value); ealloc_value: @@ -1034,24 +1034,24 @@ mala_engine_bracket_expansion (MalaEngine self, MalaStringList list, MalaStringL mala_string_free (str1); mala_string_free (str2); - mala_stringlist_elem_delete (list, pptr); - mala_stringlist_elem_delete (list, &nitr); + mala_stringlist_elem_delete (list, *pptr); + mala_stringlist_elem_delete (list, nitr); *pptr = node; return 0; esyntax: mala_string_free (str1); - mala_stringlist_elem_delete (list, &node1); - mala_stringlist_elem_delete (list, &node); + mala_stringlist_elem_delete (list, node1); + mala_stringlist_elem_delete (list, node); self->state = MALA_ESYNTAX; return MALA_EXPANSION_ERROR; ealloc_node2: mala_string_free (str1); - mala_stringlist_elem_delete (list, &node1); + mala_stringlist_elem_delete (list, node1); ealloc_node1: - mala_stringlist_elem_delete (list, &node); + mala_stringlist_elem_delete (list, node); ealloc_node: self->state = MALA_EALLOC; return MALA_EXPANSION_ERROR; @@ -1095,9 +1095,9 @@ mala_engine_assign_contraction (MalaEngine self, goto ealloc_node; mala_string_free (str); - mala_stringlist_elem_delete (list, pptr); - mala_stringlist_elem_delete (list, &assign); - mala_stringlist_elem_delete (list, &value); + mala_stringlist_elem_delete (list, *pptr); + mala_stringlist_elem_delete (list, assign); + mala_stringlist_elem_delete (list, value); *pptr = node; return 0; diff --git a/engine/stringlist.c b/engine/stringlist.c index bc2fc0b..b8b16d9 100644 --- a/engine/stringlist.c +++ b/engine/stringlist.c @@ -172,12 +172,11 @@ mala_stringlist_elem_remove (MalaStringList head, MalaStringListNode elem) } void -mala_stringlist_elem_delete (MalaStringList head, MalaStringListNode_ref elem) +mala_stringlist_elem_delete (MalaStringList head, MalaStringListNode elem) { - mala_stringlist_elem_remove (head, *elem); - mala_string_free ((*elem)->string); - free (*elem); - *elem=NULL; + mala_stringlist_elem_remove (head, elem); + mala_string_free (elem->string); + free (elem); } void diff --git a/engine/stringlist.h b/engine/stringlist.h index 432c498..cfbd839 100644 --- a/engine/stringlist.h +++ b/engine/stringlist.h @@ -112,7 +112,7 @@ mala_stringlist_elem_remove (MalaStringList head, MalaStringListNode elem); void -mala_stringlist_elem_delete (MalaStringList head, MalaStringListNode_ref elem); +mala_stringlist_elem_delete (MalaStringList head, MalaStringListNode elem); static inline void mala_stringlist_elem_delete_fwd (MalaStringList head, MalaStringListNode_ref elem); @@ -187,7 +187,7 @@ mala_stringlist_elem_delete_fwd (MalaStringList head, MalaStringListNode_ref ele { MalaStringListNode tmp = *elem; *elem = (*elem)->node.cqe_next; - mala_stringlist_elem_delete (head, &tmp); + mala_stringlist_elem_delete (head, tmp); } static inline MalaStringListNode -- 2.11.4.GIT