]> granicus.if.org Git - graphviz/log
graphviz
2 years agoDevIL plugin: only save output if image processing succeeded
Matthew Fernandez [Sat, 5 Mar 2022 23:18:13 +0000 (15:18 -0800)]
DevIL plugin: only save output if image processing succeeded

As suggested during the review of !2488.¹

¹ https://gitlab.com/graphviz/graphviz/-/merge_requests/2488

2 years agoDevIL plugin: fix comment typo
Matthew Fernandez [Sat, 5 Mar 2022 23:17:56 +0000 (15:17 -0800)]
DevIL plugin: fix comment typo

2 years agoMerge branch 'smattr/82FF01D9-153B-4619-AAAD-E56F7D2F8CFD' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 20:21:58 +0000 (20:21 +0000)]
Merge branch 'smattr/82FF01D9-153B-4619-AAAD-E56F7D2F8CFD' into 'main'

Windows unistd.h shim: remove stdint.h types

See merge request graphviz/graphviz!2492

2 years agoWindows unistd.h shim: remove stdint.h types
Matthew Fernandez [Sun, 6 Mar 2022 00:11:09 +0000 (16:11 -0800)]
Windows unistd.h shim: remove stdint.h types

MSVC, like every other C99 compliant platform, defines these in stdint.h.

2 years agoMerge branch 'smattr/C0FA2163-3B08-4347-A288-27C793B4FDF1' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 17:56:35 +0000 (17:56 +0000)]
Merge branch 'smattr/C0FA2163-3B08-4347-A288-27C793B4FDF1' into 'main'

CI: remove metrics collection in Pylint job

See merge request graphviz/graphviz!2494

2 years agoCI: remove metrics collection in Pylint job
Matthew Fernandez [Sat, 5 Mar 2022 21:14:59 +0000 (13:14 -0800)]
CI: remove metrics collection in Pylint job

The Pylint job was running two checks:

  1. Everything, with warning count piped to metrics.txt
  2. Everything except the check for FIXMEs, hard failing if there is any
     warning

The latter passes. That is, all Graphviz Python code is warning-free with the
exception of FIXMEs. Meanwhile FIXMEs are frequently _intentionally_ introduced
in test code, indicating a known open bug for which a test case is being added.
So metric collection in step 1 above is not relevant; we expect this number
often to go up. This commit removes the collection of this unused metric to
decrease CI complexity.

2 years agoMerge branch 'smattr/82AC6B39-F94C-4ADA-BC89-847305B0F7EB' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 06:42:22 +0000 (06:42 +0000)]
Merge branch 'smattr/82AC6B39-F94C-4ADA-BC89-847305B0F7EB' into 'main'

Xlib plugin: squash sopm warnings

See merge request graphviz/graphviz!2491

2 years agoXlib plugin: squash -Wsign-conversion warnings when setting 'normalhints'
Matthew Fernandez [Sat, 5 Mar 2022 18:38:44 +0000 (10:38 -0800)]
Xlib plugin: squash -Wsign-conversion warnings when setting 'normalhints'

2 years agoXlib plugin: squash -Wsign-conversion warnings for 'w' and 'h'
Matthew Fernandez [Sat, 5 Mar 2022 18:37:22 +0000 (10:37 -0800)]
Xlib plugin: squash -Wsign-conversion warnings for 'w' and 'h'

2 years agoXlib plugin: remove an unnecessary cast
Matthew Fernandez [Sat, 5 Mar 2022 18:35:18 +0000 (10:35 -0800)]
Xlib plugin: remove an unnecessary cast

2 years agoXlib plugin: remove some unnecessary parens
Matthew Fernandez [Sat, 5 Mar 2022 18:35:03 +0000 (10:35 -0800)]
Xlib plugin: remove some unnecessary parens

2 years agoXlib plugin: remove unused 'err' variable
Matthew Fernandez [Sat, 5 Mar 2022 18:27:55 +0000 (10:27 -0800)]
Xlib plugin: remove unused 'err' variable

The return value of `execvp` is irrelevant because this function only ever
returns when it fails. In this situation, the failure cause is in the `errno`
global, not in the return value.

2 years agoXlib plugin: squash some -Wsign-conversion warnings
Matthew Fernandez [Sat, 5 Mar 2022 18:26:08 +0000 (10:26 -0800)]
Xlib plugin: squash some -Wsign-conversion warnings

2 years agoXlib plugin: squash some -Wsign-compare warnings
Matthew Fernandez [Sat, 5 Mar 2022 18:25:24 +0000 (10:25 -0800)]
Xlib plugin: squash some -Wsign-compare warnings

