]> granicus.if.org Git - graphviz/log
graphviz
2 years agoremove Lefty test cases
Matthew Fernandez [Mon, 17 Jan 2022 04:40:37 +0000 (20:40 -0800)]
remove Lefty test cases

The Lefty tool is deprecated and planned to be removed.
1a4ad00b59cc1e1e9302fcbd1a205495ee59cab5 toggled it to default to disabled in
the Autotools build system. The present change is a preparatory commit for
dropping explicit re-enabling of it in CI, allowing it to no longer be compiled
in CI.

2 years agoMerge branch 'smattr/BC8175D4-61E0-42FB-B7FA-EFC605CC9333' into 'main'
Matthew Fernandez [Tue, 18 Jan 2022 16:40:27 +0000 (16:40 +0000)]
Merge branch 'smattr/BC8175D4-61E0-42FB-B7FA-EFC605CC9333' into 'main'

get_cycle_centroid: undo caching or cycle list

See merge request graphviz/graphviz!2414

2 years agoget_cycle_centroid: undo caching of 'cycle' list
Matthew Fernandez [Mon, 17 Jan 2022 16:09:11 +0000 (08:09 -0800)]
get_cycle_centroid: undo caching of 'cycle' list

This function attempted to save time by caching the results of a graph cycle
search and then reusing them in a future call. The logic used for this caching
is invalid. It compares graph pointers to see if it is operating on the same
graph as last time, but this can return a false positive if the previous graph
has been deallocated and a new (unrelated) graph has been allocated at the same
address.

This logic would eventually have to be unwound or adjusted in order to support
multithreading in this code too.

It is possible this is the root cause of the issue described in #2162, though I
was never able to reproduce that issue.

2 years agoMerge branch 'smattr/884E30F6-80F8-47C7-B083-88BC1718A1F5' into 'main'
Matthew Fernandez [Tue, 18 Jan 2022 07:22:45 +0000 (07:22 +0000)]
Merge branch 'smattr/884E30F6-80F8-47C7-B083-88BC1718A1F5' into 'main'

agglomerative_ink_bundling_internal: remove disabled code

See merge request graphviz/graphviz!2411

2 years agoagglomerative_ink_bundling_internal: remove disabled code
Matthew Fernandez [Sun, 16 Jan 2022 21:57:00 +0000 (13:57 -0800)]
agglomerative_ink_bundling_internal: remove disabled code

This code has been a no-op since its first addition in
0cd264937e210404c56c195b9b74749e41ffa332. Anything ANDed with `FALSE` is
`FALSE`.

2 years agoMerge branch 'fix-lneato-on-windows' into 'main'
Magnus Jacobsson [Mon, 17 Jan 2022 17:35:34 +0000 (17:35 +0000)]
Merge branch 'fix-lneato-on-windows' into 'main'

Fix flaky lneato usage on Windows

Closes #1934

See merge request graphviz/graphviz!2407

2 years agotest_tools: remove now obsolete workaround for flaky lneato usage
Magnus Jacobsson [Sun, 16 Jan 2022 12:24:46 +0000 (13:24 +0100)]
test_tools: remove now obsolete workaround for flaky lneato usage

2 years agolneato: Windows: correct argument interpretation with respect to unicode
Magnus Jacobsson [Sun, 16 Jan 2022 09:52:23 +0000 (10:52 +0100)]
lneato: Windows: correct argument interpretation with respect to unicode

Change from WinMain to wWinMain to handle unicode correctly and avoid
the flakiness of the test_tools test.

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

The culprit was probably this warning which now is removed:

C:\GitLab-Runner\builds\magjac\graphviz\cmd\lneato\mswin32\lneato.c(46,40): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPCWSTR' [C:\GitLab-Runner\builds\magjac\graphviz\cmd\lneato\lneato.vcxproj]

LPSTR is a char* and LPCWSTR is a const wchar_t*. The former points to
an array of 8-bit characters, while the latter points to an array of
16-bit characters. See
https://docs.microsoft.com/en-us/windows/win32/learnwin32/working-with-strings.

In order for the argument interpretation to work correctly after this
change, another change was necessary. The type of the argv variable is
LPWSTR which is a wchar_t* so we must use wcscmp and wide-character
literal string to get a correct 16-bit unicode character comparison.

Removes this warning:

