]> granicus.if.org Git - graphviz/log
graphviz
3 years agoadd GVLayout construction overload, passing the graph as an rvalue ref
Magnus Jacobsson [Wed, 7 Jul 2021 13:35:52 +0000 (15:35 +0200)]
add GVLayout construction overload, passing the graph as an rvalue ref

3 years agoadd test of GVLayout construction overload, passing the context and the graph as...
Magnus Jacobsson [Wed, 7 Jul 2021 12:17:43 +0000 (14:17 +0200)]
add test of GVLayout construction overload, passing the context and the graph as rvalue refs

3 years agoadd GVLayout constructor overload, passing the context and the graph as rvalue refs
Magnus Jacobsson [Wed, 7 Jul 2021 12:17:43 +0000 (14:17 +0200)]
add GVLayout constructor overload, passing the context and the graph as rvalue refs

3 years agoMerge branch 'add-cpp-api' into 'main'
Magnus Jacobsson [Sat, 7 Aug 2021 06:49:46 +0000 (06:49 +0000)]
Merge branch 'add-cpp-api' into 'main'

Add a very basic C++ API

Closes #2001

See merge request graphviz/graphviz!2058

3 years agoadd test of throwing exception when trying to create a layout on a graph when one...
Magnus Jacobsson [Wed, 4 Aug 2021 16:25:02 +0000 (18:25 +0200)]
add test of throwing exception when trying to create a layout on a graph when one already exists

3 years agothrow exception if trying to create a layout on a graph when one already exists
Magnus Jacobsson [Wed, 4 Aug 2021 16:21:53 +0000 (18:21 +0200)]
throw exception if trying to create a layout on a graph when one already exists

Before this, the first layout was silently replaced by the second,
which may not be what the caller would expect.

3 years agodestroy first layout before creating second in multiple layouts test
Magnus Jacobsson [Wed, 4 Aug 2021 16:20:14 +0000 (18:20 +0200)]
destroy first layout before creating second in multiple layouts test

An upcoming commit in this series will change the implementation to
throw an exception if the previous layout has not been destroyed when
a second layout is created.

3 years agoadd a gvLayoutDone function to the gvc lib
Magnus Jacobsson [Wed, 4 Aug 2021 16:18:04 +0000 (18:18 +0200)]
add a gvLayoutDone function to the gvc lib

An upcoming commit in the series need to perform this check from
C++. Using the LAYOUT_DONE macro directly would give the warning
below. It would be possible to change the underlying C functions to
take a const char * instead, but exposing this new function seems
better than using a macro in C++ anyway.

The warning that would have been the result otherwise:

In file included from /home/magjac/graphviz/lib/gvc++/GVContext.h:5,
                 from /home/magjac/graphviz/lib/gvc++/GVLayout.cpp:6:
/home/magjac/graphviz/lib/gvc++/GVLayout.cpp: In constructor ‘GVC::GVLayout::GVLayout(const std::shared_ptr<GVC::GVContext>&, const std::shared_ptr<CGraph::AGraph>&, const string&)’:
/home/magjac/graphviz/lib/gvc/gvc.h:38:38: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
   38 | #define LAYOUT_DONE(g) (agbindrec(g, "Agraphinfo_t", 0, TRUE) && GD_drawing(g))
      |                                      ^~~~~~~~~~~~~~
/home/magjac/graphviz/lib/gvc++/GVLayout.cpp:18:9: note: in expansion of macro ‘LAYOUT_DONE’
   18 |     if (LAYOUT_DONE(g->c_struct())) {}
      |         ^~~~~~~~~~~

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

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

3 years agostep minor release version
Magnus Jacobsson [Sun, 4 Jul 2021 07:35:02 +0000 (09:35 +0200)]
step minor release version

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

3 years agoadd test of GVLayout render throwing an exception for unknown formats
Magnus Jacobsson [Mon, 5 Apr 2021 19:10:51 +0000 (21:10 +0200)]
add test of GVLayout render throwing an exception for unknown formats

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