2 years agoMerge branch 'smattr/24a2f3d2-0e9f-4ed5-9110-a60af25348ca' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 05:20:17 +0000 (05:20 +0000)]
Merge branch 'smattr/24a2f3d2-0e9f-4ed5-9110-a60af25348ca' into 'main'

gvc: [nfc] minor clean up

See merge request graphviz/graphviz!2482

2 years agogvc: [nfc] remove parens around return value style
Matthew Fernandez [Sat, 26 Feb 2022 22:16:26 +0000 (14:16 -0800)]
gvc: [nfc] remove parens around return value style

This is an idiom occasionally used to allow defining `return` as a macro that
does some additional instrumentation. This style has mostly fallen out of favor,
with mechanisms like `-finstrument-functions` instead used as a more robust way
of achieving the same thing.

2 years agogvc: [nfc] remove unnecessary parens around use of 'write_fn'
Matthew Fernandez [Sat, 26 Feb 2022 22:01:18 +0000 (14:01 -0800)]
gvc: [nfc] remove unnecessary parens around use of 'write_fn'

2 years agogvc: remove unnecessary parens around use of 'errorfn'
Matthew Fernandez [Sat, 26 Feb 2022 22:00:05 +0000 (14:00 -0800)]
gvc: remove unnecessary parens around use of 'errorfn'

2 years agoMerge branch 'smattr/FE85B9CB-54E3-4E97-81C3-98188A35A353' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 04:04:40 +0000 (04:04 +0000)]
Merge branch 'smattr/FE85B9CB-54E3-4E97-81C3-98188A35A353' into 'main'

rsvg plugin: squash some warnings

See merge request graphviz/graphviz!2489

2 years agorsvg plugin: remove disabled 'g_type_term' code
Matthew Fernandez [Fri, 4 Mar 2022 16:11:34 +0000 (08:11 -0800)]
rsvg plugin: remove disabled 'g_type_term' code

The build system does not check for `g_type_term` so this code is always
disabled. More importantly though, I cannot locate any reference to a
`g_type_term` function that has ever existed anywhere except the Graphviz code
base. That is, it appears this has never been a librsvg or Glib function. The
commit message of its introduction in 9f4cb1fcb745b9b71c937980ef6b0d08552ead0f
also offers no enlightenment, only suggesting this was somehow related to Fedora
20.

2 years agorsvg plugin: squash -Wsign-compare warnings for 'fileSize'
Matthew Fernandez [Fri, 4 Mar 2022 16:08:15 +0000 (08:08 -0800)]
rsvg plugin: squash -Wsign-compare warnings for 'fileSize'

2 years agorsvg plugin: remove unused 'result' variable
Matthew Fernandez [Fri, 4 Mar 2022 16:06:03 +0000 (08:06 -0800)]
rsvg plugin: remove unused 'result' variable

2 years agoMerge branch 'smattr/DB16E9C9-0ECA-4F74-9078-1763C301E445' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 01:22:15 +0000 (01:22 +0000)]
Merge branch 'smattr/DB16E9C9-0ECA-4F74-9078-1763C301E445' into 'main'

sfio: remove 'access' prototype

See merge request graphviz/graphviz!2486

2 years agosfio: remove 'access' prototype
Matthew Fernandez [Wed, 2 Mar 2022 04:50:57 +0000 (20:50 -0800)]
sfio: remove 'access' prototype

The last use of `access` in SFIO was removed in
f552c0dece1435773de62334dee3310d1728e22f.

2 years agoMerge branch 'smattr/422AF363-7D82-4831-8774-334F85EBEC69' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 00:07:59 +0000 (00:07 +0000)]
Merge branch 'smattr/422AF363-7D82-4831-8774-334F85EBEC69' into 'main'

DevIL plugin: fix all compiler warnings

See merge request graphviz/graphviz!2488

2 years agoDevIL plugin: squash -Wsign-conversion warning for 'ilSaveF' call
Matthew Fernandez [Fri, 4 Mar 2022 06:03:31 +0000 (22:03 -0800)]
DevIL plugin: squash -Wsign-conversion warning for 'ilSaveF' call

The DevIL plugin provides a number of output devices for which it claims IDs
matching the DevIL `ILenum` types. That is, it effectively stashes the DevIL
output format in the Graphviz device ID. This change simply makes it more
obvious to the compiler that the translation back and forth is intentional. For
more information, see the DevIL manual.¹

¹ http://openil.sourceforge.net/docs/DevIL%20Manual.pdf

2 years agoDevIL plugin: remove unused 'rc' variable
Matthew Fernandez [Fri, 4 Mar 2022 05:58:51 +0000 (21:58 -0800)]
DevIL plugin: remove unused 'rc' variable