C:\GitLab-Runner\builds\magjac\graphviz\cmd\lneato\mswin32\lneato.c(47,36): warning C4133: 'function': incompatible types - from 'LPWSTR' to 'const char *' [C:\GitLab-Runner\builds\magjac\graphviz\cmd\lneato\lneato.vcxproj]

Although not necessary, this commit also renames the lpCmdLine
argument to pCmdLine in order to match the naming in the wWinMain
signature.

This commit also removes the expectation that lneato should fail at
least one time out of 100 in the test_tools test. The actual
workaround for the flakiness will be removed in the next commit in
this series.

2 years agolneato: Windows: correct argument types to WinMain
Magnus Jacobsson [Sat, 15 Jan 2022 16:38:24 +0000 (17:38 +0100)]
lneato: Windows: correct argument types to WinMain

Fixes these warnings:

C:\GitLab-Runner\builds\magjac\graphviz\cmd\lneato\mswin32\lneato.c(27,28): warning C4028: formal parameter 1 different from declaration [C:\GitLab-Runner\builds\magjac\graphviz\cmd\lneato\lneato.vcxproj]
C:\GitLab-Runner\builds\magjac\graphviz\cmd\lneato\mswin32\lneato.c(27,46): warning C4028: formal parameter 2 different from declaration [C:\GitLab-Runner\builds\magjac\graphviz\cmd\lneato\lneato.vcxproj]

See
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-winmain.

2 years agolneato: Windows: replace obsolete PASCAL declaration with WINAPI
Magnus Jacobsson [Sat, 15 Jan 2022 16:35:11 +0000 (17:35 +0100)]
lneato: Windows: replace obsolete PASCAL declaration with WINAPI

See
https://docs.microsoft.com/en-us/cpp/cpp/obsolete-calling-conventions?view=msvc-170.

2 years agoMerge branch 'smattr/34de5d89-7e39-49ff-857a-325fd4169853' into 'main'
Matthew Fernandez [Sun, 16 Jan 2022 20:00:25 +0000 (20:00 +0000)]
Merge branch 'smattr/34de5d89-7e39-49ff-857a-325fd4169853' into 'main'

move the remainder of mingle into C++

Closes #2154

See merge request graphviz/graphviz!2405

2 years agonearest_neighbor_graph_ann: use a reference for 'nz0' instead of pointer
Matthew Fernandez [Sat, 15 Jan 2022 22:18:48 +0000 (14:18 -0800)]
nearest_neighbor_graph_ann: use a reference for 'nz0' instead of pointer

This parameter is non-nullable, so we can make the type signature reflect that.

2 years agoagglomerative_ink_bundling_internal: remove 'xx' manual memory management
Matthew Fernandez [Sat, 15 Jan 2022 22:13:52 +0000 (14:13 -0800)]
agglomerative_ink_bundling_internal: remove 'xx' manual memory management

2 years agoAgglomerative_Ink_Bundling: remove 'inks' manual memory management
Matthew Fernandez [Sat, 15 Jan 2022 22:11:29 +0000 (14:11 -0800)]
Agglomerative_Ink_Bundling: remove 'inks' manual memory management

2 years agoAgglomerative_Ink_Bundling: remove unused 'prev' pointers
Matthew Fernandez [Sat, 15 Jan 2022 22:04:37 +0000 (14:04 -0800)]
Agglomerative_Ink_Bundling: remove unused 'prev' pointers

This struct was used as a node in a doubly-linked list. But the back pointers
were never used. This commit simplifies it into a singly-linked-list.

2 years agolib/mingle headers: drop 'extern "C"'
Matthew Fernandez [Sat, 15 Jan 2022 21:41:51 +0000 (13:41 -0800)]
lib/mingle headers: drop 'extern "C"'

These headers are only used by C++ code, so they no longer need to fallback to C
linkage.

Gitlab: #2154

2 years agoAgglomerative_Ink_Bundling_new: remove 'pick' manual memory management
Matthew Fernandez [Sat, 15 Jan 2022 21:34:22 +0000 (13:34 -0800)]
Agglomerative_Ink_Bundling_new: remove 'pick' manual memory management

2 years agoAgglomerative_Ink_Bundling_establish: remove unused 'mask'
Matthew Fernandez [Sat, 15 Jan 2022 21:32:45 +0000 (13:32 -0800)]
Agglomerative_Ink_Bundling_establish: remove unused 'mask'

