]> granicus.if.org Git - graphviz/log
graphviz
2 years agoMerge branch 'smattr/B59EB35A-0770-4D5F-9E65-123D103FD69B' into 'main'
Matthew Fernandez [Thu, 28 Apr 2022 04:39:43 +0000 (04:39 +0000)]
Merge branch 'smattr/B59EB35A-0770-4D5F-9E65-123D103FD69B' into 'main'

cgraph: remove 'itos'

Closes #2229

See merge request graphviz/graphviz!2640

2 years agocgraph: remove 'itos'
Matthew Fernandez [Tue, 26 Apr 2022 05:07:52 +0000 (22:07 -0700)]
cgraph: remove 'itos'

This function was unsafe to use in the way described. It relied on semantics
that are not guaranteed under C99. That is, the lifetime extension of a struct
member of an rvalue. This changes under C11 to something that would make this
not problematic. But it is unlikely Graphviz will be able to migrate to C11 in
the foreseeable future as MSVC is lacking C11 support.

Gitlab: closes #2229

2 years agosparse: fix: avoid a use of 'itos'
Matthew Fernandez [Tue, 26 Apr 2022 05:05:18 +0000 (22:05 -0700)]
sparse: fix: avoid a use of 'itos'

Usage of `itos` in this way relies on lifetime extension of a struct member in
an rvalue. While these semantics exist in C11 and C++, they do not in C99. As a
result, this causes undefined behavior.

This commit effectively reverts 10638c445d1f12bb3fcd0c45946ec8a2e3af60af.

Gitlab: #2229

2 years agocommon: fix: avoid a use of 'itos'
Matthew Fernandez [Mon, 25 Apr 2022 15:12:01 +0000 (08:12 -0700)]
common: fix: avoid a use of 'itos'

Usage of `itos` in this way relies on lifetime extension of a struct member in
an rvalue. While these semantics exist in C11 and C++, they do not in C99. As a
result, this causes undefined behavior.

This commit effectively reverts 400a29f0dbc39682f98eff999bcd32448e328450.

Gitlab: #2229

2 years agoMerge branch 'smattr/0E2CB714-5EBC-4EA4-B2EA-402E31133427' into 'main'
Matthew Fernandez [Thu, 28 Apr 2022 03:14:28 +0000 (03:14 +0000)]
Merge branch 'smattr/0E2CB714-5EBC-4EA4-B2EA-402E31133427' into 'main'

gvedit: minor cleanup

See merge request graphviz/graphviz!2634

2 years agogvedit: avoid the need to cast arguments to 'errorPipe'
Matthew Fernandez [Sat, 9 Apr 2022 17:39:13 +0000 (10:39 -0700)]
gvedit: avoid the need to cast arguments to 'errorPipe'

2 years agogvedit: remove unnecessary 'QString' construction
Matthew Fernandez [Sat, 9 Apr 2022 17:37:55 +0000 (10:37 -0700)]
gvedit: remove unnecessary 'QString' construction

`QString::operator==` has an overload that takes `const char*`.

2 years agogvedit: remove unnecessary parens
Matthew Fernandez [Sat, 9 Apr 2022 17:37:20 +0000 (10:37 -0700)]
gvedit: remove unnecessary parens

2 years agogvedit: standardize on more modern 'nullptr'
Matthew Fernandez [Sat, 9 Apr 2022 17:22:45 +0000 (10:22 -0700)]
gvedit: standardize on more modern 'nullptr'

2 years agogvedit: remove unnecessary casts when calling Graphviz’ own functions
Matthew Fernandez [Sat, 9 Apr 2022 17:19:31 +0000 (10:19 -0700)]
gvedit: remove unnecessary casts when calling Graphviz’ own functions

2 years agogvedit: use a 'unique_ptr' to avoid manually managing 'previewFrm'
Matthew Fernandez [Sat, 9 Apr 2022 17:12:56 +0000 (10:12 -0700)]
gvedit: use a 'unique_ptr' to avoid manually managing 'previewFrm'

2 years agoMerge branch 'smattr/AC0D09C8-AC89-46D5-AB9A-796C8CF8D9F9' into 'main'
Matthew Fernandez [Thu, 28 Apr 2022 01:35:51 +0000 (01:35 +0000)]
Merge branch 'smattr/AC0D09C8-AC89-46D5-AB9A-796C8CF8D9F9' into 'main'

cgraph: some minor cleanup

See merge request graphviz/graphviz!2633