According to the DevIL API docs,¹ any error from `ilTexImage` is reported via
`ilGetError`, not through its return value. Squashes a -Wunused-but-set-variable
warning.

¹ https://www-f9.ijs.si/~matevz/docs/DevIL/il/f00059.htm

2 years agoMerge branch 'smattr/6ED69563-0D4E-4B8B-BFC5-F55A459A529B' into 'main'
Matthew Fernandez [Sat, 5 Mar 2022 20:58:09 +0000 (20:58 +0000)]
Merge branch 'smattr/6ED69563-0D4E-4B8B-BFC5-F55A459A529B' into 'main'

Pango plugin: fix: do not judge empty lines as failing during text layout

Closes #2179

See merge request graphviz/graphviz!2484

2 years agoPango plugin: fix: do not judge empty lines as failing during text layout
Matthew Fernandez [Mon, 28 Feb 2022 02:49:26 +0000 (18:49 -0800)]
Pango plugin: fix: do not judge empty lines as failing during text layout

Text layout plugins are expected to return failure as `false` from their
`textlayout` function. The Pango plugin considered failure to be anything that
resulted in a horizontal layout width of 0. However, this is not a failure in
the case where the text being laid out is the empty string; its horizontal width
is expected to be 0.

The effect of this was that HTML-like strings like `<<br/>1>` were judged to
fail during text layout and a (redundant) estimation of their text width was
performed. This seems to have been a latent bug present since commit
ad82ef8613b0731806b81f9c0047d0cbf6745470 (~July 2007). This recently became more
visible due to commit 7aa0dcc03ea20b544b2463d97fe4a78af699589c that introduced
warnings during text width estimation if a fallback metric needed to be used.
Users were now presented with “Warning: no hard-coded metrics” when using fonts
that Pango knew of and should not have needed estimation in the first place.

This fix makes the Pango plugin consider 0 width for the layout of an empty
string to be successful. To be clear, this commit is both a functional fix and a
performance improvement.

Gitlab: fixes #2179

2 years agopango_textlayout: [nfc] remove an unnecessary 'void*' cast
Matthew Fernandez [Mon, 28 Feb 2022 02:48:29 +0000 (18:48 -0800)]
pango_textlayout: [nfc] remove an unnecessary 'void*' cast

2 years agogvc: [nfc] remove unnecessary 'gvplugin_installed_t.features' casts
Matthew Fernandez [Mon, 28 Feb 2022 02:39:55 +0000 (18:39 -0800)]
gvc: [nfc] remove unnecessary 'gvplugin_installed_t.features' casts

2 years agogvc: [nfc] remove unnecessary 'gvplugin_installed_t.engine' casts
Matthew Fernandez [Mon, 28 Feb 2022 02:37:59 +0000 (18:37 -0800)]
gvc: [nfc] remove unnecessary 'gvplugin_installed_t.engine' casts

2 years agotests: introduce a further variant of #2179
Matthew Fernandez [Mon, 28 Feb 2022 02:30:35 +0000 (18:30 -0800)]
tests: introduce a further variant of #2179

When working on a fix for this issue, we want to ensure we do not also affect
the case that currently (correctly) does not warn.

2 years agoMerge branch 'smattr/48F581D5-5BD5-4555-8460-C8B620B657CD-2' into 'main'
Matthew Fernandez [Sat, 5 Mar 2022 19:12:26 +0000 (19:12 +0000)]
Merge branch 'smattr/48F581D5-5BD5-4555-8460-C8B620B657CD-2' into 'main'

enable 'png:gd' format on macOS with CMake

See merge request graphviz/graphviz!2483

2 years agoCMake: enable libgd support on macOS when possible smattr/48F581D5-5BD5-4555-8460-C8B620B657CD-2
Matthew Fernandez [Sat, 26 Feb 2022 22:38:01 +0000 (14:38 -0800)]
CMake: enable libgd support on macOS when possible

As discussed in the comment in this commit, we hard code the options the
Homebrew libgd package is built with.¹ It seems not possible to build a libgd
without GIF support, so perhaps the `HAVE_GD_GIF` logic in the Graphviz code
base could be simplified in future.

Gitlab: #1786

¹ https://github.com/Homebrew/homebrew-core/blob/1a7c405f0e4da91c378d1ebb73ee0d90b2775d32/Formula/gd.rb#L27-L48

2 years agoCMake: fix: link against pathplan when building GD plugin
Matthew Fernandez [Wed, 16 Feb 2022 21:00:10 +0000 (08:00 +1100)]
CMake: fix: link against pathplan when building GD plugin

