]> granicus.if.org Git - graphviz/log
graphviz
3 years agouse a header with prototypes to squash bindings -Wmissing-prototypes warnings
Matthew Fernandez [Sat, 11 Sep 2021 16:30:14 +0000 (09:30 -0700)]
use a header with prototypes to squash bindings -Wmissing-prototypes warnings

This removes 30 build warnings and is generally a cleaner way of doing this.

3 years agoMerge branch 'smattr/25F2CD31-80C6-48D6-A6EE-9D7EEEB2FA14' into 'main'
Matthew Fernandez [Sun, 19 Sep 2021 02:18:41 +0000 (02:18 +0000)]
Merge branch 'smattr/25F2CD31-80C6-48D6-A6EE-9D7EEEB2FA14' into 'main'

smyrna: remove unused materials.h

See merge request graphviz/graphviz!2160

3 years agosmyrna: remove unused materials.h
Matthew Fernandez [Tue, 14 Sep 2021 00:01:45 +0000 (17:01 -0700)]
smyrna: remove unused materials.h

3 years agoMerge branch 'smattr/FDB29D45-8A65-4119-B80E-24C4F73985C5' into 'main'
Matthew Fernandez [Sun, 19 Sep 2021 01:12:07 +0000 (01:12 +0000)]
Merge branch 'smattr/FDB29D45-8A65-4119-B80E-24C4F73985C5' into 'main'

more smyrna clean up

See merge request graphviz/graphviz!2161

3 years agoMerge branch 'windows' into 'main'
Mark Hansen [Sun, 19 Sep 2021 01:01:51 +0000 (01:01 +0000)]
Merge branch 'windows' into 'main'

Update schema of generated deploy.py JSON

See merge request graphviz/graphviz!2174

3 years agoUpdate schema of generated deploy.py JSON
Mark Hansen [Sat, 18 Sep 2021 23:12:59 +0000 (09:12 +1000)]
Update schema of generated deploy.py JSON

I've updated the schema in the docs dir, to make room for Windows releases in here.

I haven't filled in the windows array yet.

3 years agosmyrna: remove unused hotkey macros
Matthew Fernandez [Tue, 14 Sep 2021 01:48:38 +0000 (18:48 -0700)]
smyrna: remove unused hotkey macros

3 years agosmyrna: remove unused 'get_key_action'
Matthew Fernandez [Tue, 14 Sep 2021 01:47:18 +0000 (18:47 -0700)]
smyrna: remove unused 'get_key_action'

3 years agosmyrna: remove unused LOCATION_X macros
Matthew Fernandez [Tue, 14 Sep 2021 01:43:55 +0000 (18:43 -0700)]
smyrna: remove unused LOCATION_X macros

3 years agosmyrna: remove unused tvnode types
Matthew Fernandez [Tue, 14 Sep 2021 01:42:32 +0000 (18:42 -0700)]
smyrna: remove unused tvnode types

3 years agosmyrna: remove 'attach_camera_widget' prototype
Matthew Fernandez [Tue, 14 Sep 2021 01:39:29 +0000 (18:39 -0700)]
smyrna: remove 'attach_camera_widget' prototype

This function is not implemented.

3 years agosmyrna: remove unused 'countof' macro
Matthew Fernandez [Tue, 14 Sep 2021 00:20:48 +0000 (17:20 -0700)]
smyrna: remove unused 'countof' macro

3 years agosmyrna apply_actions: remove useless break statement
Matthew Fernandez [Tue, 14 Sep 2021 00:20:27 +0000 (17:20 -0700)]
smyrna apply_actions: remove useless break statement

3 years agosmyrna: remove unused 'setGdkColor'
Matthew Fernandez [Tue, 14 Sep 2021 00:17:07 +0000 (17:17 -0700)]
smyrna: remove unused 'setGdkColor'

3 years agosmyrna realize: remove useless trailing return statement
Matthew Fernandez [Tue, 14 Sep 2021 00:16:34 +0000 (17:16 -0700)]
smyrna realize: remove useless trailing return statement

3 years agosmyrna: remove some commented out prototypes
Matthew Fernandez [Tue, 14 Sep 2021 00:16:15 +0000 (17:16 -0700)]
smyrna: remove some commented out prototypes

3 years agoMerge branch 'smattr/d8544aa0-66a2-485d-bc01-4017f399a188' into 'main'
Matthew Fernandez [Sat, 18 Sep 2021 23:13:11 +0000 (23:13 +0000)]
Merge branch 'smattr/d8544aa0-66a2-485d-bc01-4017f399a188' into 'main'

progress on removing sfio

See merge request graphviz/graphviz!2154

3 years agogvpr mkStmts: use internal temporary buffers instead of sfio
Matthew Fernandez [Sat, 11 Sep 2021 19:05:23 +0000 (12:05 -0700)]
gvpr mkStmts: use internal temporary buffers instead of sfio