2 years agocgraph: remove some unused struct names
Matthew Fernandez [Thu, 21 Apr 2022 15:13:35 +0000 (08:13 -0700)]
cgraph: remove some unused struct names

2 years agocgraph: use a C99 bool for 'maybe_num'
Matthew Fernandez [Thu, 21 Apr 2022 15:00:01 +0000 (08:00 -0700)]
cgraph: use a C99 bool for 'maybe_num'

This makes it slightly clearer what the intent and usage of this variable is.

2 years agocgraph: inline and remove 'ISALNUM'
Matthew Fernandez [Thu, 21 Apr 2022 14:57:50 +0000 (07:57 -0700)]
cgraph: inline and remove 'ISALNUM'

It does not seem worth maintaining this abstraction for a single usage.
Especially when the surrounding code directly calls numerous other ctype.h
functions.

2 years agocgraph: realign 'agmapnametoid' parameter name with its definition
Matthew Fernandez [Thu, 21 Apr 2022 14:51:36 +0000 (07:51 -0700)]
cgraph: realign 'agmapnametoid' parameter name with its definition

The definition of this function calls the last parameter `createflag`, not
`allocflag`.

2 years agoMerge branch 'cdt-doc' into 'main'
Matthew Fernandez [Wed, 27 Apr 2022 00:02:16 +0000 (00:02 +0000)]
Merge branch 'cdt-doc' into 'main'

doxygen comment in cdt.h

See merge request graphviz/graphviz!2641

2 years agodoxygen comment for Dtoset etc
Costa Shulyupin [Tue, 26 Apr 2022 16:42:26 +0000 (19:42 +0300)]
doxygen comment for Dtoset etc

Text of comments is copied from DT_SET etc

2 years agodoxygen comment for cdt.h
Costa Shulyupin [Tue, 26 Apr 2022 16:34:59 +0000 (19:34 +0300)]
doxygen comment for cdt.h

2 years agodoxygen comment for lib/cdt
Costa Shulyupin [Tue, 26 Apr 2022 16:33:37 +0000 (19:33 +0300)]
doxygen comment for lib/cdt

2 years agoMerge branch 'pq' into 'main'
Matthew Fernandez [Tue, 26 Apr 2022 00:04:11 +0000 (00:04 +0000)]
Merge branch 'pq' into 'main'

upgragde lib/ortho/fPQ.h comment to doxygen style

See merge request graphviz/graphviz!2632

2 years agoupgragde lib/ortho/fPQ.h comment to doxygen style
Costa Shulyupin [Mon, 25 Apr 2022 04:32:10 +0000 (07:32 +0300)]
upgragde lib/ortho/fPQ.h comment to doxygen style

2 years agoMerge branch 'smattr/9F31BC78-A50E-4AD8-8640-72058C3795C4' into 'main'
Matthew Fernandez [Mon, 25 Apr 2022 05:21:10 +0000 (05:21 +0000)]
Merge branch 'smattr/9F31BC78-A50E-4AD8-8640-72058C3795C4' into 'main'

remove unused glyphwidth.ps

See merge request graphviz/graphviz!2619

2 years agoremove unused glyphwidth.ps
Matthew Fernandez [Wed, 20 Apr 2022 01:26:40 +0000 (18:26 -0700)]
remove unused glyphwidth.ps

2 years agoMerge branch 'smattr/83F37629-35B5-4AEA-AC37-EE8EBF5E6D7A' into 'main'
Matthew Fernandez [Mon, 25 Apr 2022 03:54:40 +0000 (03:54 +0000)]
Merge branch 'smattr/83F37629-35B5-4AEA-AC37-EE8EBF5E6D7A' into 'main'

move gvpack into C++

See merge request graphviz/graphviz!2618

2 years agogvpack: use C++ style of indicating unused parameters
Matthew Fernandez [Mon, 18 Apr 2022 14:46:04 +0000 (07:46 -0700)]
gvpack: use C++ style of indicating unused parameters

2 years agogvpack: use C++ casts instead of C casts
Matthew Fernandez [Mon, 18 Apr 2022 14:45:52 +0000 (07:45 -0700)]
gvpack: use C++ casts instead of C casts

2 years agogvpack: use C++ 'nullptr' in preference to C 'NULL'
Matthew Fernandez [Mon, 18 Apr 2022 14:41:13 +0000 (07:41 -0700)]
gvpack: use C++ 'nullptr' in preference to C 'NULL'

