]> granicus.if.org Git - graphviz/log
graphviz
3 years agoreturn an error value instead of longjmping out of find_ints
Matthew Fernandez [Sat, 10 Apr 2021 02:43:34 +0000 (19:43 -0700)]
return an error value instead of longjmping out of find_ints

Related to #1801.

3 years agoanticipate <0 meaning failure from find_ints
Matthew Fernandez [Sat, 10 Apr 2021 02:38:14 +0000 (19:38 -0700)]
anticipate <0 meaning failure from find_ints

find_ints does not currently return negative values. It returns only 0 or 1.
However, we would like to unravel a use of longjmp within it, so returning a
negative value to indicate an error is convenient. This is preparation for
upcoming changes. Related to #1801.

3 years agofix comment typo
Matthew Fernandez [Sat, 10 Apr 2021 02:26:37 +0000 (19:26 -0700)]
fix comment typo

3 years agoMerge branch 'smattr/a2c0e10b-3770-4314-9761-004b3181b192' into 'main'
Matthew Fernandez [Sun, 18 Apr 2021 00:29:05 +0000 (00:29 +0000)]
Merge branch 'smattr/a2c0e10b-3770-4314-9761-004b3181b192' into 'main'

observe CFLAGS and LDFLAGS when compiling C code during testing

See merge request graphviz/graphviz!1903

3 years agoecho C compiler commands in the test suite
Matthew Fernandez [Fri, 16 Apr 2021 00:29:57 +0000 (17:29 -0700)]
echo C compiler commands in the test suite

If a test compiles and/or runs C code and that test fails, included in the test
suite output will now be the commands themselves that were run, echoed in the
style of Bash’s set -x.

3 years agofix a Python type signature
Matthew Fernandez [Fri, 16 Apr 2021 00:29:30 +0000 (17:29 -0700)]
fix a Python type signature

Technically List[str] is the type of a list of strings, not [str].

3 years agosupport receiving C compiler flags in the test suite from the environment
Matthew Fernandez [Thu, 15 Apr 2021 04:07:09 +0000 (21:07 -0700)]
support receiving C compiler flags in the test suite from the environment

The environment variables CFLAGS and LDFLAGS now also effect the flags used with
the C compiler in the test suite, in addition to the build system. Related to
#1881.

3 years agouse general C compiler support for vmalloc test
Matthew Fernandez [Thu, 15 Apr 2021 04:02:47 +0000 (21:02 -0700)]
use general C compiler support for vmalloc test

Now that the test suite’s C compiler support also allows passing extra flags,
the vmalloc test no longer needs to do its work manually.

3 years agosupport passing extra args to the test suite’s C compiler interface
Matthew Fernandez [Thu, 15 Apr 2021 03:55:55 +0000 (20:55 -0700)]
support passing extra args to the test suite’s C compiler interface

3 years agoconsolidate common test suite functionality
Matthew Fernandez [Thu, 15 Apr 2021 03:36:52 +0000 (20:36 -0700)]
consolidate common test suite functionality

In future we could grow this gvtest.py to be a more full featured library of
common functions we need in the Graphviz test suite.

3 years agoMerge branch 'smattr/2B83BB5F-5D3B-4537-A875-E8225842E9C7' into 'main'
Matthew Fernandez [Sat, 17 Apr 2021 23:47:13 +0000 (23:47 +0000)]
Merge branch 'smattr/2B83BB5F-5D3B-4537-A875-E8225842E9C7' into 'main'

visio plugin: further pointer and manual memory management clean up

See merge request graphviz/graphviz!1889

3 years agovisio plugin: manage _chars member of Text as a value instead of a pointer
Matthew Fernandez [Thu, 8 Apr 2021 00:39:33 +0000 (17:39 -0700)]
visio plugin: manage _chars member of Text as a value instead of a pointer

This member is never set to NULL and the Char class is not involved in any
inheritance hierarchy. So there is no need to heap-allocate it or pass it around
by pointer.

3 years agovisio plugin: manage _para member of Text as a value instead of a pointer
Matthew Fernandez [Thu, 8 Apr 2021 00:34:01 +0000 (17:34 -0700)]
visio plugin: manage _para member of Text as a value instead of a pointer