This simplifies code, progresses the ongoing sfio removal goal, and also makes
it more obvious to the compiler how to optimize this code.

Related to #1873, #1998.

3 years agogvpr mkStmts: make 'lbl' parameter const
Matthew Fernandez [Sat, 11 Sep 2021 18:30:29 +0000 (11:30 -0700)]
gvpr mkStmts: make 'lbl' parameter const

The pointed to data is not modified within this function.

3 years agogvpr mkBlock: remove an unnecessary use of an sfio buffer
Matthew Fernandez [Sat, 11 Sep 2021 18:27:30 +0000 (11:27 -0700)]
gvpr mkBlock: remove an unnecessary use of an sfio buffer

Related to #1873, #1998.

3 years agogvpr mkBlock: more precise bounds on internal buffers
Matthew Fernandez [Sat, 11 Sep 2021 18:50:08 +0000 (11:50 -0700)]
gvpr mkBlock: more precise bounds on internal buffers

On most platforms, `BUFSIZ` is likely large enough to contain the data printed
to it. But since we know the exact data that is placed in these buffers, we can
write this code more portably.

3 years agoexpose itos buffer size as a constant
Matthew Fernandez [Sat, 11 Sep 2021 18:40:05 +0000 (11:40 -0700)]
expose itos buffer size as a constant

Elsewhere in Graphviz we sometimes need to print ints into fixed sized buffers,
but not using itos. So it is useful to have a value for the number of bytes this
requires that is also regularly validated by the Graphviz test suite. That is,
uses of this constant should be robust to future environment/platform changes,
because the itos tests will fail, prompting an update of this constant, that
will then correctly affect all usages of this.

3 years agogvpr mkBlock: scope a buffer closer to its uses
Matthew Fernandez [Sat, 11 Sep 2021 18:23:08 +0000 (11:23 -0700)]
gvpr mkBlock: scope a buffer closer to its uses

3 years agogvpr compile: make 'lbl' parameter const
Matthew Fernandez [Sat, 11 Sep 2021 18:16:40 +0000 (11:16 -0700)]
gvpr compile: make 'lbl' parameter const

The pointed to data is not modified within this function.

3 years agogvpr compileProg: remove now unnecessary 'strdup'
Matthew Fernandez [Sat, 11 Sep 2021 18:12:51 +0000 (11:12 -0700)]
gvpr compileProg: remove now unnecessary 'strdup'

Now that the backing memory for `endgsfx` is no longer hosted in a temporary
sfio buffer that may be overwritten, there is no need to duplicate this further.

3 years agogvpr doFlags: rewrite to avoid dynamic memory allocation
Matthew Fernandez [Sat, 11 Sep 2021 18:07:25 +0000 (11:07 -0700)]
gvpr doFlags: rewrite to avoid dynamic memory allocation

There is no need for this function to go through the overhead of sfio and
dynamic string construction just for this simple logic.

Related to #1873, #1998.

3 years agogvpr compileProg: remove some dead code
Matthew Fernandez [Sat, 11 Sep 2021 18:00:05 +0000 (11:00 -0700)]
gvpr compileProg: remove some dead code

The `doFlags` function, at a minimum, prints "\n" into its buffer so there is
never a case when the result is an empty string.

3 years agoremove unused 'ptchk' function
Matthew Fernandez [Sat, 11 Sep 2021 17:57:21 +0000 (10:57 -0700)]
remove unused 'ptchk' function

3 years agogvpr compile: make 'sfx' parameter const
Matthew Fernandez [Sat, 11 Sep 2021 17:54:13 +0000 (10:54 -0700)]
gvpr compile: make 'sfx' parameter const

The pointed to data is not modified within this function.

3 years agoMerge branch 'smattr/0d085d9e-4d11-43b3-9d0c-d940e49e10d5' into 'main'
Matthew Fernandez [Sat, 18 Sep 2021 21:35:58 +0000 (21:35 +0000)]
Merge branch 'smattr/0d085d9e-4d11-43b3-9d0c-d940e49e10d5' into 'main'

rewrite `INT2PTR` and `PTR2INT` as functions

See merge request graphviz/graphviz!2153

3 years ago lib/gvpr/compile.c: rewrite 'PTR2INT' macro as a function
Matthew Fernandez [Sat, 11 Sep 2021 19:31:39 +0000 (12:31 -0700)]
 lib/gvpr/compile.c: rewrite 'PTR2INT' macro as a function

This is more straightforward, type safe, and shorter. This also squashes 13
-Wbad-function-cast compiler warnings.

3 years agolib/gvpr/compile.c: rewrite 'INT2PTR' macro as a function
Matthew Fernandez [Sat, 11 Sep 2021 19:26:07 +0000 (12:26 -0700)]
lib/gvpr/compile.c: rewrite 'INT2PTR' macro as a function

This is more straightforward, type safe, and shorter.