2 years agogvpack: use 'std::string' to simplify dynamic string construction
Matthew Fernandez [Sun, 17 Apr 2022 21:43:18 +0000 (14:43 -0700)]
gvpack: use 'std::string' to simplify dynamic string construction

2 years agogvpack: manage graph collection as a 'std::vector'
Matthew Fernandez [Sat, 16 Apr 2022 04:18:58 +0000 (21:18 -0700)]
gvpack: manage graph collection as a 'std::vector'

This removes a number of manual allocations as well as awkward passing of the
base pointer and size of this array around. We also drop the `nGraphs` hint, as
it is simpler and more optimal to let `std::vector`’s standard allocation
algorithm handle this.

2 years agogvpack: track graph counts as a 'size_t'
Matthew Fernandez [Sat, 16 Apr 2022 04:16:29 +0000 (21:16 -0700)]
gvpack: track graph counts as a 'size_t'

This will ease an upcoming change to switching the graph collection to be a
`std::vector` instead of a raw C array.

2 years agogvpack: convert C stdio to C++ iostreams
Matthew Fernandez [Sun, 17 Apr 2022 04:27:51 +0000 (21:27 -0700)]
gvpack: convert C stdio to C++ iostreams

Gitlab: #2154

2 years agogvpack: remove unnecessary guard in 'readGraphs'
Matthew Fernandez [Sat, 16 Apr 2022 04:09:45 +0000 (21:09 -0700)]
gvpack: remove unnecessary guard in 'readGraphs'

This function is only ever called with a non-null 'cp'.

2 years agogvpack: rewrite 'xName' to return a 'std::string'
Matthew Fernandez [Sat, 16 Apr 2022 04:04:52 +0000 (21:04 -0700)]
gvpack: rewrite 'xName' to return a 'std::string'

This removes some manual memory management leaving an easier to read function,
as well as removing a static unfreed buffer that impedes Valgrind and ASan.

2 years agogvpack: manage 'G_args' as a 'std::vector'
Matthew Fernandez [Fri, 15 Apr 2022 04:51:40 +0000 (21:51 -0700)]
gvpack: manage 'G_args' as a 'std::vector'

Simplifies the surrounding code and make it less error prone.

2 years agogvpack: remove '__cplusplus' guards
Matthew Fernandez [Fri, 15 Apr 2022 04:47:23 +0000 (21:47 -0700)]
gvpack: remove '__cplusplus' guards

Now that this code has made the C→C++ transition, we can drop the conditionals
around this linkage specification.

2 years agogvpack: drop stdbool.h #include
Matthew Fernandez [Fri, 15 Apr 2022 04:46:07 +0000 (21:46 -0700)]
gvpack: drop stdbool.h #include

`bool` is a built-in type in C++.

2 years agomove 'gvpack' into C++
Matthew Fernandez [Wed, 13 Apr 2022 15:15:47 +0000 (08:15 -0700)]
move 'gvpack' into C++

When ipsepcola is enabled, `gvpack` transitively links against lib/vpsc which is
partly written in C++. A consequence of this is that building `gvpack` requires
a C++ toolchain and linking against the C++ standard library. With this in mind,
there is no advantage for `gvpack` itself to be written in C instead of C++.
Moving to C++ will allow removing some manual memory management and data
structures.

This commit itself is just a straight rename. Upcoming changes will make the
code more idiomatic C++.

Gitlab: #2154

2 years agogvpack: mark 'gvplugin_neato_layout_LTX_library' as having C linkage
Matthew Fernandez [Fri, 15 Apr 2022 00:28:00 +0000 (17:28 -0700)]
gvpack: mark 'gvplugin_neato_layout_LTX_library' as having C linkage

gvpack.c is currently compiled as C, so this symbol already has C linkage by
default. However an upcoming commit converts it to C++, which then results in
link failures due to this defaulting to C++ linkage. To pre-empt that, we note
its linkage explicitly for now. These guards will be removed in a future commit.

Gitlab: #2154

2 years agogvpack: cast results of 'dtmatch'
Matthew Fernandez [Thu, 14 Apr 2022 14:56:08 +0000 (07:56 -0700)]
gvpack: cast results of 'dtmatch'

This pre-emptively squashes some upcoming warnings when converting this file to
C++ which otherwise fail the CMake build:

  cmd/tools/../../lib/cdt/cdt.h:259:66: error: invalid conversion from 'void*'
    to 'pair_t*' [-fpermissive]

Gitlab: #2154

