]> granicus.if.org Git - graphviz/log
graphviz
2 years agoremove 'pointfof' and replace with aggregate initialization
Matthew Fernandez [Thu, 20 Oct 2022 00:31:07 +0000 (17:31 -0700)]
remove 'pointfof' and replace with aggregate initialization

Now that Graphviz is compiled with C99, there does not seem to be much advantage
in retaining this helper function. We have initialization syntax that is the
same number of characters and can be understood locally without having to lookup
the definition of `pointfof`.

2 years agoMerge branch 'smattr/56490884-a2c9-40bb-a9e0-c0825b5d780d' into 'main'
Matthew Fernandez [Tue, 1 Nov 2022 16:02:54 +0000 (16:02 +0000)]
Merge branch 'smattr/56490884-a2c9-40bb-a9e0-c0825b5d780d' into 'main'

unconditionally use 'deflateBound' when zlib is enabled

See merge request graphviz/graphviz!2916

2 years agounconditionally use 'deflateBound' when zlib is enabled
Matthew Fernandez [Wed, 19 Oct 2022 03:51:44 +0000 (20:51 -0700)]
unconditionally use 'deflateBound' when zlib is enabled

When Graphviz was built with support for zlib-based compression, it would only
use `deflateBound` if it was discovered at build time. The `deflateBound` code
path provides a tighter estimate of final compressed size, allowing compression
to minimize its intermediate heap allocations.

The CMake build system did not attempt to discover the presence of
`deflateBound` (config-cmake.in). The Windows build hard coded `deflateBound` as
unavailable (windows/include/config.h). So both these builds would result in a
Graphviz that would use more memory than necessary when writing compressed
output formats.

`deflateBound` arrived in zlib 1.2.0, released on 2003-03-09. It seems safe to
unconditionally assume its existence in 2022. The estimate `deflateBound`
provides has improved in successive releases, with even the latest zlib 1.2.13
released on 2022-10-13 further tightening its estimate. So it is expected that
Graphviz users, with this change, will get lower memory usage during writing
compressed formats, and then lower still as newer zlib releases propagate
through the ecosystem.

2 years agoMerge branch 'fix-issue-372-for-diamond-arrows' into 'main'
Magnus Jacobsson [Mon, 31 Oct 2022 06:01:53 +0000 (06:01 +0000)]
Merge branch 'fix-issue-372-for-diamond-arrows' into 'main'

Fix issue 372 for diamond arrows

Closes #372

See merge request graphviz/graphviz!2914

2 years agoarrows: arrow_length_diamond: take edge penwidth into account when calculating length
Magnus Jacobsson [Thu, 6 Oct 2022 09:02:40 +0000 (11:02 +0200)]
arrows: arrow_length_diamond: take edge penwidth into account when calculating length

The test_edge_node_overlap_diamond_edge_arrow test case now succeeds,
so the expectancy that it should fail is removed.

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

2 years agoarrows: factor out arrow_type_diamond0 function
Magnus Jacobsson [Thu, 6 Oct 2022 07:22:25 +0000 (09:22 +0200)]
arrows: factor out arrow_type_diamond0 function

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

2 years agoarrows: arrow_type_diamond: fix positioning of diamond arrow
Magnus Jacobsson [Wed, 5 Oct 2022 20:33:40 +0000 (22:33 +0200)]
arrows: arrow_type_diamond: fix positioning of diamond arrow

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

2 years agoadd new test_edge_node_overlap_diamond_edge_arrow test
Magnus Jacobsson [Wed, 5 Oct 2022 20:33:07 +0000 (22:33 +0200)]
add new test_edge_node_overlap_diamond_edge_arrow test

2 years agotests: GraphvizEdge: handle primitive arrow shape 'diamond' in arrowhead/tail_outline...
Magnus Jacobsson [Wed, 5 Oct 2022 20:31:28 +0000 (22:31 +0200)]
tests: GraphvizEdge: handle primitive arrow shape 'diamond' in arrowhead/tail_outline_bbox

2 years agotests: test_edge_node_overlap_utilities: adjust max_edge_stem_arrow_overlap for ...
Magnus Jacobsson [Thu, 6 Oct 2022 09:01:37 +0000 (11:01 +0200)]
tests: test_edge_node_overlap_utilities: adjust max_edge_stem_arrow_overlap for 'diamond' arrow

2 years agoarrows: arrow_length_normal: update comment
Magnus Jacobsson [Fri, 21 Oct 2022 06:22:52 +0000 (08:22 +0200)]
arrows: arrow_length_normal: update comment

It doesn't matter if the corner is sharp or not. We might get a
partial gap for any corner.

2 years agotests: test_edge_node_overlap_utilities: remove FIXME for 'box' arrow
Magnus Jacobsson [Thu, 6 Oct 2022 08:44:48 +0000 (10:44 +0200)]
tests: test_edge_node_overlap_utilities: remove FIXME for 'box' arrow

