]> granicus.if.org Git - graphviz/log
graphviz
3 years agoMerge branch 'add-svg-analyzer' into 'main'
Magnus Jacobsson [Thu, 12 Aug 2021 08:24:44 +0000 (08:24 +0000)]
Merge branch 'add-svg-analyzer' into 'main'

Add an SVG analyzer and use it in the C++ tests

See merge request graphviz/graphviz!2087

3 years agoadd a few first tests of the rendered SVG
Magnus Jacobsson [Thu, 8 Apr 2021 20:51:26 +0000 (22:51 +0200)]
add a few first tests of the rendered SVG

3 years agoadd a very basic SVG analyzer based on SVG++
Magnus Jacobsson [Thu, 8 Apr 2021 20:51:26 +0000 (22:51 +0200)]
add a very basic SVG analyzer based on SVG++

3 years agoadd the RapidXml library as a test dependency
Magnus Jacobsson [Mon, 9 Aug 2021 10:24:56 +0000 (12:24 +0200)]
add the RapidXml library as a test dependency

3 years agoadd the SVG++ library as a test dependency
Magnus Jacobsson [Mon, 5 Jul 2021 11:27:48 +0000 (13:27 +0200)]
add the SVG++ library as a test dependency

3 years agoadd the Boost library as a test dependency
Magnus Jacobsson [Mon, 9 Aug 2021 10:25:08 +0000 (12:25 +0200)]
add the Boost library as a test dependency

3 years agoMerge branch 'smattr/0d0a4b9b-fa49-4682-ba70-cfff5fb32a13' into 'main'
Matthew Fernandez [Tue, 10 Aug 2021 15:44:15 +0000 (15:44 +0000)]
Merge branch 'smattr/0d0a4b9b-fa49-4682-ba70-cfff5fb32a13' into 'main'

move pathexists.c

See merge request graphviz/graphviz!2085

3 years agoremove now-unused pathexists.c
Matthew Fernandez [Wed, 4 Aug 2021 04:23:13 +0000 (21:23 -0700)]
remove now-unused pathexists.c

The caching done by this function is no longer necessary. All usages of it have
been refactored to use standard library functionality which does caching at the
operating system level.

3 years agopathpath: replace PATH_REGULAR pathexists call with a stat.
Matthew Fernandez [Wed, 4 Aug 2021 04:15:51 +0000 (21:15 -0700)]
pathpath: replace PATH_REGULAR pathexists call with a stat.

This effectively inlines and simplifies the call to pathexists that previously
existed. The caching pathexists does is no longer relevant. An improved version
of this is provided by a modern operating system’s buffer cache.

3 years agopathpath: replace PATH_EXECUTE pathexists call with X_OK access call
Matthew Fernandez [Wed, 4 Aug 2021 04:09:34 +0000 (21:09 -0700)]
pathpath: replace PATH_EXECUTE pathexists call with X_OK access call

This is equivalent and relies solely on standard library functionality. This
effectively inlines and simplifies the call to pathexists that previously
existed. The caching pathexists does is no longer relevant. An improved version
of this is provided by a modern operating system’s buffer cache.

3 years agopathpath: remove 'a' parameter
Matthew Fernandez [Wed, 4 Aug 2021 04:00:42 +0000 (21:00 -0700)]
pathpath: remove 'a' parameter

This function is only ever called with a=="". There is probably more
simplification possible within pathpath, but the logic is convoluted. Better to
unwind this mess in a separate commit.

3 years agopathpath: remove mode parameter
Matthew Fernandez [Wed, 4 Aug 2021 03:54:14 +0000 (20:54 -0700)]
pathpath: remove mode parameter

This function is only ever called with PATH_REGULAR.

3 years agoMerge branch 'fix-ctest' into 'main'
Magnus Jacobsson [Tue, 10 Aug 2021 04:50:28 +0000 (04:50 +0000)]
Merge branch 'fix-ctest' into 'main'

fix a broken C++ test case and the reason that the failure was undetected in CI

See merge request graphviz/graphviz!2091

3 years agofix multiple layout test case using rvalue refs
Magnus Jacobsson [Mon, 9 Aug 2021 17:41:35 +0000 (19:41 +0200)]
fix multiple layout test case using rvalue refs

The first layout of a graph must be destroyed before a second layout
is created.

This failure went undetected in CI since no test programs ran, which
in turn was caused by not archiving the test programs or the
CTestTestfile.cmake files in the preceding build job.

The error message was:

-------------------------------------------------------------------------------
Multiple layouts of the same graph can use different contexts passed as rvalue
refs
-------------------------------------------------------------------------------
../tests/test_GVLayout_construction.cpp:139
...............................................................................