2 years agogvpack: rename variables called 'new'
Matthew Fernandez [Thu, 14 Apr 2022 00:31:59 +0000 (17:31 -0700)]
gvpack: rename variables called 'new'

Having variables called `new` prevents this code being moved to C++, where `new`
is a keyword.

Gitlab: #2154

2 years agogvpack: cast string literals when calling 'agfindgraphattr'
Matthew Fernandez [Thu, 14 Apr 2022 00:27:53 +0000 (17:27 -0700)]
gvpack: cast string literals when calling 'agfindgraphattr'

This pre-emptively squashes several upcoming warnings when converting this file
to C++ which otherwise fail the CMake build:

  cmd/tools/gvpack.cpp:298:40: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

2 years agogvpack: cast string literals when calling 'agfindnodeattr'
Matthew Fernandez [Thu, 14 Apr 2022 00:23:47 +0000 (17:23 -0700)]
gvpack: cast string literals when calling 'agfindnodeattr'

This pre-emptively squashes several upcoming warnings when converting this file
to C++ which otherwise fail the CMake build:

  cmd/tools/gvpack.cpp:270:42: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

2 years agogvpack: cast assignment of string literal to 'rhs'
Matthew Fernandez [Thu, 14 Apr 2022 00:21:39 +0000 (17:21 -0700)]
gvpack: cast assignment of string literal to 'rhs'

This pre-emptively squashes an upcoming warning when converting this file to C++
which otherwise fails the CMake build:

  cmd/tools/gvpack.cpp:122:17: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

2 years agogvpack: cast string literal when calling 'agnodeattr'
Matthew Fernandez [Thu, 14 Apr 2022 14:52:47 +0000 (07:52 -0700)]
gvpack: cast string literal when calling 'agnodeattr'

This pre-emptively squashes an upcoming warning when converting this file to C++
which otherwise fails the CMake build:

  cmd/tools/gvpack.cpp:178:43: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

2 years agogvpack: take const values in various functions that call 'agattr'
Matthew Fernandez [Thu, 14 Apr 2022 00:19:15 +0000 (17:19 -0700)]
gvpack: take const values in various functions that call 'agattr'

This pre-emptively squashes several upcoming warnings when converting this file
to C++ which otherwise fail the CMake build:

  cmd/tools/gvpack.cpp:181:22: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

2 years agogvpack: use a const char array instead of mutable variable for usage string
Matthew Fernandez [Thu, 14 Apr 2022 00:15:20 +0000 (17:15 -0700)]
gvpack: use a const char array instead of mutable variable for usage string

This pre-emptively squashes an upcoming warning when converting this file to C++
which otherwise fails the CMake build:

  cmd/tools/gvpack.cpp:82:5: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

2 years agogvpack: cast assignment of string literal to mutable variable
Matthew Fernandez [Thu, 14 Apr 2022 00:11:34 +0000 (17:11 -0700)]
gvpack: cast assignment of string literal to mutable variable

This pre-emptively squashes an upcoming warning when converting this file to C++
which otherwise fails the CMake build:

  cmd/tools/gvpack.cpp:77:22: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

2 years agoMerge branch 'smattr/76A06EFC-E807-41D0-B837-936234C12C31' into 'main'
Matthew Fernandez [Mon, 25 Apr 2022 01:23:00 +0000 (01:23 +0000)]
Merge branch 'smattr/76A06EFC-E807-41D0-B837-936234C12C31' into 'main'

gxl2gv: replace inline stack implementations with generic API

See merge request graphviz/graphviz!2617

2 years agogxl2gv: replace custom 'slist' string stack with generic stack
Matthew Fernandez [Sat, 5 Feb 2022 06:05:42 +0000 (17:05 +1100)]
gxl2gv: replace custom 'slist' string stack with generic stack

Similar to previous changes to `gc` in 4e2875fd7376338259dcb3ccc8f029d58bdf22dd,
this replaces some duplicated functionality with the generic Graphviz stack
implementation. Apart from reducing code duplication and complexity, this
removes an unnecessary rounding of allocations. The prior code rounded up
`slist` allocations to `sizeof(void*)`, but `malloc` effectively does this
internally anyway. This also adds checks for allocation failures that were
previously missing.

Gitlab: #1793

2 years agogxl2gv: replace inline stack implementation with generic API
Matthew Fernandez [Sat, 5 Feb 2022 01:28:06 +0000 (12:28 +1100)]
gxl2gv: replace inline stack implementation with generic API