The existing calculation is correct.

2 years agoMerge branch 'smattr/94752f63-7e16-4d9b-b32f-946e22e1232c' into 'main'
Matthew Fernandez [Sun, 23 Oct 2022 01:55:49 +0000 (01:55 +0000)]
Merge branch 'smattr/94752f63-7e16-4d9b-b32f-946e22e1232c' into 'main'

Start 7.0.1 development

See merge request graphviz/graphviz!2924

2 years agoStart 7.0.1 development
Matthew Fernandez [Sat, 22 Oct 2022 23:45:08 +0000 (16:45 -0700)]
Start 7.0.1 development

2 years agoMerge branch 'smattr/d90c8be8-3fd9-4265-837e-ae9becaad5ae' into 'main' 7.0.0
Matthew Fernandez [Sun, 23 Oct 2022 00:53:13 +0000 (00:53 +0000)]
Merge branch 'smattr/d90c8be8-3fd9-4265-837e-ae9becaad5ae' into 'main'

Stable release 7.0.0

See merge request graphviz/graphviz!2915

2 years agoStable release 7.0.0
Matthew Fernandez [Wed, 19 Oct 2022 04:20:52 +0000 (21:20 -0700)]
Stable release 7.0.0

2 years agoMerge branch 'add-changelog-entry-for-partial-fix-of-issue-372' into 'main'
Magnus Jacobsson [Sat, 22 Oct 2022 20:05:33 +0000 (20:05 +0000)]
Merge branch 'add-changelog-entry-for-partial-fix-of-issue-372' into 'main'

Add CHANGELOG entry for partial fix of issue #372

See merge request graphviz/graphviz!2917

2 years agoadd CHANGELOG entry for partial fix of issue #372
Magnus Jacobsson [Wed, 19 Oct 2022 17:44:44 +0000 (19:44 +0200)]
add CHANGELOG entry for partial fix of issue #372

2 years agoMerge branch 'smattr/f160b995-5829-4a74-b4f1-c9f16987a3f7' into 'main'
Matthew Fernandez [Wed, 19 Oct 2022 15:45:03 +0000 (15:45 +0000)]
Merge branch 'smattr/f160b995-5829-4a74-b4f1-c9f16987a3f7' into 'main'

cgraph: compiler warning squashing

See merge request graphviz/graphviz!2913

2 years agocgraph aagerror: squash -Wmissing-prototypes warning
Matthew Fernandez [Sun, 16 Oct 2022 04:06:44 +0000 (21:06 -0700)]
cgraph aagerror: squash -Wmissing-prototypes warning

Calls to this function are generated by Flex – it normally generates calls to
`yyerror` but we alter the Flex prefix to `aag` – but it does not generate a
prototype for the function. So squash the compiler’s overly cautious warning:

  ../../lib/cgraph/scan.l: At top level:
  ../../lib/cgraph/scan.l:219:6: warning: no previous prototype for ‘aagerror’
    [-Wmissing-prototypes]
    219 | void aagerror(const char *str)
        |      ^~~~~~~~

2 years agocgraph aagerror: squash -Wswitch-default warning
Matthew Fernandez [Sun, 16 Oct 2022 03:59:03 +0000 (20:59 -0700)]
cgraph aagerror: squash -Wswitch-default warning

Squashes:

  ../../lib/cgraph/scan.l: In function ‘aagerror’:
  ../../lib/cgraph/scan.l:232:14: warning: switch missing default case
    [-Wswitch-default]
    232 |         else switch (YYSTATE) {
        |              ^~~~~~

This switch is adding more information to the error message based on which
lexing state we are in, of which four are defined: `INITIAL` (the built-in start
state), `comment`, `hstring`, and `qstring`. In the `INITIAL` state there is no
extra information to add.

2 years agocgraph storeFileName: squash warnings when dealing with buffer lengths
Matthew Fernandez [Sun, 16 Oct 2022 03:46:03 +0000 (20:46 -0700)]
cgraph storeFileName: squash warnings when dealing with buffer lengths

This removes the following compiler warnings which were particularly problematic
as they were pointing to the wrong source lines. It is unclear whether this is
due to a Flex bug or the way we are calling Flex.

  ../../lib/cgraph/scan.l: In function ‘storeFileName’:
  ../../lib/cgraph/scan.l:98:28: warning: conversion to ‘size_t’ {aka ‘long
    unsigned int’} from ‘int’ may change the sign of the result
    [-Wsign-conversion]
     98 |     static char* buf;
        |                            ^
  ../../lib/cgraph/scan.l:98:37: warning: conversion to ‘size_t’ {aka ‘long
    unsigned int’} from ‘int’ may change the sign of the result
    [-Wsign-conversion]
     98 |     static char* buf;
        |                                     ^
  ../../lib/cgraph/scan.l: In function ‘ppDirective’:
  ../../lib/cgraph/scan.l:125:29: warning: conversion from ‘long int’ to ‘int’
    may change value [-Wconversion]
    125 |             while (*e && *e != '"') e++;
        |                            ~^~

2 years agoMerge branch 'smattr/88db8a54-af1e-4738-af59-7cad3fc964af' into 'main'
Matthew Fernandez [Wed, 19 Oct 2022 05:29:59 +0000 (05:29 +0000)]
Merge branch 'smattr/88db8a54-af1e-4738-af59-7cad3fc964af' into 'main'

smyrna, common: fix some unchecked allocation failures

See merge request graphviz/graphviz!2912

2 years agocommon gv_fixLocale: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 18:18:19 +0000 (11:18 -0700)]
common gv_fixLocale: fix unchecked allocation failure