It is unclear to me what the purpose of this local was intended to be.
Furthermore it was being mis-allocated as if it were an array of doubles, not
ints.

2 years agoAgglomerative_Ink_Bundling_establish: remove 'matching' manual memory management
Matthew Fernandez [Sat, 15 Jan 2022 21:30:52 +0000 (13:30 -0800)]
Agglomerative_Ink_Bundling_establish: remove 'matching' manual memory management

Gitlab: #2154

2 years agoremove now unused 'Vector_*' API
Matthew Fernandez [Sat, 15 Jan 2022 21:27:46 +0000 (13:27 -0800)]
remove now unused 'Vector_*' API

2 years agoAgglomerative_Ink_Bundling_establish: replace 'cedges' with a 'std::vector'
Matthew Fernandez [Sat, 15 Jan 2022 21:24:20 +0000 (13:24 -0800)]
Agglomerative_Ink_Bundling_establish: replace 'cedges' with a 'std::vector'

This simplifies the code as well as making it significantly easier for humans
and compilers to understand what is going on here.

2 years agoagglomerative_bundling.c: move into C++
Matthew Fernandez [Sat, 15 Jan 2022 21:11:09 +0000 (13:11 -0800)]
agglomerative_bundling.c: move into C++

This completes moving all of lib/mingle into C++. Closes #2154.

2 years agoagglomerative_bundling.c: explicitly cast the results of 'realloc'
Matthew Fernandez [Sat, 15 Jan 2022 21:12:31 +0000 (13:12 -0800)]
agglomerative_bundling.c: explicitly cast the results of 'realloc'

This has no effect in C, but an upcoming change will move this code to C++ where
this is required.

Gitlab: #2154

2 years agoagglomerative_bundling.c: explicitly cast the results of 'malloc'
Matthew Fernandez [Sat, 15 Jan 2022 21:09:07 +0000 (13:09 -0800)]
agglomerative_bundling.c: explicitly cast the results of 'malloc'

This has no effect in C, but an upcoming change will move this code to C++ where
this is required.

Gitlab: #2154

2 years agoMerge branch 'smattr/4d675265-10af-4846-b248-df57d7ea3ae2' into 'main'
Matthew Fernandez [Sun, 16 Jan 2022 18:46:18 +0000 (18:46 +0000)]
Merge branch 'smattr/4d675265-10af-4846-b248-df57d7ea3ae2' into 'main'

more boolean → bool modernization

See merge request graphviz/graphviz!2406

2 years agoAPI BREAK: remove now-unused 'boolean' type
Matthew Fernandez [Sun, 16 Jan 2022 00:43:17 +0000 (16:43 -0800)]
API BREAK: remove now-unused 'boolean' type

2 years agoAPI BREAK: use C99 bools for booleans in 'GVC_common_s'
Matthew Fernandez [Sun, 16 Jan 2022 00:37:40 +0000 (16:37 -0800)]
API BREAK: use C99 bools for booleans in 'GVC_common_s'

2 years agoAPI BREAK: return a C99 bool from 'gvusershape_file_access'
Matthew Fernandez [Sun, 16 Jan 2022 00:31:42 +0000 (16:31 -0800)]
API BREAK: return a C99 bool from 'gvusershape_file_access'

2 years agoAPI BREAK: use a C99 bool for 'pccomps' output parameter
Matthew Fernandez [Sun, 16 Jan 2022 00:29:57 +0000 (16:29 -0800)]
API BREAK: use a C99 bool for 'pccomps' output parameter

2 years agoAPI BREAK: use a C99 bool array for 'pack_info.fixed'
Matthew Fernandez [Sun, 16 Jan 2022 00:27:42 +0000 (16:27 -0800)]
API BREAK: use a C99 bool array for 'pack_info.fixed'

2 years agoAPI BREAK: return a C99 bool from 'gvtextlayout_engine_t.textlayout'
Matthew Fernandez [Sun, 16 Jan 2022 00:16:40 +0000 (16:16 -0800)]
API BREAK: return a C99 bool from 'gvtextlayout_engine_t.textlayout'