3 years agoMerge branch 'smattr/1c348b36-65e2-4302-b77e-2c0e358a9066' into 'main'
Matthew Fernandez [Sat, 18 Sep 2021 20:33:35 +0000 (20:33 +0000)]
Merge branch 'smattr/1c348b36-65e2-4302-b77e-2c0e358a9066' into 'main'

squash some -Wmissing-field-initializer warnings

See merge request graphviz/graphviz!2152

3 years agop_doubleoctagon: squash a -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 16:04:04 +0000 (09:04 -0700)]
p_doubleoctagon: squash a -Wmissing-field-initializer warning

3 years agop_invhouse: squash a -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 16:03:03 +0000 (09:03 -0700)]
p_invhouse: squash a -Wmissing-field-initializer warning

3 years agop_invtrapezium: squash a -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 16:01:56 +0000 (09:01 -0700)]
p_invtrapezium: squash a -Wmissing-field-initializer warning

3 years agop_invtriangle: squash a -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 16:00:42 +0000 (09:00 -0700)]
p_invtriangle: squash a -Wmissing-field-initializer warning

3 years agop_doublecircle: squash a -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 15:59:42 +0000 (08:59 -0700)]
p_doublecircle: squash a -Wmissing-field-initializer warning

3 years agop_cylinder: squash -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 15:58:45 +0000 (08:58 -0700)]
p_cylinder: squash -Wmissing-field-initializer warning

3 years agop_underline: squash a -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 15:57:04 +0000 (08:57 -0700)]
p_underline: squash a -Wmissing-field-initializer warning

3 years agop_component: squash -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 15:56:18 +0000 (08:56 -0700)]
p_component: squash -Wmissing-field-initializer warning

3 years agop_box3d: squash a -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 15:54:46 +0000 (08:54 -0700)]
p_box3d: squash a -Wmissing-field-initializer warning

3 years agop_folder: squash a -Wmissing-field-initializer warning
Matthew Fernandez [Sat, 11 Sep 2021 15:53:55 +0000 (08:53 -0700)]
p_folder: squash a -Wmissing-field-initializer warning

3 years agoMerge branch 'smattr/f144d6f4-ad9a-4600-815b-d8a29575145d' into 'main'
Matthew Fernandez [Sat, 18 Sep 2021 18:14:25 +0000 (18:14 +0000)]
Merge branch 'smattr/f144d6f4-ad9a-4600-815b-d8a29575145d' into 'main'

teach the Autotools build system that PHP headers are not part of Graphviz

See merge request graphviz/graphviz!2155

3 years agoteach the Autotools build system that PHP headers are not part of Graphviz
Matthew Fernandez [Sat, 11 Sep 2021 23:59:48 +0000 (16:59 -0700)]
teach the Autotools build system that PHP headers are not part of Graphviz

tl;dr: this removes 166 spurious compiler warnings.

When building the Graphviz PHP bindings, PHP headers are included and the build
system was treating these as local includes; things to be warned about. With PHP
7, this was generating a *lot* of warnings. Many of these issues are already
fixed upstream in PHP but, moreover, these files are not part of Graphviz and
warnings about them should not be part of the Graphviz build.

This commit teaches the compiler that the PHP headers are system headers, not
local headers, and warnings about them should be suppressed.

Some open questions:

  1. I explored finding an alternative `--includes` option to `php-config` that
     would give `-isystem` prefixed paths instead of `-I` prefixed paths. It
     would be cleaner than this commit to do such a thing in configure.ac, but
     such an option does not appear to exist.

  2. Vim highlights the use of `$(patsubst …)` as if it is an error. Is it
     illegal to use GNU Make functions in Makefile.am files? I do not think so,
     but given how long both Autotools and Vim have co-existed for, I am
     wondering if this highlighting is deliberate and telling me something I am
     missing.

3 years agoMerge branch 'improve-cygwin-cmake-build' into 'main'
Magnus Jacobsson [Sat, 18 Sep 2021 07:15:36 +0000 (07:15 +0000)]
Merge branch 'improve-cygwin-cmake-build' into 'main'

Improve crlf handling in windows-cygwin-cmake-build CI job

See merge request graphviz/graphviz!2165

3 years agoCI: remove obsolete exporting of SHELLOPTS = "igncr" in windows-cygwin-cmake-build
Magnus Jacobsson [Wed, 15 Sep 2021 17:10:52 +0000 (19:10 +0200)]
CI: remove obsolete exporting of SHELLOPTS = "igncr" in windows-cygwin-cmake-build

This is no longer necessary since crlf is now replaced with lf in all
text files in the repository before Cygwin starts.

Exporting SHELLOPTS has the negative side effect that other flags such
as -e, -u and -x are inherited by child processes which could cause
invoked bash scripts to fail (because of -u) and abort (because of -e)
unintentionally. While this does not happen in the current Cygwin
CMake build, this has been observed in Cygwin autotools builds that
will be introduced in an upcoming MR. This commit ensures that this
can not occur in the future for CMake builds either.

