]> granicus.if.org Git - graphviz/log
graphviz
2 years agocdt: squash -Wconversion warning
Matthew Fernandez [Thu, 3 Nov 2022 04:41:33 +0000 (21:41 -0700)]
cdt: squash -Wconversion warning

This squashes the warning:

  dtstrhash.c: In function ‘dtstrhash’:
  dtstrhash.c:36:18: warning: conversion to ‘unsigned int’ from ‘int’ may change
    the sign of the result [-Wsign-conversion]
     36 |         return (h+n)*DT_PRIME;
        |                  ^

`n` is guaranteed non-negative by the logic preceding this.

2 years agocdt: squash -Wconversion warning
Matthew Fernandez [Thu, 3 Nov 2022 04:37:56 +0000 (21:37 -0700)]
cdt: squash -Wconversion warning

This squashes the warning:

  dtstrhash.c:23:21: warning: conversion from ‘long int’ to ‘int’ may change
    value [-Wconversion]
     23 |                 n = s - (unsigned char*)args;
        |                     ^

This cast is mostly guaranteed safe by the inability to practically pass a
>INT_MAX length string into this function.

2 years agocdt: make intent to coerce to unsigned clearer in 'dtstrhash'
Matthew Fernandez [Thu, 3 Nov 2022 04:25:47 +0000 (21:25 -0700)]
cdt: make intent to coerce to unsigned clearer in 'dtstrhash'

This squashes some compiler warnings on CentOS 7:

  dtstrhash.c: In function 'dtstrhash':
  dtstrhash.c:22:18: warning: conversion to 'unsigned int' from 'int' may change
    the sign of the result [-Wsign-conversion]
      h = (h + (s[0]<<8) + s[1])*DT_PRIME;
                    ^
  dtstrhash.c:28:18: warning: conversion to 'unsigned int' from 'int' may change
    the sign of the result [-Wsign-conversion]
      h = (h + (s[0]<<8) + s[1])*DT_PRIME;
                    ^
  dtstrhash.c:30:18: warning: conversion to 'unsigned int' from 'int' may change
    the sign of the result [-Wsign-conversion]
      h = (h + (s[0]<<8))*DT_PRIME;

2 years agoMerge branch 'smattr/c45f1bca-907b-4b5e-a821-311edc34490b' into 'main'
Matthew Fernandez [Fri, 4 Nov 2022 02:03:35 +0000 (02:03 +0000)]
Merge branch 'smattr/c45f1bca-907b-4b5e-a821-311edc34490b' into 'main'

smyrna, common: some clean up and warning squashing

See merge request graphviz/graphviz!2931

2 years agosmyrna: avoid inadvertent double promotion in 'renderSelectedNodes'
Matthew Fernandez [Thu, 3 Nov 2022 02:34:57 +0000 (19:34 -0700)]
smyrna: avoid inadvertent double promotion in 'renderSelectedNodes'

Squashes two compiler warnings:

  topviewfuncs.c: In function ‘renderSelectedNodes’:
  topviewfuncs.c:283:41: warning: conversion from ‘double’ to ‘GLfloat’ {aka
    ‘float’} may change value [-Wfloat-conversion]
    283 |             glVertex3f(pos.x,pos.y,pos.z+0.001);
        |                                    ~~~~~^~~~~~
  topviewfuncs.c:285:50: warning: conversion from ‘double’ to ‘float’ may
    change value [-Wfloat-conversion]
    285 |             drawCircle(pos.x,pos.y,nodeSize,pos.z+0.001);
        |                                             ~~~~~^~~~~~

2 years agosmyrna: remove unused parameter from 'showAttrsWidget'
Matthew Fernandez [Thu, 3 Nov 2022 02:30:03 +0000 (19:30 -0700)]
smyrna: remove unused parameter from 'showAttrsWidget'

2 years agosmyrna: remove 'line' shadowing in 'load_attr_list'
Matthew Fernandez [Thu, 3 Nov 2022 02:25:13 +0000 (19:25 -0700)]
smyrna: remove 'line' shadowing in 'load_attr_list'