3 years agoadd test of GVLayout render creating a GVRenderData object
Magnus Jacobsson [Mon, 5 Apr 2021 19:10:51 +0000 (21:10 +0200)]
add test of GVLayout render creating a GVRenderData object

GVRenderData destroy is also implicitly tested since we would detect
potential memory leaks with ASan.

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

3 years agoadd render method to GVLayout that returns a GVRenderData object
Magnus Jacobsson [Tue, 6 Jul 2021 20:13:07 +0000 (22:13 +0200)]
add render method to GVLayout that returns a GVRenderData object

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

3 years agoadd a GVRenderData class
Magnus Jacobsson [Thu, 15 Jul 2021 12:37:33 +0000 (14:37 +0200)]
add a GVRenderData class

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

3 years agoadd test of multiple GVLayout constructions of the same graph using different contexts
Magnus Jacobsson [Wed, 7 Jul 2021 13:56:05 +0000 (15:56 +0200)]
add test of multiple GVLayout constructions of the same graph using different contexts

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

3 years agoadd test of multiple GVLayout constructions of different graphs using the same context
Magnus Jacobsson [Wed, 7 Jul 2021 13:08:36 +0000 (15:08 +0200)]
add test of multiple GVLayout constructions of different graphs using the same context

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

3 years agoadd test of GVLayout move construction
Magnus Jacobsson [Sat, 17 Jul 2021 09:18:41 +0000 (11:18 +0200)]
add test of GVLayout move construction

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

3 years agoadd test of GVLayout move assignment
Magnus Jacobsson [Thu, 8 Jul 2021 19:36:11 +0000 (21:36 +0200)]
add test of GVLayout move assignment

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

3 years agoadd test of GVLayout construction throwing an exception when layout fails
Magnus Jacobsson [Sun, 4 Apr 2021 13:58:29 +0000 (15:58 +0200)]
add test of GVLayout construction throwing an exception when layout fails

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

3 years agoadd test of GVLayout construction using built-in plugins
Magnus Jacobsson [Fri, 16 Jul 2021 05:46:18 +0000 (07:46 +0200)]
add test of GVLayout construction using built-in plugins

GVLayout destroy is also implicitly tested since we would detect
potential memory leaks with ASan.

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

3 years agoadd test of GVLayout construction using on-demand loaded plugins
Magnus Jacobsson [Sun, 4 Apr 2021 13:58:29 +0000 (15:58 +0200)]
add test of GVLayout construction using on-demand loaded plugins

Test construction of a GVLayout object from shared pointers to AGraph
and GVContext objects, performing a layout of AGraph using GVContext.

GVLayout destroy is also implicitly tested since we would detect
potential memory leaks with ASan.

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

3 years agoadd a GVLayout class with construction from AGraph and GVContext objects
Magnus Jacobsson [Sun, 4 Apr 2021 13:58:29 +0000 (15:58 +0200)]
add a GVLayout class with construction from AGraph and GVContext objects

The GVLayout class is an RAII-class that performs a layout using
shared pointers to AGraph and GVContext objects. It participates in
the handling of the lifetime of those objects, since it needs them to
free the layout when the GVLayout object is destroyed. It currently
supports construction with built-in plugins, move construction and
move assignment, but not copy construction or copy assignment since
the AGraph and GVContext objects do not support that.

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

3 years agoadd test of GVContext move assignment
Magnus Jacobsson [Sat, 17 Jul 2021 09:04:20 +0000 (11:04 +0200)]
add test of GVContext move assignment

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

3 years agoadd test of GVContext move construction
Magnus Jacobsson [Sat, 17 Jul 2021 09:04:09 +0000 (11:04 +0200)]
add test of GVContext move construction

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

3 years agoadd test of GVContext construction without built-in plugins
Magnus Jacobsson [Sat, 3 Apr 2021 22:10:58 +0000 (00:10 +0200)]
add test of GVContext construction without built-in plugins

Destroy is also implicitly tested since we would detect potential
memory leaks with ASan.

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

