]> granicus.if.org Git - graphviz/commit
add a gvLayoutDone function to the gvc lib
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 4 Aug 2021 16:18:04 +0000 (18:18 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 7 Aug 2021 04:54:12 +0000 (06:54 +0200)
commit6f46c2c224180dc238851d2fb88d1fb909548376
tree7a6959e37a2157fbfc411a0b9357fe176d1861f3
parent886e0ce0b194fcdfdbbdda7dc8461666a206ca33
add a gvLayoutDone function to the gvc lib

An upcoming commit in the series need to perform this check from
C++. Using the LAYOUT_DONE macro directly would give the warning
below. It would be possible to change the underlying C functions to
take a const char * instead, but exposing this new function seems
better than using a macro in C++ anyway.

The warning that would have been the result otherwise:

In file included from /home/magjac/graphviz/lib/gvc++/GVContext.h:5,
                 from /home/magjac/graphviz/lib/gvc++/GVLayout.cpp:6:
/home/magjac/graphviz/lib/gvc++/GVLayout.cpp: In constructor ‘GVC::GVLayout::GVLayout(const std::shared_ptr<GVC::GVContext>&, const std::shared_ptr<CGraph::AGraph>&, const string&)’:
/home/magjac/graphviz/lib/gvc/gvc.h:38:38: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
   38 | #define LAYOUT_DONE(g) (agbindrec(g, "Agraphinfo_t", 0, TRUE) && GD_drawing(g))
      |                                      ^~~~~~~~~~~~~~
/home/magjac/graphviz/lib/gvc++/GVLayout.cpp:18:9: note: in expansion of macro ‘LAYOUT_DONE’
   18 |     if (LAYOUT_DONE(g->c_struct())) {}
      |         ^~~~~~~~~~~
lib/gvc/gvc.def
lib/gvc/gvc.h
lib/gvc/gvlayout.c