]> granicus.if.org Git - graphviz/log
graphviz
2 years agogvgen: abbreviate setting 'type' in 'makeRandom'
Matthew Fernandez [Tue, 10 May 2022 01:20:01 +0000 (18:20 -0700)]
gvgen: abbreviate setting 'type' in 'makeRandom'

2 years agoMerge branch 'smattr/35D73C8A-9B3B-4DEF-8B7A-DC3015994249' into 'main'
Matthew Fernandez [Sat, 14 May 2022 20:46:17 +0000 (20:46 +0000)]
Merge branch 'smattr/35D73C8A-9B3B-4DEF-8B7A-DC3015994249' into 'main'

gml2gv: silence a -Wimplicit-fallthrough warning

See merge request graphviz/graphviz!2664

2 years agogml2gv: silence a -Wimplicit-fallthrough warning
Matthew Fernandez [Thu, 12 May 2022 04:03:10 +0000 (21:03 -0700)]
gml2gv: silence a -Wimplicit-fallthrough warning

All paths in this case end in a call to `exit`. But the compiler is apparently
unable to determine this, so use an explicit `break` to suppress a false
positive warning.

2 years agoMerge branch 'smattr/AA0A9CEA-253F-4EBA-BC44-E90796B74DFD' into 'main'
Matthew Fernandez [Sat, 14 May 2022 19:36:26 +0000 (19:36 +0000)]
Merge branch 'smattr/AA0A9CEA-253F-4EBA-BC44-E90796B74DFD' into 'main'

mm2gv: squash -Wconversion warnings for 'tolower' usage

See merge request graphviz/graphviz!2662

2 years agomm2gv: squash -Wconversion warnings for 'tolower' usage
Matthew Fernandez [Mon, 9 May 2022 02:30:23 +0000 (19:30 -0700)]
mm2gv: squash -Wconversion warnings for 'tolower' usage

For historical reasons, C functions/macros like `tolower` are specified to take
and return an `int`. This means sometimes one set of pedantic compilers (MinGW
with -Wconversion) complains about passing `char` values into these ctype.h
interfaces and another set of pedantic compilers (GCC with -Wconversion)
complains about coercing the result into a `char`. This change suppresses both
of these false positives.

2 years agoMerge branch 'qmake-detection' into 'main'
Matthew Fernandez [Sat, 14 May 2022 18:28:39 +0000 (18:28 +0000)]
Merge branch 'qmake-detection' into 'main'

Augment QMAKE detection

See merge request graphviz/graphviz!2660

2 years agoAugment QMAKE detection
David Seifert [Sat, 14 May 2022 17:40:31 +0000 (19:40 +0200)]
Augment QMAKE detection

* Many distros (Gentoo included) version qmake nowadays. For Qt 6,
  The Qt Company has decided to use `qmake6` for versioning, and
  many distros have followed this and used the same approach for Qt 5.

2 years agoMerge branch 'smattr/102AAE2A-9760-4007-8C25-9519DC274095' into 'main'
Matthew Fernandez [Sat, 14 May 2022 17:34:23 +0000 (17:34 +0000)]
Merge branch 'smattr/102AAE2A-9760-4007-8C25-9519DC274095' into 'main'

edgepaint: remove unused 'nnodes' in 'node_distinct_coloring'

See merge request graphviz/graphviz!2665

2 years agosfdpgen: squash -Wunused warnings for 'nsuper_avg'
Matthew Fernandez [Sat, 14 May 2022 03:55:32 +0000 (20:55 -0700)]
sfdpgen: squash -Wunused warnings for 'nsuper_avg'

These are currently failing the macOS CMake build in CI.

2 years agoneatogen: remove unused 'total_gap' in 'constrained_majorization_new_with_gaps'
Matthew Fernandez [Sat, 14 May 2022 02:31:41 +0000 (19:31 -0700)]
neatogen: remove unused 'total_gap' in 'constrained_majorization_new_with_gaps'

The CMake macOS CI job has begun erroring out:

  …/lib/neatogen/quad_prog_solve.c:602:11: error: variable 'total_gap' set but
    not used [-Werror,-Wunused-but-set-variable]
    float total_gap, target_place;
          ^

While the error is accurate, nothing has changed on our side that would have
caused this. I can only assume Gitlab have upgraded the macOS runners to pull in
a new version of Clang.

2 years agomingle: remove unused 'len_total' in 'pedge_export_gv'
Matthew Fernandez [Sat, 14 May 2022 00:01:26 +0000 (17:01 -0700)]
mingle: remove unused 'len_total' in 'pedge_export_gv'

The CMake macOS CI job has begun erroring out:

  …/lib/mingle/edge_bundling.cpp:208:27: error: variable 'len_total' set but not
    used [-Werror,-Wunused-but-set-variable]
    double maxwgt = 0, len, len_total, len_total0;
                            ^

While the error is accurate, nothing has changed on our side that would have
caused this. I can only assume Gitlab have upgraded the macOS runners to pull in
a new version of Clang.

