]> granicus.if.org Git - graphviz/log
graphviz
3 years agoosage: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sun, 2 Jan 2022 13:08:50 +0000 (14:08 +0100)]
osage: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes in
globals.h to be controlled only by the GVDLL symbol, not also by the
WIN32_DLL symbol.

Without this change, errors like this would occur:

osage.lib(osageinit.obj) : error LNK2001: unresolved external symbol _Ndim

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agopatchwork: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sun, 2 Jan 2022 13:08:50 +0000 (14:08 +0100)]
patchwork: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes in
globals.h to be controlled only by the GVDLL symbol, not also by the
WIN32_DLL symbol.

Without this change, errors like this would occur:

patchwork.lib(patchworkinit.obj) : error LNK2001: unresolved external symbol _Ndim

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agotwopigen: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sun, 2 Jan 2022 13:08:50 +0000 (14:08 +0100)]
twopigen: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes in
globals.h to be controlled only by the GVDLL symbol, not also by the
WIN32_DLL symbol.

Without this change, errors like this would occur:

twopigen.lib(twopiinit.obj) : error LNK2001: unresolved external symbol _Ndim

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agosfdp: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sun, 2 Jan 2022 10:31:27 +0000 (11:31 +0100)]
sfdp: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes in
globals.h to be controlled only by the GVDLL symbol, not also by the
WIN32_DLL symbol.

Without this change, errors like this would occur:

sfdp.lib(spring_electrical.obj) : error LNK2001: unresolved external symbol _Verbose

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocommon: [nfc] rename DECLSPEC macro to GLOBALS_API in globals.h
Magnus Jacobsson [Sun, 2 Jan 2022 10:02:42 +0000 (11:02 +0100)]
common: [nfc] rename DECLSPEC macro to GLOBALS_API in globals.h

3 years agocommon: [nfc] remove useless default extern declaration of functions in geomprocs.h
Magnus Jacobsson [Sun, 2 Jan 2022 09:59:00 +0000 (10:59 +0100)]
common: [nfc] remove useless default extern declaration of functions in geomprocs.h

3 years agoMerge branch 'smattr/046089E8-9134-4984-9478-E5E84A0C637F' into 'main'
Matthew Fernandez [Sun, 9 Jan 2022 18:37:48 +0000 (18:37 +0000)]
Merge branch 'smattr/046089E8-9134-4984-9478-E5E84A0C637F' into 'main'

CI: stop installing a custom Python on CentOS 7

See merge request graphviz/graphviz!2385

3 years agoCI: stop installing a custom Python on CentOS 7
Matthew Fernandez [Sun, 9 Jan 2022 01:47:14 +0000 (17:47 -0800)]
CI: stop installing a custom Python on CentOS 7

It is not clear to me why this was pulling in a custom Python 3.6 when Python
3.6 is in the default repositories on CentOS 7. It is possible it was not
packaged there at the time this Dockerfile was written.

3 years agoMerge branch 'install-msys2-from-msys2.org' into 'main'
Magnus Jacobsson [Sun, 9 Jan 2022 16:11:44 +0000 (16:11 +0000)]
Merge branch 'install-msys2-from-msys2.org' into 'main'

CI: install msys2 from msys2.org instead of with choco

See merge request graphviz/graphviz!2375

3 years agoci: install msys2 from msys2.org instead of with choco
Magnus Jacobsson [Sat, 1 Jan 2022 13:07:50 +0000 (14:07 +0100)]
ci: install msys2 from msys2.org instead of with choco

3 years agoMerge branch 'unify-storage-class-declarations-in-cgraph' into 'main'
Magnus Jacobsson [Sun, 9 Jan 2022 09:40:57 +0000 (09:40 +0000)]
Merge branch 'unify-storage-class-declarations-in-cgraph' into 'main'

Unify storage-class declarations in cgraph headers with Graphviz standard

See merge request graphviz/graphviz!2380