2 years agocommon emit_once: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 18:13:46 +0000 (11:13 -0700)]
common emit_once: fix unchecked allocation failure

2 years agocommon emit_colors: fix unchecked allocation failures
Matthew Fernandez [Sat, 15 Oct 2022 18:13:13 +0000 (11:13 -0700)]
common emit_colors: fix unchecked allocation failures

2 years agocommon xdotBB: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 18:07:06 +0000 (11:07 -0700)]
common xdotBB: fix unchecked allocation failure

2 years agocommon emit_begin_edge: fix unchecked allocation failures
Matthew Fernandez [Sat, 15 Oct 2022 18:06:32 +0000 (11:06 -0700)]
common emit_begin_edge: fix unchecked allocation failures

2 years agocommon emit_edge_graphics: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 18:05:00 +0000 (11:05 -0700)]
common emit_edge_graphics: fix unchecked allocation failure

2 years agocommon parse_layers: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 18:03:53 +0000 (11:03 -0700)]
common parse_layers: fix unchecked allocation failure

2 years agocommon parseSegs: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 18:02:53 +0000 (11:02 -0700)]
common parseSegs: fix unchecked allocation failure

2 years agocommon initMapData: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 18:01:50 +0000 (11:01 -0700)]
common initMapData: fix unchecked allocation failure

2 years agosmyrna loadGraph: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 18:00:18 +0000 (11:00 -0700)]
smyrna loadGraph: fix unchecked allocation failure

2 years agosmyrna get_data_dir: fix unchecked allocation failure
Matthew Fernandez [Sat, 15 Oct 2022 17:59:52 +0000 (10:59 -0700)]
smyrna get_data_dir: fix unchecked allocation failure

2 years agoMerge branch 'smattr/8699c0b2-506c-4894-baa7-ebd68e41a77c' into 'main'
Matthew Fernandez [Wed, 19 Oct 2022 04:25:21 +0000 (04:25 +0000)]
Merge branch 'smattr/8699c0b2-506c-4894-baa7-ebd68e41a77c' into 'main'

common: fix some unchecked allocation failures

See merge request graphviz/graphviz!2909

2 years agocommon make_label: fix unchecked allocation failures
Matthew Fernandez [Fri, 14 Oct 2022 04:02:41 +0000 (21:02 -0700)]
common make_label: fix unchecked allocation failures

2 years agocommon make_html_label: fix unchecked allocation failures
Matthew Fernandez [Fri, 14 Oct 2022 04:02:24 +0000 (21:02 -0700)]
common make_html_label: fix unchecked allocation failures

2 years agocommon pos_html_tbl: fix unchecked allocation failure
Matthew Fernandez [Fri, 14 Oct 2022 04:02:03 +0000 (21:02 -0700)]
common pos_html_tbl: fix unchecked allocation failure

2 years agocommon pos_html_cell: fix unchecked allocation failure
Matthew Fernandez [Fri, 14 Oct 2022 04:01:46 +0000 (21:01 -0700)]
common pos_html_cell: fix unchecked allocation failure

2 years agocommon initAnchor: fix unchecked allocation failure
Matthew Fernandez [Fri, 14 Oct 2022 04:01:28 +0000 (21:01 -0700)]
common initAnchor: fix unchecked allocation failure

2 years agoMerge branch 'smattr/6cc83583-ac65-48bd-a384-2d2630f3e9ca' into 'main'
Matthew Fernandez [Wed, 19 Oct 2022 01:16:13 +0000 (01:16 +0000)]
Merge branch 'smattr/6cc83583-ac65-48bd-a384-2d2630f3e9ca' into 'main'

remove checks for librsvg ≥2.36.0 and 'HAVE_SVG_2_36'

See merge request graphviz/graphviz!2908

