From 7257b9fceb8301b0e90bcec8c75eea82b8a7314c Mon Sep 17 00:00:00 2001 From: Emden Gansner Date: Fri, 16 Dec 2011 16:44:18 -0500 Subject: [PATCH] Remove some uses of abort(). --- lib/cgraph/apply.c | 4 +++- lib/cgraph/attr.c | 4 +++- lib/cgraph/grammar.y | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/cgraph/apply.c b/lib/cgraph/apply.c index 7eff8a17f..467c57b0a 100644 --- a/lib/cgraph/apply.c +++ b/lib/cgraph/apply.c @@ -76,7 +76,9 @@ int agapply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg, objsearch = subedge_search; break; default: - abort(); + agerr(AGERR, "agapply: unknown object type %d\n", AGTYPE(obj)); + return FAILURE; + break; } if ((subobj = objsearch(g, obj))) { rec_apply(g, subobj, fn, arg, objsearch, preorder); diff --git a/lib/cgraph/attr.c b/lib/cgraph/attr.c index 67a41c872..c33fa54be 100644 --- a/lib/cgraph/attr.c +++ b/lib/cgraph/attr.c @@ -68,7 +68,9 @@ Dict_t *agdictof(Agraph_t * g, int kind) dict = dd->dict.e; break; default: - abort(); + agerr(AGERR,"agdictof: unknown kind %d\n", kind); + dict = NIL(Dict_t *); + break; } else dict = NIL(Dict_t *); return dict; diff --git a/lib/cgraph/grammar.y b/lib/cgraph/grammar.y index 9ce100675..5dfcc17d8 100644 --- a/lib/cgraph/grammar.y +++ b/lib/cgraph/grammar.y @@ -299,6 +299,9 @@ static void nomacros(void) agerr(AGWARN,"attribute macros not implemented"); } +/* attrstmt: + * First argument is always attrtype, so switch covers all cases. + */ static void attrstmt(int tkind, char *macroname) { item *aptr; @@ -315,7 +318,6 @@ static void attrstmt(int tkind, char *macroname) case T_graph: kind = AGRAPH; break; case T_node: kind = AGNODE; break; case T_edge: kind = AGEDGE; break; - default : abort(); } bindattrs(kind); /* set up defaults for new attributes */ for (aptr = Attrlist.first; aptr; aptr = aptr->next) { -- 2.49.0