../tests/test_GVLayout_construction.cpp:139: FAILED:
due to unexpected exception with message:
  Previous layout not yet destroyed

3 years agofix CTestTestfile.cmake files not archived
Magnus Jacobsson [Mon, 9 Aug 2021 17:25:09 +0000 (19:25 +0200)]
fix CTestTestfile.cmake files not archived

No CTestTestfile.cmake files were archived in the build job that
created them, which had the effect that the suceeding test job
silently did not find any ctest tests.

3 years agofix C++ test programs not archived
Magnus Jacobsson [Mon, 9 Aug 2021 17:25:09 +0000 (19:25 +0200)]
fix C++ test programs not archived

No C++ test programs were archived in the build job that built them,
which had the effect that the suceeding test job silently did not run
any.

3 years agoMerge branch 'smattr/248235f2-06a2-400f-adad-66d935359f86' into 'main'
Matthew Fernandez [Sun, 8 Aug 2021 18:30:50 +0000 (18:30 +0000)]
Merge branch 'smattr/248235f2-06a2-400f-adad-66d935359f86' into 'main'

more compiler warning squashing

See merge request graphviz/graphviz!2084

3 years agopathgetlink: use a ssize_t locally, squashing -Wsign-conversion warnings
Matthew Fernandez [Wed, 4 Aug 2021 03:31:38 +0000 (20:31 -0700)]
pathgetlink: use a ssize_t locally, squashing -Wsign-conversion warnings

The type of the local used now matches the return type of readlink. This avoids
several compiler warnings. pathgetlink.c now builds warning-free on Linux.

3 years agopathgetlink: return a size_t and SIZE_MAX for an error value
Matthew Fernandez [Wed, 4 Aug 2021 03:23:45 +0000 (20:23 -0700)]
pathgetlink: return a size_t and SIZE_MAX for an error value

This will permit some upcoming changes to remove some compiler warnings.

3 years agopathcanon: avoid reusing `dots` variable for unrelated values
Matthew Fernandez [Wed, 4 Aug 2021 03:10:07 +0000 (20:10 -0700)]
pathcanon: avoid reusing `dots` variable for unrelated values

This branch reuses the `dots` variable, previously used for counting the number
of periods in the path, for storing the result of symlink resolution. This is
unnecessary (`dots` is immediately overwritten with the value 4 after this), and
is getting in the way of cleaning up some compiler warnings in this area.

3 years agopathgetlink: accept a size_t size to avoid -Wsign-conversion warnings
Matthew Fernandez [Wed, 4 Aug 2021 02:56:53 +0000 (19:56 -0700)]
pathgetlink: accept a size_t size to avoid -Wsign-conversion warnings

3 years agoremove unnecessary #include
Matthew Fernandez [Wed, 4 Aug 2021 02:56:18 +0000 (19:56 -0700)]
remove unnecessary #include

It is unnecessary to include stddef.h when stdlib.h is included.

3 years agosquash -Wmissing-prototypes warnings for pathgetlink
Matthew Fernandez [Wed, 4 Aug 2021 02:53:21 +0000 (19:53 -0700)]
squash -Wmissing-prototypes warnings for pathgetlink

3 years agoremove unnecessary ifdef sun guard
Matthew Fernandez [Wed, 4 Aug 2021 02:49:04 +0000 (19:49 -0700)]
remove unnecessary ifdef sun guard

Graphviz is compiled with C99, where string.h is always available and safe to
include.

3 years agoremove UNIV_MAX-guarded code
Matthew Fernandez [Wed, 4 Aug 2021 02:46:59 +0000 (19:46 -0700)]
remove UNIV_MAX-guarded code

Nothing in the build systems define this.

3 years agosquash -Wundef warnings for _DEBUG_MATCH
Matthew Fernandez [Wed, 4 Aug 2021 02:43:29 +0000 (19:43 -0700)]
squash -Wundef warnings for _DEBUG_MATCH

3 years agoMerge branch 'add-GVLayout-construction-overloads-using-rvalue-refs' into 'main'
Magnus Jacobsson [Sun, 8 Aug 2021 04:56:31 +0000 (04:56 +0000)]
Merge branch 'add-GVLayout-construction-overloads-using-rvalue-refs' into 'main'

Add GVLayout construction overloads to the C++ API

See merge request graphviz/graphviz!2086

3 years agoadd test of multiple GVLayout constructions of the same graph using different context...
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 passed as rvalue refs

3 years agoadd GVLayout construction overload, passing the context as an rvalue ref
Magnus Jacobsson [Wed, 7 Jul 2021 13:55:08 +0000 (15:55 +0200)]
add GVLayout construction overload, passing the context as an rvalue ref

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

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.