]> granicus.if.org Git - graphviz/log
graphviz
2 years agoccomps: remove use of long lived 'getBuf' allocation
Matthew Fernandez [Sat, 12 Mar 2022 19:28:16 +0000 (11:28 -0800)]
ccomps: remove use of long lived 'getBuf' allocation

Allows more localized reasoning. This also makes progress towards thread safety.

2 years agoccomps: remove parameter to 'split'
Matthew Fernandez [Sat, 12 Mar 2022 19:21:45 +0000 (11:21 -0800)]
ccomps: remove parameter to 'split'

This function was retaining a pointer to memory pointed to by its parameter,
`name`, in the global `suffix`. So it is unsafe to call this with anything
except a long lived string. We can make this more obvious/explicit by inlining
the use of `outfile`, the only parameter it is ever called with.

2 years agoccomps: make all internal variables static
Matthew Fernandez [Sat, 12 Mar 2022 19:20:02 +0000 (11:20 -0800)]
ccomps: make all internal variables static

2 years agoMerge branch 'smattr/ec571e5b-baf1-40a7-add9-416a446bd4b2' into 'main'
Matthew Fernandez [Sun, 13 Mar 2022 19:45:44 +0000 (19:45 +0000)]
Merge branch 'smattr/ec571e5b-baf1-40a7-add9-416a446bd4b2' into 'main'

some misc clean up

See merge request graphviz/graphviz!2507

2 years agofinishEdge: remove now-unused 'p' and 'q' parameters
Matthew Fernandez [Sat, 12 Mar 2022 04:29:20 +0000 (20:29 -0800)]
finishEdge: remove now-unused 'p' and 'q' parameters

2 years agofinishEdge: remove now-unused 'p1' and 'q1' locals
Matthew Fernandez [Sat, 12 Mar 2022 04:22:49 +0000 (20:22 -0800)]
finishEdge: remove now-unused 'p1' and 'q1' locals

2 years agomakePolyline: remove now-unused 'p0' and 'q0' locals
Matthew Fernandez [Sat, 12 Mar 2022 04:21:37 +0000 (20:21 -0800)]
makePolyline: remove now-unused 'p0' and 'q0' locals

2 years agomakeStraightEdges: remove now-unused 'p' and 'q' locals
Matthew Fernandez [Sat, 12 Mar 2022 04:20:42 +0000 (20:20 -0800)]
makeStraightEdges: remove now-unused 'p' and 'q' locals

2 years agoaddEdgeLabels: remove unused parameters
Matthew Fernandez [Sat, 12 Mar 2022 04:18:25 +0000 (20:18 -0800)]
addEdgeLabels: remove unused parameters

The use of separate points to the edge itself was removed in commit
24c4a1ce2994b624ba680c74a33aef60ec16de21 in 2011.

2 years agomkMaze: remove unused 'doLbls' parameter
Matthew Fernandez [Sat, 12 Mar 2022 03:54:20 +0000 (19:54 -0800)]
mkMaze: remove unused 'doLbls' parameter

2 years agomkMaze: abbreviate some open coded 'fmax'
Matthew Fernandez [Sat, 12 Mar 2022 03:49:54 +0000 (19:49 -0800)]
mkMaze: abbreviate some open coded 'fmax'

2 years agoMerge branch 'smattr/275A397A-C582-46E4-BA96-18CE75BABA1C' into 'main'
Matthew Fernandez [Sun, 13 Mar 2022 18:31:01 +0000 (18:31 +0000)]
Merge branch 'smattr/275A397A-C582-46E4-BA96-18CE75BABA1C' into 'main'

GD plugin: some minor fixes to use of `gdIOCtxPtr`

See merge request graphviz/graphviz!2509

2 years agoGD plugin: remove repurposing of 'tell' member of I/O context
Matthew Fernandez [Thu, 3 Mar 2022 06:56:11 +0000 (22:56 -0800)]
GD plugin: remove repurposing of 'tell' member of I/O context