This replicates something from the Autotools build system that was missing in
the CMake build system. The CMake build was not failing because the pathplan
dependency is only required when VRML support is enabled, which an upcoming
commit will add.

In contrast to the Autotools build system, this adds pathplan for all platforms,
not only Windows. Empirically it seems necessary on at least macOS and Windows
and it does no harm on Linux.

Gitlab: related to #1786

2 years agoCMake: only use 'gdlib-config' if libgd is found
Matthew Fernandez [Sat, 26 Feb 2022 22:25:28 +0000 (14:25 -0800)]
CMake: only use 'gdlib-config' if libgd is found

This is mostly just over-cautiousness to not accidentally define variables like
`HAVE_GD_PNG` if we not have libgd. But it will also ease some upcoming
macOS-specific changes.

Gitlab: #1786

2 years agoMerge branch 'smattr/A7432BFC-580E-4549-AF2D-264543852168' into 'main'
Matthew Fernandez [Sat, 5 Mar 2022 16:09:46 +0000 (16:09 +0000)]
Merge branch 'smattr/A7432BFC-580E-4549-AF2D-264543852168' into 'main'

CI: skip package uploading and deployment steps on non-release revisions

Closes #2139

See merge request graphviz/graphviz!2481

2 years agoCI: skip package uploading and deployment steps on non-release revisions
Matthew Fernandez [Sat, 26 Feb 2022 21:30:41 +0000 (13:30 -0800)]
CI: skip package uploading and deployment steps on non-release revisions

Traditionally CI has uploaded release artifacts and packaged a “release” for
every single commit on the main branch. These inter-release packages were
intended for testing and internal deployment. As far as we aware these are no
longer used; all Graphviz developers build from source and do not rely on
Gitlab’s generic package repository.¹

This change rearranges deployment steps to skip uploading artifacts and
packaging if the current commit is not a proper release. This should slightly
accelerate CI and reduce Graphviz storage requirements, which are currently at
>800GB on Gitlab.

Gitlab: closes #2139

¹ https://gitlab.com/graphviz/graphviz/-/packages

2 years agoMerge branch 'smattr/876f5463-c9a4-40ef-b868-bd113e6a01e1'
Matthew Fernandez [Sat, 5 Mar 2022 04:29:11 +0000 (20:29 -0800)]
Merge branch 'smattr/876f5463-c9a4-40ef-b868-bd113e6a01e1'

2 years agofix gvpr corruption of dynamically allocated arguments to user-defined functions
Matthew Fernandez [Sat, 26 Feb 2022 20:01:24 +0000 (12:01 -0800)]
fix gvpr corruption of dynamically allocated arguments to user-defined functions

Gvpr programs can define their own functions which can then be called within the
same program:

  void foo(string s) {
    print(s);
  }

  foo("bar");

This mostly worked. However in some cases the gvpr implementation was not
extending the lifetime of the memory allocated to store the passed in value
long enough. Enumerating the cases in which this occurred is complicated because
whether this (used-after-free) memory retained its intended content depended on
(1) the complexity of the expression of the passed in value and (2) what the
target function (`foo` in the above example) was itself doing. As a result, it
seems users mostly did not observe the problem (program/output corruption)
unless they were writing non-trivial functions and calling them with non-trivial
expressions.

Commit 8da53964edec8a665c3996d483df243eb150c2c4 compounded the above problem by
replacing the underlying allocator. While both before and after states use an
arena allocator,¹ the allocator after this change eagerly returns memory to the
backing system allocator (`malloc`) on `vmclear` while the allocator before this
change retained it within its own internal pool. The system allocator is used
much more pervasively in the Graphviz code base than the more tightly scoped
lib/vmalloc allocator, and it also typically does much more aggressive reuse of
recently-freed memory under the assumption that this is more likely to still be
cache-resident and thus faster to access. The net effect of this was that the
chance of the memory in question being reused and overwritten significantly
increased, making a number of latent cases of the problem described above now
user-visible.

The fix in this commit removes the freeing of expressions that are still
potentially in use. The contents of a subexpression in the above described
scenarios now remains intact up to the point it is accessed when evaluating its
parent containing expression.

The astute reader who has followed everything up to now may notice that the
subexpressions’ contents are actually maintained _beyond_ the point of
evaluation of the parent expression, and may be wondering, “didn’t you just turn
a use-after-free into a memory leak?” Unfortunately the answer is yes. However,
it is unclear how to determine when it is safe to free a subexpression without
introducing a more complex concept of call stacks and arbitrarily nested
expressions to lib/expr. Thus given the choice right now between use-after-free
or leaking memory, we are choosing to leak memory. Hopefully this can be
revisited in future.