Similar to previous changes to `gc` in 4e2875fd7376338259dcb3ccc8f029d58bdf22dd,
this replaces some duplicated functionality with the generic Graphviz stack
implementation. This removes the previously hard coded nested subgraph limit of
32. The number of supported subgraphs in now solely limited by available memory.

Gitlab: #1793

2 years agoMerge branch 'smattr/06F42B8C-5B6E-438F-8110-3B743FAF61E9' into 'main'
Matthew Fernandez [Sun, 24 Apr 2022 17:32:40 +0000 (17:32 +0000)]
Merge branch 'smattr/06F42B8C-5B6E-438F-8110-3B743FAF61E9' into 'main'

de-dupe unistd compat headers; remove unistd detection

Closes #2204

See merge request graphviz/graphviz!2614

2 years agoremove no longer used compat_unistd.h
Matthew Fernandez [Mon, 18 Apr 2022 03:17:49 +0000 (20:17 -0700)]
remove no longer used compat_unistd.h

Gitlab: closes #2204

2 years agoremove no longer used unistd.h detection
Matthew Fernandez [Mon, 18 Apr 2022 02:00:39 +0000 (19:00 -0700)]
remove no longer used unistd.h detection

Gitlab: #2204

2 years agogvpr: make #includes of unistd.h unconditional
Matthew Fernandez [Sat, 16 Apr 2022 17:07:30 +0000 (10:07 -0700)]
gvpr: make #includes of unistd.h unconditional

Gitlab: #2204

2 years agoast: make #includes of unistd.h unconditional
Matthew Fernandez [Sat, 16 Apr 2022 20:34:55 +0000 (13:34 -0700)]
ast: make #includes of unistd.h unconditional

Only the one in pathfind.c was actually having the intended effect, because the
other two files were not #including config.h.

Gitlab: #2204

2 years agotreat 'X_OK' as an alias of 'R_OK' in the Windows unistd.h shim
Matthew Fernandez [Sat, 16 Apr 2022 22:05:30 +0000 (15:05 -0700)]
treat 'X_OK' as an alias of 'R_OK' in the Windows unistd.h shim

This is not technically correct (Windows does not have `X_OK` at all), but this
is an accurate approximation for the ways in which Graphviz uses `X_OK`. This is
another step towards replacing lib/ast/compat_unistd.h.

Gitlab: #2204

2 years agoimplement a 'S_ISDIR' shim for Windows
Matthew Fernandez [Sat, 16 Apr 2022 22:01:35 +0000 (15:01 -0700)]
implement a 'S_ISDIR' shim for Windows

This will enable further migration away from lib/ast/compat_unistd.h. Note that
the `S_ISDIR` wrapper there appears incorrect, in using a platform-specific
constant for the mask. Its definition of `X_OK` also seems incorrect, as this
value has no documented meaning when calling `_access` on Windows.

Gitlab: #2204

2 years agocommon: make #include of unistd.h unconditional
Matthew Fernandez [Sat, 16 Apr 2022 00:05:38 +0000 (17:05 -0700)]
common: make #include of unistd.h unconditional

Gitlab: #2204

2 years agocgraph: control Flex unistd.h suppression by whether we are on Windows
Matthew Fernandez [Thu, 14 Apr 2022 14:33:08 +0000 (07:33 -0700)]
cgraph: control Flex unistd.h suppression by whether we are on Windows

Windows is the only non-unistd.h-having platform we support.

Gitlab: #2204

2 years agosfio: make #include of unistd.h unconditional
Matthew Fernandez [Thu, 14 Apr 2022 04:31:43 +0000 (21:31 -0700)]
sfio: make #include of unistd.h unconditional

Gitlab: #2204

2 years agogvc: make #include of unistd.h unconditional
Matthew Fernandez [Thu, 14 Apr 2022 03:01:33 +0000 (20:01 -0700)]
gvc: make #include of unistd.h unconditional

Gitlab: #2204

2 years agolefty: make a unix #include of unistd.h unconditional
Matthew Fernandez [Thu, 14 Apr 2022 02:57:15 +0000 (19:57 -0700)]
lefty: make a unix #include of unistd.h unconditional

On unices, it is fine to assume the existence of unistd.h.

Gitlab: #2204

2 years agogml2gv: control Flex unistd.h suppression by whether we are on Windows
Matthew Fernandez [Thu, 14 Apr 2022 00:37:36 +0000 (17:37 -0700)]
gml2gv: control Flex unistd.h suppression by whether we are on Windows