The GD plugin was using (abusing) the `gdIOCtx.tell` field as a way to pass
around the Graphviz context through GD library functions and callbacks. The GD
docs¹ have this to say about the `tell` field:

  The seek and tell functions are only required in conjunction with the gd2 file
  format, which supports quick loading of partial images.

The Graphviz GD plugin _is_ using gd2 functionality, so it seems its usage only
works out because it coincidentally does not hit any code paths that use `tell`.

We can avoid this latent issue entirely by rephrasing the way the plugin passes
the Graphviz context around to something less brittle. The approach taken in
this commit is inspired by something like Linux’s `container_of` macro.

¹ https://libgd.github.io/manuals/2.3.3/files/gd_io-h.html#gdIOCtx

2 years agoGD plugin: fix: zero I/O contexts on creation
Matthew Fernandez [Thu, 3 Mar 2022 06:33:39 +0000 (22:33 -0800)]
GD plugin: fix: zero I/O contexts on creation

The GD plugin was creating `gdIOCtx` objects on the stack with some
uninitialized members. At time of writing, the GD docs¹ claim this struct’s
layout is:

  typedef struct gdIOCtx
  {
    int (*getC)(gdIOCtxPtr);
    int (*getBuf)(gdIOCtxPtr, void *, int wanted);

    void (*putC)(gdIOCtxPtr, int);
    int (*putBuf)(gdIOCtxPtr, const void *, int wanted);

    // seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek!
    int (*seek)(gdIOCtxPtr, const int);
    long (*tell)(gdIOCtxPtr);

    void (*gd_free)(gdIOCtxPtr);
  } gdIOCtx;

So Graphviz’ usage was leaving `getC`, `getBuf`, `seek`, and `gd_free`
uninitialized. This seems to work out OK; Graphviz’ usage of libgd apparently
does not involve any code paths that use these members. But this does not seem
to be an API guarantee. This change zeroes these members for future stability.

¹ https://libgd.github.io/manuals/2.3.3/files/gd_io-h.html#gdIOCtx

2 years agoMerge branch 'smattr/C10BAFD7-8A61-449E-AD42-00D171808AAD' into 'main'
Matthew Fernandez [Sun, 13 Mar 2022 02:14:33 +0000 (02:14 +0000)]
Merge branch 'smattr/C10BAFD7-8A61-449E-AD42-00D171808AAD' into 'main'

gvplugin_install: remove 63-character limit on plugin names

See merge request graphviz/graphviz!2505

2 years agoMerge branch 'smattr/DA683A5D-79E9-46FD-B58A-A0DBAAE673A1' into 'main'
Matthew Fernandez [Sun, 13 Mar 2022 01:01:47 +0000 (01:01 +0000)]
Merge branch 'smattr/DA683A5D-79E9-46FD-B58A-A0DBAAE673A1' into 'main'

avoid use of '__builtin_unreachable' in 'UNREACHABLE' macro

See merge request graphviz/graphviz!2506

2 years agogvplugin_install: remove 63-character limit on plugin names
Matthew Fernandez [Sun, 6 Mar 2022 03:09:43 +0000 (19:09 -0800)]
gvplugin_install: remove 63-character limit on plugin names

This change rephrases `gvplugin_install` to avoid the use of intermediate
buffers and, in the process, removes a constraint on the maximum length of
plugin names. That is, this is a performance improvement and a functional
improvement.

2 years agoavoid use of '__builtin_unreachable' in 'UNREACHABLE' macro
Matthew Fernandez [Thu, 10 Mar 2022 02:57:17 +0000 (18:57 -0800)]
avoid use of '__builtin_unreachable' in 'UNREACHABLE' macro

There was some discussion on !2503¹ around the effect of `__builtin_unreachable`
and whether we are really confident applying such a strong compiler hint to
complex control flow logic that is, in some cases, only partially understood.
This change softens the effect of the `UNREACHABLE` macro to a reliable program
abort rather than undefined behavior if mistakenly tagged unreachable code is
reached. The result is slightly less efficient but safer code.