2 years agomingle: remove unused 'total_wgt' in 'agglomerative_ink_bundling_internal'
Matthew Fernandez [Fri, 13 May 2022 15:04:07 +0000 (08:04 -0700)]
mingle: remove unused 'total_wgt' in 'agglomerative_ink_bundling_internal'

The CMake macOS CI job has begun erroring out:

  …/lib/mingle/agglomerative_bundling.cpp:400:27: error: variable 'total_wgt'
    set but not used [-Werror,-Wunused-but-set-variable]
  double eps = 0., wgt, total_wgt = 0;
                        ^

While the error is accurate, nothing has changed on our side that would have
caused this. I can only assume Gitlab have upgraded the macOS runners to pull in
a new version of Clang.

2 years agoedgepaint: remove unused 'nnodes' in 'node_distinct_coloring'
Matthew Fernandez [Fri, 13 May 2022 13:49:46 +0000 (06:49 -0700)]
edgepaint: remove unused 'nnodes' in 'node_distinct_coloring'

The CMake macOS CI job has begun erroring out:

  …/lib/edgepaint/node_distinct_coloring.c:204:17: error: variable 'nnodes'
    set but not used [-Werror,-Wunused-but-set-variable]
  int i, j, jj, nnodes = 0;
                ^

While the error is accurate, nothing has changed on our side that would have
caused this. I can only assume Gitlab have upgraded the macOS runners to pull in
a new version of Clang.

2 years agoMerge branch 'smattr/EE3BD42E-42C7-4AA3-A03E-1E4F0CEEDA39' into 'main'
Matthew Fernandez [Thu, 12 May 2022 03:50:30 +0000 (03:50 +0000)]
Merge branch 'smattr/EE3BD42E-42C7-4AA3-A03E-1E4F0CEEDA39' into 'main'

tclpkg: squash some compiler warnings

See merge request graphviz/graphviz!2655

2 years agotclpkg: remove unnecessary explicit dereference and parens on function pointer
Matthew Fernandez [Fri, 6 May 2022 00:37:30 +0000 (17:37 -0700)]
tclpkg: remove unnecessary explicit dereference and parens on function pointer

The compiler already knows how to dereference and call through a function
pointer without needing explicit instruction.

2 years agotclpkg: remove unnecessary line wrapping
Matthew Fernandez [Fri, 6 May 2022 00:37:19 +0000 (17:37 -0700)]
tclpkg: remove unnecessary line wrapping

2 years agotclpkg: squash -Wunused-parameter warnings in commands
Matthew Fernandez [Fri, 6 May 2022 00:28:02 +0000 (17:28 -0700)]
tclpkg: squash -Wunused-parameter warnings in commands

These functions are used as callback so need to conform to a particular type
signature.

2 years agotclpkg: mark 'gdCmd' static
Matthew Fernandez [Fri, 6 May 2022 00:21:52 +0000 (17:21 -0700)]
tclpkg: mark 'gdCmd' static

This function is not used outside of its containing file.

2 years agoMerge branch 'smattr/A26FCACA-4EE0-449E-A1C6-9BF2D60F49B8' into 'main'
Matthew Fernandez [Thu, 12 May 2022 02:22:04 +0000 (02:22 +0000)]
Merge branch 'smattr/A26FCACA-4EE0-449E-A1C6-9BF2D60F49B8' into 'main'

neatogen: remove unused randomkit code

See merge request graphviz/graphviz!2658

2 years agoneatogen: remove unused 'rk_state' members
Matthew Fernandez [Fri, 6 May 2022 01:34:13 +0000 (18:34 -0700)]
neatogen: remove unused 'rk_state' members

2 years agoneatogen: remove unused 'rk_strerror' and 'rk_error'
Matthew Fernandez [Fri, 6 May 2022 01:29:37 +0000 (18:29 -0700)]
neatogen: remove unused 'rk_strerror' and 'rk_error'

These do _not_ appear to be the errors returned by randomkit.c at all.

2 years agoneatogen: remove unused 'rk_long'
Matthew Fernandez [Fri, 6 May 2022 01:26:30 +0000 (18:26 -0700)]
neatogen: remove unused 'rk_long'

2 years agoneatogen: remove unused 'rk_double'
Matthew Fernandez [Fri, 6 May 2022 01:25:20 +0000 (18:25 -0700)]
neatogen: remove unused 'rk_double'

2 years agoMerge branch 'smattr/CA30E255-C16A-426F-BEE2-05B541F3546F' into 'main'
Matthew Fernandez [Wed, 11 May 2022 17:06:21 +0000 (17:06 +0000)]
Merge branch 'smattr/CA30E255-C16A-426F-BEE2-05B541F3546F' into 'main'

only append 'generic' TCL include path to 'TCL_INCLUDES' if it exists

See merge request graphviz/graphviz!2656

2 years agoonly append 'generic' TCL include path to 'TCL_INCLUDES' if it exists
Matthew Fernandez [Fri, 6 May 2022 00:17:11 +0000 (17:17 -0700)]
only append 'generic' TCL include path to 'TCL_INCLUDES' if it exists