2 years agoremove checks for librsvg ≥2.36.0 and 'HAVE_SVG_2_36'
Matthew Fernandez [Fri, 14 Oct 2022 00:15:45 +0000 (17:15 -0700)]
remove checks for librsvg ≥2.36.0 and 'HAVE_SVG_2_36'

The only code that used this was removed in
63a5fcd96f53761630a37fff7657db5d03619a7d.

2 years agoMerge branch 'fix-issue-372-for-dot-arrows' into 'main'
Magnus Jacobsson [Tue, 18 Oct 2022 19:58:13 +0000 (19:58 +0000)]
Merge branch 'fix-issue-372-for-dot-arrows' into 'main'

Fix issue 372 for dot arrows

Closes #372

See merge request graphviz/graphviz!2910

2 years agoarrows: arrow_length_dot: take edge penwidth into account when calculating length
Magnus Jacobsson [Thu, 6 Oct 2022 06:23:38 +0000 (08:23 +0200)]
arrows: arrow_length_dot: take edge penwidth into account when calculating length

The test_edge_node_overlap_dot_edge_arrow test case now succeeds, so
the expectancy that it should fail is removed.

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

2 years agoarrows: arrow_type_dot: fix positioning of 'dot' shaped edge arrows
Magnus Jacobsson [Wed, 5 Oct 2022 14:58:08 +0000 (16:58 +0200)]
arrows: arrow_type_dot: fix positioning of 'dot' shaped edge arrows

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

2 years agoadd new test_edge_node_overlap_dot_edge_arrow test
Magnus Jacobsson [Wed, 5 Oct 2022 14:45:29 +0000 (16:45 +0200)]
add new test_edge_node_overlap_dot_edge_arrow test

2 years agotests: GraphvizEdge: handle primitive arrow shape 'dot' in arrowtail_outline_bbox
Magnus Jacobsson [Wed, 5 Oct 2022 20:28:14 +0000 (22:28 +0200)]
tests: GraphvizEdge: handle primitive arrow shape 'dot' in arrowtail_outline_bbox

2 years agotests: GraphvizEdge: handle primitive arrow shape 'dot' in arrowhead_outline_bbox
Magnus Jacobsson [Wed, 5 Oct 2022 20:28:14 +0000 (22:28 +0200)]
tests: GraphvizEdge: handle primitive arrow shape 'dot' in arrowhead_outline_bbox

2 years agoarrows: arrow_length_box: change to 2-space indentation
Magnus Jacobsson [Tue, 18 Oct 2022 18:43:18 +0000 (20:43 +0200)]
arrows: arrow_length_box: change to 2-space indentation

This is newly added code that should conform to the clang-format
style.

2 years agoMerge branch 'gshklover_msbuild' into 'main'
Matthew Fernandez [Sat, 15 Oct 2022 21:43:05 +0000 (21:43 +0000)]
Merge branch 'gshklover_msbuild' into 'main'

Increase stack size for dot MSBUILD project file (avoid crash on larger graphs)

See merge request graphviz/graphviz!2858

2 years agoIncrease stack size for dot MSBUILD project file (avoid crash on larger graphs)
greg [Fri, 7 Oct 2022 00:34:47 +0000 (17:34 -0700)]
Increase stack size for dot MSBUILD project file (avoid crash on larger graphs)

Comment from Matthew Fernandez: It is believed this resolves some instances of
stack overflow in `dfs_enter_outedge` experienced with larger graphs on Windows.

Co-authored-by: Matthew Fernandez <matthew.fernandez@gmail.com>
2 years agoMerge branch 'smattr/1350efe5-0c2c-4d52-9e20-2cdee7f2cc34' into 'main'
Matthew Fernandez [Sat, 15 Oct 2022 01:31:39 +0000 (01:31 +0000)]
Merge branch 'smattr/1350efe5-0c2c-4d52-9e20-2cdee7f2cc34' into 'main'

smyrna: fix several memory leaks

See merge request graphviz/graphviz!2901

2 years agosmyrna mTestgvpr: remove unnecessary dynamic allocation
Matthew Fernandez [Mon, 10 Oct 2022 15:22:47 +0000 (08:22 -0700)]
smyrna mTestgvpr: remove unnecessary dynamic allocation

This is the equivalent of e18e57257e968545ff9d130a3b9b7bdd440deb1c applied to
similar code.

2 years agosmyrna on_gvprbuttonsave_clicked: fix comment description
Matthew Fernandez [Mon, 10 Oct 2022 15:17:21 +0000 (08:17 -0700)]
smyrna on_gvprbuttonsave_clicked: fix comment description

This appears to have been copy-pasted from `on_gvprbuttonload_clicked` and not
updated.

2 years agosmyrna on_gvprbuttonsave_clicked: simplify file writing
Matthew Fernandez [Mon, 10 Oct 2022 15:16:04 +0000 (08:16 -0700)]
smyrna on_gvprbuttonsave_clicked: simplify file writing