¹ https://gitlab.com/graphviz/graphviz/-/merge_requests/2503#note_866261546

2 years agoMerge branch 'smattr/CFF10D10-9221-483B-8A24-6716633FE172' into 'main'
Matthew Fernandez [Sat, 12 Mar 2022 23:45:08 +0000 (23:45 +0000)]
Merge branch 'smattr/CFF10D10-9221-483B-8A24-6716633FE172' into 'main'

fix corruption of user shape characteristics during EPSF initialization

See merge request graphviz/graphviz!2498

2 years agofix corruption of user shape characteristics during EPSF initialization
Matthew Fernandez [Sun, 6 Mar 2022 22:28:23 +0000 (14:28 -0800)]
fix corruption of user shape characteristics during EPSF initialization

From the surrounding context, it is clear this code was intending to set `h`,
the height of the shape, not overwrite the `y` coordinate it had previously set
for the shape. This change not only fixes the overwrite of `us->y` but fixes a
read of uninitialized memory in `us->h` by the caller of this function.

It is not clear to me what the full user-visible effect of this change is.

2 years agoMerge branch 'fix-out-of-source-build' into 'main'
Matthew Fernandez [Sat, 12 Mar 2022 21:01:24 +0000 (21:01 +0000)]
Merge branch 'fix-out-of-source-build' into 'main'

fix autotools out of source build errors

Closes #2207

See merge request graphviz/graphviz!2490

2 years agofix out of source build error in lib/expr
Costa Shulyupin [Thu, 10 Mar 2022 07:47:14 +0000 (09:47 +0200)]
fix out of source build error in lib/expr

make[3]: Entering directory '/home/costa/oss/graphviz/build/lib/expr'
  CC       excc.lo
In file included from ../../../lib/expr/expr.h:28,
                 from ../../../lib/expr/exlib.h:126,
                 from ../../../lib/expr/excc.c:25:
../../../lib/expr/exparse.h:4:10: fatal error: expr/y.tab.h: No such file or directory
    4 | #include <expr/y.tab.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

2 years agofix out of source build error in lib/common
Costa Shulyupin [Thu, 10 Mar 2022 07:40:06 +0000 (09:40 +0200)]
fix out of source build error in lib/common

make[4]: Entering directory '/home/costa/oss/graphviz/build/lib/common'
  CC       arrows.lo
../../../lib/common/arrows.c: In function ‘arrowOrthoClip’:
.....
../../../lib/common/colxlate.c:21:10: fatal error: common/colortbl.h: No such file or directory
   21 | #include <common/colortbl.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

2 years agofix out of source build error in gvpr
Costa Shulyupin [Thu, 10 Mar 2022 06:10:43 +0000 (08:10 +0200)]
fix out of source build error in gvpr

Explanation:

It needs $(top_builddir)/lib to include generated expr/y.tab.h in lib

Command:

(mkdir -p build && cd build && ../configure -q && make)

Error:

make[3]: Entering directory '/home/costa/oss/graphviz/build/lib/gvpr'
  CC       actions.lo
In file included from ../../../lib/expr/expr.h:28,
                 from ../../../lib/gvpr/actions.h:18,
                 from ../../../lib/gvpr/actions.c:16:
../../../lib/expr/exparse.h:4:10: fatal error: expr/y.tab.h: No such file or directory
    4 | #include <expr/y.tab.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

2 years agofix indentation
Costa Shulyupin [Thu, 10 Mar 2022 05:59:10 +0000 (07:59 +0200)]
fix indentation

replace eight spaces with a tab

2 years agoMerge branch 'smattr/89ad4b85-34bb-4b7e-bf49-ee381244722a' into 'main'
Matthew Fernandez [Sat, 12 Mar 2022 20:07:32 +0000 (20:07 +0000)]
Merge branch 'smattr/89ad4b85-34bb-4b7e-bf49-ee381244722a' into 'main'