3 years agoconfigure the dot layout plugin for use pre-installation
Magnus Jacobsson [Mon, 5 Jul 2021 13:26:02 +0000 (15:26 +0200)]
configure the dot layout plugin for use pre-installation

When running ctest, the Graphviz shared libraries are used from the
locations where they reside directly after being created, i.e., before
they are copied to the installation directory by cpack. Since the
pre-configuring of the Graphviz plugins that cpack does is done on the
installed plugins, the pre-install plugins need to be configured
separately.

We use GVBINDIR for this. It tells Graphviz both where to find plugins
and where to read and write the plugin configuration file,
config6. Unfortunately this means that we can only use one plugin
since the others are in separate directories and Graphviz currently
supports only one path in GVBINDIR. We choose to configure the dot
layout plugin which is good for now.

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

3 years agoarchive the just-built dot program in the Ubuntu 21.04 ctest CI job
Magnus Jacobsson [Mon, 5 Jul 2021 13:24:47 +0000 (15:24 +0200)]
archive the just-built dot program in the Ubuntu 21.04 ctest CI job

In an upcoming commit in this series, the dot program will be used by
the ctest CI jobs to configure plugins for pre-install tests without
built-in plugins. This extra archiving is needed since these tests use
the dot program from the location where it resides directly after
being created, i.e., before it is copied to the installation directory
by cpack.

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

3 years agoadd test of GVContext construction with built-in plugins
Magnus Jacobsson [Sat, 3 Apr 2021 22:10:58 +0000 (00:10 +0200)]
add test of GVContext construction with built-in plugins

Destroy is also implicitly tested since we would detect potential
memory leaks with ASan.

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

3 years agoadd a new gvc++ library with a very basic GVContext C++ class
Magnus Jacobsson [Sat, 3 Apr 2021 22:10:58 +0000 (00:10 +0200)]
add a new gvc++ library with a very basic GVContext C++ class

The GVContext class is an RAII-class that handles the lifetime of the
underlying GVC_t C data structure. It currently supports construction
with or without built-in plugins, move construction and move
assignment, but not copy construction or copy assignment since the
underlying C data structure cannot be easily copied. It also supports
retrieving a non-owning pointer to the underlying GVC_t.

The new gvc++ library is optional and can be enabled with the CMake
option "with_cxx_api".

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

3 years agoadd test of Agraph move assignment
Magnus Jacobsson [Fri, 16 Jul 2021 04:32:03 +0000 (06:32 +0200)]
add test of Agraph move assignment

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

3 years agoadd test of Agraph move construction
Magnus Jacobsson [Fri, 16 Jul 2021 04:31:37 +0000 (06:31 +0200)]
add test of Agraph move construction

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

3 years agoadd test of Agraph construction throwing an exception for empty DOT source
Magnus Jacobsson [Fri, 16 Jul 2021 04:30:50 +0000 (06:30 +0200)]
add test of Agraph construction throwing an exception for empty DOT source

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

3 years agoadd test of Agraph construction throwing an exception for illegal DOT source
Magnus Jacobsson [Fri, 16 Jul 2021 04:28:45 +0000 (06:28 +0200)]
add test of Agraph construction throwing an exception for illegal DOT source

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

3 years agoadd test of Agraph construction from DOT source
Magnus Jacobsson [Sat, 3 Apr 2021 22:24:40 +0000 (00:24 +0200)]
add test of Agraph construction from DOT source

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

3 years agoenable building the C++ API in CI in Windows CMake builds
Magnus Jacobsson [Sat, 10 Jul 2021 14:09:42 +0000 (16:09 +0200)]
enable building the C++ API in CI in Windows CMake builds

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

3 years agoenable building the C++ API in CI in macOS CMake builds
Magnus Jacobsson [Sat, 10 Jul 2021 14:09:14 +0000 (16:09 +0200)]
enable building the C++ API in CI in macOS CMake builds

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