Compilers like GCC can make this optimizing transform themselves, but this
change aids less sophisticated compilers.

2 years agosmyrna on_gvprbuttonsave_clicked: fix memory leak
Matthew Fernandez [Mon, 10 Oct 2022 15:13:56 +0000 (08:13 -0700)]
smyrna on_gvprbuttonsave_clicked: fix memory leak

The `gtk_text_buffer_get_text` docs¹ note:

  Return value
  …
  The caller of the method takes ownership of the data, and is responsible for
  freeing it.

¹ https://docs.gtk.org/gtk4/method.TextBuffer.get_text.html

2 years agosmyrna savefiledlg, on_gvprbuttonsave_clicked: fix memory leaks
Matthew Fernandez [Mon, 10 Oct 2022 15:08:51 +0000 (08:08 -0700)]
smyrna savefiledlg, on_gvprbuttonsave_clicked: fix memory leaks

The `gtk_file_chooser_get_filename` docs¹ note:

  Return value
  …
  The currently selected filename, or NULL if no file is selected, or the
  selected file can’t be represented with a local filename. Free with g_free().

  The caller of the method takes ownership of the data, and is responsible for
  freeing it.

Contrary to this, `savefiledlg` was duplicating the pointed to data and then
losing the pointer `gtk_file_chooser_get_filename` returned.

The straightforward fix to this would be to retain the pointer and then `g_free`
it after copying its contents into the buffer `xbuf`. However, we can instead
refactor this function to avoid the copy altogether and simply pass the original
memory back to the caller, making this both a fix and an optimization.

On top of this, `on_gvprbuttonsave_clicked` was never calling `agxbfree` on its
local `xbuf`. By moving to a standard string, we also fix this memory leak.

¹ https://docs.gtk.org/gtk3/method.FileChooser.get_filename.html

2 years agosmyrna savefiledlg: remove filter parameters
Matthew Fernandez [Mon, 10 Oct 2022 15:03:46 +0000 (08:03 -0700)]
smyrna savefiledlg: remove filter parameters

This function is only ever called without any filters.

2 years agosmyrna openfiledlg: fix memory leak
Matthew Fernandez [Mon, 10 Oct 2022 04:37:45 +0000 (21:37 -0700)]
smyrna openfiledlg: fix memory leak

The `gtk_file_chooser_get_filename` docs¹ note:

  Return value
  …
  The currently selected filename, or NULL if no file is selected, or the
  selected file can’t be represented with a local filename. Free with g_free().

  The caller of the method takes ownership of the data, and is responsible for
  freeing it.

Contrary to this, `openfiledlg` was duplicating the pointed to data and then
losing the pointer `gtk_file_chooser_get_filename` returned.

The straightforward fix to this would be to retain the pointer and then `g_free`
it after copying its contents into the buffer `xbuf`. However, we can instead
refactor this function to avoid the copy altogether and simply pass the original
memory back to the caller, making this both a fix and an optimization.

¹ https://docs.gtk.org/gtk3/method.FileChooser.get_filename.html

2 years agosmyrna openfiledlg: remove filter parameters
Matthew Fernandez [Mon, 10 Oct 2022 04:28:53 +0000 (21:28 -0700)]
smyrna openfiledlg: remove filter parameters

This function is only ever called without any filters.

2 years agoMerge branch 'smattr/d09d7fac-10de-445a-a41f-d426f8d2bffb' into 'main'
Matthew Fernandez [Fri, 14 Oct 2022 16:38:15 +0000 (16:38 +0000)]
Merge branch 'smattr/d09d7fac-10de-445a-a41f-d426f8d2bffb' into 'main'

graphml2gv: remove some dead code

See merge request graphviz/graphviz!2906

2 years agocommon appendFLineList: fix unchecked allocation failure
Matthew Fernandez [Thu, 13 Oct 2022 04:46:00 +0000 (21:46 -0700)]
common appendFLineList: fix unchecked allocation failure

2 years agographml2gv: remove 'composite_buffer' from 'userdata_t'
Matthew Fernandez [Thu, 13 Oct 2022 04:36:28 +0000 (21:36 -0700)]
graphml2gv: remove 'composite_buffer' from 'userdata_t'

1d28d7d2b4d2b2551bd1f432aa175f54a69364a4 seems to have copied this
implementation of `userdata_t` from cmd/tools/gxl2gv.c without noticing the
`composite_buffer` member is never used in graphml2gv.

2 years agographml2gv: remove 'xml_attr_value' from 'userdata_t'
Matthew Fernandez [Thu, 13 Oct 2022 04:33:36 +0000 (21:33 -0700)]
graphml2gv: remove 'xml_attr_value' from 'userdata_t'

1d28d7d2b4d2b2551bd1f432aa175f54a69364a4 seems to have copied this
implementation of `userdata_t` from cmd/tools/gxl2gv.c without noticing the
`xml_attr_value` member is never written to in graphml2gv.