Squashes a compiler warning:

  gui/frmobjectui.c:580:10: warning: declaration of ‘line’ shadows a global
    declaration [-Wshadow]
    580 |     char line[BUFSIZ];
        |          ^~~~
  In file included from ./smyrnadefs.h:27,
                   from gui/gui.h:13,
                   from gui/frmobjectui.c:15:
  ../../lib/glcomp/glutils.h:25:7: note: shadowed declaration is here
     25 |     } line;
        |       ^~~~

2 years agosmyrna: remove 'line' shadowing in 'load_attributes'
Matthew Fernandez [Thu, 3 Nov 2022 02:23:27 +0000 (19:23 -0700)]
smyrna: remove 'line' shadowing in 'load_attributes'

Squashes a compiler warning:

  gui/gui.c: In function ‘load_attributes’:
  gui/gui.c:45:10: warning: declaration of ‘line’ shadows a global declaration
    [-Wshadow]
     45 |     char line[BUFSIZ];
        |          ^~~~
  In file included from ./smyrnadefs.h:27,
                   from gui/gui.h:13,
                   from gui/gui.c:14:
  ../../lib/glcomp/glutils.h:25:7: note: shadowed declaration is here
     25 |     } line;
        |       ^~~~

2 years agosmyrna: use a more appropriate type for 'ComboValuesCount'
Matthew Fernandez [Thu, 3 Nov 2022 02:20:41 +0000 (19:20 -0700)]
smyrna: use a more appropriate type for 'ComboValuesCount'

