From: Matthew Fernandez Date: Sun, 26 Dec 2021 03:56:19 +0000 (-0800) Subject: remove cgraph macro aliases X-Git-Tag: 3.0.0~96^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7e9e1d9e9e522961cc3f0ab316852c6649ef7a2;p=graphviz remove cgraph macro aliases The functions removed in this commit were intended to be aliases for the same-named macros declared in cgraph.h. The claimed purpose is debugger introspection. It is unclear to me what value these have in a modern development environment. Some modern debuggers can understand macro definitions. Those that cannot are _impeded_ by these aliases. A developer debugging looks at the alias definition and thinks they understand the code, but they do not. The code that is executing on their system is _not_ the code these functions compile to. To state something stronger: it is unclear to me how these definitions were ever helpful. They appear to (accidentally) obscure what is actually occurring in the machine at runtime. Note that these functions also bloated the cgraph .so/.a size by including functions that were never called. --- diff --git a/lib/cgraph/edge.c b/lib/cgraph/edge.c index 0b1e195b6..f42dda6a1 100644 --- a/lib/cgraph/edge.c +++ b/lib/cgraph/edge.c @@ -469,37 +469,3 @@ Dtdisc_t Ag_subedge_id_disc = { agdictobjmem, NIL(Dtevent_f) }; - -/* expose macros as functions for ease of debugging -and to expose them to foreign languages without C preprocessor. */ -#ifdef ageqedge -#undef ageqedge -#endif -CGRAPH_API int ageqedge(Agedge_t * e, Agedge_t * f) -{ - return AGEQEDGE(e, f); -} - -#ifdef agtail -#undef agtail -#endif -CGRAPH_API Agnode_t *agtail(Agedge_t * e) -{ - return AGTAIL(e); -} - -#ifdef aghead -#undef aghead -#endif -CGRAPH_API Agnode_t *aghead(Agedge_t * e) -{ - return AGHEAD(e); -} - -#ifdef agopp -#undef agopp -#endif -CGRAPH_API Agedge_t *agopp(Agedge_t * e) -{ - return AGOPP(e); -}