Squashes numerous -Wmissing-include-dirs compilation warnings.

2 years agoMerge branch 'smattr/D01C105D-5B09-45D9-9130-AE2DEF972D96' into 'main'
Matthew Fernandez [Wed, 11 May 2022 14:22:13 +0000 (14:22 +0000)]
Merge branch 'smattr/D01C105D-5B09-45D9-9130-AE2DEF972D96' into 'main'

unify tests/ and rtest/

See merge request graphviz/graphviz!2652

2 years agoMerge branch 'smattr/7F4532A1-7289-4917-A936-D7D27DE1AE1C' into 'main'
Matthew Fernandez [Wed, 11 May 2022 06:47:19 +0000 (06:47 +0000)]
Merge branch 'smattr/7F4532A1-7289-4917-A936-D7D27DE1AE1C' into 'main'

cgraph: fix 'gv_recalloc' bugs, replace unchecked allocations in agxbuf

See merge request graphviz/graphviz!2645

2 years agocgraph: abbreviate 'agxbdisown' string duplication to 'strdup'
Matthew Fernandez [Sat, 30 Apr 2022 23:57:37 +0000 (16:57 -0700)]
cgraph: abbreviate 'agxbdisown' string duplication to 'strdup'

2 years agocgraph: replace unchecked agxbuf allocations with alloc helpers
Matthew Fernandez [Sat, 30 Apr 2022 23:44:22 +0000 (16:44 -0700)]
cgraph: replace unchecked agxbuf allocations with alloc helpers

These allocations are at the core of some work Graphviz does and were not
checked for failure. This change swaps confusing crashes on out-of-memory for a
more graceful exit.

2 years agocgraph: fix overflow check in 'gv_recalloc'
Matthew Fernandez [Sun, 1 May 2022 01:16:34 +0000 (18:16 -0700)]
cgraph: fix overflow check in 'gv_recalloc'

2 years agocgraph: fix incorrect 'gv_recalloc' assertion
Matthew Fernandez [Sun, 1 May 2022 01:13:17 +0000 (18:13 -0700)]
cgraph: fix incorrect 'gv_recalloc' assertion

The assertion here was claiming that overflow _did_ occur when computing the
extent of the previous allocation rather than the reverse.

2 years agoMerge branch 'smattr/8283DE76-A9BE-42CF-A132-6BE3EAE609A8' into 'main'
Matthew Fernandez [Wed, 11 May 2022 05:15:14 +0000 (05:15 +0000)]
Merge branch 'smattr/8283DE76-A9BE-42CF-A132-6BE3EAE609A8' into 'main'

smyrna: squash some warnings in 'set_boundaries'

See merge request graphviz/graphviz!2654

2 years agosmyrna: simplify bounding box calculation in 'set_boundaries'
Matthew Fernandez [Thu, 5 May 2022 15:32:35 +0000 (08:32 -0700)]
smyrna: simplify bounding box calculation in 'set_boundaries'

2 years agosmyrna: squash -Wmaybe-uninitialized warnings in 'set_boundaries'
Matthew Fernandez [Thu, 5 May 2022 15:33:16 +0000 (08:33 -0700)]
smyrna: squash -Wmaybe-uninitialized warnings in 'set_boundaries'

This code is assuming there is at least one point to scan in the loop. In case
there is not (and to pacify the compiler) set an initial trivial bounding box.

2 years agoMerge branch 'smattr/2D6B3C0D-DD2F-44EA-B81B-9B1FA5B0E582' into 'main'
Matthew Fernandez [Wed, 11 May 2022 03:11:56 +0000 (03:11 +0000)]
Merge branch 'smattr/2D6B3C0D-DD2F-44EA-B81B-9B1FA5B0E582' into 'main'

some glcomp and smyrna clean up

See merge request graphviz/graphviz!2651

2 years agosmyrna: abbreviate some 'GLfloat' literals
Matthew Fernandez [Wed, 4 May 2022 15:49:33 +0000 (08:49 -0700)]
smyrna: abbreviate some 'GLfloat' literals

The `GLfloat` type is a 32-bit IEEE-754 floating point value¹ which is identical
to what the C `float` type provides on all supported platforms.

¹ https://www.khronos.org/opengl/wiki/OpenGL_Type

2 years agoglcomp: remove unused 'fontset_t'
Matthew Fernandez [Wed, 4 May 2022 15:47:07 +0000 (08:47 -0700)]
glcomp: remove unused 'fontset_t'

2 years agoglcomp: remove unnecessary 'GLfloat' casts
Matthew Fernandez [Wed, 4 May 2022 15:45:57 +0000 (08:45 -0700)]
glcomp: remove unnecessary 'GLfloat' casts

These values are already `GLfloat`s.

2 years agoglcomp: remove unused 'glCompPoly.hotKey'
Matthew Fernandez [Wed, 4 May 2022 15:42:56 +0000 (08:42 -0700)]
glcomp: remove unused 'glCompPoly.hotKey'