core plugin: some warning squashing and runtime performance improvements

See merge request graphviz/graphviz!2503

2 years agocore plugin svg_gradstyle: treat angle-based quantities as a double
Matthew Fernandez [Mon, 7 Mar 2022 04:50:30 +0000 (20:50 -0800)]
core plugin svg_gradstyle: treat angle-based quantities as a double

This removes an assumption that these calculated values fit in an int. Squashes
two -Wfloat-conversion warnings.

2 years agocore plugin svg_rgradstyle: treat 'angle' as a double instead of a float
Matthew Fernandez [Mon, 7 Mar 2022 04:44:58 +0000 (20:44 -0800)]
core plugin svg_rgradstyle: treat 'angle' as a double instead of a float

This is consistent with how `angle` is derived from `gradient_angle` elsewhere
in this plugin and it squashes a -Wconversion warning.

2 years agocore plugin map_output_shape: replace dynamic buffer with inline conversion
Matthew Fernandez [Mon, 7 Mar 2022 04:39:57 +0000 (20:39 -0800)]
core plugin map_output_shape: replace dynamic buffer with inline conversion

This function was using a long lived buffer to hold conversions of the input
array `AF`. However each entry was only used once or twice. It is faster to
avoid the heap buffer altogether and simply do the conversions on-demand when
they are needed.

This change is expected to be a slight performance improvement as well as
further progress towards thread safety in this code.

2 years agocore plugin: remove assumptions that pen width fits in an int
Matthew Fernandez [Mon, 7 Mar 2022 04:20:55 +0000 (20:20 -0800)]
core plugin: remove assumptions that pen width fits in an int

By dealing with this field consistently as a double, we retain the previous
intent while removing assumptions on the characteristics of `int`. Squashes 8
compiler warnings.

2 years agocore plugin write_xdot: squash a -Wswitch-default warning
Matthew Fernandez [Mon, 7 Mar 2022 03:53:25 +0000 (19:53 -0800)]
core plugin write_xdot: squash a -Wswitch-default warning

This switch is exhaustive.

2 years agoMerge branch 'smattr/FCCD7D3F-8164-4BFC-A411-5B8F9643E11E' into 'main'
Matthew Fernandez [Thu, 10 Mar 2022 02:51:55 +0000 (02:51 +0000)]
Merge branch 'smattr/FCCD7D3F-8164-4BFC-A411-5B8F9643E11E' into 'main'

squash more compiler warnings from GTK headers

See merge request graphviz/graphviz!2497

2 years agolib/glcomp: squash warnings from GTK headers
Matthew Fernandez [Sun, 6 Mar 2022 21:43:07 +0000 (13:43 -0800)]
lib/glcomp: squash warnings from GTK headers

Equivalent change to that in !2495.¹

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

2 years agostandardize on '$(foo:a=b)' pattern substitution
Matthew Fernandez [Sun, 6 Mar 2022 21:40:39 +0000 (13:40 -0800)]
standardize on '$(foo:a=b)' pattern substitution

GNU Make supports both this syntax and `patsubst` for pattern substitution. The
former is more portable to other Make implementations, so use this in preference
to the latter.

2 years agoMerge branch 'gtk' into 'main'
Matthew Fernandez [Wed, 9 Mar 2022 17:22:34 +0000 (17:22 +0000)]
Merge branch 'gtk' into 'main'

squash warnings in gtk headers

See merge request graphviz/graphviz!2495

2 years agosquash warnings in gtk headers
Costa Shulyupin [Sun, 6 Mar 2022 19:07:01 +0000 (21:07 +0200)]
squash warnings in gtk headers

2 years agoMerge branch 'smattr/FF581D5F-7AFA-44C4-A22F-79C660FDB42A' into 'main'
Matthew Fernandez [Wed, 9 Mar 2022 15:33:02 +0000 (15:33 +0000)]
Merge branch 'smattr/FF581D5F-7AFA-44C4-A22F-79C660FDB42A' into 'main'