Gitlab: fixes #2185

¹ https://en.wikipedia.org/wiki/Region-based_memory_management

2 years agoMerge branch 'fix-warnings2' into 'main'
Matthew Fernandez [Tue, 1 Mar 2022 16:25:26 +0000 (16:25 +0000)]
Merge branch 'fix-warnings2' into 'main'

fix or avoid some warnings

See merge request graphviz/graphviz!2450

2 years agoavoid unused args in free_clust
Costa Shulyupin [Sun, 20 Feb 2022 05:53:27 +0000 (07:53 +0200)]
avoid unused args in free_clust

the function must be compatible with specified signature

2 years agoavoid unused args in callbacks freeItem
Costa Shulyupin [Sun, 20 Feb 2022 05:53:05 +0000 (07:53 +0200)]
avoid unused args in callbacks freeItem

the function must be compatible with specified signature

2 years agoavoid unused args in callbacks newItem
Costa Shulyupin [Wed, 16 Feb 2022 11:04:29 +0000 (13:04 +0200)]
avoid unused args in callbacks newItem

the function must be compatible with specified signature

2 years agoremove unused argument in getintrsxi
Costa Shulyupin [Wed, 16 Feb 2022 11:06:08 +0000 (13:06 +0200)]
remove unused argument in getintrsxi

2 years agoavoid unused args in ps_image_free
Costa Shulyupin [Wed, 16 Feb 2022 10:57:08 +0000 (12:57 +0200)]
avoid unused args in ps_image_free

the function must have signature, compatible
typedef void (*Dtfree_f)(Dt_t*,void*,Dtdisc_t*);

2 years agoavoid unused args in free_string_entry
Costa Shulyupin [Wed, 16 Feb 2022 10:50:50 +0000 (12:50 +0200)]
avoid unused args in free_string_entry

the function must have signature, compatible
typedef void (*Dtfree_f)(Dt_t*,void*,Dtdisc_t*);

2 years agoMerge branch 'smattr/BDEE2E31-8B1D-4272-9616-3F34D5730490' into 'main'
Matthew Fernandez [Mon, 28 Feb 2022 01:20:04 +0000 (01:20 +0000)]
Merge branch 'smattr/BDEE2E31-8B1D-4272-9616-3F34D5730490' into 'main'

fix some clang-format; add enforcement

See merge request graphviz/graphviz!2477

2 years agoCI: add a clang-format checking job
Matthew Fernandez [Tue, 22 Feb 2022 02:05:22 +0000 (18:05 -0800)]
CI: add a clang-format checking job

2 years agogvc++: [nfc] reorder GVLayout.h includes for clang-format
Matthew Fernandez [Sat, 26 Feb 2022 05:58:20 +0000 (21:58 -0800)]
gvc++: [nfc] reorder GVLayout.h includes for clang-format

2 years agotests: [nfc] reorder 2057 test code includes for clang-format
Matthew Fernandez [Fri, 25 Feb 2022 01:20:08 +0000 (17:20 -0800)]
tests: [nfc] reorder 2057 test code includes for clang-format

2 years agotests: [nfc] reflow 1910 test code
Matthew Fernandez [Thu, 24 Feb 2022 16:23:57 +0000 (08:23 -0800)]
tests: [nfc] reflow 1910 test code

2 years agocgraph: [nfc] reflow test_sprint.h
Matthew Fernandez [Thu, 24 Feb 2022 05:43:54 +0000 (21:43 -0800)]
cgraph: [nfc] reflow test_sprint.h

2 years agocgraph: [nfc] reflow test_itos.c
Matthew Fernandez [Thu, 24 Feb 2022 05:29:50 +0000 (21:29 -0800)]
cgraph: [nfc] reflow test_itos.c

2 years agocgraph: [nfc] reflow strcasecmp.h
Matthew Fernandez [Thu, 24 Feb 2022 05:17:44 +0000 (21:17 -0800)]
cgraph: [nfc] reflow strcasecmp.h

This was intended to be compliant when I wrote it, but apparently I erred.

2 years agocgraph: [nfc] reflow bitarray.h
Matthew Fernandez [Thu, 24 Feb 2022 05:05:21 +0000 (21:05 -0800)]
cgraph: [nfc] reflow bitarray.h

Some non-compliant formatting crept in.

2 years agoMerge branch 'smattr/0ee3a8de-0467-49e2-bfeb-9bd70a4bc90a' into 'main'
Matthew Fernandez [Mon, 28 Feb 2022 00:06:30 +0000 (00:06 +0000)]
Merge branch 'smattr/0ee3a8de-0467-49e2-bfeb-9bd70a4bc90a' into 'main'