2 years agoglcomp: remove unused 'glCompPointI'
Matthew Fernandez [Wed, 4 May 2022 15:41:55 +0000 (08:41 -0700)]
glcomp: remove unused 'glCompPointI'

2 years agoMerge branch 'smattr/AEF4FE91-97F2-4976-9CA4-B5766149054C' into 'main'
Matthew Fernandez [Wed, 11 May 2022 00:01:12 +0000 (00:01 +0000)]
Merge branch 'smattr/AEF4FE91-97F2-4976-9CA4-B5766149054C' into 'main'

CI: attempt to fix Gitlab 'cobertura' removal

Closes #2236

See merge request graphviz/graphviz!2659

2 years agoCI: attempt to fix Gitlab 'cobertura' removal
Matthew Fernandez [Fri, 6 May 2022 14:38:51 +0000 (07:38 -0700)]
CI: attempt to fix Gitlab 'cobertura' removal

The `cobertura` keyword was deprecated in March¹ and then completely removed on
2022-05-05,² causing all CI pipelines to now fail. This is an attempt to migrate
to the new syntax. More details in
https://gitlab.com/gitlab-org/gitlab/-/issues/361615.

Gitlab: Fixes #2236

¹ https://gitlab.com/gitlab-org/gitlab/-/commit/eae7dfc843783e270607d71c6db0c1ab6a52a8d1
² https://gitlab.com/gitlab-org/gitlab/-/commit/812408bafae328b81652110fc53c6c6b89e3db81#62c40d79aabcb1ce977904c9c748b08045ff0a85

2 years agoMerge branch 'maze-doc' into 'main'
Matthew Fernandez [Thu, 5 May 2022 05:34:58 +0000 (05:34 +0000)]
Merge branch 'maze-doc' into 'main'

add doxygen comments maze.h

See merge request graphviz/graphviz!2638

2 years agoadd comments to struct maze
Costa Shulyupin [Tue, 26 Apr 2022 05:20:29 +0000 (08:20 +0300)]
add comments to struct maze

The ordered sets are created by `dtopen` with descriptor `chanItemDisc`
and method `Dtoset`.

The method is defined with

 #define DT_OSET         0000004 /* ordered set (self-adjusting tree)    */

Channels are added with function `addChan` and are retrieved by `chanSearch`

2 years agoconvert comments to doxygen format in struct maze
Costa Shulyupin [Tue, 26 Apr 2022 05:10:04 +0000 (08:10 +0300)]
convert comments to doxygen format in struct maze

2 years agocomment for struct maze
Costa Shulyupin [Tue, 26 Apr 2022 05:09:14 +0000 (08:09 +0300)]
comment for struct maze

2 years agodoxygen comment for maze cell sides
Costa Shulyupin [Tue, 26 Apr 2022 04:45:56 +0000 (07:45 +0300)]
doxygen comment for maze cell sides

2 years agocomment for maze cell
Costa Shulyupin [Tue, 26 Apr 2022 04:40:19 +0000 (07:40 +0300)]
comment for maze cell

2 years agoconvert comments to doxygen format in maze.h
Costa Shulyupin [Tue, 26 Apr 2022 04:32:01 +0000 (07:32 +0300)]
convert comments to doxygen format in maze.h

2 years agodoxygen comment for maze.h
Costa Shulyupin [Tue, 26 Apr 2022 04:28:12 +0000 (07:28 +0300)]
doxygen comment for maze.h

2 years agoremove duplicate .gitignore line
Matthew Fernandez [Thu, 5 May 2022 02:33:04 +0000 (19:33 -0700)]
remove duplicate .gitignore line

2 years agounify tests/ and rtest/
Matthew Fernandez [Thu, 5 May 2022 02:27:04 +0000 (19:27 -0700)]
unify tests/ and rtest/

For a long time, there has been confusion in the source tree with tests/ and
rtest/ each containing part of the test suite. These were initially distinct,
but over time files in tests/ have begun importing or referring to sources in
rtest/. This has been a common point of confusion for newcomers to the project:
tests/ is the logical place the test suite should live, so they run that, but
then discover it is not the full test suite.

The diff for this commit is large, so it is challenging to see that it is not a
complex change:

  1. Merge rtest/Makefile.am into tests/Makefile.am

  2. `git mv rtest/* tests/*`

  3. Adjust all Pytest invocations from `… ci/tests.py rtest tests` to
     `… ci/tests.py tests`

  4. Adjust all other references to rtest/ to tests/ (e.g. .gitignore)

Now seems to be a brief period of calm when edits to the test suite are not
in-flight, so we have less chance of a painful merge conflict. The problem of a
large part of the rtest/rtest.py suite being disabled remains and is not
affected by this commit.

2 years agoMerge branch 'vec-delete' into 'main'
Matthew Fernandez [Thu, 5 May 2022 00:58:45 +0000 (00:58 +0000)]
Merge branch 'vec-delete' into 'main'