rephrase all sqrt(x*x+y*y) into hypot(x,y)

See merge request graphviz/graphviz!2499

2 years agoortho LENGTH: rephras an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 23:06:43 +0000 (15:06 -0800)]
ortho LENGTH: rephras an open coded 'hypot'

2 years agofdpgen dumpstat: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 23:05:54 +0000 (15:05 -0800)]
fdpgen dumpstat: rephrase an open coded 'hypot'

2 years agocommit get_gradient_points: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 23:04:32 +0000 (15:04 -0800)]
commit get_gradient_points: rephrase an open coded 'hypot'

2 years agocommon round_corners: rephrase some open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 23:03:38 +0000 (15:03 -0800)]
common round_corners: rephrase some open coded 'hypot'

2 years agocommon l2dist: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 23:01:49 +0000 (15:01 -0800)]
common l2dist: rephrase an open coded 'hypot'

2 years agoneatogen dist: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 23:01:05 +0000 (15:01 -0800)]
neatogen dist: rephrase an open coded 'hypot'

2 years agoneatogen ideal_distance_avoid_overlap: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 23:00:07 +0000 (15:00 -0800)]
neatogen ideal_distance_avoid_overlap: rephrase an open coded 'hypot'

2 years agopathplan dist: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 22:59:15 +0000 (14:59 -0800)]
pathplan dist: rephrase an open coded 'hypot'

2 years agopathplan dist_n: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 22:58:33 +0000 (14:58 -0800)]
pathplan dist_n: rephrase an open coded 'hypot'

2 years agotopfish ddist: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 22:57:01 +0000 (14:57 -0800)]
topfish ddist: rephrase an open coded 'hypot'

2 years agolibmingle force_directed_edge_bundling: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 22:56:01 +0000 (14:56 -0800)]
libmingle force_directed_edge_bundling: rephrase an open coded 'hypot'

2 years agotclpathplan distance: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 22:52:55 +0000 (14:52 -0800)]
tclpathplan distance: rephrase an open coded 'hypot'

2 years agotopfish DIST: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 22:51:28 +0000 (14:51 -0800)]
topfish DIST: rephrase an open coded 'hypot'

2 years agotopfish compute_densities: rephrase an open coded 'hypot'
Matthew Fernandez [Sun, 6 Mar 2022 22:50:21 +0000 (14:50 -0800)]
topfish compute_densities: rephrase an open coded 'hypot'

2 years agoMerge branch 'smattr/EB5F6EF3-EB42-4C47-81F5-90ED0C55B9FF' into 'main'
Matthew Fernandez [Wed, 9 Mar 2022 07:17:50 +0000 (07:17 +0000)]
Merge branch 'smattr/EB5F6EF3-EB42-4C47-81F5-90ED0C55B9FF' into 'main'

topfish: remove unmutated 'cur_level'

See merge request graphviz/graphviz!2496

2 years agotopfish: remove unmutated 'cur_level'
Matthew Fernandez [Sun, 6 Mar 2022 03:26:00 +0000 (19:26 -0800)]
topfish: remove unmutated 'cur_level'

This file has a fairly strange structure where almost every use of `cur_level`
is actually referencing a local that shadows the global `cur_level`. The global
`cur_level` is never written to and remains 0 throughout execution, making it
somewhat useless.

2 years agoMerge branch 'smattr/7557D547-EFFB-48E0-BB59-4D61EF4FFB69' into 'main'
Matthew Fernandez [Wed, 9 Mar 2022 06:02:58 +0000 (06:02 +0000)]
Merge branch 'smattr/7557D547-EFFB-48E0-BB59-4D61EF4FFB69' into 'main'

remove Criterion submodule

See merge request graphviz/graphviz!2501

2 years agoremove Criterion submodule
Matthew Fernandez [Mon, 7 Mar 2022 00:47:16 +0000 (16:47 -0800)]
remove Criterion submodule