3 years agoenable building the C++ API in CI in Ubuntu 21.04 CMake builds
Magnus Jacobsson [Mon, 5 Jul 2021 11:59:36 +0000 (13:59 +0200)]
enable building the C++ API in CI in Ubuntu 21.04 CMake builds

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

3 years agoadd a new cgraph++ library with a very basic AGraph C++ class
Magnus Jacobsson [Sat, 3 Apr 2021 22:24:40 +0000 (00:24 +0200)]
add a new cgraph++ library with a very basic AGraph C++ class

The AGraph class is an RAII-class that handles the lifetime of the
underlying Agraph_t C data structure. It currently supports
construction from DOT source, move construction and move assignment,
but not copy construction or copy assignment since the underlying C
data structure cannot be easily copied. It also supports retrieving a
non-owning pointer to the underlying Agraph_t.

The new C++ API is optional and can be enabled with the CMake option
"with_cxx_api".

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

3 years agorun ctest before installing packages in CI
Magnus Jacobsson [Thu, 22 Jul 2021 20:04:25 +0000 (22:04 +0200)]
run ctest before installing packages in CI

This ensures that ctest can only use libraries, headers and
executables from the locations where they are built, i.e., before they
are copied to the intallation directory by cpack. This change should
have no impact, but is made to avoid doubt of which files are used in
ctest.

3 years agoadd JUnit test reports from C++ tests to artifacts
Magnus Jacobsson [Sat, 3 Jul 2021 19:33:38 +0000 (21:33 +0200)]
add JUnit test reports from C++ tests to artifacts

This commit should really have been part of
https://gitlab.com/graphviz/graphviz/-/merge_requests/2035, but it was
accidentally left out.

3 years ago[nfc] add dependency to the gvc library for all tests
Magnus Jacobsson [Thu, 15 Jul 2021 16:29:50 +0000 (18:29 +0200)]
[nfc] add dependency to the gvc library for all tests

The tests directly use gvc so this is correct, although it worked even
before this change since gvc was available through other libraries.

3 years agoMerge branch 'lefty-build-cleanup' into 'main'
Matthew Fernandez [Fri, 6 Aug 2021 02:20:09 +0000 (02:20 +0000)]
Merge branch 'lefty-build-cleanup' into 'main'

Simplify `lefty` building

See merge request graphviz/graphviz!2082

3 years agochangelog entry about improved Xaw/Xmu detection
Matthew Fernandez [Fri, 6 Aug 2021 01:50:23 +0000 (18:50 -0700)]
changelog entry about improved Xaw/Xmu detection

3 years agoSimplify `lefty` building
David Seifert [Sat, 31 Jul 2021 20:39:32 +0000 (22:39 +0200)]
Simplify `lefty` building

3 years agoMerge branch 'smattr/ebf3cf31-f820-4853-8bf1-b23127e213fd' into 'main'
Matthew Fernandez [Wed, 4 Aug 2021 03:31:53 +0000 (03:31 +0000)]
Merge branch 'smattr/ebf3cf31-f820-4853-8bf1-b23127e213fd' into 'main'

more sfprintf removal

See merge request graphviz/graphviz!2071