Fix unintended recursion in vec_delete

Closes #2225

See merge request graphviz/graphviz!2572

2 years agoAdd changelog entry summarizing the fix for #2225
Mark Hansen [Fri, 8 Apr 2022 21:23:58 +0000 (07:23 +1000)]
Add changelog entry summarizing the fix for #2225

2 years agoRemove unintended recursion in vec_delete.
Mark Hansen [Fri, 8 Apr 2022 07:35:55 +0000 (17:35 +1000)]
Remove unintended recursion in vec_delete.

This prevents a segfault: Fixes #2225.

Add a little more documentation around the responsibilities of callers
to make this a little less likely to happen again.

I thought about calling this vec_vec_delete but went with cycles_delete;
the only place this is used is for cycles.

This effectively reverts c4ef19f483d577a8395a1a1f9ca5a321af3472b5,
and fixes that commit's memory leak in a different way.

2 years agoAdd failing test case for #2225
Mark Hansen [Fri, 8 Apr 2022 07:34:40 +0000 (17:34 +1000)]
Add failing test case for #2225

This fails when I run

```
pytest test_regression.py -k test_2225
```

on macOS.

I manually reduced the test case to minimal format, starting from
`graphs/undirected/ngk10_4.gv` and removing unnecessary elements.

Co-authored-by: Matthew Fernandez <matthew.fernandez@gmail.com>
2 years agoMerge branch 'automake-cleanup' into 'main'
Matthew Fernandez [Tue, 3 May 2022 00:10:04 +0000 (00:10 +0000)]
Merge branch 'automake-cleanup' into 'main'

Move unconditional `man_MANS` -> `dist_man_MANS`

See merge request graphviz/graphviz!2649

2 years agoMove `pdf_DATA` -> `dist_pdf_DATA`
David Seifert [Mon, 2 May 2022 20:30:58 +0000 (22:30 +0200)]
Move `pdf_DATA` -> `dist_pdf_DATA`

2 years agoMove `html_DATA` -> `dist_html_DATA`
David Seifert [Mon, 2 May 2022 20:30:58 +0000 (22:30 +0200)]
Move `html_DATA` -> `dist_html_DATA`

2 years agoMove unconditional `man_MANS` -> `dist_man_MANS`
David Seifert [Mon, 2 May 2022 20:30:58 +0000 (22:30 +0200)]
Move unconditional `man_MANS` -> `dist_man_MANS`

* Avoids the repetition in `EXTRA_DIST`, and is the recommended
  Automake pattern.
* Some `man_MANS` will have to remain, since Automake has a bug
  where `dist_man_MANS` in Automake branches do not get included
  in the tarball:
    https://lists.gnu.org/archive/html/bug-automake/2008-06/msg00019.html

2 years agoMerge branch 'smattr/C84BAA48-355C-42CA-9E67-B89D004FB871' into 'main'
Matthew Fernandez [Mon, 2 May 2022 17:50:19 +0000 (17:50 +0000)]
Merge branch 'smattr/C84BAA48-355C-42CA-9E67-B89D004FB871' into 'main'

remove Awk build dependency

Closes #2118

See merge request graphviz/graphviz!2644

2 years agoadd changelog entry for Awk dependency removal
Matthew Fernandez [Mon, 11 Apr 2022 02:57:47 +0000 (19:57 -0700)]
add changelog entry for Awk dependency removal

Gitlab: closes #2118

2 years agoWindows: remove Awk setup
Matthew Fernandez [Mon, 11 Apr 2022 02:47:50 +0000 (19:47 -0700)]
Windows: remove Awk setup

Awk is no longer used by any of the build systems in use on Windows.

Gitlab: #2118

2 years agoCMake: remove required Awk detection
Matthew Fernandez [Mon, 11 Apr 2022 02:47:06 +0000 (19:47 -0700)]
CMake: remove required Awk detection

Awk is no longer used in the CMake build system.

Gitab: #2118

2 years agoAutotools: remove required Awk detection
Matthew Fernandez [Mon, 11 Apr 2022 02:46:00 +0000 (19:46 -0700)]
Autotools: remove required Awk detection

Awk is no longer used in the Autotools build system.

Gitlab: #2118

2 years agoport colortbl.h generation script to Python
Matthew Fernandez [Mon, 11 Apr 2022 02:43:04 +0000 (19:43 -0700)]
port colortbl.h generation script to Python

Note that this does not introduce an extra build dependency in any of the three
build systems:

  1. Autotools: these steps are done during construction of the portable source
     tarball, during which Python 3 is already required (see autogen.sh).

  2. CMake: Python 3 is already required by and used in the top level
     CMakeLists.txt.

  3. MS Build: Python 3 is already used in version generation in
     lib/version/version.vcxproj.

This change is motivated by the goal of removing a dependency on Awk. This
commit removes the last remaining Awk usage in all three build systems, as well
as removing dependencies on `type` and `sort` in the MS Build build system.