This aligns more closely with the idiom used in lib/cgraph, and Windows is the
only non-unistd.h-having platform we support.

Gitlab: #2204

2 years agomove Windows unistd.h shim to its own directory
Matthew Fernandez [Wed, 13 Apr 2022 06:41:44 +0000 (23:41 -0700)]
move Windows unistd.h shim to its own directory

Graphviz contains two shims for platforms lacking unistd.h:

  1. windows/include/unistd.h
  2. lib/ast/compat_unistd.h

(1) is more comprehensive than (2), and we would like to replace (2) entirely
with (1). However, it is not currently possible to put (1) in the compiler’s
include path during the CMake build. Because it lives in the same directory as
the config.h used in the MS Build build, putting it in the compiler’s include
path also makes this config.h eligible for inclusion. This conflicts with the
CMake build system’s own generated config.h.

Moving this unistd.h to its own directory allows us to more selectively put it
in the include path when relevant. Though surprisingly this file seems unused
right now; even the adjacent config.h does not define `HAVE_UNISTD_H`,
indicating it should not be included.

With unistd.h available natively on every supported platform except Windows,
this change should allow removing unistd.h detection in future and
unconditionally including it when desired.

Gitlab: #2204

2 years agocommon: remove unused unistd.h #include
Matthew Fernandez [Wed, 13 Apr 2022 06:36:12 +0000 (23:36 -0700)]
common: remove unused unistd.h #include

Gitlab: #2204

2 years agodoc sccmap: remove unused unistd.h #include
Matthew Fernandez [Wed, 13 Apr 2022 06:33:05 +0000 (23:33 -0700)]
doc sccmap: remove unused unistd.h #include

Gitlab: #2204

2 years agoremove unistd.h check in plugin.demo
Matthew Fernandez [Wed, 13 Apr 2022 06:31:22 +0000 (23:31 -0700)]
remove unistd.h check in plugin.demo

Nothing in plugin.demo uses unistd.h anymore.

Gitlab: #2204

2 years agoMerge branch 'smattr/30329BC5-7D90-4D80-84EC-0821124864B6' into 'main'
Matthew Fernandez [Sun, 24 Apr 2022 06:29:31 +0000 (06:29 +0000)]
Merge branch 'smattr/30329BC5-7D90-4D80-84EC-0821124864B6' into 'main'

upgrade Pylint

See merge request graphviz/graphviz!2624

2 years agoupgrade Pylint
Matthew Fernandez [Thu, 14 Apr 2022 14:47:40 +0000 (07:47 -0700)]
upgrade Pylint

2 years agoMerge branch 'doc' into 'main'
Matthew Fernandez [Sun, 24 Apr 2022 05:06:02 +0000 (05:06 +0000)]
Merge branch 'doc' into 'main'

add doxygen comment to cell::edges

See merge request graphviz/graphviz!2623

2 years agoadd doxygen comment to cell::edges
Costa Shulyupin [Thu, 21 Apr 2022 17:30:37 +0000 (20:30 +0300)]
add doxygen comment to cell::edges

The first two lines (brief) will shown in description
of the `struct cell`

The list will be shown in detailed description of cell::edges

2 years agoMerge branch 'smattr/CE3E9D6F-BFB1-44FB-BCCE-FAD52D1FE9F1' into 'main'
Matthew Fernandez [Sun, 24 Apr 2022 04:02:38 +0000 (04:02 +0000)]
Merge branch 'smattr/CE3E9D6F-BFB1-44FB-BCCE-FAD52D1FE9F1' into 'main'

lib/neatogen: replace inline stack with generic implementation

See merge request graphviz/graphviz!2622

2 years agolib/neatogen: replace inline stack with generic implementation
Matthew Fernandez [Sun, 6 Feb 2022 07:07:28 +0000 (18:07 +1100)]
lib/neatogen: replace inline stack with generic implementation

Similar to previous changes to `gc` in 4e2875fd7376338259dcb3ccc8f029d58bdf22dd,
this replaces some duplicated functionality with the generic Graphviz stack
implementation. This also introduces some missing allocation failure checks.

Gitlab: #1793

2 years agoMerge branch 'smattr/9060F827-8691-4085-BB0D-430A545CC103' into 'main'
Matthew Fernandez [Sun, 24 Apr 2022 02:34:10 +0000 (02:34 +0000)]
Merge branch 'smattr/9060F827-8691-4085-BB0D-430A545CC103' into 'main'