3 years agoexcast: avoid sfprintf in integer-to-string
Matthew Fernandez [Sat, 24 Jul 2021 03:15:53 +0000 (20:15 -0700)]
excast: avoid sfprintf in integer-to-string

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoexcast: avoid sfprintf in float-to-string
Matthew Fernandez [Sat, 24 Jul 2021 03:13:24 +0000 (20:13 -0700)]
excast: avoid sfprintf in float-to-string

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoexstringOf: avoid sfprintf in integer-to-string
Matthew Fernandez [Sat, 24 Jul 2021 03:00:23 +0000 (20:00 -0700)]
exstringOf: avoid sfprintf in integer-to-string

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoexstringOf: avoid sfprintf in float-to-string
Matthew Fernandez [Sat, 24 Jul 2021 02:31:46 +0000 (19:31 -0700)]
exstringOf: avoid sfprintf in float-to-string

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoeval: avoid sfprintf in integer-to-string dynamic
Matthew Fernandez [Sat, 24 Jul 2021 02:26:37 +0000 (19:26 -0700)]
eval: avoid sfprintf in integer-to-string dynamic

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoeval: avoid sfprintf in integer-to-string static
Matthew Fernandez [Sat, 24 Jul 2021 02:24:48 +0000 (19:24 -0700)]
eval: avoid sfprintf in integer-to-string static

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoeval: avoid sfprintf in float-to-string dynamic
Matthew Fernandez [Sat, 24 Jul 2021 02:13:45 +0000 (19:13 -0700)]
eval: avoid sfprintf in float-to-string dynamic

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoeval: avoid sfprintf in float-to-string static
Matthew Fernandez [Sat, 24 Jul 2021 02:10:40 +0000 (19:10 -0700)]
eval: avoid sfprintf in float-to-string static

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoMerge branch 'fix-include-warning' into 'main'
Matthew Fernandez [Tue, 3 Aug 2021 03:42:08 +0000 (03:42 +0000)]
Merge branch 'fix-include-warning' into 'main'

plugin/gdiplus: Fix warning with header file name

See merge request graphviz/graphviz!2079

3 years agoplugin/gdiplus: Fix warning with header file name
Biswapriyo Nath [Wed, 28 Jul 2021 16:00:47 +0000 (21:30 +0530)]
plugin/gdiplus: Fix warning with header file name

This fixes the following warning with clang in mingw
warning: non-portable path to file '<gdiplus.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]

3 years agoMerge branch 'smattr/B40D0BFD-1F7E-4DF2-8043-2612346DBEE9' into 'main'
Matthew Fernandez [Mon, 2 Aug 2021 03:08:52 +0000 (03:08 +0000)]
Merge branch 'smattr/B40D0BFD-1F7E-4DF2-8043-2612346DBEE9' into 'main'

gcalloc: fix: do not abort on calloc(0, 0) returning NULL

See merge request graphviz/graphviz!2078

3 years agogcalloc: fix: do not abort on calloc(0, x) or calloc(x, 0) returning NULL
Matthew Fernandez [Mon, 26 Jul 2021 04:52:08 +0000 (21:52 -0700)]
gcalloc: fix: do not abort on calloc(0, x) or calloc(x, 0) returning NULL

Commit 43a37bedd934bde50a6441766b85dfc9648abda9 added a `calloc` wrapper but
mistakenly did not account for it being valid for `calloc` to return `NULL` when
the input arguments are 0. This is unlikely to have caused a problem with Glibc
whose allocator typically returns non-null pointers even for 0 allocations.
However assuming a 0 allocation may return a null pointer is more portable.

3 years agoMerge branch 'smattr/D1A6A66B-15B4-449F-BB71-088F95E12676' into 'main'
Matthew Fernandez [Mon, 2 Aug 2021 01:26:53 +0000 (01:26 +0000)]
Merge branch 'smattr/D1A6A66B-15B4-449F-BB71-088F95E12676' into 'main'

fix an #if _WIN32

See merge request graphviz/graphviz!2073

3 years agofix an #if _WIN32
Matthew Fernandez [Sat, 24 Jul 2021 22:31:39 +0000 (15:31 -0700)]
fix an #if _WIN32

This worked out correctly, as _WIN32 is defined to 1 on Windows and is undefined
elsewhere. But it triggered -Wundef compiler warnings on non-Windows platforms.

3 years agoMerge branch 'smattr/2D62A146-06BC-4160-B15F-B8F495E8589C' into 'main'
Matthew Fernandez [Fri, 30 Jul 2021 05:23:18 +0000 (05:23 +0000)]
Merge branch 'smattr/2D62A146-06BC-4160-B15F-B8F495E8589C' into 'main'

squash some Pylint warnings

See merge request graphviz/graphviz!2080

3 years agodisable a wrong-import-position Pylint warning around run_c
Matthew Fernandez [Thu, 29 Jul 2021 00:22:38 +0000 (17:22 -0700)]
disable a wrong-import-position Pylint warning around run_c