expr: [nfc] some clean up

See merge request graphviz/graphviz!2480

2 years agoexpr exeval: [nfc] remove unnecessary parens, dereference of function pointers
Matthew Fernandez [Sat, 26 Feb 2022 19:20:56 +0000 (11:20 -0800)]
expr exeval: [nfc] remove unnecessary parens, dereference of function pointers

The C compiler knows how to dereference and call through a function pointer
without needing this manual instruction.

2 years agoexpr: [nfc] remove unnecessary parens and dereference of 'convertf'
Matthew Fernandez [Sat, 26 Feb 2022 19:18:53 +0000 (11:18 -0800)]
expr: [nfc] remove unnecessary parens and dereference of 'convertf'

The C compiler knows how to dereference and call through a function pointer
without needing this manual instruction.

2 years agoexpr: [nfc] remove unnecessary parens and dereference of 'binaryf'
Matthew Fernandez [Sat, 26 Feb 2022 19:10:04 +0000 (11:10 -0800)]
expr: [nfc] remove unnecessary parens and dereference of 'binaryf'

The C compiler knows how to dereference and call through a function pointer
without needing this manual instruction.

2 years agoexpr: [nfc] remove unnecessary parens and dereference of 'matchf'
Matthew Fernandez [Sat, 26 Feb 2022 19:08:03 +0000 (11:08 -0800)]
expr: [nfc] remove unnecessary parens and dereference of 'matchf'

The C compiler knows how to dereference and call through a function pointer
without needing this manual instruction.

2 years agoexpr: [nfc] remove unnecessary parens and dereference of 'exitf'
Matthew Fernandez [Sat, 26 Feb 2022 19:03:00 +0000 (11:03 -0800)]
expr: [nfc] remove unnecessary parens and dereference of 'exitf'

The C compiler knows how to dereference and call through a function pointer
without needing this manual instruction.

2 years agoexpr: [nfc] remove unnecessary parens and dereference of 'setf'
Matthew Fernandez [Sat, 26 Feb 2022 19:01:57 +0000 (11:01 -0800)]
expr: [nfc] remove unnecessary parens and dereference of 'setf'

The C compiler knows how to dereference and call through a function pointer
without needing this manual instruction.

2 years agoexpr: [nfc] remove unnecessary parens in 'eval(…).string' expressions
Matthew Fernandez [Sat, 26 Feb 2022 19:00:08 +0000 (11:00 -0800)]
expr: [nfc] remove unnecessary parens in 'eval(…).string' expressions

2 years agoexpr: [nfc] remove unorthodox spacing around member accesses
Matthew Fernandez [Sat, 26 Feb 2022 18:57:15 +0000 (10:57 -0800)]
expr: [nfc] remove unorthodox spacing around member accesses

2 years agoexpr: [nfc] remove unnecessary parens and dereference of 'getf'
Matthew Fernandez [Sat, 26 Feb 2022 18:56:04 +0000 (10:56 -0800)]
expr: [nfc] remove unnecessary parens and dereference of 'getf'

The C compiler knows how to dereference and call through a function pointer
without needing this manual instruction.

2 years agoMerge branch 'smattr/1197F5FA-7D54-45A7-961E-EC4BB50BCFE2' into 'main'
Matthew Fernandez [Sun, 27 Feb 2022 22:22:57 +0000 (22:22 +0000)]
Merge branch 'smattr/1197F5FA-7D54-45A7-961E-EC4BB50BCFE2' into 'main'

cgraph: fix some minor bugs

See merge request graphviz/graphviz!2475

2 years agocgraph: fix: handle allocation failures in 'agcanon' and friends
Matthew Fernandez [Fri, 25 Feb 2022 16:18:17 +0000 (08:18 -0800)]
cgraph: fix: handle allocation failures in 'agcanon' and friends

There are a number of cgraph API functions that use an internally managed buffer
to save the caller from having to allocate space themselves. Failure to expand
this buffer was being silently ignored, resulting in messy crashes when memory
was exhausted. These failures are now checked for and `agcanon` and `agcanonStr`
return `NULL` on allocation failure. `agwrite` returns `EOF` on allocation
failure.

2 years agoagwrite: fix: ignore out of range 'linelength'
Matthew Fernandez [Fri, 25 Feb 2022 16:09:36 +0000 (08:09 -0800)]
agwrite: fix: ignore out of range 'linelength'

This code was accepting large negative numbers and then converting them to
positive numbers that were applied as the line length limit. This seems clearly
unintended. This rephrasing now ignores any out of range value set for
`linelength`.