2 years agoAPI BREAK: take a C99 bool in 'gvloadimage_engine_t.loadimage'
Matthew Fernandez [Sun, 16 Jan 2022 00:08:12 +0000 (16:08 -0800)]
API BREAK: take a C99 bool in 'gvloadimage_engine_t.loadimage'

2 years agoAPI BREAK: use a C99 bool for other 'GVJ_t' boolean fields
Matthew Fernandez [Sat, 15 Jan 2022 23:58:15 +0000 (15:58 -0800)]
API BREAK: use a C99 bool for other 'GVJ_t' boolean fields

2 years agoAPI BREAK: use a C99 bool for 'GVJ_t.external_context'
Matthew Fernandez [Sat, 15 Jan 2022 23:45:31 +0000 (15:45 -0800)]
API BREAK: use a C99 bool for 'GVJ_t.external_context'

2 years agoAPI BREAK: use a C99 bool for 'GVJ_t.device_sets_dpi'
Matthew Fernandez [Sat, 15 Jan 2022 23:42:33 +0000 (15:42 -0800)]
API BREAK: use a C99 bool for 'GVJ_t.device_sets_dpi'

2 years agoAPI BREAK: use a C99 bool for 'usershape_t.nocache'
Matthew Fernandez [Sat, 15 Jan 2022 23:39:39 +0000 (15:39 -0800)]
API BREAK: use a C99 bool for 'usershape_t.nocache'

2 years agoAPI BREAK: use a C99 bool for 'usershape_t.must_inline'
Matthew Fernandez [Sat, 15 Jan 2022 23:38:07 +0000 (15:38 -0800)]
API BREAK: use a C99 bool for 'usershape_t.must_inline'

2 years agoAPI BREAK: use unsigned types for 1-bit fields of 'obj_state_s'
Matthew Fernandez [Sat, 15 Jan 2022 23:34:23 +0000 (15:34 -0800)]
API BREAK: use unsigned types for 1-bit fields of 'obj_state_s'

This has little impact (the bit encoding of these fields is identical), but it
suppresses numerous -Wconversion warnings from the compiler, worried that an
implicit conversion from `1` to `-1` was unintended.

2 years agoAPI BREAK: use a C99 bool for 'Agedgeinfo_t.conc_opp_flag'
Matthew Fernandez [Sat, 15 Jan 2022 23:27:51 +0000 (15:27 -0800)]
API BREAK: use a C99 bool for 'Agedgeinfo_t.conc_opp_flag'

2 years agoAPI BREAK: use a C99 bool for 'Agnodeinfo_t.has_port'
Matthew Fernandez [Sat, 15 Jan 2022 23:26:06 +0000 (15:26 -0800)]
API BREAK: use a C99 bool for 'Agnodeinfo_t.has_port'

2 years agoAPI BREAK: use a C99 bool for 'Agnodeinfo_t.clustnode'
Matthew Fernandez [Sat, 15 Jan 2022 23:24:22 +0000 (15:24 -0800)]
API BREAK: use a C99 bool for 'Agnodeinfo_t.clustnode'

2 years agoMerge branch 'smattr/F84CFD8E-734D-47B0-A614-AD649741668A' into 'main'
Matthew Fernandez [Sun, 16 Jan 2022 02:00:55 +0000 (02:00 +0000)]
Merge branch 'smattr/F84CFD8E-734D-47B0-A614-AD649741668A' into 'main'

add test case for #1879

See merge request graphviz/graphviz!2404

2 years agoadd test case for #1879
Matthew Fernandez [Sun, 18 Apr 2021 21:40:11 +0000 (14:40 -0700)]
add test case for #1879

Unfortunately we cannot xfail this test with `strict=True` because this test
passes or fails across various different platforms with no discernible pattern
to me. Results from the current commit:

  * pass: CentOS 7, CentOS 7 CMake, Fedora 35, macOS, macOS CMake, Ubuntu 20.04,
          MinGW 32 CMake, MinGW 64 CMake
  * fail: Fedora 34, Ubuntu 18.04, Ubuntu 18.04 CMake, Ubuntu 21.04,
          Ubuntu 21.04 CMake, Ubuntu 21.10, Ubuntu 21.10 CMake,
          Windows all debug builds