This import has to come out of order because it only works due to prior sys.path
tweaks.

3 years agodisable Pylint’s too-many-lines warning
Matthew Fernandez [Thu, 29 Jul 2021 00:21:28 +0000 (17:21 -0700)]
disable Pylint’s too-many-lines warning

By the nature of how Graphviz makes use of Python, some test sources are long
files of independent functions. It does not make sense to split these up and
having long files is not an impediment to maintaining these test cases.

3 years agoaddress some missing docstring Pylint warnings
Matthew Fernandez [Thu, 29 Jul 2021 00:21:10 +0000 (17:21 -0700)]
address some missing docstring Pylint warnings

3 years agoMerge branch 'smattr/90bb42c1-3025-449a-8300-7ec7776f7c33' into 'main'
Matthew Fernandez [Fri, 30 Jul 2021 04:23:10 +0000 (04:23 +0000)]
Merge branch 'smattr/90bb42c1-3025-449a-8300-7ec7776f7c33' into 'main'

make agsetfile argument a const char*

See merge request graphviz/graphviz!2072

3 years agoCFrmSettings::createLayout: remove now-unnecessary cast of a agsetfile parameter
Matthew Fernandez [Sat, 24 Jul 2021 17:59:47 +0000 (10:59 -0700)]
CFrmSettings::createLayout: remove now-unnecessary cast of a agsetfile parameter

Related to #634.

3 years agoagsetfile: take a const char pointer instead of a mutable one
Matthew Fernandez [Sat, 24 Jul 2021 17:54:22 +0000 (10:54 -0700)]
agsetfile: take a const char pointer instead of a mutable one

This function does not modify the contents of the argument passed to it. Related
to #634.

3 years agocgraph: use a const char pointer for storing input filename
Matthew Fernandez [Sat, 24 Jul 2021 17:52:40 +0000 (10:52 -0700)]
cgraph: use a const char pointer for storing input filename

Related to #634.

3 years agochkNum: use a const char pointer for storing input file name
Matthew Fernandez [Sat, 24 Jul 2021 17:49:15 +0000 (10:49 -0700)]
chkNum: use a const char pointer for storing input file name

Related to #634.

3 years agoMerge branch 'smattr/51C10EB6-96A3-4442-9E10-9CE23E07AD2F' into 'main'
Matthew Fernandez [Fri, 30 Jul 2021 03:33:09 +0000 (03:33 +0000)]
Merge branch 'smattr/51C10EB6-96A3-4442-9E10-9CE23E07AD2F' into 'main'

minor no-op clean up

See merge request graphviz/graphviz!2076

3 years agoremove conditional inlining of mydist
Matthew Fernandez [Sun, 25 Jul 2021 20:28:10 +0000 (13:28 -0700)]
remove conditional inlining of mydist

Modern compilers mostly ignore `inline` and make their own decisions about
whether to inline a function or not.

3 years agoremove unused Windows gettxt redirect
Matthew Fernandez [Sun, 25 Jul 2021 20:26:06 +0000 (13:26 -0700)]
remove unused Windows gettxt redirect

3 years agoMerge branch 'smattr/2A41855C-DA22-4790-B27C-C1FF9B6108BC' into 'main'
Matthew Fernandez [Fri, 30 Jul 2021 00:52:57 +0000 (00:52 +0000)]
Merge branch 'smattr/2A41855C-DA22-4790-B27C-C1FF9B6108BC' into 'main'

install Python3 to a known path in Windows CI

Closes #2085

See merge request graphviz/graphviz!2067

3 years agoinstall Python3 to a known path in Windows CI
Matthew Fernandez [Fri, 23 Jul 2021 01:35:09 +0000 (18:35 -0700)]
install Python3 to a known path in Windows CI

This avoids a latent problem wherein Python is installed to a directory
containing its version number and the follow on `Path` manipulation was hard
coded to Python 3.9. This would have broken as soon as Python 3.10 became
available through Chocolatey. Closes #2085. Note, I still do not understand why
the documented technique Chocolatey recommends of `refreshenv` does not work.