The -x option is more or less harmless, but causes excessive logging
in invoked scripts. This can be seen in
e.g. https://gitlab.com/graphviz/graphviz/-/jobs/1593005342.

3 years agoCI: change crlf to lf in worktree in windows-cygwin-cmake-build
Magnus Jacobsson [Wed, 15 Sep 2021 17:06:46 +0000 (19:06 +0200)]
CI: change crlf to lf in worktree in windows-cygwin-cmake-build

Replace crlf with lf in all text files in the worktree before starting
Cygwin.

This will allow an upcoming commit to stop exporting SHELLOPTS =
"igncr" which has some negative side effects explained in that commit.

3 years agoCI: correct name of version file to archive in windows-cygwin-cmake-build job
Magnus Jacobsson [Wed, 15 Sep 2021 10:30:59 +0000 (12:30 +0200)]
CI: correct name of version file to archive in windows-cygwin-cmake-build job

The name was changed in c188de232323285caabb7f96c5822dec2db99645 was
missed when https://gitlab.com/graphviz/graphviz/-/merge_requests/2137
was rebased.

3 years agoci/build.sh: CMake: use pushd and popd instead of cd
Magnus Jacobsson [Wed, 15 Sep 2021 17:04:28 +0000 (19:04 +0200)]
ci/build.sh: CMake: use pushd and popd instead of cd

3 years agoMerge branch 'smattr/4878700D-5019-4BF2-B61B-60F2AB2DF3E7' into 'main'
Matthew Fernandez [Thu, 16 Sep 2021 05:25:04 +0000 (05:25 +0000)]
Merge branch 'smattr/4878700D-5019-4BF2-B61B-60F2AB2DF3E7' into 'main'

fix some of Stephen's posted warnings

See merge request graphviz/graphviz!2151

3 years agosmyrna update_columns: fix incorrect call to initGrid
Matthew Fernandez [Fri, 10 Sep 2021 04:31:02 +0000 (21:31 -0700)]
smyrna update_columns: fix incorrect call to initGrid

Thanks to backwards compatibility with K&R C, a function declared with no
parameter list takes an unspecified number of parameters. So it is legal to call
such a function with any arguments. Nevertheless on macOS Clang notices:

  tvnodes.c:354:18: warning: too many arguments in call to 'initGrid'

as noted by Stephen.¹ This commit both fixes the call and alters `initGrid` to
have a more strict signature. This appears to be the correct fix to me as `str`
is duped into `g->flds` below this which is what I think the mistaken call to
`initGrid` believed was happening inside `initGrid`.

¹ https://forum.graphviz.org/t/tracking-down-warnings-old-news-to-some-of-you/821

3 years agosmyrna renderSelectedNodes: fix no-op loop
Matthew Fernandez [Fri, 10 Sep 2021 04:28:21 +0000 (21:28 -0700)]
smyrna renderSelectedNodes: fix no-op loop

This condition was pretty clearly meant to guard the `continue`, not nothing. On
macOS, Clang dutifully warns:

  topviewfuncs.c:276:21: warning: if statement has empty body [-Wempty-body]

as noted by Stephen.¹

¹ https://forum.graphviz.org/t/tracking-down-warnings-old-news-to-some-of-you/821

3 years agosmyrna object_color: rephrase to make initialization of 'vis' more obvious
Matthew Fernandez [Fri, 10 Sep 2021 04:24:36 +0000 (21:24 -0700)]
smyrna object_color: rephrase to make initialization of 'vis' more obvious

Auditing all call sites of this function reveals it is only ever called with
edges and nodes. But the compiler could not see enough to know this. On macOS,
Clang dutifully warns:

  topviewfuncs.c:165:13: warning: variable 'vis' is used uninitialized whenever
    'if' condition is false [-Wsometimes-uninitialized]

as noted by Stephen.¹

¹ https://forum.graphviz.org/t/tracking-down-warnings-old-news-to-some-of-you/821

3 years agolefty: remove unused 'myyylex'
Matthew Fernandez [Fri, 10 Sep 2021 04:20:24 +0000 (21:20 -0700)]
lefty: remove unused 'myyylex'

On macOS, Clang correctly warns:

  dotlex.c:50:20: warning: all paths through this function will call itself
    [-Winfinite-recursion]

As noted by Stephen.¹

¹ https://forum.graphviz.org/t/tracking-down-warnings-old-news-to-some-of-you/821

3 years agogv2gml: use C99 support to portably print uint64_t variables
Matthew Fernandez [Fri, 10 Sep 2021 04:15:23 +0000 (21:15 -0700)]
gv2gml: use C99 support to portably print uint64_t variables

This squashes a number of -Wformat compiler warnings, as reported by Stephen.¹