2 years agoMerge branch 'smattr/af7ac83f-22ac-4fff-b0d2-b7136bfc5813' into 'main'
Matthew Fernandez [Sun, 16 Jan 2022 00:09:51 +0000 (00:09 +0000)]
Merge branch 'smattr/af7ac83f-22ac-4fff-b0d2-b7136bfc5813' into 'main'

more boolean → bool modernization

See merge request graphviz/graphviz!2403

2 years agoAPI BREAK: use a C99 bool for 'Agraphinfo.exact_ranksep'
Matthew Fernandez [Sat, 15 Jan 2022 19:00:32 +0000 (11:00 -0800)]
API BREAK: use a C99 bool for 'Agraphinfo.exact_ranksep'

2 years agoAPI BREAK: use a C99 bool for 'Agraphinfo.expanded'
Matthew Fernandez [Sat, 15 Jan 2022 18:59:15 +0000 (10:59 -0800)]
API BREAK: use a C99 bool for 'Agraphinfo.expanded'

2 years agoAPI BREAK: use a C99 bool for 'Agraphinfo.has_sinkrank'
Matthew Fernandez [Sat, 15 Jan 2022 18:57:58 +0000 (10:57 -0800)]
API BREAK: use a C99 bool for 'Agraphinfo.has_sinkrank'

2 years agoAPI BREAK: use a C99 bool for 'Agraphinfo.has_sourcerank'
Matthew Fernandez [Sat, 15 Jan 2022 18:56:42 +0000 (10:56 -0800)]
API BREAK: use a C99 bool for 'Agraphinfo.has_sourcerank'

2 years agoAPI BREAK: use a C99 bool for 'Agraphinfo.has_flat_edges'
Matthew Fernandez [Sat, 15 Jan 2022 18:55:26 +0000 (10:55 -0800)]
API BREAK: use a C99 bool for 'Agraphinfo.has_flat_edges'

2 years agoAPI BREAK: use a C99 bool for 'Agraphinfo_t.has_images'
Matthew Fernandez [Sat, 15 Jan 2022 18:53:15 +0000 (10:53 -0800)]
API BREAK: use a C99 bool for 'Agraphinfo_t.has_images'

2 years agoAPI BREAK: use C99 bools for 'layout_t' boolean fields
Matthew Fernandez [Sat, 15 Jan 2022 18:50:01 +0000 (10:50 -0800)]
API BREAK: use C99 bools for 'layout_t' boolean fields

2 years agoAPI BREAK: use C99 bools for 'rank_t' boolean fields
Matthew Fernandez [Sat, 15 Jan 2022 18:41:34 +0000 (10:41 -0800)]
API BREAK: use C99 bools for 'rank_t' boolean fields

2 years agoAPI BREAK: use a C99 bool for 'shape_desc.usershape' instead of a boolean
Matthew Fernandez [Sat, 15 Jan 2022 18:34:08 +0000 (10:34 -0800)]
API BREAK: use a C99 bool for 'shape_desc.usershape' instead of a boolean

2 years agoAPI BREAK: use C99 bools for 'textlabel_t' fields instead of booleans
Matthew Fernandez [Sat, 15 Jan 2022 18:31:55 +0000 (10:31 -0800)]
API BREAK: use C99 bools for 'textlabel_t' fields instead of booleans

2 years agomake_label: remove unnecessary casts
Matthew Fernandez [Sat, 15 Jan 2022 18:16:51 +0000 (10:16 -0800)]
make_label: remove unnecessary casts

2 years agolefty: use a C99 bool instead of int for 'htmlflag' in 'writeattr'
Matthew Fernandez [Sat, 15 Jan 2022 18:16:27 +0000 (10:16 -0800)]
lefty: use a C99 bool instead of int for 'htmlflag' in 'writeattr'

2 years agolefty: use a C99 bool instead of int for 'innetscape'
Matthew Fernandez [Sat, 15 Jan 2022 18:16:01 +0000 (10:16 -0800)]
lefty: use a C99 bool instead of int for 'innetscape'

2 years agolefty: return a C99 bool from 'boolop' instead of an int
Matthew Fernandez [Sat, 15 Jan 2022 18:13:09 +0000 (10:13 -0800)]
lefty: return a C99 bool from 'boolop' instead of an int

2 years agolefty AIX I/O: return a C99 bool from 'boolop' instead of an int
Matthew Fernandez [Sat, 15 Jan 2022 18:11:03 +0000 (10:11 -0800)]
lefty AIX I/O: return a C99 bool from 'boolop' instead of an int