3 years agoMerge branch 'smattr/b672cf7c-7615-4629-b14d-4760b3a76c03' into 'main'
Matthew Fernandez [Thu, 29 Jul 2021 19:59:19 +0000 (19:59 +0000)]
Merge branch 'smattr/b672cf7c-7615-4629-b14d-4760b3a76c03' into 'main'

remove vmresize

See merge request graphviz/graphviz!2060

3 years agoremove return type from assignable
Matthew Fernandez [Mon, 19 Jul 2021 00:48:16 +0000 (17:48 -0700)]
remove return type from assignable

This function only ever returns 1 and no calls check its return value.

3 years agoremove unnecessary casts of disc->user
Matthew Fernandez [Mon, 19 Jul 2021 00:44:52 +0000 (17:44 -0700)]
remove unnecessary casts of disc->user

This pointer implicitly coerces.

3 years agoreflow some text in lib/gvpr
Matthew Fernandez [Mon, 19 Jul 2021 00:44:32 +0000 (17:44 -0700)]
reflow some text in lib/gvpr

3 years agoxyOf: use size_t for string length
Matthew Fernandez [Mon, 19 Jul 2021 00:43:50 +0000 (17:43 -0700)]
xyOf: use size_t for string length

Squashes a -Wsign-conversion warning.

3 years agobbOf: use size_t for string length
Matthew Fernandez [Mon, 19 Jul 2021 00:43:23 +0000 (17:43 -0700)]
bbOf: use size_t for string length

Squashes a -Wsign-conversion warning.

3 years agoxyOf: use a C99 bool argument to more strongly indicate a type
Matthew Fernandez [Mon, 19 Jul 2021 00:42:52 +0000 (17:42 -0700)]
xyOf: use a C99 bool argument to more strongly indicate a type

3 years agobbOf: use a C99 bool argument to more strongly indicate a type
Matthew Fernandez [Mon, 19 Jul 2021 00:42:24 +0000 (17:42 -0700)]
bbOf: use a C99 bool argument to more strongly indicate a type

3 years agoremove some unnecessary forward declarations
Matthew Fernandez [Mon, 19 Jul 2021 00:30:37 +0000 (17:30 -0700)]
remove some unnecessary forward declarations

3 years agoremove now-unused vmresize
Matthew Fernandez [Mon, 19 Jul 2021 00:22:30 +0000 (17:22 -0700)]
remove now-unused vmresize

3 years agoremove now-unused vmnewof
Matthew Fernandez [Mon, 19 Jul 2021 00:12:48 +0000 (17:12 -0700)]
remove now-unused vmnewof

3 years agoscformat: use vmalloc instead of vmresize when processing '['
Matthew Fernandez [Mon, 19 Jul 2021 00:09:59 +0000 (17:09 -0700)]
scformat: use vmalloc instead of vmresize when processing '['

Though it is hard to see, the previous code bottomed out in a call to vmresize.
After allocating, it zeroes the allocated region. So vmresize (itself calling
realloc) signals an unnecessary constraint to the allocator that previous data
in this memory must be preserved.

To simplify this, this change converts the sequence to a vmfree of the prior
memory and then a new vmalloc, more clearly divorcing the new buffer from the
old one.

3 years agosimplify exalloc
Matthew Fernandez [Sun, 18 Jul 2021 23:53:30 +0000 (16:53 -0700)]
simplify exalloc

This macro eventually bottoms out on a call to vmresize with NULL. We can
simplify this to directly calling vmalloc instead.

3 years agoexstralloc: call vmalloc instead of vmresize
Matthew Fernandez [Sun, 18 Jul 2021 23:42:41 +0000 (16:42 -0700)]
exstralloc: call vmalloc instead of vmresize

When passing an input pointer of NULL, vmresize is equivalent to vmalloc. So we
can shortcut the whole thing by just calling vmalloc directly.