2 years agographml2gv: remove 'xml_attr_name' from 'userdata_t'
Matthew Fernandez [Thu, 13 Oct 2022 04:31:29 +0000 (21:31 -0700)]
graphml2gv: remove 'xml_attr_name' from 'userdata_t'

1d28d7d2b4d2b2551bd1f432aa175f54a69364a4 seems to have copied this
implementation of `userdata_t` from cmd/tools/gxl2gv.c without noticing the
`xml_attr_name` member is never written to in graphml2gv.

2 years agoMerge branch 'fix-issue-372-for-box-arrows' into 'main'
Magnus Jacobsson [Fri, 14 Oct 2022 15:35:21 +0000 (15:35 +0000)]
Merge branch 'fix-issue-372-for-box-arrows' into 'main'

Fix issue 372 for box arrows

Closes #372

See merge request graphviz/graphviz!2907

2 years agoarrows: arrow_length_box: take edge penwidth into account when calculating length
Magnus Jacobsson [Tue, 4 Oct 2022 11:40:45 +0000 (13:40 +0200)]
arrows: arrow_length_box: take edge penwidth into account when calculating length

The test_edge_node_overlap_box_edge_arrow test case now succeeds, so
the expectancy that it should fail is removed.

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

2 years agoarrows: arrow_type_box: fix positioning of box arrow
Magnus Jacobsson [Tue, 4 Oct 2022 11:40:09 +0000 (13:40 +0200)]
arrows: arrow_type_box: fix positioning of box arrow

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

2 years agotests: add new test_edge_node_overlap_box_edge_arrows test
Magnus Jacobsson [Tue, 4 Oct 2022 11:38:55 +0000 (13:38 +0200)]
tests: add new test_edge_node_overlap_box_edge_arrows test

2 years agotests: GraphvizEdge: handle primitive arrow shape 'box' in arrowtail_outline_bbox
Magnus Jacobsson [Tue, 4 Oct 2022 13:21:11 +0000 (15:21 +0200)]
tests: GraphvizEdge: handle primitive arrow shape 'box' in arrowtail_outline_bbox

2 years agotests: GraphvizEdge: handle primitive arrow shape 'box' in arrowhead_outline_bbox
Magnus Jacobsson [Tue, 4 Oct 2022 13:21:00 +0000 (15:21 +0200)]
tests: GraphvizEdge: handle primitive arrow shape 'box' in arrowhead_outline_bbox

2 years agotests: graphviz_edge: remove 'arrow' method and inline instead
Magnus Jacobsson [Tue, 4 Oct 2022 13:08:15 +0000 (15:08 +0200)]
tests: graphviz_edge: remove 'arrow' method and inline instead

Upcoming commits will introduce handling of primitive arrow shapes
other than 'normal' or 'inv' which cannot be represented by a single
SVG element.

2 years agotests: test_edge_node_overlap_utilities: factor out GraphvizEdge::arrowtail_outline_b...
Magnus Jacobsson [Tue, 4 Oct 2022 12:30:12 +0000 (14:30 +0200)]
tests: test_edge_node_overlap_utilities: factor out GraphvizEdge::arrowtail_outline_bbox()

2 years agotests: test_edge_node_overlap_utilities: factor out GraphvizEdge::arrowhead_outline_b...
Magnus Jacobsson [Tue, 4 Oct 2022 12:30:12 +0000 (14:30 +0200)]
tests: test_edge_node_overlap_utilities: factor out GraphvizEdge::arrowhead_outline_bbox()

2 years agoMerge branch 'smattr/07c690c2-bf9b-4aba-a3be-31defa322cfb' into 'main'
Matthew Fernandez [Fri, 14 Oct 2022 01:38:03 +0000 (01:38 +0000)]
Merge branch 'smattr/07c690c2-bf9b-4aba-a3be-31defa322cfb' into 'main'

bump required CMake version to 3.13.0

See merge request graphviz/graphviz!2905

2 years agobump required CMake version to 3.13.0
Matthew Fernandez [Thu, 13 Oct 2022 00:52:52 +0000 (17:52 -0700)]
bump required CMake version to 3.13.0

This allows dropping several workarounds in the CMake build system. The only
supported platform with a CMake version less than 3.13.0 is Ubuntu 18.04. Given
CMake is not the default build system, the age of Ubuntu 18.04 makes it unlikely
there are users there building Graphviz from source, and later CMake versions
are easily obtainable from Kitware, it seems reasonable to increase this
requirement.

Gitlab: #2290

2 years agoCI: on Ubuntu 18.04, install CMake from Kitware instead of Apt
Matthew Fernandez [Wed, 12 Oct 2022 04:43:55 +0000 (21:43 -0700)]
CI: on Ubuntu 18.04, install CMake from Kitware instead of Apt