¹ https://forum.graphviz.org/t/tracking-down-warnings-old-news-to-some-of-you/821

3 years agoMerge branch 'smattr/40cab147-e739-4c48-8774-ed75ce2dc89a' into 'main'
Matthew Fernandez [Thu, 16 Sep 2021 04:29:31 +0000 (04:29 +0000)]
Merge branch 'smattr/40cab147-e739-4c48-8774-ed75ce2dc89a' into 'main'

some neatogen clean up

See merge request graphviz/graphviz!2150

3 years agoELleftbnd: remove unnecessary for loop condition
Matthew Fernandez [Fri, 10 Sep 2021 01:35:48 +0000 (18:35 -0700)]
ELleftbnd: remove unnecessary for loop condition

An empty condition is the same as true/1.

3 years agolib/neatogen/hedges.c: abbreviate increment, decrement
Matthew Fernandez [Fri, 10 Sep 2021 01:35:19 +0000 (18:35 -0700)]
lib/neatogen/hedges.c: abbreviate increment, decrement

3 years agoright_of: use a C99 bool for 'right_of_site' for clarity
Matthew Fernandez [Fri, 10 Sep 2021 01:32:33 +0000 (18:32 -0700)]
right_of: use a C99 bool for 'right_of_site' for clarity

3 years agohintersect: use a C99 bool for 'right_of_site' for clarity
Matthew Fernandez [Fri, 10 Sep 2021 01:30:25 +0000 (18:30 -0700)]
hintersect: use a C99 bool for 'right_of_site' for clarity

3 years agohintersect: reflow some text
Matthew Fernandez [Fri, 10 Sep 2021 01:29:52 +0000 (18:29 -0700)]
hintersect: reflow some text

3 years agoright_of: remove unnecessary bitwise operations
Matthew Fernandez [Fri, 10 Sep 2021 01:26:38 +0000 (18:26 -0700)]
right_of: remove unnecessary bitwise operations

This code was using bitwise operations to substitute for logical boolean
operators. This is sometimes justified, to avoid the short-circuit behavior of
the logical operators that can impair CPU pre-fetching/speculation. However, in
this situation this code is not on a hot path and the bitwise operators were
just making this code harder to read.

3 years agolib/neatogen/hedges.c: remove unnecessary bracketing
Matthew Fernandez [Fri, 10 Sep 2021 01:26:13 +0000 (18:26 -0700)]
lib/neatogen/hedges.c: remove unnecessary bracketing

3 years agolib/neatogen/hedges.c: remove unnecessary casts
Matthew Fernandez [Fri, 10 Sep 2021 01:24:11 +0000 (18:24 -0700)]
lib/neatogen/hedges.c: remove unnecessary casts

3 years agoremove unnecessary casts of 'getfree' return value
Matthew Fernandez [Fri, 10 Sep 2021 01:21:08 +0000 (18:21 -0700)]
remove unnecessary casts of 'getfree' return value

3 years agofdpAdjust: remove some unnecessary bracketing
Matthew Fernandez [Fri, 10 Sep 2021 01:06:14 +0000 (18:06 -0700)]
fdpAdjust: remove some unnecessary bracketing

3 years agofdpAdjust: reflow some text
Matthew Fernandez [Fri, 10 Sep 2021 01:06:05 +0000 (18:06 -0700)]
fdpAdjust: reflow some text

3 years agorePos: abbreviate some scaling
Matthew Fernandez [Fri, 10 Sep 2021 01:03:51 +0000 (18:03 -0700)]
rePos: abbreviate some scaling

3 years agonewpos: abbreviate some accumulation
Matthew Fernandez [Fri, 10 Sep 2021 01:01:58 +0000 (18:01 -0700)]
newpos: abbreviate some accumulation

3 years agoareaOf: reflow some text
Matthew Fernandez [Fri, 10 Sep 2021 01:00:50 +0000 (18:00 -0700)]
areaOf: reflow some text

3 years agocountOverlap: reflow some text
Matthew Fernandez [Fri, 10 Sep 2021 00:59:47 +0000 (17:59 -0700)]
countOverlap: reflow some text

3 years agogeomUpdate: rephrase and condense some open coded fmax/fmin
Matthew Fernandez [Fri, 10 Sep 2021 00:57:07 +0000 (17:57 -0700)]
geomUpdate: rephrase and condense some open coded fmax/fmin

3 years agoscomp: remove unnecessary brackets
Matthew Fernandez [Fri, 10 Sep 2021 00:53:49 +0000 (17:53 -0700)]
scomp: remove unnecessary brackets

3 years agochkBoundBox: rephrase and condense some open coded fmax/fmin
Matthew Fernandez [Fri, 10 Sep 2021 00:52:21 +0000 (17:52 -0700)]
chkBoundBox: rephrase and condense some open coded fmax/fmin