sfio: remove some dead code

See merge request graphviz/graphviz!2621

2 years agosfio: remove function pointer dereferences and parens
Matthew Fernandez [Thu, 21 Apr 2022 00:00:23 +0000 (17:00 -0700)]
sfio: remove function pointer dereferences and parens

The C compiler knows how to dereference a function pointer and call through it
without needing to be explicitly told.

Gitlab: #1998

2 years agosfio: remove unnecessary casts
Matthew Fernandez [Wed, 20 Apr 2022 04:46:21 +0000 (21:46 -0700)]
sfio: remove unnecessary casts

Gitlab: #1998

2 years agosfio: remove open coded 'NULL'
Matthew Fernandez [Wed, 20 Apr 2022 04:45:31 +0000 (21:45 -0700)]
sfio: remove open coded 'NULL'

Gitlab: #1998

2 years agosfio: use 'SIG_IGN' instead of custom ignoring signal handler
Matthew Fernandez [Wed, 20 Apr 2022 04:29:15 +0000 (21:29 -0700)]
sfio: use 'SIG_IGN' instead of custom ignoring signal handler

This is a simpler, more efficient, and more concise way of achieving the same
thing that has existed since at least C89.

Gitlab: #1998

2 years agosfio: remove unnecessary C++ guards in a C file
Matthew Fernandez [Wed, 20 Apr 2022 04:15:42 +0000 (21:15 -0700)]
sfio: remove unnecessary C++ guards in a C file

This file is compiled with the C compiler, so the ifdef condition on these
guards is always false.

Gitlab: #1998

2 years agosfio: remove legacy '__SFDPP__directive' support
Matthew Fernandez [Wed, 20 Apr 2022 04:13:41 +0000 (21:13 -0700)]
sfio: remove legacy '__SFDPP__directive' support

This seems to be support for some legacy platform lost to the sands of time.
Various internet code searches turn up some clues, but I cannot precisely
determine what platform or system was expected to define these. AFAIK these are
undefined on all currently supported Graphviz platforms.

Gitlab: #1998

2 years agosfio: remove unused '_sfgetpath'
Matthew Fernandez [Wed, 20 Apr 2022 04:36:49 +0000 (21:36 -0700)]
sfio: remove unused '_sfgetpath'

Gitlab: #1998

2 years agosfio: remove unused 'sfresize'
Matthew Fernandez [Wed, 20 Apr 2022 03:51:58 +0000 (20:51 -0700)]
sfio: remove unused 'sfresize'

Gitlab: #1998

2 years agoMerge branch 'smattr/94A38AB0-13D5-4797-B464-88C8BE016582' into 'main'
Matthew Fernandez [Sun, 24 Apr 2022 01:09:21 +0000 (01:09 +0000)]
Merge branch 'smattr/94A38AB0-13D5-4797-B464-88C8BE016582' into 'main'

API BREAK: change 'Agiodisc_t' output function from puts-alike to printf-alike

See merge request graphviz/graphviz!2620

2 years agocommon: inline and remove 'agputs'
Matthew Fernandez [Wed, 20 Apr 2022 02:42:20 +0000 (19:42 -0700)]
common: inline and remove 'agputs'

2 years agocommon: fuse adjacent 'print' calls
Matthew Fernandez [Wed, 20 Apr 2022 02:41:31 +0000 (19:41 -0700)]
common: fuse adjacent 'print' calls

With a `printf` API, there is no longer a need to make all these I/O calls
separately.

2 years agocommon: inline and remove 'printdouble'
Matthew Fernandez [Wed, 20 Apr 2022 02:36:42 +0000 (19:36 -0700)]
common: inline and remove 'printdouble'

With the `Agiodisc_t` output function now taking a format string, this code can
be written more readably and concisely. This also avoids the need for
intermediate buffering.

2 years agocommon: inline and remove 'printint'
Matthew Fernandez [Wed, 20 Apr 2022 02:33:47 +0000 (19:33 -0700)]
common: inline and remove 'printint'

With the `Agiodisc_t` output function now taking a format string, this code can
be written more readably and concisely. This also avoids the need for
intermediate buffering.

2 years agocommon: inline and remove 'printstring'
Matthew Fernandez [Wed, 20 Apr 2022 02:32:36 +0000 (19:32 -0700)]
common: inline and remove 'printstring'

With the `Agiodisc_t` output function now taking a format string, this code can
be written more readably and concisely.