2 years agoagwrite: [nfc] separate assignment from conditional
Matthew Fernandez [Fri, 25 Feb 2022 15:59:14 +0000 (07:59 -0800)]
agwrite: [nfc] separate assignment from conditional

Squashes an MSVC “warning C4706: assignment within conditional expression”
warning.

2 years agoMerge branch 'smattr/D7055808-9A1D-4DCD-90A7-E0484002CF03' into 'main'
Matthew Fernandez [Sat, 26 Feb 2022 18:24:25 +0000 (18:24 +0000)]
Merge branch 'smattr/D7055808-9A1D-4DCD-90A7-E0484002CF03' into 'main'

Start 3.0 development series

See merge request graphviz/graphviz!2478

2 years agoStart 3.0 development series
Matthew Fernandez [Sat, 26 Feb 2022 16:19:01 +0000 (08:19 -0800)]
Start 3.0 development series

2 years agoMerge branch 'smattr/5DA70CF4-980D-4F81-AEF7-058695CA2E40' into 'main' 3.0.0
Matthew Fernandez [Sat, 26 Feb 2022 17:11:28 +0000 (17:11 +0000)]
Merge branch 'smattr/5DA70CF4-980D-4F81-AEF7-058695CA2E40' into 'main'

Stable Release 3.0.0

See merge request graphviz/graphviz!2461

2 years agoStable Release 3.0.0
Matthew Fernandez [Sun, 20 Feb 2022 00:13:41 +0000 (16:13 -0800)]
Stable Release 3.0.0

2 years agoMerge branch 'smattr/51EA14FF-2973-4E74-9B56-9E7681B60DBB' into 'main'
Matthew Fernandez [Sat, 26 Feb 2022 07:05:14 +0000 (07:05 +0000)]
Merge branch 'smattr/51EA14FF-2973-4E74-9B56-9E7681B60DBB' into 'main'

add a test case for #191

See merge request graphviz/graphviz!2474

2 years agoadd a test case for #191
Matthew Fernandez [Fri, 25 Feb 2022 04:09:14 +0000 (20:09 -0800)]
add a test case for #191

2 years agoMerge branch 'smattr/6BECC6DB-0939-436D-839C-A2159C2C25A3' into 'main'
Matthew Fernandez [Sat, 26 Feb 2022 05:55:17 +0000 (05:55 +0000)]
Merge branch 'smattr/6BECC6DB-0939-436D-839C-A2159C2C25A3' into 'main'

agnameof: [nfc] separate assignments from conditionals

See merge request graphviz/graphviz!2473

2 years agoagnameof: [nfc] separate assignments from conditionals
Matthew Fernandez [Fri, 25 Feb 2022 04:56:39 +0000 (20:56 -0800)]
agnameof: [nfc] separate assignments from conditionals

Squashes a number of MSVC “C4706: assignment within conditional expression”
warnings.

2 years agoMerge branch 'fix-warnings' into 'main'
Matthew Fernandez [Fri, 25 Feb 2022 02:07:14 +0000 (02:07 +0000)]
Merge branch 'fix-warnings' into 'main'

fix freeTreeList

See merge request graphviz/graphviz!2449

2 years agofix freeTreeList
Costa Shulyupin [Fri, 25 Feb 2022 02:07:14 +0000 (02:07 +0000)]
fix freeTreeList

2 years agoMerge branch 'smattr/0A79D579-4787-4FF1-AC4B-BE5FFA581FE8' into 'main'
Matthew Fernandez [Thu, 24 Feb 2022 18:20:45 +0000 (18:20 +0000)]
Merge branch 'smattr/0A79D579-4787-4FF1-AC4B-BE5FFA581FE8' into 'main'

cgraph: [nfc] remove unused return value from 'agxbmore'

See merge request graphviz/graphviz!2471

2 years agocgraph: [nfc] remove unused return value from 'agxbmore'
Matthew Fernandez [Wed, 23 Feb 2022 07:57:09 +0000 (23:57 -0800)]
cgraph: [nfc] remove unused return value from 'agxbmore'

2 years agoMerge branch 'smattr/C7E834B5-E093-4BCD-B39E-39DDFA0CE179' into 'main'
Matthew Fernandez [Thu, 24 Feb 2022 08:17:36 +0000 (08:17 +0000)]
Merge branch 'smattr/C7E834B5-E093-4BCD-B39E-39DDFA0CE179' into 'main'

lib/pathplan/shortest.c: [nfc] some clean up and warning squashing

See merge request graphviz/graphviz!2469