3 years agoMerge branch 'smattr/210FD7B7-14C5-437F-BD2D-064D7A0B0026' into 'main'
Matthew Fernandez [Wed, 15 Sep 2021 14:44:29 +0000 (14:44 +0000)]
Merge branch 'smattr/210FD7B7-14C5-437F-BD2D-064D7A0B0026' into 'main'

fix: do not overwrite exparse.h during MSBuild compilation

See merge request graphviz/graphviz!2163

3 years agofix: do not overwrite exparse.h during MSBuild compilation
Matthew Fernandez [Wed, 15 Sep 2021 00:14:10 +0000 (17:14 -0700)]
fix: do not overwrite exparse.h during MSBuild compilation

Commit 09973560cc67c5277df8732ebba75da784afbe51 altered exparse.h to be a static
checked-in file instead of generated by Bison. This passed CI testing, but
unfortunately it was not noticed that on Windows MSBuild this resulted in the
build process still generating exparse.h and overwriting the in-repo copy.

This change reverts the Bison command used during MSBuild to generate the
default y.tab.c/y.tab.h output, more closely aligning it with the other build
systems.

3 years agoMerge branch 'smattr/4B281EFC-D08A-45E1-BAE8-5A2DE694D6E5' into 'main'
Matthew Fernandez [Tue, 14 Sep 2021 15:50:52 +0000 (15:50 +0000)]
Merge branch 'smattr/4B281EFC-D08A-45E1-BAE8-5A2DE694D6E5' into 'main'

smyrna: remove trackball code

See merge request graphviz/graphviz!2159

3 years agosmyrna: remove trackball code
Matthew Fernandez [Mon, 13 Sep 2021 04:45:33 +0000 (21:45 -0700)]
smyrna: remove trackball code

Nothing in the code base uses this.

3 years agoMerge branch 'smattr/64a6a7d8-d61a-406c-9491-4e7105d1a880' into 'main'
Matthew Fernandez [Tue, 14 Sep 2021 14:50:46 +0000 (14:50 +0000)]
Merge branch 'smattr/64a6a7d8-d61a-406c-9491-4e7105d1a880' into 'main'

CMake: generate gzipped man pages if possible

Closes #1883

See merge request graphviz/graphviz!2162

3 years agoCMake: generate gzipped man pages if possible
Matthew Fernandez [Tue, 14 Sep 2021 02:57:46 +0000 (19:57 -0700)]
CMake: generate gzipped man pages if possible

On most platforms, man has built in support for reading gzipped man pages so it
is an advantage to compress these at build time to reduce Graphviz’ on-disk
footprint.

Closes #1883.

3 years agoMerge branch 'smattr/790ff9fb-e333-430a-bbbf-8805c62a12d6' into 'main'
Matthew Fernandez [Mon, 13 Sep 2021 15:49:49 +0000 (15:49 +0000)]
Merge branch 'smattr/790ff9fb-e333-430a-bbbf-8805c62a12d6' into 'main'

sed-removal motivated changes

See merge request graphviz/graphviz!2144

3 years agostop re-enabling '-Wall' with --enable-debug
Matthew Fernandez [Mon, 6 Sep 2021 00:34:07 +0000 (17:34 -0700)]
stop re-enabling '-Wall' with --enable-debug

In commit 7d0a6af5edd4cd1408f04548bc0e49cf8dfa5ac2 that added this code, it is
not clear what the purpose of this was. Compiler warnings and more-debuggable
compiler outputs are completely orthogonal things. Now configure.ac
unconditionally enables `-Wall` earlier so this code is redundant.

3 years agostop attempting to suppress double '-O?' with --enable-debug
Matthew Fernandez [Mon, 6 Sep 2021 00:31:49 +0000 (17:31 -0700)]
stop attempting to suppress double '-O?' with --enable-debug

Similar to the prior commit, there is little advantage to these error prone
gymnastics when the compiler is perfectly happy to let a later option supersede
an earlier one. Note that for compilers that are not GCC or ICC, this means
there optimization flags are no longer altered when passing `--enable-debug`.

Related to #2115.

3 years agostop attempting to suppress double '-g' with --enable-debug
Matthew Fernandez [Mon, 6 Sep 2021 00:23:40 +0000 (17:23 -0700)]
stop attempting to suppress double '-g' with --enable-debug

This reverts part of 3b7da5bc0345872efcf011c9c614cc27f82b9998. It is unclear
whether this was a typo or just an insufficiently scoped attempt to clean up
build flags. Of the problems with this code, the main ones were:

  1. It seems somewhat purposeless to suppress `-g` only to just re-add it. GCC
     and ICC can both cope with duplicate `-g` options. It seems purely
     aesthetically-motivated gymnastics to try and pass the compiler a sole
     `-g`.

  2. The scope of things that matched this replacement was too wide. For
     example, a `-ggdb` option would be mangled into `gdb` which is almost
     certainly not what the user intended and would result in cryptic build
     errors. Something like `-fprofile-generate` would be mangled into
     `-fprofileenerate` resulting in similarly confusing build errors.