3 years agoadd a CHANGELOG entry for the breaking GVDLL change in cgraph.h
Magnus Jacobsson [Fri, 7 Jan 2022 11:49:45 +0000 (12:49 +0100)]
add a CHANGELOG entry for the breaking GVDLL change in cgraph.h

3 years agocgraph: [nfc] align storage-class declarations to Graphviz standard in sprint.h
Magnus Jacobsson [Sun, 2 Jan 2022 09:54:59 +0000 (10:54 +0100)]
cgraph: [nfc] align storage-class declarations to Graphviz standard in sprint.h

3 years agocgraph: [nfc] rename DECLSPEC macro to SPRINT_API
Magnus Jacobsson [Sun, 2 Jan 2022 09:54:00 +0000 (10:54 +0100)]
cgraph: [nfc] rename DECLSPEC macro to SPRINT_API

3 years agocgraph: use GVDLL instead of _WIN32 to control storage-class attributes in csprint.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:30:02 +0000 (17:30 +0100)]
cgraph: use GVDLL instead of _WIN32 to control storage-class attributes in csprint.h

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocgraph: [nfc] align storage-class declarations to Graphviz standard in cgraph.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:30:38 +0000 (17:30 +0100)]
cgraph: [nfc] align storage-class declarations to Graphviz standard in cgraph.h

3 years agocgraph: use GVDLL instead of _WIN32 to control storage-class attributes in cgraph.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:30:02 +0000 (17:30 +0100)]
cgraph: use GVDLL instead of _WIN32 to control storage-class attributes in cgraph.h

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocgraph: [nfc] remove whitespace in preprocessor directives in cgraph.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:29:37 +0000 (17:29 +0100)]
cgraph: [nfc] remove whitespace in preprocessor directives in cgraph.h

3 years agocgraph: [nfc] align storage-class declarations to Graphviz standard in cghdr.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:25:54 +0000 (17:25 +0100)]
cgraph: [nfc] align storage-class declarations to Graphviz standard in cghdr.h

3 years agocgraph: [nfc] remove useless default extern declaration of functions in cghdr.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:25:02 +0000 (17:25 +0100)]
cgraph: [nfc] remove useless default extern declaration of functions in cghdr.h

3 years agocgraph: use GVDLL instead of _WIN32 to control storage-class attributes in cghdr.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:23:53 +0000 (17:23 +0100)]
cgraph: use GVDLL instead of _WIN32 to control storage-class attributes in cghdr.h

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocgraph: [nfc] remove whitespace in preprocessor directives in cghdr.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:23:08 +0000 (17:23 +0100)]
cgraph: [nfc] remove whitespace in preprocessor directives in cghdr.h

3 years agocgraph: remove useless definition of _BLD_cgraph in cghdr.h
Magnus Jacobsson [Sun, 2 Jan 2022 16:07:13 +0000 (17:07 +0100)]
cgraph: remove useless definition of _BLD_cgraph in cghdr.h

This symbol is not used anywhere.

3 years agocgraph: move include of config.h to before defining storage-class attributes in cghdr.h
Magnus Jacobsson [Sun, 2 Jan 2022 09:21:35 +0000 (10:21 +0100)]
cgraph: move include of config.h to before defining storage-class attributes in cghdr.h

The GVDLL symbol is defined in config.h for autotools builds and an
upcoming commit which changes cghdr.h to use GVDLL to control the
storage-class attribute declarations would otherwise cause errors like
this:

C:\Users\magja\graphviz\cmd\tools/gc.c:333: undefined reference to `__imp_agapply'

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocgraph: [nfc] align storage-class declarations to Graphviz standard in agxbuf.h
Magnus Jacobsson [Sat, 1 Jan 2022 16:00:03 +0000 (17:00 +0100)]
cgraph: [nfc] align storage-class declarations to Graphviz standard in agxbuf.h

3 years agocgraph: [nfc] remove useless default extern declaration of functions in agxbuf.h
Magnus Jacobsson [Sat, 1 Jan 2022 15:58:43 +0000 (16:58 +0100)]
cgraph: [nfc] remove useless default extern declaration of functions in agxbuf.h

3 years agocgraph: use GVDLL instead of _WIN32 to control storage-class attributes in agxbuf.h
Magnus Jacobsson [Sat, 1 Jan 2022 15:56:18 +0000 (16:56 +0100)]
cgraph: use GVDLL instead of _WIN32 to control storage-class attributes in agxbuf.h

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocgraph: [nfc] remove whitespace in preprocessor directives in agxbuf.h
Magnus Jacobsson [Sat, 1 Jan 2022 15:53:33 +0000 (16:53 +0100)]
cgraph: [nfc] remove whitespace in preprocessor directives in agxbuf.h

3 years agocgraph: include config.h in agxbuf.h to get GVDLL in autotools builds
Magnus Jacobsson [Sun, 2 Jan 2022 09:21:35 +0000 (10:21 +0100)]
cgraph: include config.h in agxbuf.h to get GVDLL in autotools builds

An upcoming commit which changes agxbuf.h to use GVDLL to control the
storage-class attribute declarations would otherwise cause errors like
this:

C:\Users\magja\graphviz\lib\gvc/gvplugin.c:386: undefined reference to `__imp_agxbprint'

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocgraph++: use GVDLL instead of _WIN32 to control storage-class attributes in AGraph.h
Magnus Jacobsson [Sat, 1 Jan 2022 15:52:13 +0000 (16:52 +0100)]
cgraph++: use GVDLL instead of _WIN32 to control storage-class attributes in AGraph.h

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocgraph++: [nfc] align storage-class declarations to Graphviz standard in AGraph.h
Magnus Jacobsson [Sat, 1 Jan 2022 15:47:14 +0000 (16:47 +0100)]
cgraph++: [nfc] align storage-class declarations to Graphviz standard in AGraph.h

3 years agotests: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 18:15:21 +0000 (19:15 +0100)]
tests: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cgraph.h.

Without this change, errors like this would occur when building the
test examples:

demo.obj : error LNK2019: unresolved external symbol Agdirected referenced in function main

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agolib/gvpr: use GVDLL instead of _WIN32 to control gprDisc init in compile.c
Magnus Jacobsson [Sun, 2 Jan 2022 15:02:47 +0000 (16:02 +0100)]
lib/gvpr: use GVDLL instead of _WIN32 to control gprDisc init in compile.c

Without this change, an upcoming commit that changes cgraph.h to use
GVDLL instead of _WIN32 to control storage-class attributes would
cause this error:

compile.c:85:29: error: initializer element is not constant
   85 | static Agdisc_t gprDisc = { &AgMemDisc, &AgIdDisc, &gprIoDisc };
      |                             ^
compile.c:85:29: note: (near initialization for ‘gprDisc.mem’)

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agodot: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
dot: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cgraph.h.

Without this change, errors like this would occur:

dot.obj : error LNK2001: unresolved external symbol _Agdirected

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agosccmap: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
sccmap: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cgraph.h.

Without this change, errors like this would occur:

sccmap.obj : error LNK2001: unresolved external symbol _Agdirected

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agobcomps: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
bcomps: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cgraph.h.

Without this change, errors like this would occur:

bcomps.obj : error LNK2001: unresolved external symbol _Agstrictundirected

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agomm2gv: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
mm2gv: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cgraph.h.

Without this change, errors like this would occur:

mm2gv.obj : error LNK2001: unresolved external symbol _Agdirected

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agoccomps: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
ccomps: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cgraph.h.

Without this change, errors like this would occur:

ccomps.obj : error LNK2001: unresolved external symbol _Agstrictundirected

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agodotgen: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
dotgen: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cgraph.h.