This commit removes the generation of the intermediate artifacts color_lib,
color_lib-sort, and color_lib-temp. Instead, we generate only the final
artifact, colortbl.h. This consolidation of logic into Python is part of what
allows the removal of dependencies described above.

Gitlab: #2118

2 years agoport brewer_lib generation script to Python
Matthew Fernandez [Mon, 11 Apr 2022 00:44:19 +0000 (17:44 -0700)]
port brewer_lib generation script to Python

Note that this does not introduce an extra build dependency in any of the three
build systems:

  1. Autotools: these steps are done during construction of the portable source
     tarball, during which Python 3 is already required (see autogen.sh).

  2. CMake: Python 3 is already required by and used in the top level
     CMakeLists.txt.

  3. MS Build: Python 3 is already used in version generation in
     lib/version/version.vcxproj.

This change is motivated by the goal of removing a dependency on Awk.

Gitlab: #2118

2 years agoport svgcolor_lib generation script to Python
Matthew Fernandez [Sun, 10 Apr 2022 21:07:36 +0000 (14:07 -0700)]
port svgcolor_lib generation script to Python

Note that this does not introduce an extra build dependency in any of the three
build systems:

  1. Autotools: these steps are done during construction of the portable source
     tarball, during which Python 3 is already required (see autogen.sh).

  2. CMake: Python 3 is already required by and used in the top level
     CMakeLists.txt.

  3. MS Build: Python 3 is already used in version generation in
     lib/version/version.vcxproj.

This change is motivated by the goal of removing a dependency on Awk. Though it
also conveniently side steps some line ending portability issues that were being
worked around with `AWK_OPTIONS`. In Python, this is unnecessary because reading
a file in text mode accounts for both flavors of line endings.

Gitlab: #2118

2 years agofix missing distclean of 'svgcolor_lib'
Matthew Fernandez [Sun, 10 Apr 2022 20:37:53 +0000 (13:37 -0700)]
fix missing distclean of 'svgcolor_lib'

This is a generated file that appears intended to be treated like `brewer_lib`
and `color_lib`.

2 years agoMerge branch 'smattr/257B56CE-F640-40F2-9EB7-43E72C4B95B3' into 'main'
Matthew Fernandez [Mon, 2 May 2022 02:02:48 +0000 (02:02 +0000)]
Merge branch 'smattr/257B56CE-F640-40F2-9EB7-43E72C4B95B3' into 'main'

cgraph, glcomp: minor clean up

See merge request graphviz/graphviz!2643

2 years agoglcomp: abbreviate 'GLfloat' literals
Matthew Fernandez [Sat, 30 Apr 2022 02:07:44 +0000 (19:07 -0700)]
glcomp: abbreviate 'GLfloat' literals

The `GLfloat` type is a 32-bit IEEE-754 floating point value¹ which is identical
to what the C `float` type provides on all supported platforms.

¹ https://www.khronos.org/opengl/wiki/OpenGL_Type

2 years agoglcomp: inline and remove 'copy_glcomp_color'
Matthew Fernandez [Sat, 30 Apr 2022 02:02:50 +0000 (19:02 -0700)]
glcomp: inline and remove 'copy_glcomp_color'

The C compiler knows how to copy a struct without needing it spelled out
member-by-member.

2 years agoglcomp: remove unused 'glCompColor.test'
Matthew Fernandez [Sat, 30 Apr 2022 02:01:13 +0000 (19:01 -0700)]
glcomp: remove unused 'glCompColor.test'

2 years agoglcomp: remove unused 'glCompColor.tag'
Matthew Fernandez [Sat, 30 Apr 2022 02:00:53 +0000 (19:00 -0700)]
glcomp: remove unused 'glCompColor.tag'

2 years agocgraph: remove prototype of unimplemented 'agrebind0'
Matthew Fernandez [Sat, 30 Apr 2022 01:27:23 +0000 (18:27 -0700)]
cgraph: remove prototype of unimplemented 'agrebind0'

This was added in the first commit, but apparently was never implemented.

2 years agoMerge branch 'smattr/ADD4EDF2-0C76-420E-B9BA-BA3D82E4A083' into 'main'
Matthew Fernandez [Mon, 2 May 2022 00:38:44 +0000 (00:38 +0000)]
Merge branch 'smattr/ADD4EDF2-0C76-420E-B9BA-BA3D82E4A083' into 'main'

remove unused 'updatePM'

See merge request graphviz/graphviz!2642

2 years agoremove unused 'updatePM'
Matthew Fernandez [Tue, 26 Apr 2022 14:47:32 +0000 (07:47 -0700)]
remove unused 'updatePM'

The last use of this was removed in 4d12d3f0826198aad637a5ee4d9c1eff21952019.

2 years agoMerge branch 'smattr/5F69683D-065F-4437-AA93-AF01343A36D7' into 'main'
Matthew Fernandez [Sun, 1 May 2022 14:35:04 +0000 (14:35 +0000)]
Merge branch 'smattr/5F69683D-065F-4437-AA93-AF01343A36D7' into 'main'