2 years agolib/pathplan/shortest.c: [nfc] separate assignments from conditionals
Matthew Fernandez [Tue, 22 Feb 2022 16:17:37 +0000 (08:17 -0800)]
lib/pathplan/shortest.c: [nfc] separate assignments from conditionals

Squashes a number of MSVC “C4706: assignment within conditional expression”
warnings.

2 years agopathplan connecttris: [nfc] remove unnecessary use of the comma operator
Matthew Fernandez [Tue, 22 Feb 2022 16:14:28 +0000 (08:14 -0800)]
pathplan connecttris: [nfc] remove unnecessary use of the comma operator

2 years agolib/pathplan/shortest.c: [nfc] reflow some code for readability
Matthew Fernandez [Tue, 22 Feb 2022 16:14:12 +0000 (08:14 -0800)]
lib/pathplan/shortest.c: [nfc] reflow some code for readability

2 years agolib/pathplan/shortest.c: [nfc] remove unnecessary parens
Matthew Fernandez [Tue, 22 Feb 2022 16:09:33 +0000 (08:09 -0800)]
lib/pathplan/shortest.c: [nfc] remove unnecessary parens

2 years agoMerge branch 'smattr/9662124d-546f-46ec-86b2-59fdac3d6e8a' into 'main'
Matthew Fernandez [Thu, 24 Feb 2022 07:08:25 +0000 (07:08 +0000)]
Merge branch 'smattr/9662124d-546f-46ec-86b2-59fdac3d6e8a' into 'main'

various test cases for #2185

See merge request graphviz/graphviz!2463

2 years agovarious test cases for #2185
Matthew Fernandez [Sun, 20 Feb 2022 03:53:59 +0000 (19:53 -0800)]
various test cases for #2185

2 years agoMerge branch 'graphml2gv' into 'main'
Mark Hansen [Wed, 23 Feb 2022 09:40:29 +0000 (09:40 +0000)]
Merge branch 'graphml2gv' into 'main'

tools: remove unused arguments

See merge request graphviz/graphviz!2470

2 years agoMerge branch 'smattr/139c540a-38bd-48cf-806c-10652625b583' into 'main'
Matthew Fernandez [Wed, 23 Feb 2022 09:04:00 +0000 (09:04 +0000)]
Merge branch 'smattr/139c540a-38bd-48cf-806c-10652625b583' into 'main'

add a test case for #2193

See merge request graphviz/graphviz!2462

2 years agoadd a test case for #2193
Matthew Fernandez [Sun, 20 Feb 2022 00:47:08 +0000 (16:47 -0800)]
add a test case for #2193

2 years agotests: recognize 'canon' as a textual format
Matthew Fernandez [Sun, 20 Feb 2022 00:37:25 +0000 (16:37 -0800)]
tests: recognize 'canon' as a textual format

Gitlab: related to #2193

2 years agoMerge branch 'smattr/39320B11-3CE5-4D7B-9C8E-17152F849788' into 'main'
Matthew Fernandez [Wed, 23 Feb 2022 05:54:32 +0000 (05:54 +0000)]
Merge branch 'smattr/39320B11-3CE5-4D7B-9C8E-17152F849788' into 'main'

cdt: [nfc] some clean up

See merge request graphviz/graphviz!2466

2 years agocdt: [nfc] remove unnecessary dereference and parens on function pointers
Matthew Fernandez [Mon, 21 Feb 2022 00:02:03 +0000 (16:02 -0800)]
cdt: [nfc] remove unnecessary dereference and parens on function pointers

The compiler knows how to call through a function pointer without requiring the
programmer to manually dereference it.

2 years agocdt: [nfc] remove some unnecessary casts of 'void*' during assignment
Matthew Fernandez [Sun, 20 Feb 2022 23:42:20 +0000 (15:42 -0800)]
cdt: [nfc] remove some unnecessary casts of 'void*' during assignment

2 years agocdt: [nfc] remove an unnecessary cast of an argument to '_DTKEY'
Matthew Fernandez [Sun, 20 Feb 2022 23:34:42 +0000 (15:34 -0800)]
cdt: [nfc] remove an unnecessary cast of an argument to '_DTKEY'

2 years agocdt: [nfc] remove an unnecessary cast of the return value of '_DTOBJ'
Matthew Fernandez [Sun, 20 Feb 2022 23:33:48 +0000 (15:33 -0800)]
cdt: [nfc] remove an unnecessary cast of the return value of '_DTOBJ'

2 years agocdt: [nfc] remove unnecessary casts of arguments to 'searchf'
Matthew Fernandez [Sun, 20 Feb 2022 23:30:08 +0000 (15:30 -0800)]
cdt: [nfc] remove unnecessary casts of arguments to 'searchf'