Without this change, errors like this would occur:

dotgen.lib(mincross.obj) : error LNK2001: unresolved external symbol _Agstrictdirected

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agoStart 3.0 development series
Magnus Jacobsson [Fri, 7 Jan 2022 11:48:49 +0000 (12:48 +0100)]
Start 3.0 development series

An upcoming commit will introduce a breaking change.

3 years agoMerge branch 'smattr/18156802-8e89-4532-9958-fdc6fb4c0f13' into 'main'
Matthew Fernandez [Sat, 8 Jan 2022 17:12:02 +0000 (17:12 +0000)]
Merge branch 'smattr/18156802-8e89-4532-9958-fdc6fb4c0f13' into 'main'

convert lib/mingle/ink.c to C++

See merge request graphviz/graphviz!2381

3 years agolib/mingle: remove an unused sparse include
Matthew Fernandez [Fri, 7 Jan 2022 03:40:08 +0000 (19:40 -0800)]
lib/mingle: remove an unused sparse include

3 years agolib/mingle: replace some 'MIN' usage with 'std::min'
Matthew Fernandez [Fri, 7 Jan 2022 03:38:52 +0000 (19:38 -0800)]
lib/mingle: replace some 'MIN' usage with 'std::min'

3 years agolib/mingle ink: pass point lists around as vectors instead of C arrays
Matthew Fernandez [Fri, 7 Jan 2022 03:27:50 +0000 (19:27 -0800)]
lib/mingle ink: pass point lists around as vectors instead of C arrays

3 years agolib/mingle ink: avoid manual memory management of 'targets'
Matthew Fernandez [Thu, 6 Jan 2022 06:16:40 +0000 (22:16 -0800)]
lib/mingle ink: avoid manual memory management of 'targets'

3 years agolib/mingle: scope use of an array to a local temp
Matthew Fernandez [Thu, 6 Jan 2022 06:13:16 +0000 (22:13 -0800)]
lib/mingle: scope use of an array to a local temp

Similar to the preceding changes for `sources`, it is not clear to me why this
code was using the `targets` array when the output values are irrelevant.

3 years agolib/mingle ink: avoid manual memory management of 'sources'
Matthew Fernandez [Thu, 6 Jan 2022 06:08:38 +0000 (22:08 -0800)]
lib/mingle ink: avoid manual memory management of 'sources'

3 years agolib/mingle: scope use of an array to a local temp
Matthew Fernandez [Thu, 6 Jan 2022 06:00:51 +0000 (22:00 -0800)]
lib/mingle: scope use of an array to a local temp

It is not clear to me why this loop was using the `sources` array. AFAICT the
values written to this array are (1) not used by subsequent loop iterations (no
loop-carried dependency) and (2) not used after the loop before being
overwritten by other values.

This change cuts the dependency. A future commit will refactor the allocation in
this area to avoid allocating a possibly-unused array upfront.

3 years agolib/mingle: rephrase some open coded hypotenuse calculations
Matthew Fernandez [Thu, 6 Jan 2022 05:50:53 +0000 (21:50 -0800)]
lib/mingle: rephrase some open coded hypotenuse calculations

Surprisingly every `sqrt` call in this file except one is a hypotenuse
calculation that can be done more accurately. Maybe `hypot` was not widely
available when this code was written.

3 years agolib/mingle: replace some 'MAX' usage with 'std::max'
Matthew Fernandez [Thu, 6 Jan 2022 05:43:39 +0000 (21:43 -0800)]
lib/mingle: replace some 'MAX' usage with 'std::max'

This is straightforward find-and-replace. No attempt was made to investigate if
the surrounding algorithm could/should be rephrased.

Gitlab: #2154

3 years agolib/mingle: [nfc] change C includes to their C++ equivalents
Matthew Fernandez [Thu, 6 Jan 2022 05:38:03 +0000 (21:38 -0800)]
lib/mingle: [nfc] change C includes to their C++ equivalents