Criterion is a testing framework that has been used for writing Graphviz unit
tests in the past (see tests/unit_tests). These unit tests are not currently
enabled. However, Windows CI unconditionally checks out all submodules, thus
pulling in a version of Criterion that goes unused.

This change removes the previously described behavior. If/when the
Criterion-based unit tests are resurrected, an up to date version of Criterion
can be pulled in via a package manager or the Windows build dependencies
repository¹ instead.

This change should slightly accelerate Windows CI jobs.

¹ https://gitlab.com/graphviz/graphviz-build-utilities

2 years agoMerge branch 'smattr/A4158690-8353-4D1F-911E-C66D722F62F2' into 'main'
Matthew Fernandez [Wed, 9 Mar 2022 03:58:57 +0000 (03:58 +0000)]
Merge branch 'smattr/A4158690-8353-4D1F-911E-C66D722F62F2' into 'main'

epsf_emit_body: minor clean up

See merge request graphviz/graphviz!2500

2 years agoepsf_emit_body: remove unnecessary parens and make some comparisons more obvious
Matthew Fernandez [Sun, 6 Mar 2022 22:46:51 +0000 (14:46 -0800)]
epsf_emit_body: remove unnecessary parens and make some comparisons more obvious

2 years agoepsf_emit_body: remove local 'c'
Matthew Fernandez [Sun, 6 Mar 2022 22:44:48 +0000 (14:44 -0800)]
epsf_emit_body: remove local 'c'

This did not seem to be aiding readability.

2 years agoepsf_emit_body: undo a 'strcmp' micro-optimization
Matthew Fernandez [Sun, 6 Mar 2022 22:42:45 +0000 (14:42 -0800)]
epsf_emit_body: undo a 'strcmp' micro-optimization

The preceding `%` checks are unnecessary to do separately. Modern compilers can
do this kind of optimization themselves.

2 years agoMerge branch 'smattr/DCC4171E-CD52-49AB-A824-0FAAA8F3BF4D' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 23:19:00 +0000 (23:19 +0000)]
Merge branch 'smattr/DCC4171E-CD52-49AB-A824-0FAAA8F3BF4D' into 'main'

GD plugin: movement towards thread safety

See merge request graphviz/graphviz!2485

2 years agoGD plugin: remove unused 'GD2_RAW'
Matthew Fernandez [Wed, 2 Mar 2022 04:39:38 +0000 (20:39 -0800)]
GD plugin: remove unused 'GD2_RAW'

2 years agoGD plugin: use a dynamically allocated VRML rendering state instead of globals
Matthew Fernandez [Tue, 1 Mar 2022 01:25:01 +0000 (17:25 -0800)]
GD plugin: use a dynamically allocated VRML rendering state instead of globals

This brings the affected code closer to being thread safe. The goal is to allow
(1) multiple threads to execute in this code safely as well as (2) multiple VRML
renderings on the same thread to be interleaved with each other.

2 years agoGD plugin: remove unnecessary common/utils.h include
Matthew Fernandez [Mon, 28 Feb 2022 16:13:08 +0000 (08:13 -0800)]
GD plugin: remove unnecessary common/utils.h include

This was introduced in ff97490f4de09db950f708b1bf44a8f8f62902c5 in the same
commit that _removed_ all usage of `late_double` here, so it is unclear what the
intended meaning of the leading comment was.

2 years agoGD plugin: remove commented out globals
Matthew Fernandez [Mon, 28 Feb 2022 16:06:40 +0000 (08:06 -0800)]
GD plugin: remove commented out globals

2 years agoMerge branch 'smattr/784EA405-51D5-4078-9EF5-3945503ECDED' into 'main'
Matthew Fernandez [Sun, 6 Mar 2022 22:04:47 +0000 (22:04 +0000)]
Merge branch 'smattr/784EA405-51D5-4078-9EF5-3945503ECDED' into 'main'

DevIL plugin: only save output if image processing succeeded

See merge request graphviz/graphviz!2493

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