From 8446d7bfac4dda9c2d4050715a4966a6f29c5891 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 13 Aug 2020 20:38:52 -0700 Subject: [PATCH] make lib/cgraph/*.c #includes unambiguous Related to #1785. --- lib/cgraph/CMakeLists.txt | 13 +++++++------ lib/cgraph/Makefile.am | 2 +- lib/cgraph/agerror.c | 2 +- lib/cgraph/agxbuf.c | 2 +- lib/cgraph/apply.c | 2 +- lib/cgraph/attr.c | 2 +- lib/cgraph/cgraph.vcxproj | 4 ++-- lib/cgraph/cmpnd.c | 2 +- lib/cgraph/edge.c | 2 +- lib/cgraph/flatten.c | 2 +- lib/cgraph/graph.c | 2 +- lib/cgraph/id.c | 2 +- lib/cgraph/imap.c | 2 +- lib/cgraph/io.c | 2 +- lib/cgraph/mem.c | 2 +- lib/cgraph/node.c | 2 +- lib/cgraph/obj.c | 2 +- lib/cgraph/pend.c | 2 +- lib/cgraph/rec.c | 2 +- lib/cgraph/refstr.c | 2 +- lib/cgraph/subg.c | 2 +- lib/cgraph/utils.c | 2 +- lib/cgraph/write.c | 4 ++-- 23 files changed, 31 insertions(+), 30 deletions(-) diff --git a/lib/cgraph/CMakeLists.txt b/lib/cgraph/CMakeLists.txt index b81230b1e..8c1d22990 100644 --- a/lib/cgraph/CMakeLists.txt +++ b/lib/cgraph/CMakeLists.txt @@ -4,12 +4,6 @@ ADD_FLEX_BISON_DEPENDENCY(Scan Grammar) add_definitions(-DEXPORT_CGRAPH -DEXPORT_AGXBUF -DEXPORT_CGHDR -DYY_NO_UNISTD_H) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${GRAPHVIZ_LIB_DIR}/cdt -) - add_library(cgraph SHARED # Header files agxbuf.h @@ -43,6 +37,13 @@ add_library(cgraph SHARED ${FLEX_Scan_OUTPUTS} ) +target_include_directories(cgraph PRIVATE + ${GRAPHVIZ_LIB_DIR} + ${GRAPHVIZ_LIB_DIR}/cdt + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + target_link_libraries(cgraph cdt) # Installation location of library files diff --git a/lib/cgraph/Makefile.am b/lib/cgraph/Makefile.am index 6c01f4152..688498093 100644 --- a/lib/cgraph/Makefile.am +++ b/lib/cgraph/Makefile.am @@ -6,7 +6,7 @@ CGRAPH_VERSION="6:0:0" pdfdir = $(pkgdatadir)/doc/pdf pkgconfigdir = $(libdir)/pkgconfig -AM_CPPFLAGS = -I$(top_srcdir)/lib/cdt +AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/lib/cdt pkginclude_HEADERS = cgraph.h strcasecmp.h noinst_HEADERS = agxbuf.h cghdr.h diff --git a/lib/cgraph/agerror.c b/lib/cgraph/agerror.c index d458f8f72..865e39198 100644 --- a/lib/cgraph/agerror.c +++ b/lib/cgraph/agerror.c @@ -12,7 +12,7 @@ *************************************************************************/ #include -#include +#include #define MAX(a,b) ((a)>(b)?(a):(b)) static agerrlevel_t agerrno; /* Last error level */ diff --git a/lib/cgraph/agxbuf.c b/lib/cgraph/agxbuf.c index 6c5bfeecb..3f2c809a6 100644 --- a/lib/cgraph/agxbuf.c +++ b/lib/cgraph/agxbuf.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #define N_GNEW(n,t) (t*)calloc((n),sizeof(t)) diff --git a/lib/cgraph/apply.c b/lib/cgraph/apply.c index 467c57b0a..923089ec7 100644 --- a/lib/cgraph/apply.c +++ b/lib/cgraph/apply.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include /* The following functions take a graph and a template (node/edge/graph) * and return the object representing the template within the local graph. diff --git a/lib/cgraph/attr.c b/lib/cgraph/attr.c index a223ac1cd..9211a0034 100644 --- a/lib/cgraph/attr.c +++ b/lib/cgraph/attr.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include /* * dynamic attributes diff --git a/lib/cgraph/cgraph.vcxproj b/lib/cgraph/cgraph.vcxproj index fff37f5f8..35455dbdc 100644 --- a/lib/cgraph/cgraph.vcxproj +++ b/lib/cgraph/cgraph.vcxproj @@ -51,7 +51,7 @@ Disabled - $(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib\cdt + $(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib;$(SolutionDir)lib\cdt EXPORT_CGRAPH;EXPORT_AGXBUF;EXPORT_CGHDR;YY_NO_UNISTD_H;%(PreprocessorDefinitions) true EnableFastChecks @@ -76,7 +76,7 @@ win_flex -oscan.c scan.l - $(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib\cdt + $(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib;$(SolutionDir)lib\cdt EXPORT_CGRAPH;EXPORT_AGXBUF;EXPORT_CGHDR;YY_NO_UNISTD_H;%(PreprocessorDefinitions) Level4 diff --git a/lib/cgraph/cmpnd.c b/lib/cgraph/cmpnd.c index ab75fb11e..bebcae8e5 100644 --- a/lib/cgraph/cmpnd.c +++ b/lib/cgraph/cmpnd.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include /* * provides "compound nodes" on top of base Libgraph. diff --git a/lib/cgraph/edge.c b/lib/cgraph/edge.c index c0c1af4b8..91ac5ffc3 100644 --- a/lib/cgraph/edge.c +++ b/lib/cgraph/edge.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include #define IN_SET FALSE #define OUT_SET TRUE diff --git a/lib/cgraph/flatten.c b/lib/cgraph/flatten.c index 7e14772eb..0928be8b8 100644 --- a/lib/cgraph/flatten.c +++ b/lib/cgraph/flatten.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include "cghdr.h" +#include static void agflatten_elist(Dict_t * d, Dtlink_t ** lptr, int flag) { diff --git a/lib/cgraph/graph.c b/lib/cgraph/graph.c index 0d9dbac37..dde4e35f5 100644 --- a/lib/cgraph/graph.c +++ b/lib/cgraph/graph.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include Agraph_t *Ag_G_global; diff --git a/lib/cgraph/id.c b/lib/cgraph/id.c index bef71a16e..9146177ee 100644 --- a/lib/cgraph/id.c +++ b/lib/cgraph/id.c @@ -12,7 +12,7 @@ *************************************************************************/ #include -#include +#include /* a default ID allocator that works off the shared string lib */ diff --git a/lib/cgraph/imap.c b/lib/cgraph/imap.c index 7b006e1fb..6ba271c65 100644 --- a/lib/cgraph/imap.c +++ b/lib/cgraph/imap.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include typedef struct IMapEntry_s { Dtlink_t namedict_link; diff --git a/lib/cgraph/io.c b/lib/cgraph/io.c index 544e76948..1080a0292 100644 --- a/lib/cgraph/io.c +++ b/lib/cgraph/io.c @@ -12,7 +12,7 @@ *************************************************************************/ #include -#include +#include #if defined(_WIN32) #include #endif diff --git a/lib/cgraph/mem.c b/lib/cgraph/mem.c index 62542c778..765bb5832 100644 --- a/lib/cgraph/mem.c +++ b/lib/cgraph/mem.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include /* memory management discipline and entry points */ static void *memopen(Agdisc_t* disc) diff --git a/lib/cgraph/node.c b/lib/cgraph/node.c index 3fc3a5da3..35e99b505 100644 --- a/lib/cgraph/node.c +++ b/lib/cgraph/node.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include Agnode_t *agfindnode_by_id(Agraph_t * g, IDTYPE id) { diff --git a/lib/cgraph/obj.c b/lib/cgraph/obj.c index 709774e3d..430c7482c 100644 --- a/lib/cgraph/obj.c +++ b/lib/cgraph/obj.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include int agdelete(Agraph_t * g, void *obj) { diff --git a/lib/cgraph/pend.c b/lib/cgraph/pend.c index ac91938f9..cb8c311b9 100644 --- a/lib/cgraph/pend.c +++ b/lib/cgraph/pend.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include static char DRName[] = "_AG_pending"; diff --git a/lib/cgraph/rec.c b/lib/cgraph/rec.c index c0839da5d..faef776a8 100644 --- a/lib/cgraph/rec.c +++ b/lib/cgraph/rec.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include /* * run time records diff --git a/lib/cgraph/refstr.c b/lib/cgraph/refstr.c index 0aaa70324..8c52b4742 100644 --- a/lib/cgraph/refstr.c +++ b/lib/cgraph/refstr.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include /* * reference counted strings. diff --git a/lib/cgraph/subg.c b/lib/cgraph/subg.c index 0e9acb18c..3fb06bde8 100644 --- a/lib/cgraph/subg.c +++ b/lib/cgraph/subg.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include static Agraph_t *agfindsubg_by_id(Agraph_t * g, IDTYPE id) { diff --git a/lib/cgraph/utils.c b/lib/cgraph/utils.c index bdfa84efc..245d6b819 100644 --- a/lib/cgraph/utils.c +++ b/lib/cgraph/utils.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include +#include static Agraph_t *Ag_dictop_G; diff --git a/lib/cgraph/write.c b/lib/cgraph/write.c index 5b00304be..e3d45cf3c 100644 --- a/lib/cgraph/write.c +++ b/lib/cgraph/write.c @@ -13,8 +13,8 @@ #include /* need sprintf() */ #include -#include "cghdr.h" -#include "strcasecmp.h" +#include +#include #define EMPTY(s) ((s == 0) || (s)[0] == '\0') #define MAX(a,b) ((a)>(b)?(a):(b)) -- 2.40.0