Related to #2115.

3 years agoremove Guile hack for SWIG-generated code
Matthew Fernandez [Sun, 5 Sep 2021 23:43:44 +0000 (16:43 -0700)]
remove Guile hack for SWIG-generated code

This effectively reverts 34d39968f1412986c90f800db7a9f816e0c0d35a. So called
“Guile GH” that this code was attempting to work around was removed from SWIG in
SWIG commit b819d2a91e951508cf84dc2d78fc7d57391c9dca in 2013. This made it into
SWIG release 2.0.10 also in 2013.

Related to #2115.

3 years agortest.py: avoid the use of sed
Matthew Fernandez [Sun, 5 Sep 2021 23:24:05 +0000 (16:24 -0700)]
rtest.py: avoid the use of sed

Related to #2115.

3 years agogvtest.py: also allow 'dst' parameter to be a string
Matthew Fernandez [Sun, 5 Sep 2021 23:23:18 +0000 (16:23 -0700)]
gvtest.py: also allow 'dst' parameter to be a string

Allowing both `pathlib.Path` and string is more consistent with what 'dst' can
be within this function.

3 years agogvtest.py: fix: use os.remove instead of pathlib.unlink to remove a file
Matthew Fernandez [Sun, 5 Sep 2021 22:56:27 +0000 (15:56 -0700)]
gvtest.py: fix: use os.remove instead of pathlib.unlink to remove a file

There were two problems with using pathlib.unlink here:

  1. If the caller did not pass in a value for `dst`, it was assigned to the
     second return value of a `tempfile.mkstemp` call. That is, `dst` would be a
     string, not a `pathlib.Path`, and calling `.unlink()` would fail
     cryptically.

  2. The `missing_ok` parameter which this code was using was only added to
     `pathlib.unlink` in Python 3.8. The stated Python baseline for Graphviz
     currently is Python 3.6. If this code was reached with Python < 3.8 it
     would result in an exception, obscuring the original problem.

3 years agoMerge branch 'smattr/B74C4F78-BCD7-4583-AF1E-08B7BB49E964' into 'main'
Matthew Fernandez [Mon, 13 Sep 2021 14:43:00 +0000 (14:43 +0000)]
Merge branch 'smattr/B74C4F78-BCD7-4583-AF1E-08B7BB49E964' into 'main'

fix compilation errors with Bison 3.8

Closes #2127

See merge request graphviz/graphviz!2157

3 years agofix: re-align dotlex’s 'yyerror' with that expected by Bison
Matthew Fernandez [Sun, 12 Sep 2021 21:44:02 +0000 (14:44 -0700)]
fix: re-align dotlex’s 'yyerror' with that expected by Bison