gvmap: replace unchecked allocations with cgraph alloc wrappers

See merge request graphviz/graphviz!2637

2 years agogvmap: replace unchecked allocations with cgraph alloc wrappers
Matthew Fernandez [Sat, 9 Apr 2022 18:05:41 +0000 (11:05 -0700)]
gvmap: replace unchecked allocations with cgraph alloc wrappers

These turn messy crashes into more graceful exits.

2 years agogvmap: remove unused 'plot_label'
Matthew Fernandez [Sat, 9 Apr 2022 17:48:20 +0000 (10:48 -0700)]
gvmap: remove unused 'plot_label'

2 years agogvmap: remove unused 'bg_color'
Matthew Fernandez [Sat, 9 Apr 2022 17:47:22 +0000 (10:47 -0700)]
gvmap: remove unused 'bg_color'

2 years agosparse: unconditionally include 'graphviz_exit' from cgraph
Matthew Fernandez [Sat, 9 Apr 2022 19:31:35 +0000 (12:31 -0700)]
sparse: unconditionally include 'graphviz_exit' from cgraph

This fixes a problem encountered in an upcoming commit, that other code cannot
include both this header and cgraph/exit.h if it is building in standalone mode.
cgraph/exit.h is header-only, so should be fine to use even in standalone mode.

2 years agoMerge branch 'smattr/E41729D4-C252-4B87-8C6F-E3326A52D927' into 'main'
Matthew Fernandez [Sun, 1 May 2022 04:37:29 +0000 (04:37 +0000)]
Merge branch 'smattr/E41729D4-C252-4B87-8C6F-E3326A52D927' into 'main'

CI: add Ubuntu 22.04 as a tested platform

Closes #2234

See merge request graphviz/graphviz!2636

2 years agoCI: add Ubuntu 22.04 as a tested platform
Matthew Fernandez [Fri, 22 Apr 2022 00:19:18 +0000 (17:19 -0700)]
CI: add Ubuntu 22.04 as a tested platform

We should perhaps consider migrating the more unusual variants like the ASan
jobs to Ubuntu 22.04 too in future.

Github: closes #2234

2 years agoLASi plugin: support newer Pango font variants
Matthew Fernandez [Tue, 26 Apr 2022 00:11:27 +0000 (17:11 -0700)]
LASi plugin: support newer Pango font variants

Similar to 89edf3fe0ac0378b7d1297a0ca349a15bade3980, this introduces support for
newer versions of Pango. Without this, strict compilation with -Werror in the
CMake build fails when building against Pango ≥ 1.50. The only LASi font
variants are `NORMAL_VARIANT` and `SMALLCAPS`, so mapping Pango to LASi
equivalents is limited to being a coarse-grained lossy conversion.

Github: #2234

2 years agoinstead of using 'LIBPOSTFIX' heuristics, ask the OCaml compiler where it lives
Matthew Fernandez [Mon, 25 Apr 2022 02:37:52 +0000 (19:37 -0700)]
instead of using 'LIBPOSTFIX' heuristics, ask the OCaml compiler where it lives

This is a more portable way of locating OCaml directories for the OCaml
bindings. This resolves some issues encountered when porting to Ubuntu 22.04.

Gitlab: #2234

2 years agoMerge branch 'smattr/28C4C5DE-C6BC-4998-A29C-6677AE8C267E' into 'main'
Matthew Fernandez [Sun, 1 May 2022 01:45:23 +0000 (01:45 +0000)]
Merge branch 'smattr/28C4C5DE-C6BC-4998-A29C-6677AE8C267E' into 'main'

mm2gv: some trivial clean up

See merge request graphviz/graphviz!2635

2 years agomm2gv: remove open coded NULL
Matthew Fernandez [Fri, 8 Apr 2022 02:26:34 +0000 (19:26 -0700)]
mm2gv: remove open coded NULL

2 years agomm2gv: remove unnecessary cast
Matthew Fernandez [Fri, 8 Apr 2022 02:26:24 +0000 (19:26 -0700)]
mm2gv: remove unnecessary cast

2 years agomm2gv: remove unnecessary parens
Matthew Fernandez [Fri, 8 Apr 2022 02:26:12 +0000 (19:26 -0700)]
mm2gv: remove unnecessary parens

2 years agoMerge branch 'smattr/12BC1FB5-DA85-4A0A-AE5A-7A20033F8C05' into 'main'
Matthew Fernandez [Fri, 29 Apr 2022 01:20:38 +0000 (01:20 +0000)]
Merge branch 'smattr/12BC1FB5-DA85-4A0A-AE5A-7A20033F8C05' into 'main'

remove stat.h detection and juggling

See merge request graphviz/graphviz!2630

2 years agosfio: remove 'SF_MTSAFE'
Matthew Fernandez [Mon, 25 Apr 2022 04:30:44 +0000 (21:30 -0700)]
sfio: remove 'SF_MTSAFE'