This moves the CMake version available on this platform from 3.10.2 to 3.24.2.
The new CMake floor is 3.16.3, determined by Ubuntu 20.04.

Gitlab: #2290

2 years agoMerge branch 'smattr/85e882d7-72ce-408a-91ca-8ef4a2de2ad5' into 'main'
Matthew Fernandez [Thu, 13 Oct 2022 05:16:50 +0000 (05:16 +0000)]
Merge branch 'smattr/85e882d7-72ce-408a-91ca-8ef4a2de2ad5' into 'main'

remove calls to 'rsvg_term'

See merge request graphviz/graphviz!2888

2 years agorsvg plugin gvloadimage_rsvg_cairo: remove unnecessary parens
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
rsvg plugin gvloadimage_rsvg_cairo: remove unnecessary parens

2 years agorsvg plugin gvloadimage_rsvg_cairo: squash -Wunused-parameter warning
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
rsvg plugin gvloadimage_rsvg_cairo: squash -Wunused-parameter warning

This function is used as a callback, so its unused parameter cannot easily be
removed.

2 years agorsvg plugin gvloadimage_rsvg_load: remove unnecessary cast
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
rsvg plugin gvloadimage_rsvg_load: remove unnecessary cast

2 years agorsvg plugin gvloadimage_rsvg_load: remove unnecessary use of gboolean
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
rsvg plugin gvloadimage_rsvg_load: remove unnecessary use of gboolean

2 years agoremove calls to 'rsvg_term'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
remove calls to 'rsvg_term'

The `rsvg_term` function has been a no-op for some time:¹

  rsvg_term has been deprecated since version 2.36 and should not be used in
  newly-written code.
  There is no need to de-initialize librsvg.
  This function does nothing.

Graphviz was calling it when linked against librsvg 2.36 (2.36.0 was released
2012-03-26). I do not know why this code was conditional as `rsvg_term` has been
a no-op since 2.35.0.² Moreover, calling it prior to it becoming a no-op was
wrong too. The commit that removed its functionality notes:

  rsvg_term() was dangerous to call

The problem is that it previously called libxml2’s `xmlCleanupParser` whose
documentation states:³

  This function name is somewhat misleading. It does not clean up parser state,
  it cleans up memory allocated by the library itself. It is a cleanup function
  for the XML library. It tries to reclaim all related global memory allocated
  for the library processing. It doesn't deallocate any document related memory.
  One should call xmlCleanupParser() only when the process has finished using
  the library and all XML/HTML documents built with it. See also xmlInitParser()
  which has the opposite function of preparing the library for operations.
  WARNING: if your application is multithreaded or has plugin support calling
  this may crash the application if another thread or a plugin is still using
  libxml2. It's sometimes very hard to guess if libxml2 is in use in the
  application, some libraries or plugins may use it without notice. In case of
  doubt abstain from calling this function or do it just before calling exit()
  to avoid leak reports from valgrind !

This seems to have come to light ~2010.⁴ But presumably there is still a long
tail of software in the wild still, like Graphviz, erroneously calling
`rsvg_term`.

¹ https://www.manpagez.com/html/rsvg-2.0/rsvg-2.0-2.52.1/RsvgHandle.php#rsvg-term
² Commit 7f27418cfcdea9cdd6b2bf81ea0b0f6cc5a18b30 of librsvg.
³ https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser
⁴ https://lists.fedoraproject.org/pipermail/devel/2010-January/129117.html
  https://bugzilla.redhat.com/show_bug.cgi?id=542277
  https://bugzilla.gnome.org/show_bug.cgi?id=592100

2 years agoMerge branch 'smattr/95708189-94d5-485b-a0c1-5face69b647d' into 'main'
Matthew Fernandez [Thu, 13 Oct 2022 02:09:48 +0000 (02:09 +0000)]
Merge branch 'smattr/95708189-94d5-485b-a0c1-5face69b647d' into 'main'

gvc: remove dead code, swap some stat() for access()

See merge request graphviz/graphviz!2902

2 years agogvc: remove unused 'gv_argvlist_free'
Matthew Fernandez [Tue, 11 Oct 2022 01:36:29 +0000 (18:36 -0700)]
gvc: remove unused 'gv_argvlist_free'

The last use of this was removed in b3a03d1279b00565991abb4f0354c28f69e97650.

2 years agogvc: remove unused 'gvNEWargvlist'
Matthew Fernandez [Tue, 11 Oct 2022 01:36:03 +0000 (18:36 -0700)]
gvc: remove unused 'gvNEWargvlist'

This seems to have never been used.

2 years agogvc gvplugin_library_load: replace read check using 'stat' with using 'access'
Matthew Fernandez [Tue, 11 Oct 2022 01:19:18 +0000 (18:19 -0700)]
gvc gvplugin_library_load: replace read check using 'stat' with using 'access'