Bison 3.8 now emits a prototype for `yyerror`:¹

  To comply with the latest POSIX standard, in Yacc compatibility mode
  (options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
  yylex.  In some situations, this is breaking compatibility: if the user
  has already declared these functions but with some differences (e.g., to
  declare them as static, or to use specific attributes), the generated
  parser will fail to compile.  To disable these prototypes, #define yyerror
  (to `yyerror`), and likewise for yylex.

Because the generated prototype takes a const parameter,² this prototype
conflicts with the implementation in dotlex.c causing a compilation error.
Rather than the work around suggested by the Bison notes, this change simply
re-aligns `yyerror` with the Bison default.

Fixed #2127.

¹ https://github.com/akimd/bison/blob/master/NEWS
² https://www.gnu.org/software/bison/manual/html_node/Error-Reporting-Function.html

3 years agofix: take a const parameter in 'gmlerror'
Matthew Fernandez [Sun, 12 Sep 2021 21:07:07 +0000 (14:07 -0700)]
fix: take a const parameter in 'gmlerror'

This function does not modify the pointed to data of its argument. However, the
immediate problem this change is addressing is that Bison 3.8 now emits a
prototype for this function:¹

  To comply with the latest POSIX standard, in Yacc compatibility mode
  (options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
  yylex.  In some situations, this is breaking compatibility: if the user
  has already declared these functions but with some differences (e.g., to
  declare them as static, or to use specific attributes), the generated
  parser will fail to compile.  To disable these prototypes, #define yyerror
  (to `yyerror`), and likewise for yylex.

Because the generated prototype takes a const parameter,² these two prototypes
now conflict causing a compilation error. Rather than the work around suggested
by the Bison notes, this change simply re-aligns `gmlerror` with the Bison
default.

Related to #2127.

¹ https://github.com/akimd/bison/blob/master/NEWS
² https://www.gnu.org/software/bison/manual/html_node/Error-Reporting-Function.html

3 years agofix: take a const parameter in 'aagerror'
Matthew Fernandez [Sun, 12 Sep 2021 20:00:00 +0000 (13:00 -0700)]
fix: take a const parameter in 'aagerror'

This function does not modify the pointed to data of its argument. However, the
immediate problem this change is addressing is that Bison 3.8 now emits a
prototype for this function:¹

  To comply with the latest POSIX standard, in Yacc compatibility mode
  (options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
  yylex.  In some situations, this is breaking compatibility: if the user
  has already declared these functions but with some differences (e.g., to
  declare them as static, or to use specific attributes), the generated
  parser will fail to compile.  To disable these prototypes, #define yyerror
  (to `yyerror`), and likewise for yylex.

Because the generated prototype takes a const parameter,² these two prototypes
now conflict causing a compilation error. Rather than the work around suggested
by the Bison notes, this change simply re-aligns `aagerror` with the Bison
default.

Related to #2127.

¹ https://github.com/akimd/bison/blob/master/NEWS
² https://www.gnu.org/software/bison/manual/html_node/Error-Reporting-Function.html

3 years agoexpr trace: remove some unnecessary bracketing
Matthew Fernandez [Sun, 12 Sep 2021 19:00:26 +0000 (12:00 -0700)]
expr trace: remove some unnecessary bracketing

3 years agofix: alter expr’s parser’s prefix and introduce a correct yyerror analogue
Matthew Fernandez [Sun, 12 Sep 2021 18:47:49 +0000 (11:47 -0700)]
fix: alter expr’s parser’s prefix and introduce a correct yyerror analogue

Bison documents the `yyerror` function that is expected to be supplied by the
user as taking a single string argument.¹ However expr’s parser was redirecting
this to `exerror`, a variadic function. This mostly worked out fine, but only
coincidentally due to calling conventions aligning.

In Bison 3.8, prototypes for `yyerror` are now generated:²

  To comply with the latest POSIX standard, in Yacc compatibility mode
  (options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
  yylex.  In some situations, this is breaking compatibility: if the user
  has already declared these functions but with some differences (e.g., to
  declare them as static, or to use specific attributes), the generated
  parser will fail to compile.  To disable these prototypes, #define yyerror
  (to `yyerror`), and likewise for yylex.

This causes compilation failures due to type signature mismatches between the
Bison-generated prototype and the hand written `exerror` prototype. Rather than
apply Bison’s suggested work around, this commit instead changes the prefix used
for this parser and introduces a short trampoline, `ex_error` to handle
differences between the calling conventions. Not only does this fix compilation
errors, but it also makes this code robust against Bison issuing error messages
containing formatting codes (e.g. "%s") which `exerror` would previously have
misinterpreted as directives to unpack further arguments.

Note that this is backwards compatible. That is, the code following these
changes still works with Bison 3.7 series.

Related to #2127.

¹ https://www.gnu.org/software/bison/manual/html_node/Error-Reporting-Function.html
² https://github.com/akimd/bison/blob/master/NEWS

3 years agolib/expr/Makefile.am: remove some commented out lines
Matthew Fernandez [Sun, 12 Sep 2021 18:48:56 +0000 (11:48 -0700)]
lib/expr/Makefile.am: remove some commented out lines

3 years agoMerge branch 'smattr/68B86F65-F677-4E11-B60B-95C2114AAC79' into 'main' 2121-include-graphviz-source-in-svg-file
Matthew Fernandez [Sat, 11 Sep 2021 18:17:47 +0000 (18:17 +0000)]
Merge branch 'smattr/68B86F65-F677-4E11-B60B-95C2114AAC79' into 'main'

remove some legacy CI steps

See merge request graphviz/graphviz!2132

3 years agoremove /etc/redhat-release path in install script
Matthew Fernandez [Wed, 1 Sep 2021 01:56:50 +0000 (18:56 -0700)]
remove /etc/redhat-release path in install script

This is the equivalent of 80ccebe66e71c6da570ea5a27f62c21d8c8e39aa but applied
to the install script. Every Linux distro Graphviz CI now runs on appears to
have an /etc/os-release, so this code is unused.

3 years agoRevert "ensure ID_LIKE is always set on Debian in CI"
Matthew Fernandez [Wed, 1 Sep 2021 01:56:45 +0000 (18:56 -0700)]
Revert "ensure ID_LIKE is always set on Debian in CI"

This reverts the remainder of commit 029acf11d1d9a9eb20eddae84cadb61447da95f3.
There are currently no configured Linux CI jobs that run outside of Docker
containers, so this work around is unnecessary.

3 years agoMerge branch 'smattr/1B5CEE04-220F-4D0C-8A5C-0A16DD97F370' into 'main'
Matthew Fernandez [Sat, 11 Sep 2021 16:33:30 +0000 (16:33 +0000)]
Merge branch 'smattr/1B5CEE04-220F-4D0C-8A5C-0A16DD97F370' into 'main'

-Wfloat-equal based clean up

See merge request graphviz/graphviz!2138