3 years agolib/mingle: move ink.c into C++
Matthew Fernandez [Thu, 6 Jan 2022 04:32:31 +0000 (20:32 -0800)]
lib/mingle: move ink.c into C++

lib/mingle already has a C++ source, requiring it to link against the C++
standard library. There is no advantage to keeping some of its sources in C.

This does nothing fancy, just rename the existing file. All contained code looks
compatible across C and C++. Future commits will refactor this to more modern
C++ style.

Gitlab: #2154

3 years agolib/mingle: [nfc] pre-emptively squash -fpermissive warning
Matthew Fernandez [Thu, 6 Jan 2022 04:48:07 +0000 (20:48 -0800)]
lib/mingle: [nfc] pre-emptively squash -fpermissive warning

When moving this code to C++ in an upcoming commit, this would otherwise
trigger:

  lib/mingle/ink.cpp:46:22: error: uninitialized const 'Origin' [-fpermissive]
   static const point_t Origin;
                        ^
  In file included from lib/mingle/ink.cpp:17:0:
  lib/mingle/ink.h:19:16: note: 'const struct point_t' has no user-provided
    default constructor
   typedef struct {
                  ^
  lib/mingle/ink.h:20:10: note: and the implicitly-defined constructor does not
    initialize 'double point_t::x'
     double x, y;
          ^

This noisy initialization can probably be undone after mingle and libmingle are
moved to entirely C++.

Gitlab: #2154

3 years agolib/mingle: [nfc] remove an unused include
Matthew Fernandez [Thu, 6 Jan 2022 04:25:12 +0000 (20:25 -0800)]
lib/mingle: [nfc] remove an unused include

3 years agoMerge branch 'fix-parallel-visual-studio-builds' into 'main'
Magnus Jacobsson [Thu, 6 Jan 2022 10:56:24 +0000 (10:56 +0000)]
Merge branch 'fix-parallel-visual-studio-builds' into 'main'

Fix parallel Visual Studio builds

See merge request graphviz/graphviz!2377

3 years agoadd a changelog entry for Visual Studio fix
Magnus Jacobsson [Thu, 6 Jan 2022 09:53:30 +0000 (10:53 +0100)]
add a changelog entry for Visual Studio fix

https://gitlab.com/graphviz/graphviz/-/issues/2175.

3 years agotwopigen: MSBuild: add project reference to version
Magnus Jacobsson [Sun, 2 Jan 2022 21:43:26 +0000 (22:43 +0100)]
twopigen: MSBuild: add project reference to version

Closes https://gitlab.com/graphviz/graphviz/-/issues/2175.

3 years agocircogen: MSBuild: add project reference to version
Magnus Jacobsson [Sun, 2 Jan 2022 20:56:32 +0000 (21:56 +0100)]
circogen: MSBuild: add project reference to version

Towards https://gitlab.com/graphviz/graphviz/-/issues/2175.

3 years agoortho: MSBuild: add project reference to version
Magnus Jacobsson [Sun, 2 Jan 2022 20:44:53 +0000 (21:44 +0100)]
ortho: MSBuild: add project reference to version

Towards https://gitlab.com/graphviz/graphviz/-/issues/2175.

3 years agofdpgen: MSBuild: add project reference to version
Magnus Jacobsson [Sun, 2 Jan 2022 20:44:29 +0000 (21:44 +0100)]
fdpgen: MSBuild: add project reference to version

Towards https://gitlab.com/graphviz/graphviz/-/issues/2175.

3 years agopatchwork: MSBuild: add project reference to version
Magnus Jacobsson [Sun, 2 Jan 2022 20:27:42 +0000 (21:27 +0100)]
patchwork: MSBuild: add project reference to version

Towards https://gitlab.com/graphviz/graphviz/-/issues/2175.

3 years agogv2gml: MSBuild: add project reference to gvc
Magnus Jacobsson [Sun, 2 Jan 2022 20:26:03 +0000 (21:26 +0100)]
gv2gml: MSBuild: add project reference to gvc

Towards https://gitlab.com/graphviz/graphviz/-/issues/2175.

3 years agoMerge branch 'smattr/a679a524-8d3d-45b7-8da2-729372854b24' into 'main'
Matthew Fernandez [Thu, 6 Jan 2022 02:04:39 +0000 (02:04 +0000)]
Merge branch 'smattr/a679a524-8d3d-45b7-8da2-729372854b24' into 'main'

remove reused buffer in spline routing

See merge request graphviz/graphviz!2359

3 years agoremove reused buffer in spline routing
Matthew Fernandez [Fri, 24 Dec 2021 18:11:06 +0000 (10:11 -0800)]
remove reused buffer in spline routing

Code in routespl.c used a long-lived buffer, `ps`, that it resized to deal with
various operations. This made the code thread-unsafe, and note that there are
also various work arounds in routespl.c to deal with re-entrancy which is
complicated by this design.

This commit rephrases `simpleSplineRoute` and `_routesplines` to dynamically
allocate a fresh buffer for each operation. The ergonomics cost of this is that
callers of `simpleSplineRoute`, `routesplines`, and `routepolylines` now need to
eventually free the returned pointer. This is unfortunately fairly noisy to deal
with in C and would have been cleaner in C++.

In future, this direction should probably be taken further to allow
`routesplinesinit` and `routesplinesterm` to be removed. This design that relies
on static globals is incompatible with multi-threading, so if Graphviz ever
wants to support multi-threading, this will need to be removed.

Note that this commit introduce two new warnings (for the `calloc` calls with
`int` values). The cost seems worth it and hopefully these warnings can be
removed in future.

This change has a performance impact. For smaller graphs, this likely slightly
degrades performance due to repeated small allocations that previously would not
have been required. For larger graphs, this perhaps improves performance as the
allocator no longer (spuriously) believes it needs to retain the contents of
`ps` across calls.

3 years agoMerge branch 'smattr/3e7bbb62-f0eb-49c3-8fc3-e02f3948ea62' into 'main'
Matthew Fernandez [Wed, 5 Jan 2022 16:59:32 +0000 (16:59 +0000)]
Merge branch 'smattr/3e7bbb62-f0eb-49c3-8fc3-e02f3948ea62' into 'main'

more boolean → bool modernization

See merge request graphviz/graphviz!2369

3 years agopoly_gencode: remove claim that 'filled' is a boolean
Matthew Fernandez [Mon, 27 Dec 2021 03:22:50 +0000 (19:22 -0800)]
poly_gencode: remove claim that 'filled' is a boolean

This variable is not treated as a boolean within this function. Declaring it as
a boolean appears to have been a mistake and only worked out coincidentally as
all set values fit within the `boolean` type.

3 years agohandle_keypress: return a C99 bool instead of a boolean
Matthew Fernandez [Mon, 27 Dec 2021 03:14:43 +0000 (19:14 -0800)]
handle_keypress: return a C99 bool instead of a boolean

3 years agogetdoubles2ptf: return a C99 bool instead of boolean
Matthew Fernandez [Mon, 27 Dec 2021 03:11:07 +0000 (19:11 -0800)]
getdoubles2ptf: return a C99 bool instead of boolean

3 years agoglitz_finalize: use a C99 bool for 'watching_p' instead of a boolean
Matthew Fernandez [Mon, 27 Dec 2021 03:08:46 +0000 (19:08 -0800)]
glitz_finalize: use a C99 bool for 'watching_p' instead of a boolean

3 years agogdgen_begin_page: use a C99 bool for 'truecolor_p' instead of a boolean
Matthew Fernandez [Mon, 27 Dec 2021 03:07:38 +0000 (19:07 -0800)]
gdgen_begin_page: use a C99 bool for 'truecolor_p' instead of a boolean

3 years agopccomps: use a C99 bool for 'pin' instead of a boolean
Matthew Fernandez [Mon, 27 Dec 2021 03:06:08 +0000 (19:06 -0800)]
pccomps: use a C99 bool for 'pin' instead of a boolean

3 years agostress_majorization_cola: use a C99 for 'converged' instead of a boolean
Matthew Fernandez [Mon, 27 Dec 2021 03:04:12 +0000 (19:04 -0800)]
stress_majorization_cola: use a C99 for 'converged' instead of a boolean

3 years agogvplugin_list: use a C99 bool for 'new' instead of boolean
Matthew Fernandez [Mon, 27 Dec 2021 03:02:29 +0000 (19:02 -0800)]
gvplugin_list: use a C99 bool for 'new' instead of boolean

3 years agouse C99 bools for 'isVert' members instead of booleans
Matthew Fernandez [Mon, 27 Dec 2021 02:57:49 +0000 (18:57 -0800)]
use C99 bools for 'isVert' members instead of booleans

3 years agogenerateNonoverlapConstraints: take a C99 bool instead of boolean
Matthew Fernandez [Mon, 27 Dec 2021 02:52:23 +0000 (18:52 -0800)]
generateNonoverlapConstraints: take a C99 bool instead of boolean

Note that this required propagating this change through to `genXConstraints` as
well.

3 years agospline_edges0: take a C99 bool instead of a boolean
Matthew Fernandez [Mon, 27 Dec 2021 02:42:24 +0000 (18:42 -0800)]
spline_edges0: take a C99 bool instead of a boolean

3 years agomakeSpline: take a C99 bool instead of a boolean
Matthew Fernandez [Mon, 27 Dec 2021 02:39:45 +0000 (18:39 -0800)]
makeSpline: take a C99 bool instead of a boolean

3 years agoMerge branch 'unify-storage-class-declarations-in-cdt' into 'main'
Magnus Jacobsson [Wed, 5 Jan 2022 08:19:58 +0000 (08:19 +0000)]
Merge branch 'unify-storage-class-declarations-in-cdt' into 'main'

Unify storage-class declarations in cdt.h with Graphviz standard

See merge request graphviz/graphviz!2378

3 years agocdt: [nfc] align storage-class declarations to Graphviz standard in cdt.h
Magnus Jacobsson [Sat, 1 Jan 2022 15:45:42 +0000 (16:45 +0100)]
cdt: [nfc] align storage-class declarations to Graphviz standard in cdt.h

3 years agocdt: use GVDLL instead of _WIN32 to control storage-class attributes in cdt.h
Magnus Jacobsson [Sat, 1 Jan 2022 15:44:04 +0000 (16:44 +0100)]
cdt: use GVDLL instead of _WIN32 to control storage-class attributes in cdt.h

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocdt: [nfc] remove whitespace in preprocessor directives in cdt.h
Magnus Jacobsson [Sat, 1 Jan 2022 15:42:27 +0000 (16:42 +0100)]
cdt: [nfc] remove whitespace in preprocessor directives in cdt.h

3 years agocdt: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 16:37:22 +0000 (17:37 +0100)]
cdt: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, the following error would occur:

LINK : fatal error LNK1104: cannot open file 'C:\GitLab-Runner\builds\magjac\graphviz\Debug\Graphviz\bin\cdt.lib' [C:\GitLab-Runner\builds\magjac\graphviz\lib\pathplan\Pathplan.vcxproj]

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agogvpack: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
gvpack: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

gvpack.obj : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agographml2gv: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
graphml2gv: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

graphml2gv.obj : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agogxl2gv: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
gxl2gv: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

gxl2gv.obj : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agodijkstra: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
dijkstra: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

dijkstra.obj : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agogml2gv: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
gml2gv: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

gv2gxl.obj : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agoplugin/core: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
plugin/core: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

gvrender_core_json.obj : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agofdpgen: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
fdpgen: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

fdpgen.lib(grid.obj) : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocircogen: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
circogen: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

circogen.lib(edgelist.obj) : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agoneatogen: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
neatogen: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

neatogen.lib(neatosplines.obj) : error LNK2001: unresolved external symbol _Dtoset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agoexpr: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
expr: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

expr.lib(y.tab.obj) : error LNK2001: unresolved external symbol _Dtset

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agocgraph: MSBuild: define GVDLL to ensure correct storage-class attributes
Magnus Jacobsson [Sat, 1 Jan 2022 17:01:01 +0000 (18:01 +0100)]
cgraph: MSBuild: define GVDLL to ensure correct storage-class attributes

