remove SWIG setup steps in Windows build preparation script
As discussed on Gitlab,¹ this Windows build script tries to discover SWIG, but
none of the Windows options for building Graphviz support compiling any of the
components that use SWIG.
sccmap: re-enable non-silent output when '-v' is passed
Unix command line tools generally have a “last option wins” kind of semantics,
wherein it is valid to pass options multiple times or in combination with other
options that do their opposite. Thus when calling `sccmap -S -v`, the user could
reasonably expect that `-v` (“verbose”) reversed the effect of `-S` (“silent”).
This is also what the man page implies. But this was not what the code was
doing.
The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.
gvpack: replace CDT pair dictionaries with 'std::multiset'
This is intended to be a non-functional change with a number of benefits:
1. This is C++ code, so no need for custom CDT data structures. The STL
equivalents are likely more optimized, better understood by the compiler,
and more familiar to human readers.
2. We avoid the lib/common allocation routines (`NEW` macro and friends). Now
allocation failures naturally propagate outwards as `std::bad_alloc`
exceptions without any custom handling.
3. Related to (2), we no longer need to manually free any of these objects.
RAII takes care of all of this.
gvpack: replace CDT attribute dictionaries with std::maps
This is intended to be a non-functional change with a number of benefits:
1. This is C++ code, so no need for custom CDT data structures. The STL
equivalents are likely more optimized, better understood by the compiler,
and more familiar to human readers.
2. We avoid the lib/common allocation routines (`NEW` macro and friends). Now
allocation failures naturally propagate outwards as `std::bad_alloc`
exceptions without any custom handling.
3. Related to (2), we no longer need to manually free any of these objects.
RAII takes care of all of this.
mm2gv makeDotGraph: use cgraph wrappers for allocation
The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.
fix erroneous commas in JSON output of graphs with only clusters
When a graph or subgraph contained exclusively subnodes that were clusters (that
is, it contained a non-zero number of subnodes, but all of them were clusters),
the output of `-Tjson` would contain an extra comma. This malformed JSON could
not be ingested by most downstream parsers.
This appears to have been a mistake in f82c51fc9644047e9ce80d860fea562e98d3311c
that introduced cluster skipping in the loop that emits nodes in JSON. It did
not account for the earlier part of the containing function that was intended to
early-exit if the loop would have a 0 iteration count.
As noted in the discussion of #2282, a couple of the maintainers believe this
manual JSON writing code is inherently fragile and likely contains more latent
bugs. But we do not have maintainer consensus on migrating to an established
JSON-writing library. This fix attempts to surgically address the current known
bug. But I cannot guarantee it does not introduce others.
Mark Hansen [Mon, 26 Sep 2022 10:43:39 +0000 (20:43 +1000)]
Stop using now-hidden gs_error_names symbol
GhostScript hid their gs_error_names symbol as part of a global by-default hiding of non-API symbols.
It will probably take a while for GhostScript to get a public API for these symbols back into a release, so let's stop using the symbol for now, until then.
Other similar warnings in this file were squashed in bd869436742887a0089f5ad817ecb36a1546987c. But the revert in the previous commit
brought back this function without warnings squashed.
Other similar warnings in this file were squashed in 55efb8e562bca6c4090a73712342ac006e133704 and friends. But the revert in the
previous commit brought back this function without warnings squashed.
smyrna gvpr_select: use cgraph wrapper for allocation
The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.
smyrna gvpr_select: remove NULL-hinted call to 'agxbinit'
Reverting 656a15f855a31acc6eeb162284b89ad3367253b9 reintroduced a NULL-hinted
call to `agxbinit`. But in the meantime, db5dc6497e86b886a41d52ea13f0598ecaa9c296 removed all such uses replacing them
with an equivalent zero initialization. This commit updates the `gvpr_select`
usage to be in line with other usage in the current Graphviz tree.
This reverts commit 656a15f855a31acc6eeb162284b89ad3367253b9. An upcoming commit
will revert the removal of `on_attrSearchBtn_clicked` that calls this function.
Other similar warnings in this file were squashed in 55efb8e562bca6c4090a73712342ac006e133704 and friends. But the revert in the
previous commit brought back this function without warnings squashed.
This was a mistake in 014e38a46747be84e6f639389dd27683ad37867e that intended to
squash compiler warnings but accidentally pinned `top` and `bottom` to the limit
values, regardless of the bounding box.
pack parsePackModeInfo: fix incorrect calculation of `aspect` parameter offset
Looking at the surrounding code, it is possible to see this code intended to
move forwards by 6 (`strlen("aspect")`) after having seen the string “aspect”
rather than moving forwards 5 (`strlen("array")`) as it was doing.
Magnus Jacobsson [Fri, 16 Sep 2022 10:56:01 +0000 (12:56 +0200)]
add new test_edge_node_overlap_cylinder_node_shape test
An upcoming commit series will add separate fixes for different parts
of the overlap problems. Having separate test cases for checking
maximum or minimum overlap will make it easier to see that the fixes
have the intended effect.
Magnus Jacobsson [Fri, 16 Sep 2022 10:32:13 +0000 (12:32 +0200)]
add new test_edge_node_overlap_point_node_shape test
An upcoming commit series will add separate fixes for different parts
of the overlap problems. Having separate test cases for checking
maximum or minimum overlap will make it easier to see that the fixes
have the intended effect.
Magnus Jacobsson [Fri, 16 Sep 2022 09:07:38 +0000 (11:07 +0200)]
add new test_edge_node_overlap_ellipse_node_shapes_except_point test
An upcoming commit series will add separate fixes for different parts
of the overlap problems. Having separate test cases for checking
maximum or minimum overlap will make it easier to see that the fixes
have the intended effect.