This constant was performing two overlapping roles:

  1. A flag callers could use to indicate they anticipated calling into sfio
     functions with the same object from multiple threads.

  2. A flag used by the library itself to indicate whether thread-safety was
     available.

To deal with both macros having the same name, sfhdr.h was forcing the value
seen internally to zero. This mechanism has numerous shortcomings:

  1. It was possible for a caller to use the external value of `SF_MTSAFE`
     (010000) that, thanks to the overriding described above, sfio itself would
     fail to understand.

  2. Including sfio.h within sfio sources without including sfhdr.h was a latent
     foot gun that would result in part of sfio believing the `SF_MTSAFE` flag
     _did_ have meaning.

  3. sfio functions are not thread-safe, with or without `SF_MTSAFE` defined,
     and regardless of what value it has.

To take an example to illustrate 3, `sfopen` does something like double-checked
locking¹ to anticipate another thread modifying `f` in-between its first check
and the point at which it calls `SFMTXSTART`. Except `SFMTXSTART` is not a lock.
There is no synchronization point here, and in fact an optimizing compiler will
simply coalesce both the first and second checks into one. It is not clear to me
whether this code was written when multicore machines were uncommon (though this
design is also unsafe on a unicore machine) or if `SFMTXSTART` is some kind of
placeholder that was meant to one day grow a locking mechanism.

It seems safer and more honest to remove this constant, and with it the
implication that thread-safety is toggle-able. Migrating to C stdio (#1998) will
render all of this moot as it is thread-safe by default.

¹ https://en.wikipedia.org/wiki/Double-checked_locking

2 years agosfio: remove unused 'S_ISFIFO'
Matthew Fernandez [Mon, 25 Apr 2022 04:17:20 +0000 (21:17 -0700)]
sfio: remove unused 'S_ISFIFO'

This has seemingly never been used.

Github: #1998

2 years agosfio: remove 'fstat' prototype
Matthew Fernandez [Mon, 25 Apr 2022 04:14:41 +0000 (21:14 -0700)]
sfio: remove 'fstat' prototype

The guard on this prototype appears back to front. If `HAVE_SYS_STAT_H` is true,
we already have a prototype of this function _in_ sys/stat.h.

2 years agoremove stat.h detection and juggling
Matthew Fernandez [Sun, 24 Apr 2022 16:00:16 +0000 (09:00 -0700)]
remove stat.h detection and juggling

I do not know which platforms offer stat.h, but it does not appear to be
anything Graphviz currently supports. On all currently supported platforms (even
Windows) this file lives at sys/stat.h which is detected separately.

2 years agosfio: fix misuse of 'HAVE_SYS_STAT_H'
Matthew Fernandez [Mon, 25 Apr 2022 04:09:02 +0000 (21:09 -0700)]
sfio: fix misuse of 'HAVE_SYS_STAT_H'

When sys/stat.h is unavailable, `HAVE_SYS_STAT_H` is not `0`. It is undefined,
which was leading to a malformed expression here. This was exposed by the next
commit.

2 years agoMerge branch 'smattr/D02F76A1-BD16-4E4D-801E-943D629C9505' into 'main'
Matthew Fernandez [Thu, 28 Apr 2022 15:54:45 +0000 (15:54 +0000)]
Merge branch 'smattr/D02F76A1-BD16-4E4D-801E-943D629C9505' into 'main'

replace various SFIO to stderr with C stdio

See merge request graphviz/graphviz!2631

2 years agoreplace various SFIO to stderr with C stdio
Matthew Fernandez [Mon, 25 Apr 2022 00:16:12 +0000 (17:16 -0700)]
replace various SFIO to stderr with C stdio

While it is technically possible to replace the `sfstderr` stream with something
other than stderr or use an SFIO-specific format specifier (e.g. `%!`), nothing
in Graphviz permits this. Thus we know all these instances are actually just
doing basic output to stderr. By replacing them with C stdio, they are more
transparent to the compiler and can be implemented more efficiently.

Gitlab: #1998

2 years agoMerge branch 'smattr/A6A8CDBD-0D7F-40AF-BADB-8AEC1DCCF2EF' into 'main'
Matthew Fernandez [Thu, 28 Apr 2022 06:11:48 +0000 (06:11 +0000)]
Merge branch 'smattr/A6A8CDBD-0D7F-40AF-BADB-8AEC1DCCF2EF' into 'main'

gvpr: replace use of alternative stack implementation with Graphviz generic one

See merge request graphviz/graphviz!2639

2 years agogvpr: replace use of alternative stack implementation with Graphviz generic one
Matthew Fernandez [Mon, 25 Apr 2022 14:59:01 +0000 (07:59 -0700)]
gvpr: replace use of alternative stack implementation with Graphviz generic one

Similar to previous changes to `gc` in 4e2875fd7376338259dcb3ccc8f029d58bdf22dd,
this replaces some duplicated functionality with the generic Graphviz stack
implementation. This also adds checks for allocation failures that were
previously missing.

Gitlab: #1793