This probably uses `stat` under the hood too, but is slightly more concise and
clear about intent.

2 years agogvc gvconfig: replace existence check using 'stat' with using 'access'
Matthew Fernandez [Tue, 11 Oct 2022 01:13:19 +0000 (18:13 -0700)]
gvc gvconfig: replace existence check using 'stat' with using 'access'

This probably uses `stat` under the hood too, but is slightly more concise and
clear about intent.

2 years agoMerge branch 'smattr/63fa6275-5ac8-4657-9b09-05d3c82776e2' into 'main'
Matthew Fernandez [Thu, 13 Oct 2022 01:03:21 +0000 (01:03 +0000)]
Merge branch 'smattr/63fa6275-5ac8-4657-9b09-05d3c82776e2' into 'main'

stop enabling -ffast-math on any platform

Closes #2296 and #1412

See merge request graphviz/graphviz!2904

2 years agoremove no longer needed 'FPERR' work around
Matthew Fernandez [Wed, 12 Oct 2022 04:29:06 +0000 (21:29 -0700)]
remove no longer needed 'FPERR' work around

As of the previous commit, `-ffast-math` is no longer enabled, so this is not
needed any more.

Gitlab: #1412, #2296

2 years agostop enabling -ffast-math on any platform
Matthew Fernandez [Wed, 12 Oct 2022 04:10:54 +0000 (21:10 -0700)]
stop enabling -ffast-math on any platform

The `-ffast-math` compiler option enables a mode of floating point semantics
that are heavily relaxed from strict IEEE 754 conformance in the name of speed.¹
The permissible optimizations under `-ffast-math` include transformations that
produce floating point results most users would consider wrong. It is unclear
why “do math fast but incorrectly” is a useful mode. It seems the world is
finally coming around to this tenet.²

This change stops enabling `-ffast-math` anywhere in the Autotools build system.

Gitlab: fixes #1412, #2296
Reported-by: Kasper Daniel Hansen
Reported-by: Ross Barnowski
¹ https://gcc.gnu.org/wiki/FloatingPointMath
² https://simonbyrne.github.io/notes/fastmath/,
  https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html

2 years agoremove suppression of -ffast-math when building with ICC
Matthew Fernandez [Wed, 12 Oct 2022 04:02:18 +0000 (21:02 -0700)]
remove suppression of -ffast-math when building with ICC

The Intel C Compiler does not support the `-ffast-math` command line option, so
this logic was suppressing it. But it is coming before anything in the Graphviz
build system itself that would add `-ffast-math`. So it is actually suppressing
a `-ffast-math` addition coming from the user’s environment. If you are a user
compiling Graphviz with ICC, I have a very simple alternative for you: do not
pass `-ffast-math` explicitly.

Gitlab: #1412, #2296

2 years agowrap over-long CHANGELOG lines
Matthew Fernandez [Wed, 12 Oct 2022 04:07:58 +0000 (21:07 -0700)]
wrap over-long CHANGELOG lines

2 years agocommon miter_point: fix comment typo
Matthew Fernandez [Wed, 12 Oct 2022 03:59:30 +0000 (20:59 -0700)]
common miter_point: fix comment typo

2 years agoMerge branch 'smattr/14781c34-102f-4608-96e5-87899b5c5213' into 'main'
Matthew Fernandez [Wed, 12 Oct 2022 15:54:54 +0000 (15:54 +0000)]
Merge branch 'smattr/14781c34-102f-4608-96e5-87899b5c5213' into 'main'

common: some minor clean up

See merge request graphviz/graphviz!2896

2 years agocommon arrow_flags: abbreviate some bitwise assignments
Matthew Fernandez [Sat, 8 Oct 2022 22:35:52 +0000 (15:35 -0700)]
common arrow_flags: abbreviate some bitwise assignments

2 years agocommon: remove unnecessary parens
Matthew Fernandez [Sat, 8 Oct 2022 22:35:42 +0000 (15:35 -0700)]
common: remove unnecessary parens

2 years agocommon: use a simpler C99 zero init for null terminating 'Arrownames'
Matthew Fernandez [Sat, 8 Oct 2022 22:27:52 +0000 (15:27 -0700)]
common: use a simpler C99 zero init for null terminating 'Arrownames'

2 years agocommon: mark 'Arrownames' const
Matthew Fernandez [Sat, 8 Oct 2022 22:27:42 +0000 (15:27 -0700)]
common: mark 'Arrownames' const

2 years agocommon: use a simpler C99 zero init for null terminating 'Arrowmods'
Matthew Fernandez [Sat, 8 Oct 2022 22:27:20 +0000 (15:27 -0700)]
common: use a simpler C99 zero init for null terminating 'Arrowmods'