This member is never set to NULL and the Para class is not involved in any
inheritance hierarchy. So there is no need to heap-allocate it or pass it around
by pointer.

3 years agovisio plugin: use more modern #pragma once guards
Matthew Fernandez [Thu, 8 Apr 2021 00:27:12 +0000 (17:27 -0700)]
visio plugin: use more modern #pragma once guards

3 years agovisio plugin: manage _fill member of Graphic as a smart pointer
Matthew Fernandez [Thu, 8 Apr 2021 00:25:25 +0000 (17:25 -0700)]
visio plugin: manage _fill member of Graphic as a smart pointer

3 years agovisio plugin: manage _geom member of Graphic as a smart pointer
Matthew Fernandez [Thu, 8 Apr 2021 00:21:14 +0000 (17:21 -0700)]
visio plugin: manage _geom member of Graphic as a smart pointer

3 years agovisio plugin: manage _line member of Graphic as a value instead of pointer
Matthew Fernandez [Thu, 8 Apr 2021 00:10:31 +0000 (17:10 -0700)]
visio plugin: manage _line member of Graphic as a value instead of pointer

This member is never set to NULL and the Line class is not involved in any
inheritance hierarchy. So there is no need to heap-allocate it or pass it around
by pointer.

3 years agoMerge branch 'smattr/93449861-eaa3-4072-a1fc-0f7aa57f77eb' into 'main'
Matthew Fernandez [Sat, 17 Apr 2021 23:04:30 +0000 (23:04 +0000)]
Merge branch 'smattr/93449861-eaa3-4072-a1fc-0f7aa57f77eb' into 'main'

remove unnecessary lib/ast function

See merge request graphviz/graphviz!1892

3 years agoremove now no longer used pathbin.c
Matthew Fernandez [Sat, 10 Apr 2021 00:02:44 +0000 (17:02 -0700)]
remove now no longer used pathbin.c

3 years agoinline a getenv accessor and use a more appropriate return type
Matthew Fernandez [Sat, 10 Apr 2021 00:02:39 +0000 (17:02 -0700)]
inline a getenv accessor and use a more appropriate return type

3 years agoremove non-portable default for $PATH
Matthew Fernandez [Sat, 10 Apr 2021 00:02:34 +0000 (17:02 -0700)]
remove non-portable default for $PATH

Across the range of platforms Graphviz runs on, this is not a reasonable
default. E.g. Windows will have none of these paths and this is not even how one
separates paths in Windows $PATH. This is mostly a latent issue, as it is very
rare for $PATH to be unset.

3 years agoremove getenv("PATH") caching
Matthew Fernandez [Sat, 10 Apr 2021 00:02:25 +0000 (17:02 -0700)]
remove getenv("PATH") caching

On most modern platforms, getenv is accessing a static array in the address
space. So this caching does not add any benefit.

3 years agoMerge branch 'smattr/AB0E37EB-52FF-4036-8BF3-F01425B7486E' into 'main'
Matthew Fernandez [Sat, 17 Apr 2021 22:23:03 +0000 (22:23 +0000)]
Merge branch 'smattr/AB0E37EB-52FF-4036-8BF3-F01425B7486E' into 'main'

remove astquery prototype

See merge request graphviz/graphviz!1891

3 years agoremove astquery prototype
Matthew Fernandez [Fri, 9 Apr 2021 15:21:51 +0000 (08:21 -0700)]
remove astquery prototype

This function is not implemented.

3 years agoMerge branch 'smattr/ca8249f0-859f-412b-832d-55cdf8d7bab9' into 'main'
Matthew Fernandez [Sat, 17 Apr 2021 21:42:12 +0000 (21:42 +0000)]
Merge branch 'smattr/ca8249f0-859f-412b-832d-55cdf8d7bab9' into 'main'

squash some compiler warnings in lib/ortho

See merge request graphviz/graphviz!1890

3 years agoremove commented out code
Matthew Fernandez [Thu, 8 Apr 2021 04:55:42 +0000 (21:55 -0700)]
remove commented out code