2 years agoleft: take a C99 bool in 'buildpath' instead of an int
Matthew Fernandez [Sat, 15 Jan 2022 18:07:56 +0000 (10:07 -0800)]
left: take a C99 bool in 'buildpath' instead of an int

2 years agoAPI BREAK: use C99 bools for 'port' fields instead of booleans
Matthew Fernandez [Sat, 15 Jan 2022 17:51:44 +0000 (09:51 -0800)]
API BREAK: use C99 bools for 'port' fields instead of booleans

2 years agoAPI BREAK: use a C99 bool for 'isOrtho' instead of a boolean
Matthew Fernandez [Sat, 15 Jan 2022 17:38:05 +0000 (09:38 -0800)]
API BREAK: use a C99 bool for 'isOrtho' instead of a boolean

2 years agoAPI BREAK: use a C99 bool for 'ignoreSwap' instead of a boolean
Matthew Fernandez [Sat, 15 Jan 2022 17:33:10 +0000 (09:33 -0800)]
API BREAK: use a C99 bool for 'ignoreSwap' instead of a boolean

2 years agoAPI BREAK: return a C99 bool from 'swapEnds instead of a boolean
Matthew Fernandez [Sat, 15 Jan 2022 17:27:39 +0000 (09:27 -0800)]
API BREAK: return a C99 bool from 'swapEnds instead of a boolean

2 years agoAPI BREAK: return a C99 bool from 'splineMerge' instead of a boolean
Matthew Fernandez [Sat, 15 Jan 2022 17:19:21 +0000 (09:19 -0800)]
API BREAK: return a C99 bool from 'splineMerge' instead of a boolean

2 years agoAPI BREAK: return a C99 bool from 'insidefn' instead of a boolean
Matthew Fernandez [Sat, 15 Jan 2022 17:10:03 +0000 (09:10 -0800)]
API BREAK: return a C99 bool from 'insidefn' instead of a boolean

2 years agoMerge branch 'smattr/449D4938-41BE-4359-B1B0-6C19D1570E24' into 'main'
Matthew Fernandez [Sat, 15 Jan 2022 22:27:19 +0000 (22:27 +0000)]
Merge branch 'smattr/449D4938-41BE-4359-B1B0-6C19D1570E24' into 'main'

some Python tweaks to test code

See merge request graphviz/graphviz!2398

2 years agoshell-quote commands echoed during testing
Matthew Fernandez [Tue, 11 Jan 2022 01:23:49 +0000 (17:23 -0800)]
shell-quote commands echoed during testing

It is not typical that testing paths will contain things like spaces and other
characters that require quoting. But this change goes the extra mile to make
sure these echoed commands are always copy-pastable to re-execute them.

2 years agorun_c: [nfc] factor out an array addition
Matthew Fernandez [Sat, 15 Jan 2022 20:59:54 +0000 (12:59 -0800)]
run_c: [nfc] factor out an array addition

This will make an upcoming commit clearer and more concise.

2 years agorun_c: check return code of compiled program before returning
Matthew Fernandez [Tue, 11 Jan 2022 01:05:58 +0000 (17:05 -0800)]
run_c: check return code of compiled program before returning

Every call to `run_c` was immediately checking that the compiled program
succeeded. So by moving the check inside `run_c` itself we can write more
concise test cases.

2 years agoMerge branch 'smattr/5dbb61ed-6813-47f4-918d-6a6047f05fa9' into 'main'
Matthew Fernandez [Sat, 15 Jan 2022 18:13:38 +0000 (18:13 +0000)]
Merge branch 'smattr/5dbb61ed-6813-47f4-918d-6a6047f05fa9' into 'main'

simplification and reduction of macros

See merge request graphviz/graphviz!2402

2 years agoremove no-op 'agattrrec' casts
Matthew Fernandez [Fri, 14 Jan 2022 02:05:26 +0000 (18:05 -0800)]
remove no-op 'agattrrec' casts

2 years agoremove no-op 'agdatadict' casts
Matthew Fernandez [Fri, 14 Jan 2022 02:05:10 +0000 (18:05 -0800)]
remove no-op 'agdatadict' casts