Squashes two compiler warnings:

  gui/gui.c:94:96: warning: conversion to ‘size_t’ {aka ‘long unsigned
    int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
     94 |   attr[attrcount].ComboValuesCount - 1,
        |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
  gui/gui.c:95:78: warning: conversion to ‘size_t’ {aka ‘long unsigned
    int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
     95 |   attr[attrcount].ComboValuesCount,
        |   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

2 years agosmyrna: remove unused 'mPropertiesSlot' parameter
Matthew Fernandez [Thu, 3 Nov 2022 02:17:24 +0000 (19:17 -0700)]
smyrna: remove unused 'mPropertiesSlot' parameter

2 years agosquash compiler warnings when building Perl bindings
Matthew Fernandez [Thu, 3 Nov 2022 02:11:43 +0000 (19:11 -0700)]
squash compiler warnings when building Perl bindings

This suppresses the following warnings in generated code:

  gv_perl.cpp: In function ‘int SWIG_Perl_AcquirePtr(SV*, int)’:
  gv_perl.cpp:1130:49: warning: unused parameter ‘sv’ [-Wunused-parameter]
   1130 | SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, int own) {
        |                                             ~~~~^~
  gv_perl.cpp:1130:57: warning: unused parameter ‘own’ [-Wunused-parameter]
   1130 | SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, int own) {
        |                                                     ~~~~^~~

2 years agodotgen: remove 'arrow_flags' call whose result is ignored
Matthew Fernandez [Thu, 3 Nov 2022 01:58:36 +0000 (18:58 -0700)]
dotgen: remove 'arrow_flags' call whose result is ignored

2 years agocommon: abbreviate a prefix check
Matthew Fernandez [Thu, 3 Nov 2022 01:56:08 +0000 (18:56 -0700)]
common: abbreviate a prefix check

2 years agocommon remove an unnecessary '|='
Matthew Fernandez [Thu, 3 Nov 2022 01:47:54 +0000 (18:47 -0700)]
common remove an unnecessary '|='

All calls into this function set the `flags` parameter to 0 beforehand.

2 years agocommon: remove unused struct names
Matthew Fernandez [Thu, 3 Nov 2022 01:25:38 +0000 (18:25 -0700)]
common: remove unused struct names

2 years agoMerge branch 'smattr/gitlab-2232-5' into 'main'
Matthew Fernandez [Fri, 4 Nov 2022 00:51:36 +0000 (00:51 +0000)]
Merge branch 'smattr/gitlab-2232-5' into 'main'

fix installing example graphs during CPack; rewrite 'SMYRNA_PATH' discovery

Closes #2232

See merge request graphviz/graphviz!2928

2 years agoCMake: remove duplicate install step of 'zoom.png'
Matthew Fernandez [Tue, 1 Nov 2022 04:55:23 +0000 (21:55 -0700)]
CMake: remove duplicate install step of 'zoom.png'

This caused no harm, but resulted in unnecessary work:

  -- Installing: /tmp/tmp.YkhgwZacNd/share/graphviz/smyrna/zoom.png
  -- Up-to-date: /tmp/tmp.YkhgwZacNd/share/graphviz/smyrna/zoom.png

2 years agofix installing example graphs during CPack; rewrite 'SMYRNA_PATH' discovery
Matthew Fernandez [Tue, 1 Nov 2022 03:26:33 +0000 (20:26 -0700)]
fix installing example graphs during CPack; rewrite 'SMYRNA_PATH' discovery

This is effectively two commits in one. But there seems to be no way to separate
these changes without the parts individually failing
tests/test_tools.py::test_tools[smyrna]. Smyrna auxiliary files were being
installed incorrectly prior to this commit, so installing them correctly and
fixing how Smyrna finds them needs to be done in a single change.

---

CMake: fix installing example graphs during CPack

When running `cpack`, instead of staging the Smyrna auxiliary files (share/**)
and the example graphs (graphs/**) in build-local directories, they would be
incorrectly staged into their final install paths. This was quite unexpected as
it would result in errors if you did not have permission to write to the install
directories or deleting+replacing files from a previous Graphviz installation if
you did.

This bug was introduced in 67f88eb86c9966daa4d8c3a6f25aee8cd35a046d as an
accidental side effect of enabling Smyrna in the CMake build system. A close
re-reading of the CPack¹ and `GNUInstallDirs`² docs suggests that absolute paths
should never be used in `install` rules:

  `CMAKE_INSTALL_<dir>`
    Destination for files of a given type. This value may be passed to the
    `DESTINATION` options of `install()` commands for the corresponding file
    type. It should typically be a path relative to the installation prefix so
    that it can be converted to an absolute path in a relocatable way (see
    `CMAKE_INSTALL_FULL_<dir>`). However, an absolute path is also allowed.

  `CMAKE_INSTALL_FULL_<dir>`
    The absolute path generated from the corresponding `CMAKE_INSTALL_<dir>`
    value. If the value is not already an absolute path, an absolute path is
    constructed typically by prepending the value of the `CMAKE_INSTALL_PREFIX`
    variable. However, there are some special cases as documented below.

This change brings the behavior on Linux in line with how CPack operates on
other platforms – the default value of `CMAKE_INSTALL_DATAROOTDIR` is `share`
which is the hard coded value set on non-Linux platforms.

----

smyrna: rewrite 'SMYRNA_PATH' discovery

This aligns Smyrna on other platforms with how Smyrna on Windows locates its
templates, examples etc. This resolves a problem where a build time path was
being baked into the Smyrna binary, preventing it from being relocatable.

The code for locating our own executable in this commit is adapted from public
domain source.³

This commit also lifts the 1024 character limit on path discovery in the Windows
branch of this logic. It now dynamically expands the target buffer until the
current executable name will fit.

Gitlab: fixes #2232
Reported-by: Magnus Jacobsson <magnus.jacobsson@berotec.se>
¹ https://cmake.org/cmake/help/book/mastering-cmake/chapter/Packaging%20With%20CPack.html
² https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
³ https://github.com/Smattr/clink/blob/main/clink/src/find_me.c as of commit
  8cadfc49a74e429fa69afdc460cb2b0662d81260

2 years agosmyrna: remove unnecessary symbol lookup on Windows
Matthew Fernandez [Wed, 2 Nov 2022 01:27:08 +0000 (18:27 -0700)]
smyrna: remove unnecessary symbol lookup on Windows

The `GetModuleFileName` API accepts a null pointer as the first argument to mean
the current executable.

2 years agoMerge branch 'smattr/gitlab-2277' into 'main'
Matthew Fernandez [Thu, 3 Nov 2022 16:33:05 +0000 (16:33 +0000)]
Merge branch 'smattr/gitlab-2277' into 'main'

support SWIG 4.1.0 in the Autotools build system

Closes #2303 and #2277

See merge request graphviz/graphviz!2927

2 years agoremove unused 'LUA_VERSION' variable
Matthew Fernandez [Sat, 29 Oct 2022 22:28:15 +0000 (15:28 -0700)]
remove unused 'LUA_VERSION' variable

This was unused in its introduction in 8af1e15fc76eb51b82034bce25f94e150789b5a8
and has never been used since either.

2 years agouse newly acquired 'AX_COMPARE_VERSION' to simplify some version checks
Matthew Fernandez [Sat, 29 Oct 2022 21:58:09 +0000 (14:58 -0700)]
use newly acquired 'AX_COMPARE_VERSION' to simplify some version checks

2 years agoignore files generated by libtool
Matthew Fernandez [Sat, 29 Oct 2022 21:26:50 +0000 (14:26 -0700)]
ignore files generated by libtool

2 years agosupport SWIG 4.1.0 in the Autotools build system
Matthew Fernandez [Sat, 29 Oct 2022 21:15:39 +0000 (14:15 -0700)]
support SWIG 4.1.0 in the Autotools build system

Gitlab: closes #2277, closes #2303

2 years agoadd a way to compare version numbers in the Autotools build system
Matthew Fernandez [Sat, 29 Oct 2022 21:12:52 +0000 (14:12 -0700)]
add a way to compare version numbers in the Autotools build system

This file is imported from the Autoconf archive¹ as of commit
da89908ef7d82a90fe5dab8904a65869b5a5d996.

¹ https://git.savannah.gnu.org/git/autoconf-archive.git

2 years agoMerge branch 'smattr/398c5969-bfd5-4a12-9d47-f75fb8b17479' into 'main'
Matthew Fernandez [Thu, 3 Nov 2022 15:34:10 +0000 (15:34 +0000)]
Merge branch 'smattr/398c5969-bfd5-4a12-9d47-f75fb8b17479' into 'main'

tests: only accept 'which' results that are adjacent to 'dot'

Closes #2201

See merge request graphviz/graphviz!2926

2 years agotests: only accept 'which' results that are adjacent to 'dot'
Matthew Fernandez [Sat, 29 Oct 2022 15:40:26 +0000 (08:40 -0700)]
tests: only accept 'which' results that are adjacent to 'dot'

As described in the code comment, this addresses a problem where testing would
find binaries from a prior Graphviz installation and then spuriously fail.

This is not ideal. It is easy for an upcoming test writer to forget or be
unaware of this quirk and introduce a new direct call to `shutil.which`. But it
seems the best option we have right now.

Gitlab: closes #2201

2 years agoMerge branch 'reduce-required-approvals-for-maintainers-merge-reguests' into 'main'
Magnus Jacobsson [Thu, 3 Nov 2022 06:53:20 +0000 (06:53 +0000)]
Merge branch 'reduce-required-approvals-for-maintainers-merge-reguests' into 'main'

CONTRIBUTING.md: allow the maintainers' MRs to be merged with only one approval

See merge request graphviz/graphviz!2930

2 years agoCONTRIBUTING.md: allow the maintainers' MRs to be merged with only one approval
Magnus Jacobsson [Wed, 2 Nov 2022 21:27:48 +0000 (22:27 +0100)]
CONTRIBUTING.md: allow the maintainers' MRs to be merged with only one approval

2 years agoMerge branch 'smattr/9498a05d-a496-4c20-8f25-324b045f0651' into 'main'
Matthew Fernandez [Thu, 3 Nov 2022 04:43:00 +0000 (04:43 +0000)]
Merge branch 'smattr/9498a05d-a496-4c20-8f25-324b045f0651' into 'main'

DEVELOPERS.md: fill in basic 'perf' starter

See merge request graphviz/graphviz!2922

2 years agoDEVELOPERS.md: fill in basic 'perf' starter
Matthew Fernandez [Sat, 22 Oct 2022 02:08:47 +0000 (19:08 -0700)]
DEVELOPERS.md: fill in basic 'perf' starter

2 years agoMerge branch 'smattr/902f6d98-cc06-4200-be35-4b5334490394' into 'main'
Matthew Fernandez [Thu, 3 Nov 2022 01:33:17 +0000 (01:33 +0000)]
Merge branch 'smattr/902f6d98-cc06-4200-be35-4b5334490394' into 'main'

cgraph strview_str_contains: abbreviate prefix check

See merge request graphviz/graphviz!2918

2 years agocgraph strview_str_contains: abbreviate prefix check
Matthew Fernandez [Sat, 15 Oct 2022 21:25:22 +0000 (14:25 -0700)]
cgraph strview_str_contains: abbreviate prefix check

After this function was written, the `startswith` helper was introduced for
abbreviating the idiom `strncmp(foo, bar, strlen(bar)) == 0`. We can use it to
more concisely and clearly express the intent of this code.

2 years agoMerge branch 'smattr/721d9c7f-df4c-4fda-9c4e-f961c95d0dd9' into 'main'
Matthew Fernandez [Wed, 2 Nov 2022 16:28:54 +0000 (16:28 +0000)]
Merge branch 'smattr/721d9c7f-df4c-4fda-9c4e-f961c95d0dd9' into 'main'

CI: remove '--version' option from deploy script

See merge request graphviz/graphviz!2921

2 years agoCI: remove '--version' option from deploy script
Matthew Fernandez [Sat, 22 Oct 2022 00:19:47 +0000 (17:19 -0700)]
CI: remove '--version' option from deploy script

Since it was introduced, this option has not been needed. This change removes it
to streamline and simplify this script.

2 years agoMerge branch 'smattr/gitlab-2304' into 'main'
Matthew Fernandez [Wed, 2 Nov 2022 05:31:14 +0000 (05:31 +0000)]
Merge branch 'smattr/gitlab-2304' into 'main'

minimize test case for #2095

Closes #2304

See merge request graphviz/graphviz!2925

2 years agominimize test case for #2095
Matthew Fernandez [Wed, 26 Oct 2022 15:35:04 +0000 (08:35 -0700)]
minimize test case for #2095

Graphviz periodically runs into problems where CI test jobs exceed the maximum
timeout and recently the project as a whole has exceeded its Gitlab CI quota.

`test_2095` is by far the longest running component of the test suite. This
change is the result of applying two test case minimizers, one clever¹ and one
not so clever², to the input to this test case. The minimizers were asked to
find smaller input that still (1) provoked a segfault on
588096bd638543ea851ea22751ed91549f61a407 and (2) could be processed successfully
on 32feee561394530713292f8873020fc5feacb9fb. The result takes a ~103KB test
input to ~5KB, with execution time in an example environment dropping from
~155s to <1s.

Gitlab: closes #2304

¹ https://github.com/googleprojectzero/halfempty
² https://github.com/Smattr/mattutils/blob/master/shrink

2 years agoMerge branch 'smattr/gitlab-2300' into 'main'
Matthew Fernandez [Wed, 2 Nov 2022 04:38:16 +0000 (04:38 +0000)]
Merge branch 'smattr/gitlab-2300' into 'main'

remove dead code in graphml2gv; add a #2300 test case

See merge request graphviz/graphviz!2923

2 years agocgraph agrelabel_node: remove unnecessary cast
Matthew Fernandez [Sat, 22 Oct 2022 21:27:20 +0000 (14:27 -0700)]
cgraph agrelabel_node: remove unnecessary cast

2 years agoadd a test case for 'gxl2gv' crash
Matthew Fernandez [Sat, 22 Oct 2022 21:15:15 +0000 (14:15 -0700)]
add a test case for 'gxl2gv' crash

This is one of the variants of #2300.

Gitlab: #2300

2 years agographml2gv: remove 'nameMap'
Matthew Fernandez [Sat, 22 Oct 2022 20:43:38 +0000 (13:43 -0700)]
graphml2gv: remove 'nameMap'

This dictionary was only ever inserted to by code that was removed in the
previous commit as unreachable. So we know it is always empty and lookups into
it would have always returned null.

Gitlab: #2300

2 years agographml2gv: remove dead code handling ending of 'attr' attribute
Matthew Fernandez [Sat, 22 Oct 2022 20:26:07 +0000 (13:26 -0700)]
graphml2gv: remove dead code handling ending of 'attr' attribute

The code in the last branch in `endElementHandler` was dealing with a closing
`</attr>` tag in the input GraphML. However, the preceding `startElementHandler`
callback rejects an opening `<attr>` tag. So there is no way to reach this
closing logic. This change removes not only the local unreachable code but
several transitively unreachable functions.

As an aside, this was only discovered while trying to construct a test case to
provoke #2300. One path to `dict_relabel` is through `graphml2gv`, by handling a
closing `</attr>` tag. So I looked online for sample GraphML using `attr`. I
could not find any. So I went to the GraphML specification¹ and there discovered
`attr` is not a valid GraphML tag. So I thought, fine, I will figure out how
`graphml2gv` expects this non-standard tag to appear. And that is when I
discovered none of this logic is reachable.

This does not appear to be the result of changes. The very first revision of
`graphml2gv`, 1d28d7d2b4d2b2551bd1f432aa175f54a69364a4, seems to have this
limitation already. I can only conclude this was copy-pasted from gxl2gv without
taking into account the differences between GXL and GraphML.

Gitlab: #2300

¹ http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd

2 years agoMerge branch 'smattr/a2669180-b285-4470-a8ef-e51d4a424f43' into 'main'
Matthew Fernandez [Wed, 2 Nov 2022 03:09:41 +0000 (03:09 +0000)]
Merge branch 'smattr/a2669180-b285-4470-a8ef-e51d4a424f43' into 'main'

CI: add Ubuntu 22.10 jobs

See merge request graphviz/graphviz!2920

2 years agoCI: add Ubuntu 22.10 jobs
Matthew Fernandez [Fri, 21 Oct 2022 14:46:59 +0000 (07:46 -0700)]
CI: add Ubuntu 22.10 jobs

2 years agotests: squash Boost header deprecation warnings
Matthew Fernandez [Fri, 21 Oct 2022 15:09:49 +0000 (08:09 -0700)]
tests: squash Boost header deprecation warnings

Boost 1.74.0 deprecates some functions that svgpp is using. Without squashing
these, the CMake build fails in CI:

  [ 86%] Building CXX object
    tests/CMakeFiles/test_common.dir/svgpp_context.cpp.o
  In file included from /usr/include/boost/config/header_deprecated.hpp:18,
                   from /usr/include/boost/detail/scoped_enum_emulation.hpp:15,
                   from /usr/include/svgpp/detail/namespace.hpp:13,
                   from /usr/include/svgpp/detail/attribute_name_to_id.hpp:11,
                   from
    /usr/include/svgpp/attribute_traversal/prioritized.hpp:12,
                   from
    /usr/include/svgpp/attribute_traversal/attribute_traversal.hpp:10,
                   from /usr/include/svgpp/document_traversal.hpp:10,
                   from /usr/include/svgpp/svgpp.hpp:1,
                   from /builds/graphviz/graphviz/tests/svgpp_context.h:7,
                   from /builds/graphviz/graphviz/tests/svgpp_context.cpp:8:
  /usr/include/boost/detail/scoped_enum_emulation.hpp:17:1: note: '#pragma
    message: This header is deprecated. Use <boost/core/scoped_enum.hpp>
    instead.'
     17 | BOOST_HEADER_DEPRECATED("<boost/core/scoped_enum.hpp>")
        | ^~~~~~~~~~~~~~~~~~~~~~~

2 years agotests: fix missing #include
Matthew Fernandez [Fri, 21 Oct 2022 15:06:14 +0000 (08:06 -0700)]
tests: fix missing #include

The default toolchain on Ubuntu 22.10 comes with a slightly more pedantic header
layout:

  [ 87%] Building CXX object tests/CMakeFiles/test_common.dir/svg_element.cpp.o
  tests/svg_element.cpp: In member function 'SVG::SVGRect
    SVG::SVGElement::outline_bbox(bool)':
  tests/svg_element.cpp:287:29: error: 'all_of' is not a member of 'std'
    287 |     auto is_vertical = std::all_of(
        |                             ^~~~~~
  tests/svg_element.cpp:290:31: error: 'all_of' is not a member of 'std'
    290 |     auto is_horizontal = std::all_of(
        |                               ^~~~~~

2 years agoMerge branch 'smattr/66292151-a6ce-43e8-bf3f-6f2e1184a9d0' into 'main'
Matthew Fernandez [Wed, 2 Nov 2022 01:38:13 +0000 (01:38 +0000)]
Merge branch 'smattr/66292151-a6ce-43e8-bf3f-6f2e1184a9d0' into 'main'

remove 'pointfof' and replace with aggregate initialization

See merge request graphviz/graphviz!2919

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.