3 years agoremove unused parameter e from addEdgeToNode
Matthew Fernandez [Thu, 8 Apr 2021 04:49:57 +0000 (21:49 -0700)]
remove unused parameter e from addEdgeToNode

3 years agoremove some commented out code
Matthew Fernandez [Thu, 8 Apr 2021 04:16:41 +0000 (21:16 -0700)]
remove some commented out code

3 years agotrack edge counts as size_t in ortho.c
Matthew Fernandez [Thu, 8 Apr 2021 04:13:21 +0000 (21:13 -0700)]
track edge counts as size_t in ortho.c

This fixes some -Wsign-conversion warnings at the expense of introducing some
-Wsign-compare warnings. The latter should be removed as we migrate the cell
count in mazes to size_t.

3 years agoremove unused parameter ix to emitEdge
Matthew Fernandez [Thu, 8 Apr 2021 04:07:28 +0000 (21:07 -0700)]
remove unused parameter ix to emitEdge

3 years agoremove an unnecessary cast
Matthew Fernandez [Thu, 8 Apr 2021 04:04:04 +0000 (21:04 -0700)]
remove an unnecessary cast

3 years agorepresent route array lengths as size_t
Matthew Fernandez [Thu, 8 Apr 2021 03:58:25 +0000 (20:58 -0700)]
represent route array lengths as size_t

This fixes one -Wsign-conversion warning, though introduces a -Wconversion
warning. We should be able to remove the latter as we continue cleaning up the
use of int for sizes.

3 years agoremove some commented out code
Matthew Fernandez [Thu, 8 Apr 2021 03:54:07 +0000 (20:54 -0700)]
remove some commented out code

3 years agosquash a -Wsign-conversion warning
Matthew Fernandez [Thu, 8 Apr 2021 03:44:02 +0000 (20:44 -0700)]
squash a -Wsign-conversion warning

3 years agosquash a -Wmissing-prototypes warning
Matthew Fernandez [Thu, 8 Apr 2021 03:39:19 +0000 (20:39 -0700)]
squash a -Wmissing-prototypes warning

3 years agosquash some -Wunused-parameter warnings
Matthew Fernandez [Thu, 8 Apr 2021 03:33:40 +0000 (20:33 -0700)]
squash some -Wunused-parameter warnings

3 years agosquash two -Wswitch-default warnings
Matthew Fernandez [Thu, 8 Apr 2021 03:30:10 +0000 (20:30 -0700)]
squash two -Wswitch-default warnings

3 years agosquash a -Wswitch-default warning
Matthew Fernandez [Thu, 8 Apr 2021 02:55:01 +0000 (19:55 -0700)]
squash a -Wswitch-default warning

3 years agosquash a -Wswitch-default warning
Matthew Fernandez [Thu, 8 Apr 2021 02:51:54 +0000 (19:51 -0700)]
squash a -Wswitch-default warning

3 years agosquash some -Wunused-parameter warnings
Matthew Fernandez [Thu, 8 Apr 2021 02:50:53 +0000 (19:50 -0700)]
squash some -Wunused-parameter warnings

3 years agouse a stronger type to squash a -Wconversion warning
Matthew Fernandez [Thu, 8 Apr 2021 02:44:10 +0000 (19:44 -0700)]
use a stronger type to squash a -Wconversion warning

3 years agoremove unused parameter route_list from assignTracks
Matthew Fernandez [Thu, 8 Apr 2021 02:42:25 +0000 (19:42 -0700)]
remove unused parameter route_list from assignTracks

3 years agoremove unused parameter nrtes from assignTracks
Matthew Fernandez [Thu, 8 Apr 2021 02:41:33 +0000 (19:41 -0700)]
remove unused parameter nrtes from assignTracks

3 years agoMerge branch 'smattr/CC513531-8BFC-4587-8816-4E41C4672694' into 'main'
Matthew Fernandez [Sat, 17 Apr 2021 21:01:28 +0000 (21:01 +0000)]
Merge branch 'smattr/CC513531-8BFC-4587-8816-4E41C4672694' into 'main'

some clean up of sfextern.c

See merge request graphviz/graphviz!1888

3 years agoswap some use of hand rolled NIL for the standard NULL
Matthew Fernandez [Tue, 6 Apr 2021 02:56:19 +0000 (19:56 -0700)]
swap some use of hand rolled NIL for the standard NULL