An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cdt.h.

Without this change, errors like this would occur:

refstr.obj : error LNK2001: unresolved external symbol _Dttree [C:\GitLab-Runner\builds\magjac\graphviz\lib\cgraph\cgraph.vcxproj]

Towards https://gitlab.com/graphviz/graphviz/-/issues/2173.

3 years agoMerge branch 'post-remove-gvc-def-file-cleanup' into 'main'
Magnus Jacobsson [Wed, 5 Jan 2022 06:29:25 +0000 (06:29 +0000)]
Merge branch 'post-remove-gvc-def-file-cleanup' into 'main'

Some cleanup of duplicate declarations

See merge request graphviz/graphviz!2379

3 years agoplugin/gd: remove duplicate definition of Bezier in gvrender_gd_vrml.c
Magnus Jacobsson [Sun, 1 Aug 2021 20:57:20 +0000 (22:57 +0200)]
plugin/gd: remove duplicate definition of Bezier in gvrender_gd_vrml.c

Removes this warning:

C:\Users\magja\graphviz\plugin\gd\gvrender_gd_vrml.c(41,86): warning C4273: 'Bezier': inconsistent dll linkage [C:\Users\magja\graphviz\plugin\gd\gvplugin_gd.vcxproj]

3 years agoplugin/gd: remove duplicate declaration of shapeOf in plugin/gd/gvrender_gd_vrml.c
Magnus Jacobsson [Sun, 1 Aug 2021 20:54:53 +0000 (22:54 +0200)]
plugin/gd: remove duplicate declaration of shapeOf in plugin/gd/gvrender_gd_vrml.c