2 years agocommon: remove “slimey” comment
Matthew Fernandez [Thu, 21 Apr 2022 03:53:18 +0000 (20:53 -0700)]
common: remove “slimey” comment

It is unclear what this comment is referring to. It seems to only make this code
more confusing.

2 years agoAPI BREAK: change 'Agiodisc_t' output function from puts-alike to printf-alike
Matthew Fernandez [Wed, 20 Apr 2022 02:27:22 +0000 (19:27 -0700)]
API BREAK: change 'Agiodisc_t' output function from puts-alike to printf-alike

This enables writing calling code in a simpler manner that removes the need for
intermediate buffering. This will be demonstrated in upcoming commits.

2 years agoMerge branch 'smattr/23C59ACB-D5E2-4D3C-AED1-16F3145755B9' into 'main'
Matthew Fernandez [Sat, 23 Apr 2022 19:11:27 +0000 (19:11 +0000)]
Merge branch 'smattr/23C59ACB-D5E2-4D3C-AED1-16F3145755B9' into 'main'

pack: replace inline stack with generic implementation

See merge request graphviz/graphviz!2625

2 years agopack: replace inline stack with generic implementation
Matthew Fernandez [Sat, 5 Feb 2022 08:12:32 +0000 (19:12 +1100)]
pack: replace inline stack with generic implementation

Similar to previous changes to `gc` in 4e2875fd7376338259dcb3ccc8f029d58bdf22dd,
this replaces some duplicated functionality with the generic Graphviz stack
implementation.

Gitlab: #1793

2 years agoMerge branch 'smattr/3777e2b7-e748-48b3-be40-2d466eeb7d6d' into 'main'
Matthew Fernandez [Sat, 23 Apr 2022 17:50:25 +0000 (17:50 +0000)]
Merge branch 'smattr/3777e2b7-e748-48b3-be40-2d466eeb7d6d' into 'main'

dot2gxl: fix crashes when given an empty node id

Closes #2092

See merge request graphviz/graphviz!2627

2 years agodot2gxl: fix crashes when given an empty node id
Matthew Fernandez [Fri, 22 Apr 2022 04:53:41 +0000 (21:53 -0700)]
dot2gxl: fix crashes when given an empty node id

An empty node id is now treated as if id was missing altogether.

Gitlab: fixes #2092

2 years agotests: adjust #2092 test case to expect failure
Matthew Fernandez [Fri, 22 Apr 2022 04:51:59 +0000 (21:51 -0700)]
tests: adjust #2092 test case to expect failure

Even when this is fixed to not crash, it should still not exit with success
because the input it is given is invalid. Unfortunately we need to also adjust
the xfail condition to be non-strict because this passes under ASan, due to
exiting with 1 when an invalid memory reference is detected.

Gitlab: #2092

2 years agotests: fix 'gvtest' import adjustment
Matthew Fernandez [Fri, 22 Apr 2022 04:17:57 +0000 (21:17 -0700)]
tests: fix 'gvtest' import adjustment

This appended path was clearly wrong. Yet this test was running (and passing) in
CI. It seems somehow `./rtest` is already in the `$PYTHONPATH` in CI. A bit
mysterious, but this correction lets the test suite run locally correctly too.

2 years agoMerge branch 'smattr/1FB0FD97-370C-4494-96C7-660729E080FD' into 'main'
Matthew Fernandez [Sat, 23 Apr 2022 14:58:49 +0000 (14:58 +0000)]
Merge branch 'smattr/1FB0FD97-370C-4494-96C7-660729E080FD' into 'main'

dotgen: replace inline stack with generic implementation

See merge request graphviz/graphviz!2626

2 years agodotgen: replace inline stack with generic implementation
Matthew Fernandez [Fri, 22 Apr 2022 00:01:24 +0000 (17:01 -0700)]
dotgen: replace inline stack with generic implementation

Similar to previous changes to `gc` in 4e2875fd7376338259dcb3ccc8f029d58bdf22dd,
this replaces some duplicated functionality with the generic Graphviz stack
implementation.

Gitlab: #1793

2 years agoMerge branch 'smattr/92B5C0E4-9DD0-486F-BCF8-6CD2CF4D606A' into 'main'
Matthew Fernandez [Thu, 21 Apr 2022 01:19:28 +0000 (01:19 +0000)]
Merge branch 'smattr/92B5C0E4-9DD0-486F-BCF8-6CD2CF4D606A' into 'main'

core plugin: remove 'GVPUTS' optimization

See merge request graphviz/graphviz!2616