3 years agoremove unnecessary global initialization
Matthew Fernandez [Tue, 6 Apr 2021 02:52:23 +0000 (19:52 -0700)]
remove unnecessary global initialization

This structure is default-0-initialized.

3 years agoMerge branch 'smattr/5D993CF4-B158-4D08-AEFE-FC86452B0FF9' into 'main'
Matthew Fernandez [Sat, 17 Apr 2021 20:06:29 +0000 (20:06 +0000)]
Merge branch 'smattr/5D993CF4-B158-4D08-AEFE-FC86452B0FF9' into 'main'

Move back to 2.47 development series

See merge request graphviz/graphviz!1904

3 years agoMove back to 2.47 development series
Matthew Fernandez [Sat, 17 Apr 2021 19:20:32 +0000 (12:20 -0700)]
Move back to 2.47 development series

3 years agoMerge branch 'smattr/5689080F-D576-43E6-99D5-B96A4E4D6D98' into 'main' 2.47.1
Matthew Fernandez [Sat, 17 Apr 2021 19:19:13 +0000 (19:19 +0000)]
Merge branch 'smattr/5689080F-D576-43E6-99D5-B96A4E4D6D98' into 'main'

Stable release 2.47.1

See merge request graphviz/graphviz!1897

3 years agoStable release 2.47.1
Matthew Fernandez [Sun, 11 Apr 2021 23:23:48 +0000 (16:23 -0700)]
Stable release 2.47.1

3 years agoMerge branch 'fopen' into 'main'
Mark Hansen [Wed, 14 Apr 2021 10:10:01 +0000 (10:10 +0000)]
Merge branch 'fopen' into 'main'

Output more useful error message on fopen failure

See merge request graphviz/graphviz!1901

3 years agoOutput more useful error message on fopen failure
Mark Hansen [Tue, 13 Apr 2021 09:20:26 +0000 (19:20 +1000)]
Output more useful error message on fopen failure

This should help with bugs like
https://gitlab.com/graphviz/graphviz.gitlab.io/-/issues/86

3 years agoMerge branch 'smattr/556EAFC0-B0EF-4141-AB81-47E2C24419F9' into 'main'
Matthew Fernandez [Sat, 10 Apr 2021 22:33:36 +0000 (22:33 +0000)]
Merge branch 'smattr/556EAFC0-B0EF-4141-AB81-47E2C24419F9' into 'main'

squash C++ warnings

See merge request graphviz/graphviz!1881

3 years agoremove an unused variable
Matthew Fernandez [Sat, 3 Apr 2021 02:26:49 +0000 (19:26 -0700)]
remove an unused variable

Squashes a -Wunused-but-set-variable warning.

3 years agosquash -Wunused-parameter warnings
Matthew Fernandez [Sat, 3 Apr 2021 02:21:20 +0000 (19:21 -0700)]
squash -Wunused-parameter warnings

3 years agosquash -Wunused-parameter warnings
Matthew Fernandez [Sat, 3 Apr 2021 02:06:48 +0000 (19:06 -0700)]
squash -Wunused-parameter warnings

3 years agoLASI plugin: remove use of endl
Matthew Fernandez [Fri, 9 Apr 2021 04:02:54 +0000 (21:02 -0700)]
LASI plugin: remove use of endl

This is generally considered an anti-pattern in C++ these days.

3 years agoLASI plugin: remove unnecessary use of a pointer
Matthew Fernandez [Sat, 10 Apr 2021 01:50:44 +0000 (18:50 -0700)]
LASI plugin: remove unnecessary use of a pointer

3 years agoLASI plugin: use job context instead of globals
Matthew Fernandez [Fri, 9 Apr 2021 03:27:46 +0000 (20:27 -0700)]
LASI plugin: use job context instead of globals

The LASI plugin was using two global variables, making it impossible to process
multiple graphs with it at the same time. This change refactors it to use the
jobs context as other rendering plugins do.

3 years agodelete commented out code
Matthew Fernandez [Sat, 3 Apr 2021 02:00:27 +0000 (19:00 -0700)]
delete commented out code