3 years agoremove p argument to exstralloc
Matthew Fernandez [Sun, 18 Jul 2021 23:39:30 +0000 (16:39 -0700)]
remove p argument to exstralloc

This function is only ever called with NULL for this argument.

3 years agoMerge branch 'smattr/3f6d98e5-32f1-4219-aaf4-6e595331f922' into 'main'
Matthew Fernandez [Wed, 28 Jul 2021 04:43:56 +0000 (04:43 +0000)]
Merge branch 'smattr/3f6d98e5-32f1-4219-aaf4-6e595331f922' into 'main'

remove sfsprintf

See merge request graphviz/graphviz!2066

3 years agoremove now-unused sfio functionality for printing to strings
Matthew Fernandez [Thu, 22 Jul 2021 03:28:21 +0000 (20:28 -0700)]
remove now-unused sfio functionality for printing to strings

Related to #1998.

3 years agotrace: replace sfsprintf calls with snprintf
Matthew Fernandez [Thu, 22 Jul 2021 03:21:33 +0000 (20:21 -0700)]
trace: replace sfsprintf calls with snprintf

Related to #1998.

3 years agogetdyn: replace sfsprintf call with snprintf
Matthew Fernandez [Thu, 22 Jul 2021 03:15:35 +0000 (20:15 -0700)]
getdyn: replace sfsprintf call with snprintf

Related to #1998.

3 years agoevaldyn: replace sfsprintf call with snprintf
Matthew Fernandez [Thu, 22 Jul 2021 03:14:43 +0000 (20:14 -0700)]
evaldyn: replace sfsprintf call with snprintf

Related to #1998.

3 years agolexname: replace sfsprintf calls with snprintf
Matthew Fernandez [Thu, 22 Jul 2021 03:11:57 +0000 (20:11 -0700)]
lexname: replace sfsprintf calls with snprintf

Related to #1998.

3 years agolexname: fix latent buffer overflow
Matthew Fernandez [Sat, 24 Jul 2021 22:37:34 +0000 (15:37 -0700)]
lexname: fix latent buffer overflow

Buffers of length MAXNAME are printed into, including in a case where the
printed string is "(EXTERNAL:%d)". This needs a maximum of 23 bytes, not 16
bytes as was previously used. This overflow looks impossible to actually trigger
because I believe this code path is only used in the case of a bug in the lexer
itself. Hence no changelog entry for this.

This issue was exposed when moving sfsprintf calls to snsprintf, as the compiler
understands the semantics of the latter and knows how to warn about detectable
overflows. Related to #1998.

3 years agoexccopen: replace sfsprintf call with snprintf
Matthew Fernandez [Thu, 22 Jul 2021 03:07:36 +0000 (20:07 -0700)]
exccopen: replace sfsprintf call with snprintf

Related to #1998.

3 years agoexopname: replace sfsprintf call with snprintf
Matthew Fernandez [Thu, 22 Jul 2021 03:06:45 +0000 (20:06 -0700)]
exopname: replace sfsprintf call with snprintf

Related to #1998.

3 years agopathfind: replace sfsprintf calls with snprintf
Matthew Fernandez [Thu, 22 Jul 2021 02:59:25 +0000 (19:59 -0700)]
pathfind: replace sfsprintf calls with snprintf

Related to #1998.

3 years agoMerge branch 'smattr/fbbdaf80-7180-4b89-8e4d-2f12839b234f' into 'main'
Matthew Fernandez [Wed, 28 Jul 2021 03:43:07 +0000 (03:43 +0000)]
Merge branch 'smattr/fbbdaf80-7180-4b89-8e4d-2f12839b234f' into 'main'

[nfc] remove mode argument to openFile

See merge request graphviz/graphviz!2065

3 years agospine: [nfc] remove mode argument to openFile
Matthew Fernandez [Thu, 22 Jul 2021 02:33:18 +0000 (19:33 -0700)]
spine: [nfc] remove mode argument to openFile

This function is only ever called with mode "w". This is the equivalent of
21a6f2e2f7e8a377977c7bdad1356591a25d516f for spine.