2 years agoAPI BREAK: remove 'NIL' macros
Matthew Fernandez [Fri, 14 Jan 2022 01:58:05 +0000 (17:58 -0800)]
API BREAK: remove 'NIL' macros

2 years agoremove use of 'NIL'
Matthew Fernandez [Fri, 14 Jan 2022 01:50:17 +0000 (17:50 -0800)]
remove use of 'NIL'

2 years agouse C99 initialization to simplify 'Dtdisc_t' definitions
Matthew Fernandez [Fri, 14 Jan 2022 01:46:02 +0000 (17:46 -0800)]
use C99 initialization to simplify 'Dtdisc_t' definitions

2 years agoAPI BREAK: remove 'NOT' macro
Matthew Fernandez [Fri, 14 Jan 2022 01:08:48 +0000 (17:08 -0800)]
API BREAK: remove 'NOT' macro

2 years agoMerge branch 'smattr/7e470f6a-2599-44f5-92e8-0d1f12a223ff' into 'main'
Matthew Fernandez [Sat, 15 Jan 2022 17:12:50 +0000 (17:12 +0000)]
Merge branch 'smattr/7e470f6a-2599-44f5-92e8-0d1f12a223ff' into 'main'

move lib/mingle/edge_bundling.c to C++

See merge request graphviz/graphviz!2401

2 years agoedge_compatibility_full: use a C++ bool for 'flipped'
Matthew Fernandez [Thu, 13 Jan 2022 04:38:44 +0000 (20:38 -0800)]
edge_compatibility_full: use a C++ bool for 'flipped'

Gitlab: #2154

2 years agoedge_compatibility: use a C++ bool for 'flipped'
Matthew Fernandez [Thu, 13 Jan 2022 04:37:48 +0000 (20:37 -0800)]
edge_compatibility: use a C++ bool for 'flipped'

Gitlab: #2154

2 years agoremove unused 'pedge_export_mma'
Matthew Fernandez [Thu, 13 Jan 2022 04:34:33 +0000 (20:34 -0800)]
remove unused 'pedge_export_mma'

2 years agoremove unused 'pedge_realloc'
Matthew Fernandez [Thu, 13 Jan 2022 04:33:42 +0000 (20:33 -0800)]
remove unused 'pedge_realloc'

2 years agoforce_directed_edge_bundling: remove useless '1*'
Matthew Fernandez [Thu, 13 Jan 2022 04:32:01 +0000 (20:32 -0800)]
force_directed_edge_bundling: remove useless '1*'

2 years agoforce_directed_edge_bundling: remove manual memory management of 'force_a'
Matthew Fernandez [Thu, 13 Jan 2022 04:30:49 +0000 (20:30 -0800)]
force_directed_edge_bundling: remove manual memory management of 'force_a'

Gitlab: #2154

2 years agoforce_directed_edge_bundling: remove manual memory management of 'force_t'
Matthew Fernandez [Thu, 13 Jan 2022 04:28:03 +0000 (20:28 -0800)]
force_directed_edge_bundling: remove manual memory management of 'force_t'

Gitlab: #2154

2 years agoremove unused 'pedge_flip'
Matthew Fernandez [Thu, 13 Jan 2022 04:22:11 +0000 (20:22 -0800)]
remove unused 'pedge_flip'

2 years agolib/mingle/edge_bundling.cpp: replace 'MIN' with 'std::min'
Matthew Fernandez [Thu, 13 Jan 2022 04:18:21 +0000 (20:18 -0800)]
lib/mingle/edge_bundling.cpp: replace 'MIN' with 'std::min'

Gitlab: #2154

2 years agolib/mingle/edge_bundling.cpp: replace 'MAX' with 'std::max'
Matthew Fernandez [Thu, 13 Jan 2022 04:17:31 +0000 (20:17 -0800)]
lib/mingle/edge_bundling.cpp: replace 'MAX' with 'std::max'

Gitlab: #2154

2 years agolib/mingle: move 'edge_bundling.c' into C++
Matthew Fernandez [Thu, 13 Jan 2022 04:03:44 +0000 (20:03 -0800)]
lib/mingle: move 'edge_bundling.c' into C++

This is a straight rename. No C++-specific changes yet.

Github: #2154