3 years agoremove useless code
Matthew Fernandez [Sat, 3 Apr 2021 01:56:33 +0000 (18:56 -0700)]
remove useless code

This was added in the initial commit of VPSC,
03c20a55c921ac07599be2ae19ae34209ec0d02e. The comment was incorrect. This does
*not* limit iteration because the variable type is unsigned. That is, it is
always >= 0. This was caught by enabling CXXFLAGS+=-Wtype-limits.

3 years agosquash a -Wparentheses warning
Matthew Fernandez [Sat, 3 Apr 2021 01:54:18 +0000 (18:54 -0700)]
squash a -Wparentheses warning

3 years agosquash a -Wmisleading-indentation warning
Matthew Fernandez [Sat, 3 Apr 2021 01:52:29 +0000 (18:52 -0700)]
squash a -Wmisleading-indentation warning

3 years agoMerge branch 'smattr/1F78CB9B-13C5-4885-BAFA-8CB840D952FB' into 'main'
Matthew Fernandez [Sat, 10 Apr 2021 20:30:24 +0000 (20:30 +0000)]
Merge branch 'smattr/1F78CB9B-13C5-4885-BAFA-8CB840D952FB' into 'main'

general clean up

See merge request graphviz/graphviz!1886

3 years agopush a definition closer to its use
Matthew Fernandez [Sun, 4 Apr 2021 04:30:33 +0000 (21:30 -0700)]
push a definition closer to its use

3 years agoremove unused Info variable
Matthew Fernandez [Sun, 4 Apr 2021 04:17:29 +0000 (21:17 -0700)]
remove unused Info variable

3 years agoremove unused SFIO Version
Matthew Fernandez [Sun, 4 Apr 2021 02:42:41 +0000 (19:42 -0700)]
remove unused SFIO Version

3 years agoabbreviate some arithmetic
Matthew Fernandez [Sun, 4 Apr 2021 02:40:03 +0000 (19:40 -0700)]
abbreviate some arithmetic

3 years agoremove some unnecessary bracketing
Matthew Fernandez [Sun, 4 Apr 2021 02:39:51 +0000 (19:39 -0700)]
remove some unnecessary bracketing

3 years agoremove some unnecessary casts
Matthew Fernandez [Sun, 4 Apr 2021 02:22:21 +0000 (19:22 -0700)]
remove some unnecessary casts

These pointers coerce implicitly.

3 years agoremove some commented out code
Matthew Fernandez [Sun, 4 Apr 2021 02:14:56 +0000 (19:14 -0700)]
remove some commented out code

3 years agomark Origin as static const
Matthew Fernandez [Sun, 4 Apr 2021 02:10:28 +0000 (19:10 -0700)]
mark Origin as static const

This variable is not modified or used outside this file.

3 years agoMerge branch 'smattr/30a4bc3c-4d5a-4130-8a78-60712ab9805e' into 'main'
Matthew Fernandez [Sat, 10 Apr 2021 03:00:53 +0000 (03:00 +0000)]
Merge branch 'smattr/30a4bc3c-4d5a-4130-8a78-60712ab9805e' into 'main'

replace a use of sfstropen with malloc+vsnprintf

See merge request graphviz/graphviz!1884

3 years agoreplace a use of sfstropen with malloc+vsnprintf
Matthew Fernandez [Sat, 3 Apr 2021 20:13:02 +0000 (13:13 -0700)]
replace a use of sfstropen with malloc+vsnprintf

This is another step towards removing uses of sfstropen in the code base.
Related to #1873.

3 years agoadd missing #include
Matthew Fernandez [Sat, 3 Apr 2021 19:44:43 +0000 (12:44 -0700)]
add missing #include

3 years agoMerge branch 'smattr/19cb473f-0226-41d2-9f69-0fc1b45513ef' into 'main'
Matthew Fernandez [Sat, 10 Apr 2021 02:05:56 +0000 (02:05 +0000)]
Merge branch 'smattr/19cb473f-0226-41d2-9f69-0fc1b45513ef' into 'main'

remove another use of setjmp/longjmp

See merge request graphviz/graphviz!1883

