]> granicus.if.org Git - graphviz/log
graphviz
3 years agogv_channel_writer: gracefully handle sizes that exceed INT_MAX
Matthew Fernandez [Sun, 11 Jul 2021 01:40:56 +0000 (18:40 -0700)]
gv_channel_writer: gracefully handle sizes that exceed INT_MAX

The compiler (correctly) says:

  gv_tcl_init.c: In function ‘gv_channel_writer’:
  gv_tcl_init.c:25:58: warning: conversion from ‘size_t’ {aka ‘long
    unsigned int’} to ‘int’ may change value [-Wconversion]
       return Tcl_Write((Tcl_Channel)(job->output_file), s, len);
                                                            ^~~
  gv_tcl_init.c:25:12: warning: conversion to ‘size_t’ {aka ‘long unsigned
    int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
       return Tcl_Write((Tcl_Channel)(job->output_file), s, len);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This stems from a mismatch between gv_channel_write (or back tracking this, the
write_fn member of GVC) dealing in size_t and the TCL API dealing in int. Prior
to this change, a write of more than INT_MAX through this function would result
in passing a negative value to TCL. I do not know how it responds to such
things. Following this change, a write of more than INT_MAX results in a
truncated write of at most INT_MAX, something callers should already be
anticipating. Squashes two compiler warnings.

3 years agodisable -Wunused-parameter when building SWIG-generated Ruby bindings
Matthew Fernandez [Sun, 11 Jul 2021 01:28:31 +0000 (18:28 -0700)]
disable -Wunused-parameter when building SWIG-generated Ruby bindings

There is no value to warning about things like this in generated code, which are
just artifacts of how SWIG code generation works. Removes 91 compiler warnings.

3 years agoMerge branch 'smattr/ED9A017B-1B9E-42F5-9128-5885542A4EE8' into 'main'
Matthew Fernandez [Sat, 17 Jul 2021 18:33:37 +0000 (18:33 +0000)]
Merge branch 'smattr/ED9A017B-1B9E-42F5-9128-5885542A4EE8' into 'main'

some misc clean up

See merge request graphviz/graphviz!2045

3 years agosimplify twoDots
Matthew Fernandez [Sat, 10 Jul 2021 15:59:25 +0000 (08:59 -0700)]
simplify twoDots

The compiler can likely see this equivalence already. But this change makes the
code clearer to both it and to human readers.

3 years agoremove unnecessary not-null guards on free in spring_electrical_embedding_fast
Matthew Fernandez [Sat, 26 Jun 2021 23:21:16 +0000 (16:21 -0700)]
remove unnecessary not-null guards on free in spring_electrical_embedding_fast

It is well-defined to free null.

3 years agoremove unnecessary not-null guards to free in Operator_diag_precon_delete
Matthew Fernandez [Sat, 26 Jun 2021 23:19:44 +0000 (16:19 -0700)]
remove unnecessary not-null guards to free in Operator_diag_precon_delete

It is well-defined to free null. Apart from this though, the first condition
containing a dereference of `o` implies that `o` is not null so the second
condition can be assumed true.

3 years agoremove unnecessary not-null guards on free in StressMajorizationSmoother_smooth
Matthew Fernandez [Sat, 26 Jun 2021 23:18:00 +0000 (16:18 -0700)]
remove unnecessary not-null guards on free in StressMajorizationSmoother_smooth

It is well-defined to free null.

3 years agoremove unnecessary not-null guard in Operator_matmul_delete
Matthew Fernandez [Sat, 26 Jun 2021 23:09:17 +0000 (16:09 -0700)]
remove unnecessary not-null guard in Operator_matmul_delete

It is well-defined to free null.

3 years agoremove unnecessary cast in Operator_matmul_new
Matthew Fernandez [Sat, 26 Jun 2021 23:08:33 +0000 (16:08 -0700)]
remove unnecessary cast in Operator_matmul_new

A SparseMatrix implicitly coerces to void*.

3 years agoremove unnecessary branch in gvplugin_library_load
Matthew Fernandez [Sat, 26 Jun 2021 23:00:28 +0000 (16:00 -0700)]
remove unnecessary branch in gvplugin_library_load

The function grealloc can handle the input pointer being NULL and the follow on
code after this does not rely on the contents of the allocated buffer being
zeroed.

3 years agoremove unnecessary error handling in colorxlate
Matthew Fernandez [Sat, 26 Jun 2021 22:58:11 +0000 (15:58 -0700)]
remove unnecessary error handling in colorxlate

The grealloc function can only return NULL when the passed in size is 0. That is
not the case in this call site.

3 years agoremove unnecessary error handling in canontoken
Matthew Fernandez [Sat, 26 Jun 2021 22:56:41 +0000 (15:56 -0700)]
remove unnecessary error handling in canontoken

The grealloc function can only return NULL when the passed in size is 0. That is
not the case in this call site.

3 years agoremove unnecessary cast in canontoken
Matthew Fernandez [Sat, 26 Jun 2021 22:56:03 +0000 (15:56 -0700)]
remove unnecessary cast in canontoken

The variable canon is already an unsigned char pointer.

3 years agoremove unnecessary casts in makeDerivedNode
Matthew Fernandez [Sat, 26 Jun 2021 22:45:07 +0000 (15:45 -0700)]
remove unnecessary casts in makeDerivedNode

All these pointers implicitly coerce.

3 years agoMerge branch 'smattr/5EE3E1FF-FB01-4617-BEED-EEE6C36C5FF2' into 'main'
Matthew Fernandez [Sat, 17 Jul 2021 17:42:12 +0000 (17:42 +0000)]
Merge branch 'smattr/5EE3E1FF-FB01-4617-BEED-EEE6C36C5FF2' into 'main'

remove indent settings files

See merge request graphviz/graphviz!2055

3 years agoremove indent settings files
Matthew Fernandez [Fri, 16 Jul 2021 14:42:43 +0000 (07:42 -0700)]
remove indent settings files

Graphviz now uses clang-format for C/C++ style. Though admittedly most files are
not yet conformant.

3 years agoMerge branch 'smattr/0387F9F2-3247-4913-BD25-DB495AE7782F' into 'main'
Matthew Fernandez [Sat, 17 Jul 2021 16:52:32 +0000 (16:52 +0000)]
Merge branch 'smattr/0387F9F2-3247-4913-BD25-DB495AE7782F' into 'main'

Start 2.48 development series

See merge request graphviz/graphviz!2057

3 years agoStart 2.48 development series
Matthew Fernandez [Sat, 17 Jul 2021 15:16:52 +0000 (08:16 -0700)]
Start 2.48 development series

3 years agoMerge branch 'smattr/17BC5007-8B14-405F-A7A1-F5C859D59538' into 'main' 2.48.0
Matthew Fernandez [Sat, 17 Jul 2021 15:56:05 +0000 (15:56 +0000)]
Merge branch 'smattr/17BC5007-8B14-405F-A7A1-F5C859D59538' into 'main'

Stable Release 2.48.0

See merge request graphviz/graphviz!2051

3 years agoStable Release 2.48.0
Matthew Fernandez [Tue, 13 Jul 2021 03:09:53 +0000 (20:09 -0700)]
Stable Release 2.48.0

3 years agoMerge branch 'fix-lib-ortho-odr-violation' into 'main'
Magnus Jacobsson [Wed, 14 Jul 2021 10:05:24 +0000 (10:05 +0000)]
Merge branch 'fix-lib-ortho-odr-violation' into 'main'

Fix ODR violation in lib/ortho

Closes #2096

See merge request graphviz/graphviz!2036

3 years agoadd a changelog entry for the fixed ODR violation
Magnus Jacobsson [Mon, 12 Jul 2021 15:31:14 +0000 (17:31 +0200)]
add a changelog entry for the fixed ODR violation

Issue: https://gitlab.com/graphviz/graphviz/-/issues/2096

3 years agoRevert "temporarily disable ODR violation detection caused by lib/ortho"
Magnus Jacobsson [Wed, 7 Jul 2021 15:55:31 +0000 (17:55 +0200)]
Revert "temporarily disable ODR violation detection caused by lib/ortho"

This reverts commit 7201ac3ca213740010d4cdb52d38bfe4b91b92fc.

This is workaround is no longer needed since
https://gitlab.com/graphviz/graphviz/-/issues/2096 has been fixed.

3 years agoremove now obsolete MSBuild project dependency on ortho for neatogen
Magnus Jacobsson [Mon, 12 Jul 2021 07:17:22 +0000 (09:17 +0200)]
remove now obsolete MSBuild project dependency on ortho for neatogen

This is step 4 of 4 in replacing ortho with gvc as a link dependency
for neatogen.

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

3 years agoremove now obsolete MSBuild link dependency on ortho for neatogen
Magnus Jacobsson [Mon, 12 Jul 2021 14:09:22 +0000 (16:09 +0200)]
remove now obsolete MSBuild link dependency on ortho for neatogen

This is step 3 of 4 in replacing ortho with gvc as a link dependency
for neatogen.

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

3 years agoadd MSBuild link dependency on gvc for neatogen
Magnus Jacobsson [Mon, 12 Jul 2021 07:20:21 +0000 (09:20 +0200)]
add MSBuild link dependency on gvc for neatogen

This is step 2 of 4 in replacing ortho with gvc as a link dependency
for neatogen.

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

3 years agoadd MSBuild project reference to gvc for neatogen
Magnus Jacobsson [Mon, 12 Jul 2021 14:44:59 +0000 (16:44 +0200)]
add MSBuild project reference to gvc for neatogen

This is step 1 of 4 in replacing ortho with gvc as a link dependency
for neatogen. It ensures the correct build order under all
circumstances, also when neatogen is built stand-alone. Just a link
dependency is not enough which does not cause the dependency to
actually be built.

A project reference is a more modern way of creating a project
dependency than the centralized project dependencies in the solution
file. See https://stackoverflow.com/a/2317017/3122101.

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

3 years agoremove now obsolete MSBuild project dependency on ortho for dotgen
Magnus Jacobsson [Sun, 11 Jul 2021 19:32:08 +0000 (21:32 +0200)]
remove now obsolete MSBuild project dependency on ortho for dotgen

This is step 4 of 4 in replacing ortho with gvc as a link dependency
for dotgen.

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

3 years agoremove now obsolete MSBuild link dependency on ortho for dotgen
Magnus Jacobsson [Mon, 12 Jul 2021 14:06:58 +0000 (16:06 +0200)]
remove now obsolete MSBuild link dependency on ortho for dotgen

This is step 3 of 4 in replacing ortho with gvc as a link dependency
for dotgen.

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

3 years agoadd MSBuild link dependency to gvc for dotgen
Magnus Jacobsson [Mon, 12 Jul 2021 13:52:57 +0000 (15:52 +0200)]
add MSBuild link dependency to gvc for dotgen

This is step 2 of 4 in replacing ortho with gvc as a link dependency
for dotgen.

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

3 years agoadd MSBuild project reference to gvc for dotgen
Magnus Jacobsson [Mon, 12 Jul 2021 14:26:45 +0000 (16:26 +0200)]
add MSBuild project reference to gvc for dotgen

This is step 1 of 4 in replacing ortho with gvc as a link dependency
for dotgen. It ensures the correct build order under all
circumstances, also when dotgen is built stand-alone. Just a link
dependency is not enough which does not cause the link dependency to
actually be built.

A project reference is a more modern way of creating a project
dependency than the centralized project dependencies in the solution
file. See https://stackoverflow.com/a/2317017/3122101.

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

3 years agoforce all ortho object files to be linked into gvc for CMake and MSBuild
Magnus Jacobsson [Tue, 1 Jun 2021 16:30:05 +0000 (18:30 +0200)]
force all ortho object files to be linked into gvc for CMake and MSBuild

This is what the autotools builds do.

Whithout this, the ortho object files ended up both in
libgvplugin_dot_layout.so and libgvplugin_neato_layout.so which caused
an ASan odr_violation.

This commit also adds MSVC an import/export declaration for orthoEdges
which otherwise would become unresolved.

It also changes gvc to use PRIVATE instead of PUBLIC linking to
ortho. The reason is detailed below.

The ASan error message was:

==235826==ERROR: AddressSanitizer: odr-violation (0x7ff55b6c72c0):
  [1] size=4 'odb_flags' /home/magjac/graphviz/lib/ortho/ortho.c:44:5
  [2] size=4 'odb_flags' /home/magjac/graphviz/lib/ortho/ortho.c:44:5
These globals were registered at these points:
  [1]:
    #0 0x7ff55b8c5938 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
    #1 0x7ff55b2ce1a2 in _sub_I_00099_3 (/home/magjac/graphviz/build/plugin/dot_layout/libgvplugin_dot_layout.so.6+0x43b1a2)
    #2 0x7ff55c28c96d  (/lib64/ld-linux-x86-64.so.2+0x1196d)

  [2]:
    #0 0x7ff55b8c5938 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
    #1 0x7ff55a8008e4 in _sub_I_00099_3 (/home/magjac/graphviz/build/plugin/neato_layout/libgvplugin_neato_layout.so.6+0x6d38e4)
    #2 0x7ff55c28c96d  (/lib64/ld-linux-x86-64.so.2+0x1196d)

==235826==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'odb_flags' at /home/magjac/graphviz/lib/ortho/ortho.c:44:5
==235826==ABORTING

Fixes https://gitlab.com/graphviz/graphviz/-/issues/2096.

Here is a more detailed explanation of the problem and the fix:

1. The ortho library is not a library that we ship.

2. The ortho library is a static library.

3. The ortho object modules should be part of the gvc library. With
   autotools they are, but before this fix they are not with CMake or
   MSBuild.

4. A user program should load the ortho object modules from the gvc
   libray. This works with autotools, but before this fix not with
   CMake or MSBuild.

5. All plugins (and all other Graphviz programs and libraries) should
   load the ortho object modules from the gvc library. This works with
   autotools, but before this fix not with CMake or MSBuild.

6. Nothing should ever link directly to the ortho library except gvc.

7. Even before this fix, the gvc library had ortho as a PUBLIC
   dependency, but since gvc itself doesn't refer to any ortho
   symbols, no object modules from ortho gets included in the gvc
   library itself unless we explicitly include them. Which is what the
   autotools builds do and what the CMake and BSBuild builds do after
   this fix. My interpretation is that without this, gvc acted as an
   INTERFACE library for ortho, i.e., it could tell anything linking
   to it where to find the object modules, but not provide them itself
   (again, my interpretation. For more see
   https://cmake.org/cmake/help/latest/command/add_library.html#interface-libraries).

8. The dot_layout and neato_layout plugins have the gvc library as a
   public dependency, but they don't have any direct dependency on the
   ortho library itself. Because of this, they find the ortho objects
   modules that they need though the gvc library. Before this fix
   however, since gvc did not contain the ortho objects, they had no
   option but to link in the ortho object modules statically. This is
   what caused the ODR violation when both plugins were loaded
   simultaneously.

9. This fix also changes the gvc dependency on ortho from PUBLIC to
   PRIVATE to avoid giving anything access to the ortho static library
   through gvc.

3 years agoadd a macro to be used when declaring external functions in ortho
Magnus Jacobsson [Tue, 1 Jun 2021 16:30:05 +0000 (18:30 +0200)]
add a macro to be used when declaring external functions in ortho

The macro expands to import/export declarations on Windows that are
needed for dynamic-link libraries (DLLs) and nothing for other OSes.

This is a preparation for being able to include the ortho object files
into the gvc shared/dynamic-link library in an upcoming commit in this
series.

Note that this change continues to use the anti-pattern of GVC_EXPORTS
which is not automatically generated by CMake like gvc_EXPORTS is.

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

3 years agocreate an object library with all ortho object files for CMake
Magnus Jacobsson [Tue, 1 Jun 2021 16:30:05 +0000 (18:30 +0200)]
create an object library with all ortho object files for CMake

This is a prepration for being able to force them to be included in
the gvc shared library in an upcoming commit in this series.

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

3 years agoadd MSBuild project reference to ortho for gvc
Magnus Jacobsson [Mon, 12 Jul 2021 13:42:05 +0000 (15:42 +0200)]
add MSBuild project reference to ortho for gvc

This is a preparation for adding ortho as a link dependency to gvc in
an upcoming commit. It ensures the correct build order under all
circumstances, also when gvc is built stand-alone. A link dependency
is not enough which does not cause the link dependency to actually be
built.

A project reference is a more modern way of creating a project
dependency than the centralized project dependencies in the solution
file. See https://stackoverflow.com/a/2317017/3122101.

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

3 years agoremove useless MSBuild link dependency on ortho for gvmap
Magnus Jacobsson [Mon, 12 Jul 2021 05:43:34 +0000 (07:43 +0200)]
remove useless MSBuild link dependency on ortho for gvmap

gvmap only depends indirectly on ortho through neatogen which it
already has a link dependency on.

This change is made to avoid confusion when upcoming commits in this
series change ortho to be part of the gvc shared library and adjusts
the neatogen library accordingly.

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

3 years agoremove useless MSBuild project dependency on ortho for gvmap
Magnus Jacobsson [Mon, 12 Jul 2021 14:56:13 +0000 (16:56 +0200)]
remove useless MSBuild project dependency on ortho for gvmap

gvmap only depends indirectly on ortho through neatogen which it
already has a project dependency on.

This change is made to avoid confusion when upcoming commits in this
series change ortho to be part of the gvc shared library and adjusts
the neatogen library accordingly.

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

3 years agoremove useless MSBuild project reference to ortho for dot
Magnus Jacobsson [Mon, 12 Jul 2021 05:37:19 +0000 (07:37 +0200)]
remove useless MSBuild project reference to ortho for dot

dot only depends indirectly on ortho through dotgen which it already
has a project reference to.

This change is made to avoid confusion when upcoming commits in this
series change ortho to be part of the gvc shared library and adjusts
the dotgen library accordingly.

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

3 years agoremove useless MSBuild project dependency on ortho for neato_layout plugin
Magnus Jacobsson [Mon, 12 Jul 2021 14:54:05 +0000 (16:54 +0200)]
remove useless MSBuild project dependency on ortho for neato_layout plugin

The neato_layout plugin only depends indirectly on ortho through
neatogen which it already has a project reference to.

A project reference is a more modern way of creating a project
dependency than the centralized project dependencies in the solution
file. See https://stackoverflow.com/a/2317017/3122101.

This change is made to avoid confusion when upcoming commits in this
series change ortho to be part of the gvc shared library and adjusts
the neatogen library accordingly.

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

3 years agoremove useless MSBuild link dependency on ortho for neato_layout plugin
Magnus Jacobsson [Mon, 12 Jul 2021 05:50:59 +0000 (07:50 +0200)]
remove useless MSBuild link dependency on ortho for neato_layout plugin

The neato_layout plugin only depends indirectly on ortho through
neatogen which it already has a link dependency on.

This change is made to avoid confusion when upcoming commits in this
series change ortho to be part of the gvc shared library and adjusts
the neatogen library accordingly.

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

3 years agoremove useless MSBuild project reference to ortho for dot_layout plugin
Magnus Jacobsson [Mon, 12 Jul 2021 05:49:57 +0000 (07:49 +0200)]
remove useless MSBuild project reference to ortho for dot_layout plugin

The dot_layout plugin only depends indirectly on ortho through dotgen
which it already has a project reference to.

This change is made to avoid confusion when upcoming commits in this
series change ortho to be part of the gvc shared library and adjusts
the dotgen library accordingly.

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

3 years agoremove useless MSBuild link dependency on ortho for dot_layout plugin
Magnus Jacobsson [Mon, 12 Jul 2021 03:17:43 +0000 (05:17 +0200)]
remove useless MSBuild link dependency on ortho for dot_layout plugin

The dot_layout plugin only depends indirectly on ortho through dotgen
which it already has a link dependency on.

This change is made to avoid confusion when upcoming commits in this
series change ortho to be part of the gvc shared library and adjusts
the dotgen library accordingly.

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

3 years agoMerge branch 'smattr/78191A1F-8E39-4754-9FB7-A679AD4A5F49' into 'main'
Matthew Fernandez [Tue, 13 Jul 2021 03:58:48 +0000 (03:58 +0000)]
Merge branch 'smattr/78191A1F-8E39-4754-9FB7-A679AD4A5F49' into 'main'

remove unnecessary './' prefix on report.txt output in CI

See merge request graphviz/graphviz!2039

3 years agoremove unnecessary './' prefix on report.txt output in CI
Matthew Fernandez [Wed, 7 Jul 2021 00:51:07 +0000 (17:51 -0700)]
remove unnecessary './' prefix on report.txt output in CI

Commit 8f7c1f4c2ef253bc1a763515b344d599e5c199ee removed any directory prefix
from this artifact, outputting it to the root directory of the Graphviz checkout
in CI. In this case, like metrics.txt, it does not need an explicit './' prefix.

3 years agoMerge branch 'smattr/5852d0c9-e724-4fe3-9903-d0b235b98775' into 'main'
Matthew Fernandez [Sun, 11 Jul 2021 23:51:24 +0000 (23:51 +0000)]
Merge branch 'smattr/5852d0c9-e724-4fe3-9903-d0b235b98775' into 'main'

fix round tripping GV→GXL→GV

Closes #517

See merge request graphviz/graphviz!2034

3 years agogxl2gv: fix: recognize and handle HTML-like strings
Matthew Fernandez [Tue, 6 Jul 2021 00:38:44 +0000 (17:38 -0700)]
gxl2gv: fix: recognize and handle HTML-like strings

When translating a Graphviz file through gv2gxl, HTML-like and non-HTML-like
strings would be translated identically, resulting in a loss of information.
This was fixed in the series merged in d44d19c86f0f469d1c76ce0d7630c8e0ac85e993.
However, to take this through to completion and make round-tripping such strings
possible, changes to gxl2gv were also required.

The present commit updates gxl2gv to recognize the new ‘kind’ GXL attribute that
gv2gxl uses to indicate a string originated as an HTML-like string. The output
of gxl2gv now correctly translates this back to an HTML-like string. Fixes #517.

Note that this fix is orthogonal to the behavior when using an HTML-like and
non-HTML-like string with the same content. It is still not possible to do this
without confusing the internal string interning dictionary (#2089).

3 years agogxl2gv: use an enum instead of #defines for attribute type
Matthew Fernandez [Tue, 6 Jul 2021 00:28:39 +0000 (17:28 -0700)]
gxl2gv: use an enum instead of #defines for attribute type

This introduces some stronger typing and makes it clearer that the attribute
type variables like Current_class can only ever be one of these values. Related
to #517.

3 years agogxl2gv: add a no-op default case to a switch
Matthew Fernandez [Tue, 6 Jul 2021 00:57:28 +0000 (17:57 -0700)]
gxl2gv: add a no-op default case to a switch

An upcoming change makes the type of Current_class an enum, which introduces new
-Wswitch compiler warnings. To avoid this in advance, we give this switch a
default case that does nothing.

3 years agogxl2gv: push the ability to indicate an attribute is HTML-like outwards
Matthew Fernandez [Tue, 6 Jul 2021 00:17:59 +0000 (17:17 -0700)]
gxl2gv: push the ability to indicate an attribute is HTML-like outwards

Callers of setAttr can now indicate the attribute they are setting is an
HTML-like string. This is not yet taken advantage of, but this change is a step
towards #517.

3 years agogxl2gv: support for indicating an attribute added to a edge is HTML-like
Matthew Fernandez [Tue, 6 Jul 2021 00:05:59 +0000 (17:05 -0700)]
gxl2gv: support for indicating an attribute added to a edge is HTML-like

This is not yet exposed to users, but is preparation for supporting correct
translation of HTML-like string labels. Related to #517.

3 years agogxl2gv: move common agxset call outside conditional in setEdgeAttr
Matthew Fernandez [Tue, 6 Jul 2021 00:03:13 +0000 (17:03 -0700)]
gxl2gv: move common agxset call outside conditional in setEdgeAttr

Every path through the conditional block in this code ends in the same agxset
call. We can simplify this (and upcoming changes) by moving the common call
outside the block. Related to #517.

3 years agogxl2gv: support for indicating an attribute added to a node is HTML-like
Matthew Fernandez [Mon, 5 Jul 2021 23:57:18 +0000 (16:57 -0700)]
gxl2gv: support for indicating an attribute added to a node is HTML-like

This is not yet exposed to users, but is preparation for supporting correct
translation of HTML-like string labels. Related to #517.

3 years agoremove unnecessary cast in agraphof
Matthew Fernandez [Mon, 5 Jul 2021 23:56:06 +0000 (16:56 -0700)]
remove unnecessary cast in agraphof

The input void* argument implicitly coerces to the Agraph_t* return type.

3 years agoMerge branch 'add-test-coverage-analysis' into 'main'
Magnus Jacobsson [Sun, 11 Jul 2021 05:50:22 +0000 (05:50 +0000)]
Merge branch 'add-test-coverage-analysis' into 'main'

Add test coverage analysis

See merge request graphviz/graphviz!2037

3 years agoadd a CHANGELOG entry for the test coverage analysis
Magnus Jacobsson [Thu, 8 Jul 2021 12:09:49 +0000 (14:09 +0200)]
add a CHANGELOG entry for the test coverage analysis

3 years agoadd MR test coverage visualization based on gcovr to CI
Magnus Jacobsson [Sun, 11 Apr 2021 22:10:19 +0000 (00:10 +0200)]
add MR test coverage visualization based on gcovr to CI

See
https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html

3 years agoenable lcov branch coverage
Magnus Jacobsson [Mon, 19 Apr 2021 15:35:07 +0000 (17:35 +0200)]
enable lcov branch coverage

3 years agouse absolute paths to lex & yacc files in lib/expr for CMake
Magnus Jacobsson [Sat, 17 Apr 2021 04:58:09 +0000 (06:58 +0200)]
use absolute paths to lex & yacc files in lib/expr for CMake

With relative paths, gcovr has trouble finding them.

3 years agouse absolute paths to lex & yacc files in cmd/tools for CMake
Magnus Jacobsson [Sat, 17 Apr 2021 04:58:09 +0000 (06:58 +0200)]
use absolute paths to lex & yacc files in cmd/tools for CMake

With relative paths, gcovr has trouble finding them.

3 years agouse absolute paths to lex & yacc files in lib/common for CMake
Magnus Jacobsson [Tue, 6 Apr 2021 19:55:02 +0000 (21:55 +0200)]
use absolute paths to lex & yacc files in lib/common for CMake

With relative paths, lcov has trouble finding them.

3 years agouse absolute paths to lex & yacc files in lib/cgraph for CMake
Magnus Jacobsson [Tue, 6 Apr 2021 19:55:02 +0000 (21:55 +0200)]
use absolute paths to lex & yacc files in lib/cgraph for CMake

With relative paths, lcov has trouble finding them.

3 years agoMerge branch 'smattr/691F2C8C-E52A-405A-BC63-563A870A32A2' into 'main'
Matthew Fernandez [Sat, 10 Jul 2021 16:06:17 +0000 (16:06 +0000)]
Merge branch 'smattr/691F2C8C-E52A-405A-BC63-563A870A32A2' into 'main'

remove GVPR Vim syntax

See merge request graphviz/graphviz!2043

3 years agoremove GVPR Vim syntax
Matthew Fernandez [Fri, 9 Jul 2021 00:03:25 +0000 (17:03 -0700)]
remove GVPR Vim syntax

This file was upstreamed into Vim itself in Vim commit
2346a6378483c9871016f9fc821ec5cbea638f13. The version in Vim can now be
considered authoritative and we can cease maintaining a copy here in Graphviz.
Related to #1762.

3 years agoMerge branch 'add-changelog-entry-for-c++-test-suite' into 'main'
Magnus Jacobsson [Sat, 10 Jul 2021 14:40:47 +0000 (14:40 +0000)]
Merge branch 'add-changelog-entry-for-c++-test-suite' into 'main'

Add a CHANGELOG entry for the new C++ test infrastructure

Closes #2002

See merge request graphviz/graphviz!2042

3 years agoadd a CHANGELOG entry for the new C++ test infrastructure
Magnus Jacobsson [Sun, 4 Jul 2021 07:35:11 +0000 (09:35 +0200)]
add a CHANGELOG entry for the new C++ test infrastructure

3 years agoMerge branch 'smattr/D7F767FB-3F78-438A-A920-F170636B7AC7' into 'main'
Matthew Fernandez [Sat, 10 Jul 2021 05:44:52 +0000 (05:44 +0000)]
Merge branch 'smattr/D7F767FB-3F78-438A-A920-F170636B7AC7' into 'main'

remove unnecessary casts around usage of cgraph functions

See merge request graphviz/graphviz!2032

3 years agoremove unnecessary casts of agbindrec return values
Matthew Fernandez [Sat, 3 Jul 2021 17:08:23 +0000 (10:08 -0700)]
remove unnecessary casts of agbindrec return values

The return type of agbindrec is void*, which implicitly coerces to all other
pointer types.

3 years agoremove unnecessary casts of parameters to agget
Matthew Fernandez [Sat, 3 Jul 2021 17:03:52 +0000 (10:03 -0700)]
remove unnecessary casts of parameters to agget

The first argument to agget is a void*, to which other pointers implicitly
coerce.

3 years agoremove unnecessary casts of parameters to agnameof
Matthew Fernandez [Sat, 3 Jul 2021 16:57:27 +0000 (09:57 -0700)]
remove unnecessary casts of parameters to agnameof

The argument to agnameof is a void*, to which other pointers implicitly coerce.

3 years agoremove unnecessary casts of parameters to agraphof
Matthew Fernandez [Sat, 3 Jul 2021 16:50:06 +0000 (09:50 -0700)]
remove unnecessary casts of parameters to agraphof

The argument to agraphof is a void*, to which other pointers implicitly coerce.

3 years agoremove unnecessary casts of parameters to agwrite
Matthew Fernandez [Sat, 3 Jul 2021 16:46:35 +0000 (09:46 -0700)]
remove unnecessary casts of parameters to agwrite

The second argument to agwrite is a void*, to which other pointers implicitly
coerce.

3 years agoMerge branch 'smattr/128a62cb-cb82-43ad-9429-2955339a66b6' into 'main'
Matthew Fernandez [Sat, 10 Jul 2021 01:00:56 +0000 (01:00 +0000)]
Merge branch 'smattr/128a62cb-cb82-43ad-9429-2955339a66b6' into 'main'

some sfio-based clean up

See merge request graphviz/graphviz!2040

3 years agoremove sfio versioning mechanism
Matthew Fernandez [Wed, 7 Jul 2021 01:49:03 +0000 (18:49 -0700)]
remove sfio versioning mechanism

The sfio library versioned its format structure, _sffmt_s. This allowed multiple
format structures of differing versions to exist in memory at once,¹ with sfio
able to distinguish between a structure created by itself vs a structure created
by a different version of sfio. In theory, this allows multiple versions of the
sfio library to be loaded at once.

In practice, Graphviz does not take advantage of any of this. In fact, it is not
possible to do this within Graphviz as SFIO_VERSION has not been bumped when
lib/sfio is changed. It still claims to be compatible with a version developed
in 2001.

This commit removes the versioning mechanism entirely, in order to both reduce
maintenance overhead as well as remove the runtime cost associated with managing
this data. The latter is trivial in terms of runtime, but it is also work that
has no purpose.

¹ This kind of design often also allows you to serialize a structure to disk or
  network to later be read back in by a potentially differing version of the
  library. In the case of sfio however, this use case was not possible because
  the structure contains function pointers.

3 years agoremove KPVDEL guards
Matthew Fernandez [Wed, 7 Jul 2021 01:37:22 +0000 (18:37 -0700)]
remove KPVDEL guards

I believe these were used by Kiem-Phong Vo to remind themselves to expose these
definitions unconditionally in future. However, it seems they were never
followed up on. We remove them now to ease ongoing maintenance.

3 years agoremove NoF-guarded code
Matthew Fernandez [Wed, 7 Jul 2021 01:35:08 +0000 (18:35 -0700)]
remove NoF-guarded code

Nothing in the build systems define this.

3 years agoremove unused SF_BUFCONST
Matthew Fernandez [Wed, 7 Jul 2021 01:33:20 +0000 (18:33 -0700)]
remove unused SF_BUFCONST

3 years agoremove sfio EOF etc definitions and use libc instead
Matthew Fernandez [Wed, 7 Jul 2021 01:32:00 +0000 (18:32 -0700)]
remove sfio EOF etc definitions and use libc instead

All of these are defined in ISO C.

3 years agoremove unused noop field of _sffmt_s
Matthew Fernandez [Wed, 7 Jul 2021 01:23:22 +0000 (18:23 -0700)]
remove unused noop field of _sffmt_s

3 years agoremove UNUSED-guarded sfio definitions
Matthew Fernandez [Wed, 7 Jul 2021 01:16:55 +0000 (18:16 -0700)]
remove UNUSED-guarded sfio definitions

Nothing in the build systems define UNUSED.

3 years agoMerge branch 'smattr/103BBEBC-73DC-4EB8-B323-AEAAAA43FD78' into 'main'
Matthew Fernandez [Fri, 9 Jul 2021 15:26:24 +0000 (15:26 +0000)]
Merge branch 'smattr/103BBEBC-73DC-4EB8-B323-AEAAAA43FD78' into 'main'

Python clean up

See merge request graphviz/graphviz!2031

3 years agoadd a gating errors-only Pylint check to CI
Matthew Fernandez [Sat, 3 Jul 2021 03:24:23 +0000 (20:24 -0700)]
add a gating errors-only Pylint check to CI

As of the previous commit, the Docker image on which Pylint checks are run in CI
has all Python module dependencies available, so import-error warnings are no
longer an issue. This change adds a build-failing more relaxed Pylint check to
the existing (non-build-failing) one, that only checks for conclusive errors. It
should no longer be possible to introduce broken Python code into Graphviz –
even when it is uncalled – without breaking CI.

3 years agobump Pylint requirement to 2.7.1
Matthew Fernandez [Fri, 9 Jul 2021 14:25:01 +0000 (07:25 -0700)]
bump Pylint requirement to 2.7.1

This avoids a Pylint bug¹ that prevents adding a --errors-only check that would
fail the build on failure.

¹ https://github.com/PyCQA/pylint/issues/3882

3 years agomove Pylint CI task to the latest Ubuntu image
Matthew Fernandez [Fri, 9 Jul 2021 04:51:49 +0000 (21:51 -0700)]
move Pylint CI task to the latest Ubuntu image

We should keep this task always on the latest Ubuntu in order to pick up the
most recent version of Pylint.

3 years agoalso install doc/infosrc Python dependencies in Ubuntu 21.04 Docker image
Matthew Fernandez [Sat, 3 Jul 2021 02:53:56 +0000 (19:53 -0700)]
also install doc/infosrc Python dependencies in Ubuntu 21.04 Docker image

This makes dependencies like jinja2 available for the Pylint CI task.

3 years agoremove MarkupSafe as a claimed dependency of doc/infosrc
Matthew Fernandez [Sat, 3 Jul 2021 03:08:58 +0000 (20:08 -0700)]
remove MarkupSafe as a claimed dependency of doc/infosrc

Nothing in Graphviz uses MarkupSafe. Its last use was removed in
38e3b019bb1b73f273beec66ee2d79e814a97251, but it was incorrectly left behind as
a dependency. I only discovered this by trying to use
doc/infosrc/requirements.txt and finding that MarkupSafe 1.0 is uninstallable.

3 years agoremove unnecessary parens on Python classes
Matthew Fernandez [Sat, 3 Jul 2021 02:42:14 +0000 (19:42 -0700)]
remove unnecessary parens on Python classes

New-style Python 3 classes do not need parens if they are not inheriting from
any other class.

3 years agodisable Pylint’s line-too-long warning for reference test list
Matthew Fernandez [Sat, 3 Jul 2021 02:39:14 +0000 (19:39 -0700)]
disable Pylint’s line-too-long warning for reference test list

IMHO this list is more readable as it is, unwrapped.

3 years agodisable Pylint’s missing-function-docstring warnings on main
Matthew Fernandez [Sat, 3 Jul 2021 02:38:42 +0000 (19:38 -0700)]
disable Pylint’s missing-function-docstring warnings on main

Documenting main does not really make sense.

3 years agoupdate file comments on some Python files so they are recognized by Pylint
Matthew Fernandez [Sat, 3 Jul 2021 02:37:59 +0000 (19:37 -0700)]
update file comments on some Python files so they are recognized by Pylint

Deals with some Pylint missing-module-docstrings.

3 years agoremove quirky use of bitwise AND in Python
Matthew Fernandez [Sat, 3 Jul 2021 02:18:13 +0000 (19:18 -0700)]
remove quirky use of bitwise AND in Python

3 years agoremove legacy use of addition to construct Python strings
Matthew Fernandez [Sat, 3 Jul 2021 02:17:54 +0000 (19:17 -0700)]
remove legacy use of addition to construct Python strings

3 years agofix a Python indentation issue
Matthew Fernandez [Sat, 3 Jul 2021 02:11:54 +0000 (19:11 -0700)]
fix a Python indentation issue

4 spaces is standard for Python, but we set 2 spaces in our .pylintrc.

3 years agodisable Pylint import-error warnings for gv
Matthew Fernandez [Sat, 3 Jul 2021 02:10:26 +0000 (19:10 -0700)]
disable Pylint import-error warnings for gv

This is the Graphviz module itself which is not necessarily expected to be built
and available when the test suite is run.

3 years agoremove use of Python 2 syntax in some demo files
Matthew Fernandez [Sat, 3 Jul 2021 02:03:38 +0000 (19:03 -0700)]
remove use of Python 2 syntax in some demo files

The last remnants of Python 2 support were removed in
61ae0419198465b457df875881a2dae0aadc8bfd. So it makes sense to update these
examples to be Python 3 only.

3 years agoMerge branch 'gentoo-patches' into 'main'
Matthew Fernandez [Thu, 8 Jul 2021 00:54:20 +0000 (00:54 +0000)]
Merge branch 'gentoo-patches' into 'main'

Upstream gentoo patches

See merge request graphviz/graphviz!2038

3 years agochangelog entries for the prior two commits
Matthew Fernandez [Thu, 8 Jul 2021 00:25:36 +0000 (17:25 -0700)]
changelog entries for the prior two commits

3 years agoRemove bashism
David Seifert [Tue, 6 Jul 2021 11:46:13 +0000 (13:46 +0200)]
Remove bashism

* `==` only works in bash, whereas a shell like
  dash is significantly faster for running the
  configure script.

3 years agoDo not install `command_line`
David Seifert [Tue, 6 Jul 2021 11:46:10 +0000 (13:46 +0200)]
Do not install `command_line`

* `command_line` is solely for testing and
  shouldn't be installed to the prefix.

3 years agoMerge branch 'smattr/1482fbac-25eb-4ccc-a9ae-3f15b5b5850c' into 'main'
Matthew Fernandez [Wed, 7 Jul 2021 15:17:07 +0000 (15:17 +0000)]
Merge branch 'smattr/1482fbac-25eb-4ccc-a9ae-3f15b5b5850c' into 'main'

more lib/sparse clean up

See merge request graphviz/graphviz!2028

3 years agoremove now unused dense_transpose
Matthew Fernandez [Thu, 1 Jul 2021 03:18:51 +0000 (20:18 -0700)]
remove now unused dense_transpose