2 years agoforce_directed_edge_bundling: suppress -Wunused-parameter warning
Matthew Fernandez [Thu, 13 Jan 2022 04:07:34 +0000 (20:07 -0800)]
force_directed_edge_bundling: suppress -Wunused-parameter warning

2 years agolib/mingle/edge_bundling.c: explicitly cast the results of 'realloc'
Matthew Fernandez [Thu, 13 Jan 2022 04:06:36 +0000 (20:06 -0800)]
lib/mingle/edge_bundling.c: explicitly cast the results of 'realloc'

This has no effect in C, but this is pre-emptively squashing some warnings that
appear when moving this file to C++.

Gitlab: #2154

2 years agolib/mingle/edge_bundling.c: explicitly cast the results of 'malloc'
Matthew Fernandez [Thu, 13 Jan 2022 03:54:02 +0000 (19:54 -0800)]
lib/mingle/edge_bundling.c: explicitly cast the results of 'malloc'

This has no effect in C, but this is pre-emptively squashing some warnings that
appear when moving this file to C++.

Gitlab: #2154

2 years agoMerge branch 'smattr/36cf258d-8d34-4eb5-a1f1-601aab72970e' into 'main'
Matthew Fernandez [Sat, 15 Jan 2022 16:13:47 +0000 (16:13 +0000)]
Merge branch 'smattr/36cf258d-8d34-4eb5-a1f1-601aab72970e' into 'main'

more boolean → C99 bool modernization, and a bitarray optimization

See merge request graphviz/graphviz!2399

2 years agostandardize on C99 bool literals for calling 'agbindrec'
Matthew Fernandez [Wed, 12 Jan 2022 03:57:23 +0000 (19:57 -0800)]
standardize on C99 bool literals for calling 'agbindrec'

2 years agogvrender_core_pic.c: use a C99 bool for global 'onetime'
Matthew Fernandez [Wed, 12 Jan 2022 03:35:08 +0000 (19:35 -0800)]
gvrender_core_pic.c: use a C99 bool for global 'onetime'

2 years agouse C99 bool literals to set 'polygon_t.regular'
Matthew Fernandez [Wed, 12 Jan 2022 03:34:39 +0000 (19:34 -0800)]
use C99 bool literals to set 'polygon_t.regular'

2 years agoinit_nop: use a C99 bool for local 'didShift'
Matthew Fernandez [Wed, 12 Jan 2022 03:30:26 +0000 (19:30 -0800)]
init_nop: use a C99 bool for local 'didShift'

2 years agoimplement Small String Optimization in the bitarray API
Matthew Fernandez [Wed, 12 Jan 2022 04:59:58 +0000 (20:59 -0800)]
implement Small String Optimization in the bitarray API

Following the prior commit, this further reduces memory usage. On e.g. x86-64,
arrays of ≤ 64 bits can be managed fully on the stack.

2 years agosimplify bitarray API to assume arrays are only resized at construction time
Matthew Fernandez [Wed, 12 Jan 2022 04:35:16 +0000 (20:35 -0800)]
simplify bitarray API to assume arrays are only resized at construction time

The bit array API was written to allow arbitrary growing or shrinking of an
array after its construction, while maintaining its content. After fully rolling
it out, it turns out Graphviz only ever creates such arrays once at a fixed size
and then uses them until free. Carrying a more generic API than was necessary
had a number of negative consequences:

  1. `bitarray_resize` was more complicated than it needed to be, in order to
     cope with an arbitrary initial size of the input array.

  2. `bitarray_resize` used `realloc;memset` instead of the more efficient
     `calloc` because it was assuming the caller needed to maintain the original
     content.

  3. `bitarray_resize` performed a “loose” allocation with the capacity of the
     backing buffer larger than the size of the array itself, assuming that
     amortizing allocation costs across repeated resizes was a relevant concern.
     Dropping this and making the allocation “tight” not only reduces heap
     pressure, but allows dropping the `.capacity` member.

  4. `bitarray_array_resize_or_exit` had a more awkward calling convention than
     necessary, as exemplified by how it is streamlined in this commit.

As such, this change not only simplifies the code but also reduces memory usage.

2 years agocluster_map: replace boolean array 'assigned' with a bit array
Matthew Fernandez [Wed, 12 Jan 2022 03:28:26 +0000 (19:28 -0800)]
cluster_map: replace boolean array 'assigned' with a bit array

This is more memory efficient.