3 years agoremove now-unused jmp_buf
Matthew Fernandez [Sat, 3 Apr 2021 19:35:30 +0000 (12:35 -0700)]
remove now-unused jmp_buf

Related to #1801.

3 years agoreturn NULL from deriveGraph to indicate failure
Matthew Fernandez [Sat, 3 Apr 2021 19:34:52 +0000 (12:34 -0700)]
return NULL from deriveGraph to indicate failure

Related to #1801.

3 years agoanticipate a NULL return from deriveGraph
Matthew Fernandez [Sat, 3 Apr 2021 19:33:22 +0000 (12:33 -0700)]
anticipate a NULL return from deriveGraph

Related to #1801.

3 years agoanticipate failure from layout
Matthew Fernandez [Sat, 3 Apr 2021 19:32:05 +0000 (12:32 -0700)]
anticipate failure from layout

Related to #1801.

3 years agoadd a return value to layout
Matthew Fernandez [Sat, 3 Apr 2021 19:31:08 +0000 (12:31 -0700)]
add a return value to layout

Related to #1801.

3 years agoanticipate failure from fdpLayout
Matthew Fernandez [Sat, 3 Apr 2021 19:28:59 +0000 (12:28 -0700)]
anticipate failure from fdpLayout

Related to #1801.

3 years agoadd a return value to fdpLayout
Matthew Fernandez [Sat, 3 Apr 2021 19:27:56 +0000 (12:27 -0700)]
add a return value to fdpLayout

Related to #1801.

3 years agodelete commented out code
Matthew Fernandez [Sat, 3 Apr 2021 19:22:42 +0000 (12:22 -0700)]
delete commented out code

3 years agoMerge remote-tracking branch 'origin/smattr/1EBF65AE-6292-4A55-B9E5-A01E28911B08...
Matthew Fernandez [Sat, 10 Apr 2021 01:21:47 +0000 (18:21 -0700)]
Merge remote-tracking branch 'origin/smattr/1EBF65AE-6292-4A55-B9E5-A01E28911B08' into main

3 years agoallow macOS CI tasks to run immediately
Matthew Fernandez [Sat, 3 Apr 2021 17:56:00 +0000 (10:56 -0700)]
allow macOS CI tasks to run immediately

The macOS tasks were, by default, blocking on the portable source generation.
However these tasks do not use the portable source or any prior stage’s
artifacts. Now that we have moved to shared macOS runners without caching, the
macOS CI tasks are the limiting factor on CI runtime. Cutting this dependency
should meaningfully impact this.

3 years agopropagate COLLECTION from macOS CI build tasks to macOS CI test tasks
Matthew Fernandez [Sat, 3 Apr 2021 18:50:37 +0000 (11:50 -0700)]
propagate COLLECTION from macOS CI build tasks to macOS CI test tasks

This is more straightforward and reliable than trying to keep multiple places
where we manually set the collection coherent.

3 years agofix: propagate VERSION from macOS build tasks to macOS CI test tasks
Matthew Fernandez [Sat, 3 Apr 2021 18:46:35 +0000 (11:46 -0700)]
fix: propagate VERSION from macOS build tasks to macOS CI test tasks

The macOS test tasks in CI were picking up the VERSION from the portable source
task, despite their build tasks using a different process to derive VERSION.
This change ensures they get the VERSION file their build task created.

3 years agoMerge branch 'fix-strcpy-param-overlap' into 'main'
Magnus Jacobsson [Fri, 9 Apr 2021 18:08:29 +0000 (18:08 +0000)]
Merge branch 'fix-strcpy-param-overlap' into 'main'

Fix AddressSanitizer: strcpy-param-overlap in gvconfig_libdir

Closes #1994

See merge request graphviz/graphviz!1887

3 years agoFix AddressSanitizer: strcpy-param-overlap in gvconfig_libdir
Magnus Jacobsson [Sun, 4 Apr 2021 14:54:29 +0000 (16:54 +0200)]
Fix AddressSanitizer: strcpy-param-overlap in gvconfig_libdir

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1994.