3 years agosparse: replace local declaration of colorxlate with including common/colorprocs...
Magnus Jacobsson [Tue, 27 Jul 2021 09:48:19 +0000 (11:48 +0200)]
sparse: replace local declaration of colorxlate with including common/colorprocs.h in colorutil.h

3 years agosparse: MSBuild: add windows include dir to find config.h
Magnus Jacobsson [Sun, 12 Dec 2021 11:27:44 +0000 (12:27 +0100)]
sparse: MSBuild: add windows include dir to find config.h

An upcoming commit which will include config.h in colorprocs.h would
otherwise cause this error:

C:\Users\magja\graphviz\lib\common\colorprocs.h(13,10): fatal error C1083: Cannot open include file: 'config.h': No such file or directory [C:\Users\magja\graphviz\lib\sparse\gvsparse.vcxproj]

3 years agodot: unconditionally include globals.h in dot.c instead of duplicating declarations...
Magnus Jacobsson [Mon, 26 Jul 2021 13:28:04 +0000 (15:28 +0200)]
dot: unconditionally include globals.h in dot.c instead of duplicating declarations for WIN32_DLL

3 years agoMerge branch 'remove-gvc-def-file' into 'main'
Magnus Jacobsson [Tue, 4 Jan 2022 17:51:05 +0000 (17:51 +0000)]
Merge branch 'remove-gvc-def-file' into 'main'

Remove the last symbols from gvc.def and remove the gvc.def file

Closes #2058

See merge request graphviz/graphviz!2376