3 years agoMerge branch 'smattr/19C32E28-7A45-406A-A700-B74AB173D7FE' into 'main'
Matthew Fernandez [Thu, 8 Apr 2021 05:04:25 +0000 (05:04 +0000)]
Merge branch 'smattr/19C32E28-7A45-406A-A700-B74AB173D7FE' into 'main'

remove inlining of flip_rec_box

See merge request graphviz/graphviz!1880

3 years agoremove inlining of flip_rec_box
Matthew Fernandez [Fri, 2 Apr 2021 00:03:37 +0000 (17:03 -0700)]
remove inlining of flip_rec_box

With a modern compiler, the inline keyword is more or less ignored and the
compiler makes a (usually better) decision itself.

3 years agoMerge branch 'smattr/1DFCCF93-D5FA-4443-A701-9C65CC090280' into 'main'
Matthew Fernandez [Thu, 8 Apr 2021 02:43:35 +0000 (02:43 +0000)]
Merge branch 'smattr/1DFCCF93-D5FA-4443-A701-9C65CC090280' into 'main'

fix computation of minimum graph rank on large graphs

See merge request graphviz/graphviz!1879

3 years agofix computation of minimum graph rank on large graphs
Matthew Fernandez [Fri, 2 Apr 2021 00:02:19 +0000 (17:02 -0700)]
fix computation of minimum graph rank on large graphs

This code was using MAXSHORT as the maximum (unrealistically large) rank. That
is, start out with this value and assume all nodes will rank below this so we
can progressively step down. This was likely correct when the code was first
written. However, 97cb5fffdcaa97eadb76a9b82a026d084a6a94d9 altered the type used
for storing ranks from short to int to support larger graphs. That is, nodes in
a graph are now anticipated to have ranks in excess of 32767 (on e.g. x86). This
change did not update these algorithms to compensate.

The effect of this is that any graph whose nodes were all ranked >32767 would be
incorrectly judged to have a minimum rank of 32767. The present change fixes
this by realigning this to the limit of the new ranking type.

Note that this removes the last use MAXSHORT in the code base. Unfortunately we
cannot easily remove its definition without breaking API because the containing
header lib/common/arith.h is shipped.

3 years agoMerge branch 'smattr/BC4B3197-1AC8-4F9E-BCB8-CDF5BFE64A0D' into 'main'
Matthew Fernandez [Wed, 7 Apr 2021 05:12:57 +0000 (05:12 +0000)]
Merge branch 'smattr/BC4B3197-1AC8-4F9E-BCB8-CDF5BFE64A0D' into 'main'

use smart pointers to clean up Visio::Graphics

See merge request graphviz/graphviz!1878

3 years agooptimize some size()>0 checks
Matthew Fernandez [Thu, 1 Apr 2021 03:21:38 +0000 (20:21 -0700)]
optimize some size()>0 checks

The implementation of empty() is typically more efficient.

3 years agouse C++11 in-class member initialization to remove the need for an explicit ctor
Matthew Fernandez [Thu, 1 Apr 2021 02:12:35 +0000 (19:12 -0700)]
use C++11 in-class member initialization to remove the need for an explicit ctor

This is an equivalent way of saying the same thing.

3 years agoremove some explicit constructor calls
Matthew Fernandez [Thu, 1 Apr 2021 02:08:44 +0000 (19:08 -0700)]
remove some explicit constructor calls

These constructors are all called implicitly already.

3 years agouse range-based for loops to clean up some manual iteration
Matthew Fernandez [Thu, 1 Apr 2021 02:05:30 +0000 (19:05 -0700)]
use range-based for loops to clean up some manual iteration

Note that in once instance this modifies a loop that was skipping the first
element to not skip it. But this is a no-op the compiler should see through.

3 years agostore Graphics as managed pointers in Visio::Render instead of raw pointers
Matthew Fernandez [Thu, 1 Apr 2021 01:55:16 +0000 (18:55 -0700)]
store Graphics as managed pointers in Visio::Render instead of raw pointers

This lets us clean up some manual handling of these and stop worrying about
memory management. Note that Visio::Render::ClearGraphicsAndTexts touched in
this commit is effectively a hand written destructor for this class. Presumably
it was implemented in a time before destructors were standardized. We can likely
move the other collections affected here to using smart pointers too and remove
this function entirely eventually.