]> granicus.if.org Git - graphviz/log
graphviz
2 years agocircogen edgelist: squash -Wunused-parameter warnings
Matthew Fernandez [Tue, 12 Jul 2022 03:36:08 +0000 (20:36 -0700)]
circogen edgelist: squash -Wunused-parameter warnings

These functions are used in a `Dtdisc_t` structure so need to conform to
particular type signatures.

2 years agocircogen: remove commented out prototypes
Matthew Fernandez [Tue, 12 Jul 2022 03:33:23 +0000 (20:33 -0700)]
circogen: remove commented out prototypes

These functions were removed in e20473ad1f730c3a0550825cc3a79c13bd02346f.

2 years agocircogen: remove unused 'node_position'
Matthew Fernandez [Tue, 12 Jul 2022 03:31:35 +0000 (20:31 -0700)]
circogen: remove unused 'node_position'

2 years agogvc gvrender_ellipse: removed unused 'n' parameter
Matthew Fernandez [Tue, 12 Jul 2022 03:28:53 +0000 (20:28 -0700)]
gvc gvrender_ellipse: removed unused 'n' parameter

2 years agogvc gvrender_begin_edge: remove unused 'e' parameter
Matthew Fernandez [Tue, 12 Jul 2022 03:22:57 +0000 (20:22 -0700)]
gvc gvrender_begin_edge: remove unused 'e' parameter

2 years agogvc gvrender_begin_node: remove unused 'n' parameter
Matthew Fernandez [Tue, 12 Jul 2022 02:58:29 +0000 (19:58 -0700)]
gvc gvrender_begin_node: remove unused 'n' parameter

2 years agogvc gvrender_end_cluster: remove unused 'g' parameter
Matthew Fernandez [Tue, 12 Jul 2022 02:57:24 +0000 (19:57 -0700)]
gvc gvrender_end_cluster: remove unused 'g' parameter

2 years agogvc gvrender_begin_cluster: remove unused 'sg' parameter
Matthew Fernandez [Tue, 12 Jul 2022 02:56:19 +0000 (19:56 -0700)]
gvc gvrender_begin_cluster: remove unused 'sg' parameter

2 years agogvc gvrender_begin_graph: remove unused 'g' parameter
Matthew Fernandez [Tue, 12 Jul 2022 02:54:45 +0000 (19:54 -0700)]
gvc gvrender_begin_graph: remove unused 'g' parameter

2 years agogvc gvrender_begin_graph: remove commented out code
Matthew Fernandez [Tue, 12 Jul 2022 02:54:09 +0000 (19:54 -0700)]
gvc gvrender_begin_graph: remove commented out code

2 years agoMerge branch 'dot-demo-makefile' into 'main'
Matthew Fernandez [Sat, 16 Jul 2022 16:44:47 +0000 (16:44 +0000)]
Merge branch 'dot-demo-makefile' into 'main'

dot.demo: replace LDFLAGS with LDLIBS in Makefile

See merge request graphviz/graphviz!2761

2 years agodot.demo: replace LDFLAGS with LDLIBS in Makefile
Vincent Fu [Fri, 15 Jul 2022 00:19:20 +0000 (20:19 -0400)]
dot.demo: replace LDFLAGS with LDLIBS in Makefile

With LDFLAGS I am unable to build the demo programs using the Makefile
but the Makefile works with LDFLAGS changed to LDLIBS. We are using
pkg-config to obtain the appropriate libraries. So LDLIBS is the
appropriate variable to use.

Gitlab: fixes #2250

Signed-off-by: Vincent Fu <vincentfu@gmail.com>
2 years agoMerge branch 'smattr/B3A96CCC-49D5-41E2-BACB-30F753258B2B' into 'main'
Matthew Fernandez [Sat, 16 Jul 2022 02:53:19 +0000 (02:53 +0000)]
Merge branch 'smattr/B3A96CCC-49D5-41E2-BACB-30F753258B2B' into 'main'

replace 'oldof' with central allocation wrappers

See merge request graphviz/graphviz!2754

2 years agoast: remove now unused 'oldof'
Matthew Fernandez [Sat, 9 Jul 2022 16:57:22 +0000 (09:57 -0700)]
ast: remove now unused 'oldof'

2 years agogvpr addOutputGraph: fix an unchecked allocation failure
Matthew Fernandez [Sat, 9 Jul 2022 16:55:51 +0000 (09:55 -0700)]
gvpr addOutputGraph: fix an unchecked allocation failure

2 years agogvpr parseArgs: fix an unchecked allocation failure
Matthew Fernandez [Sat, 9 Jul 2022 16:52:46 +0000 (09:52 -0700)]
gvpr parseArgs: fix an unchecked allocation failure

2 years agogvpr makef: fix an unchecked allocation failure
Matthew Fernandez [Sat, 9 Jul 2022 16:46:35 +0000 (09:46 -0700)]
gvpr makef: fix an unchecked allocation failure

The previous use of `oldof` was a verbose way of allocating a single element, so
we replace it with the central allocation helper, also avoiding crashes if
allocation fails.

2 years agoexpr expush: remove unnecessary cast
Matthew Fernandez [Sat, 9 Jul 2022 16:32:25 +0000 (09:32 -0700)]
expr expush: remove unnecessary cast

2 years agoMerge branch 'smattr/d2888353-8f83-47f7-b03d-7303042d9142' into 'main'
Matthew Fernandez [Sat, 16 Jul 2022 01:43:59 +0000 (01:43 +0000)]
Merge branch 'smattr/d2888353-8f83-47f7-b03d-7303042d9142' into 'main'

reduce strdup calls

See merge request graphviz/graphviz!2755

2 years agoxdot sprintXDot: steal agxbuf’s buffer instead of double copying
Matthew Fernandez [Sat, 9 Jul 2022 15:39:55 +0000 (08:39 -0700)]
xdot sprintXDot: steal agxbuf’s buffer instead of double copying

8064f6e902cc4c3062cffa2d1d307ee9cf1893bb replaced lib/xdot’s inline copy of a
subset of the agxbuf.h API with an include of the header containing the full
API. This gives us access to `agxbdisown`. This function effectively does the
work of `agxbuse;strdup;agxbfree` by taking the existing dynamically allocated
buffer within the `agxbuf` object, rather than making yet another copy of this
data only to discard the original.

2 years agoedgepaint: remove unnecessary 'strdup' of 'lightness'
Matthew Fernandez [Sat, 9 Jul 2022 15:29:58 +0000 (08:29 -0700)]
edgepaint: remove unnecessary 'strdup' of 'lightness'

Pointers `getopt` returns in `optarg` point into the original `argv` which lives
in immortal storage. There is no need to duplicate such a pointer to prolong its
lifetime.

This commit looks like it is changing the source string, but `arg` and `optarg`
point at the same thing at this point. But `optarg` is not `const` qualified, so
we can do this assignment without a compiler warning.

2 years agosmyrna: remove unnecessary 'strdup' calls in 'mTestgvpr'
Matthew Fernandez [Sat, 9 Jul 2022 15:24:11 +0000 (08:24 -0700)]
smyrna: remove unnecessary 'strdup' calls in 'mTestgvpr'

The strings being duplicated are passed through to `gvpr` which does not modify
its arguments. So by rearranging when we release `bf2`, we can remove the need
to dynamically allocate the members of `argv`.

2 years agosmyrna: fix memory leak in 'mTestgvpr'
Matthew Fernandez [Sat, 9 Jul 2022 15:17:44 +0000 (08:17 -0700)]
smyrna: fix memory leak in 'mTestgvpr'

Even when a text field is empty, calling `gtk_text_buffer_get_text` returns a
dynamically allocated (empty) string that must be freed.

2 years agosmyrna load_attributes: use a string view for 'ss'
Matthew Fernandez [Sun, 10 Jul 2022 18:03:02 +0000 (11:03 -0700)]
smyrna load_attributes: use a string view for 'ss'

This code contained multiple memory leaks and unchecked allocations:¹

  1. `pch` was `strdup`-ed into `ss` on line 58. But `strdup`-ed again when
     being saved to an `attr` field. This lost the memory originating from the
     first `strdup`.

  2. Cases 0, 3, and 4 of the switch do not save the full contents of `ss` at
     all. This means naively removing the `strdup` calls in cases 1, 2, and
     default would not have solved the memory leak in (1) because cases 0, 3,
     and 4 would still leak memory.

  3. None of the `strdup` calls in this function were checked for failure.

This commit attempts to solve all the above. We now take a read-only reference
to the string data on line 58 and only `strdup` it when needed.

¹ It also assumes all lines of the input file are fewer characters than
  `BUFSIZ`, a platform-dependent constant. I do not know why this would be
  guaranteed. However, this problem seems orthogonal to the above.

2 years agocgraph: add a 'strdup' equivalent for 'strview_t'
Matthew Fernandez [Sun, 10 Jul 2022 17:53:54 +0000 (10:53 -0700)]
cgraph: add a 'strdup' equivalent for 'strview_t'

This will be used in an upcoming commit.

2 years agocgraph: add a 'strstr' equivalent for 'strview_t'
Matthew Fernandez [Sun, 10 Jul 2022 17:50:42 +0000 (10:50 -0700)]
cgraph: add a 'strstr' equivalent for 'strview_t'

This will be used in an upcoming commit.

2 years agosmyrna: simplify outer 'load_attributes' loop
Matthew Fernandez [Sat, 9 Jul 2022 15:13:48 +0000 (08:13 -0700)]
smyrna: simplify outer 'load_attributes' loop

This loop contains no `continue` statements, its counter is incremented in a
regular way, and the counter is unused outside the loop. So we can write the
loop more concisely and scope `attrcount` more tightly by using a `for` loop
instead of a `while` loop.

2 years agosmyrna: simplify inner 'load_attributes' loop
Matthew Fernandez [Sat, 9 Jul 2022 15:11:44 +0000 (08:11 -0700)]
smyrna: simplify inner 'load_attributes' loop

This loop contains no `continue` statements, its counter is incremented in a
regular way, and the counter is unused outside the loop. So we can write the
loop more concisely and scope `ind` more tightly by using a `for` loop instead
of a `while` loop.

2 years agosmyrna: remove an unnecessary 'strdup'
Matthew Fernandez [Sat, 9 Jul 2022 15:05:04 +0000 (08:05 -0700)]
smyrna: remove an unnecessary 'strdup'

Pointers `getopt` returns in `optarg` point into the original `argv` which lives
in immortal storage. There is no need to duplicate such a pointer to prolong its
lifetime.

2 years agocgraph: fix a missing header guard
Matthew Fernandez [Sun, 10 Jul 2022 02:44:32 +0000 (19:44 -0700)]
cgraph: fix a missing header guard

2 years agoMerge branch 'smattr/53F5F123-E14D-494D-B685-B8F9C64A50DD' into 'main'
Matthew Fernandez [Fri, 15 Jul 2022 01:17:44 +0000 (01:17 +0000)]
Merge branch 'smattr/53F5F123-E14D-494D-B685-B8F9C64A50DD' into 'main'

mm2gv: remove unused 'mm_typecode_to_str'

See merge request graphviz/graphviz!2753

2 years agomm2gv: remove unused 'mm_typecode_to_str'
Matthew Fernandez [Sun, 10 Jul 2022 19:40:58 +0000 (12:40 -0700)]
mm2gv: remove unused 'mm_typecode_to_str'

2 years agomm2gv SparseMatrix_import_matrix_market: replace an 'assert' with 'UNREACHABLE'
Matthew Fernandez [Sun, 10 Jul 2022 19:39:36 +0000 (12:39 -0700)]
mm2gv SparseMatrix_import_matrix_market: replace an 'assert' with 'UNREACHABLE'

This is slightly clearer and yields more reliable error behavior.

2 years agoMerge branch 'types-h' into 'main'
Matthew Fernandez [Sun, 10 Jul 2022 01:30:24 +0000 (01:30 +0000)]
Merge branch 'types-h' into 'main'

types.h: doxygen comments

See merge request graphviz/graphviz!2742

2 years agotypes.h: doxygen comments
Costa Shulyupin [Tue, 5 Jul 2022 16:16:50 +0000 (19:16 +0300)]
types.h: doxygen comments

2 years agoMerge branch 'smattr/72B145EF-707C-4237-AEAC-A88969A1AF9F' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 23:43:12 +0000 (23:43 +0000)]
Merge branch 'smattr/72B145EF-707C-4237-AEAC-A88969A1AF9F' into 'main'

cgraph: some warning squashing

See merge request graphviz/graphviz!2743

2 years agocgraph: more uniform treatment of sequence IDs
Matthew Fernandez [Wed, 6 Jul 2022 00:24:05 +0000 (17:24 -0700)]
cgraph: more uniform treatment of sequence IDs

Sequence IDs are calculated using 64-bit counters in `Agclos_s`. But then the
field used to store sequence IDs, `Agtag_s.seq`, is `sizeof(unsigned) * 8 - 4`
bits wide, 28-bit on x86 and x86-64. As a result, the compiler believes IDs that
exceed 2²⁸ - 1 can occur and overflow `Agtag_s.seq`:

  edge.c:213:30: warning: conversion from 'int' to 'unsigned int:28' may change
    value [-Wconversion]
  213 |     AGSEQ(in) = AGSEQ(out) = seq;
      |                              ^~~
  ...
  graph.c: In function 'agopen1':
  graph.c:77:20: warning: conversion from 'uint64_t' {aka 'long unsigned int'}
    to 'unsigned int:28' may change value [-Wconversion]
   77 |         AGSEQ(g) = agnextseq(par, AGRAPH);
      |                    ^~~~~~~~~
  ...
  node.c: In function 'newnode':
  node.c:76:16: warning: conversion from 'uint64_t' {aka 'long unsigned int'} to
    'unsigned int:28' may change value [-Wconversion]
   76 |     AGSEQ(n) = seq;
      |                ^~~
  ...
  node.c: In function 'agnodebefore':
  node.c:359:22: warning: conversion from 'uint64_t' {aka 'long unsigned int'}
    to 'unsigned int:28' may change value [-Wconversion]
  359 |         AGSEQ(snd) = (g->clos->seq[AGNODE] + 2);
      |                      ^

In practice, ingesting a graph of this size is not achievable, so these
overflows cannot occur.

This change introduces assertions and casts in these cases to explain the
assumptions to the compiler. It squashes the above warnings. In future, perhaps
these fields should all be made to all consistently use the same type.

2 years agocgraph: rephrase ID comparison in 'agraphidcmpf'
Matthew Fernandez [Wed, 6 Jul 2022 00:24:05 +0000 (17:24 -0700)]
cgraph: rephrase ID comparison in 'agraphidcmpf'

Avoids a possible integer overflow and squashes a -Wsign-conversion warning.

2 years agocgraph: remove unnecessary casts in 'agraphidcmpf'
Matthew Fernandez [Wed, 6 Jul 2022 00:24:05 +0000 (17:24 -0700)]
cgraph: remove unnecessary casts in 'agraphidcmpf'

2 years agoMerge branch 'smattr/52D7B067-5BE8-44F3-AC13-6CA93F46B9A5' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 20:24:23 +0000 (20:24 +0000)]
Merge branch 'smattr/52D7B067-5BE8-44F3-AC13-6CA93F46B9A5' into 'main'

CI: some minor fixes to the deployment script

See merge request graphviz/graphviz!2748

2 years agoCI: call Windows ZIP artifact 'archive' not 'installer'
Matthew Fernandez [Fri, 8 Jul 2022 02:29:15 +0000 (19:29 -0700)]
CI: call Windows ZIP artifact 'archive' not 'installer'

This is what the website’s JSON has always called this artifact, but a mistake
in 32b91edef64d1c726c88c7a7d6e68239399cc358 labelled this 'installer' instead.

2 years agoCI: remove legacy TODO in deploy script
Matthew Fernandez [Fri, 8 Jul 2022 02:28:11 +0000 (19:28 -0700)]
CI: remove legacy TODO in deploy script

This was addressed in 6117abe680037824d134149b0de42f589fb24466, with subsequent
fixes in 92804597802903f126c3d701179fc06bda58ed4c and
156b57941de82d1d229c0ccf331cf2dc3a9f7e32.

2 years agoMerge branch 'smattr/6a4630c7-4928-4c5c-a28f-4b9a0f7ad13d' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 19:21:30 +0000 (19:21 +0000)]
Merge branch 'smattr/6a4630c7-4928-4c5c-a28f-4b9a0f7ad13d' into 'main'

gv_trim_zeros: identify string extent instead of writing a '\0'

See merge request graphviz/graphviz!2749

2 years agogv_trim_zeros: identify string extent instead of writing a '\0'
Matthew Fernandez [Fri, 8 Jul 2022 03:19:38 +0000 (20:19 -0700)]
gv_trim_zeros: identify string extent instead of writing a '\0'

The buffer that this function was truncating is destined for `gvwrite`. So we
can make the whole thing read-only by identifying a string extent instead of
modifying the buffer in place. The compiler may have been able to identify the
intent of this code anyway¹ but if not these changes make it clearer how this
code can be optimized.

¹ Though probably not if the experience discussed in
  bf800b51ccf5808c9b4faecdec01488b5513c307 is anything to go by.

2 years agoMerge branch 'smattr/AC13F6AC-696F-43DA-AA5E-4B62E0EE03FB' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 18:17:24 +0000 (18:17 +0000)]
Merge branch 'smattr/AC13F6AC-696F-43DA-AA5E-4B62E0EE03FB' into 'main'

glcomp: remove no-op casts

See merge request graphviz/graphviz!2751

2 years agoglcomp: remove no-op casts
Matthew Fernandez [Sat, 9 Apr 2022 19:05:35 +0000 (12:05 -0700)]
glcomp: remove no-op casts

2 years agoMerge branch 'smattr/255050CF-C355-4788-9063-95138C4395EB' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 17:09:47 +0000 (17:09 +0000)]
Merge branch 'smattr/255050CF-C355-4788-9063-95138C4395EB' into 'main'

move dot_builtins.c into C++

See merge request graphviz/graphviz!2752

2 years agomove dot_builtins.c into C++
Matthew Fernandez [Sat, 28 May 2022 17:40:34 +0000 (10:40 -0700)]
move dot_builtins.c into C++

This looks like a bit of a strange change, when we now wrap the entire file in
`extern "C"`. However this has two key benefits:

  1. `dot_builtins` and `dot_static` that include this source needed an
     Autotools hack¹ to force compilation to use the C++ front end (`c++`)
     instead of the C front end (`cc`) in order to link against the C++ standard
     library. By moving this source into C++ we can remove this hack.

  2. When trying to integrate `dot_builtins` into the CMake build system, MSVC
     complains (correctly) that the initializers to the array in this file are
     not compile-time constants. GCC and Clang apparently allow this by a
     non-standard extension. By moving this into C++, we get more relaxed
     initialization semantics that allow this on all compilers.

Gitlab: #1836

¹ https://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries

2 years agoMerge branch 'smattr/B5CBD467-EBB2-4F04-B9EA-75F2E2AC4093' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 15:59:50 +0000 (15:59 +0000)]
Merge branch 'smattr/B5CBD467-EBB2-4F04-B9EA-75F2E2AC4093' into 'main'

common: some macro clean up

See merge request graphviz/graphviz!2744

2 years agocommon: remove 'GD_inleaf'
Matthew Fernandez [Wed, 6 Jul 2022 04:11:43 +0000 (21:11 -0700)]
common: remove 'GD_inleaf'

As discussed in the prior commit, this refers to a field that does not and has
never existed.

2 years agodotgen: remove 'OBSOLETE'-guarded code
Matthew Fernandez [Wed, 6 Jul 2022 04:00:34 +0000 (21:00 -0700)]
dotgen: remove 'OBSOLETE'-guarded code

This code is not currently compiled and, in fact, will not compile if you try to
re-enable it. As an example issue, it uses `GD_inleaf`, a macro intended for
accessing `Agraphinfo_t` fields, on a `node_t`. This is sort of a double mistake
as `Agraphinfo_t` also has no `inleaf` field. This problem seems to have been
present in the very first Graphviz revision,
256ef66663ca0c072554ee3f5e7971911031b3c7. Fortunately the mistakes sort of
cancelled each other out because the `GD_*` marcos did no casting and
`Agnodeinfo_t` _does_ have an `inleaf` field. The outcome seems to be what the
author intended, even if the route by which they got there was not intended.

The above is only one of several issues with this code. Resurrecting it has
unknown cost and unknown benefit, so we remove it here to avoid the implication
that it can be easily switched back on.

2 years agocommon: remove 'GD_cl_cnt'
Matthew Fernandez [Wed, 6 Jul 2022 03:48:39 +0000 (20:48 -0700)]
common: remove 'GD_cl_cnt'

This macro is clearly typoed (it refers to the field `cl_nt` while its name says
`cl_cnt`), but this macro has also never been used.

2 years agoMerge branch 'smattr/gitlab-2256' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 06:14:00 +0000 (06:14 +0000)]
Merge branch 'smattr/gitlab-2256' into 'main'

xlib plugin: relax button value assertions

Closes #2256

See merge request graphviz/graphviz!2740

2 years agoxlib plugin: relax button value assertions
Matthew Fernandez [Mon, 4 Jul 2022 21:44:42 +0000 (14:44 -0700)]
xlib plugin: relax button value assertions

Contrary to the X11 documentation,¹ it seems button values other than 1-5 can be
returned as button press events. The assertions altered in this commit were
introduced to guarantee the value does not exceed the limits of the type of the
parameter in the user’s callback (`int`). So we can safely relax this to just
the limit itself.

Gitlab: fixes #2256

¹ https://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html#Keyboard_and_Pointer_Events_b

2 years agoMerge branch 'clone-name-clash' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 04:26:34 +0000 (04:26 +0000)]
Merge branch 'clone-name-clash' into 'main'

rename clone to cloneO to avoid clone(2) nameclash

See merge request graphviz/graphviz!2750

2 years agorename clone to cloneO to avoid clone(2) nameclash
Natanael Copa [Tue, 26 Jul 2011 12:41:21 +0000 (12:41 +0000)]
rename clone to cloneO to avoid clone(2) nameclash

Rename clone to cloneO to avoid a name clash with the Linux `clone`
syscall. https://man7.org/linux/man-pages/man2/clone.2.html

2 years agoMerge branch 'chgraph-h' into 'main'
Matthew Fernandez [Sat, 9 Jul 2022 03:21:23 +0000 (03:21 +0000)]
Merge branch 'chgraph-h' into 'main'

doxygen doc for cgraph.h

See merge request graphviz/graphviz!2741

2 years agocgraph.h: exclude irrelevant from doxygen
Costa Shulyupin [Tue, 5 Jul 2022 13:16:53 +0000 (16:16 +0300)]
cgraph.h: exclude irrelevant from doxygen

2 years agocgraph.h: reformat comments for doxygen
Costa Shulyupin [Tue, 5 Jul 2022 13:15:57 +0000 (16:15 +0300)]
cgraph.h: reformat comments for doxygen

2 years agoDoxyfile: ignore attribute PRINTF_LIKE
Costa Shulyupin [Tue, 5 Jul 2022 12:34:24 +0000 (15:34 +0300)]
Doxyfile: ignore attribute PRINTF_LIKE

because it is not relevant for documentation

2 years agoMerge branch 'logic' into 'main'
Matthew Fernandez [Fri, 8 Jul 2022 03:15:21 +0000 (03:15 +0000)]
Merge branch 'logic' into 'main'

replace obsolete logic.h

See merge request graphviz/graphviz!2745

2 years agoremove obsolete unused logic.h
Costa Shulyupin [Wed, 6 Jul 2022 09:38:31 +0000 (12:38 +0300)]
remove obsolete unused logic.h

to reduce number of files in overpopulated directory lib/common
and make project a little bit more tidy

2 years agoreplace include of logic.h with stdbool.h
Costa Shulyupin [Wed, 6 Jul 2022 09:35:18 +0000 (12:35 +0300)]
replace include of logic.h with stdbool.h

and replace FALSE/TRUE with false/true

to reuse standard definitions

2 years agoremove unused includes of logic.h
Costa Shulyupin [Wed, 6 Jul 2022 09:32:46 +0000 (12:32 +0300)]
remove unused includes of logic.h

to keep the code a bit cleaner

2 years agoMerge branch 'smattr/A2FCED53-DEC0-47DE-BC19-01625CA7B4E9' into 'main'
Matthew Fernandez [Fri, 8 Jul 2022 01:00:59 +0000 (01:00 +0000)]
Merge branch 'smattr/A2FCED53-DEC0-47DE-BC19-01625CA7B4E9' into 'main'

Start 5.0.1 development

See merge request graphviz/graphviz!2747

2 years agoStart 5.0.1 development
Matthew Fernandez [Fri, 8 Jul 2022 00:24:05 +0000 (17:24 -0700)]
Start 5.0.1 development

2 years agoMerge branch 'smattr/02831009-9CCD-442E-B5A1-42688269FF91' into 'main' 5.0.0
Matthew Fernandez [Thu, 7 Jul 2022 15:40:57 +0000 (15:40 +0000)]
Merge branch 'smattr/02831009-9CCD-442E-B5A1-42688269FF91' into 'main'

Stable Release 5.0.0

See merge request graphviz/graphviz!2738

2 years agoStable Release 5.0.0
Matthew Fernandez [Sun, 3 Jul 2022 04:49:22 +0000 (21:49 -0700)]
Stable Release 5.0.0

2 years agofix CHANGELOG link
Matthew Fernandez [Sun, 3 Jul 2022 04:48:43 +0000 (21:48 -0700)]
fix CHANGELOG link

2 years agofix markdown indentation
Matthew Fernandez [Sun, 3 Jul 2022 04:45:38 +0000 (21:45 -0700)]
fix markdown indentation

2 years agoMerge branch 'smattr/C9FBABF6-463E-4B3D-9EA4-2EE6F963B313' into 'main'
Matthew Fernandez [Tue, 5 Jul 2022 16:11:15 +0000 (16:11 +0000)]
Merge branch 'smattr/C9FBABF6-463E-4B3D-9EA4-2EE6F963B313' into 'main'

gvpr: rewrite 'indexOf' to a simpler equivalent

See merge request graphviz/graphviz!2732

2 years agogvpr: rewrite 'indexOf' to a simpler equivalent
Matthew Fernandez [Fri, 1 Jul 2022 15:13:56 +0000 (08:13 -0700)]
gvpr: rewrite 'indexOf' to a simpler equivalent

This was initially attempted in 84efe93d5c5a4da0e778dbf01ed8550d2d774fdf and
then reverted in 51d787ece01fb4443db5eabd6932046b7b715dbc when it was discovered
this introduced a bug. The present commit fixes the, now obvious in retrospect,
bug with the original change of flipping the operands in the final subtraction.

This was validated by doing an exhaustive comparison of all strlen ≤2 inputs to
both the before and after function. Not bulletproof, but it is a strong signal
that the new version is functionally identical.

2 years agoMerge branch 'smattr/FDF1EA53-08F9-4F8C-8A22-2430083D6152' into 'main'
Matthew Fernandez [Tue, 5 Jul 2022 04:44:54 +0000 (04:44 +0000)]
Merge branch 'smattr/FDF1EA53-08F9-4F8C-8A22-2430083D6152' into 'main'

some allocation call clean up

See merge request graphviz/graphviz!2734

2 years agogxl2gv: fix an unchecked allocation failure
Matthew Fernandez [Sat, 2 Jul 2022 02:46:21 +0000 (19:46 -0700)]
gxl2gv: fix an unchecked allocation failure

2 years agographml2gv: fix an unchecked allocation failure
Matthew Fernandez [Sat, 2 Jul 2022 02:45:20 +0000 (19:45 -0700)]
graphml2gv: fix an unchecked allocation failure

2 years agodiffimg: replace 'xmalloc' with central allow wrapper
Matthew Fernandez [Sat, 2 Jul 2022 02:43:29 +0000 (19:43 -0700)]
diffimg: replace 'xmalloc' with central allow wrapper

2 years agopango plugin: replace 'xstrdup' with central alloc wrapper
Matthew Fernandez [Sat, 2 Jul 2022 02:41:53 +0000 (19:41 -0700)]
pango plugin: replace 'xstrdup' with central alloc wrapper

2 years agoMerge branch 'smattr/AA938AAA-1935-4594-A534-5EC62FFFBF57' into 'main'
Matthew Fernandez [Tue, 5 Jul 2022 02:56:17 +0000 (02:56 +0000)]
Merge branch 'smattr/AA938AAA-1935-4594-A534-5EC62FFFBF57' into 'main'

reference counted strings: de-duplicate some code, introduce malloc failure checks

See merge request graphviz/graphviz!2735

2 years agoagstrdup_internal: handle allocation failures
Matthew Fernandez [Sat, 2 Jul 2022 02:06:58 +0000 (19:06 -0700)]
agstrdup_internal: handle allocation failures

2 years agooutline the common core of 'agstrdup' and 'agstrdup_html'
Matthew Fernandez [Sat, 2 Jul 2022 02:04:01 +0000 (19:04 -0700)]
outline the common core of 'agstrdup' and 'agstrdup_html'

2 years agoMerge branch 'smattr/25FB51E1-C422-452D-9D1F-130886D5BAC3' into 'main'
Matthew Fernandez [Tue, 5 Jul 2022 01:53:26 +0000 (01:53 +0000)]
Merge branch 'smattr/25FB51E1-C422-452D-9D1F-130886D5BAC3' into 'main'

core plugin: fix unchecked allocation failure in dot rendering

See merge request graphviz/graphviz!2736

2 years agocore plugin: fix unchecked allocation failure in dot rendering
Matthew Fernandez [Sat, 2 Jul 2022 15:45:18 +0000 (08:45 -0700)]
core plugin: fix unchecked allocation failure in dot rendering

2 years agoMerge branch 'smattr/c7e76059-49ef-436d-940e-f756525e7a55' into 'main'
Matthew Fernandez [Mon, 4 Jul 2022 23:19:30 +0000 (23:19 +0000)]
Merge branch 'smattr/c7e76059-49ef-436d-940e-f756525e7a55' into 'main'

gvpr simplification

See merge request graphviz/graphviz!2737

2 years agogvpr: squash -Wunused-parameter warnings in 'gvexitf'
Matthew Fernandez [Sat, 2 Jul 2022 20:50:47 +0000 (13:50 -0700)]
gvpr: squash -Wunused-parameter warnings in 'gvexitf'

This function needs to conform to the `exitf` type signature, so these
parameters cannot be removed.

2 years agogvpr: make use of 'okay' clearer in 'evalNode'
Matthew Fernandez [Sat, 2 Jul 2022 20:48:26 +0000 (13:48 -0700)]
gvpr: make use of 'okay' clearer in 'evalNode'

Squashes a -Wconversion warning.

2 years agogvpr: make use of 'okay' clearer in 'evalEdge'
Matthew Fernandez [Sat, 2 Jul 2022 20:47:40 +0000 (13:47 -0700)]
gvpr: make use of 'okay' clearer in 'evalEdge'

Squashes a -Wconversion warning.

2 years agogvpr: exit on allocation failure in 'concat'
Matthew Fernandez [Sat, 2 Jul 2022 15:37:37 +0000 (08:37 -0700)]
gvpr: exit on allocation failure in 'concat'

This function gracefully handled allocation failures by returning 0. Except its
caller does not check for this and assumes the returned pointer is non-null.

2 years agogvpr: fix unchecked allocation failures in 'resolve'
Matthew Fernandez [Sat, 2 Jul 2022 15:36:00 +0000 (08:36 -0700)]
gvpr: fix unchecked allocation failures in 'resolve'

2 years agogvpr: fix unchecked allocation failure in 'parseArgs'
Matthew Fernandez [Sat, 2 Jul 2022 15:35:46 +0000 (08:35 -0700)]
gvpr: fix unchecked allocation failure in 'parseArgs'

2 years agogvpr: simplify 'freeOpts' by passing by value
Matthew Fernandez [Sat, 2 Jul 2022 15:30:52 +0000 (08:30 -0700)]
gvpr: simplify 'freeOpts' by passing by value

This also removes the conditional on `argc` in this function. The contained loop
is a no-op when `argc` is 0 and in this case `argv` is NULL, which it is well
defined to `free`.

2 years agogvpr: stack-allocate options struct
Matthew Fernandez [Sat, 2 Jul 2022 15:28:09 +0000 (08:28 -0700)]
gvpr: stack-allocate options struct

There is no need to heap-allocate this struct that is small and whose usage is
well scoped.

2 years agoMerge branch 'cgraph' into 'main'
Matthew Fernandez [Mon, 4 Jul 2022 22:18:19 +0000 (22:18 +0000)]
Merge branch 'cgraph' into 'main'

cgraph doxygen title comments

See merge request graphviz/graphviz!2739

2 years agocgraph doxygen title comments
Costa Shulyupin [Mon, 4 Jul 2022 22:18:19 +0000 (22:18 +0000)]
cgraph doxygen title comments

2 years agoMerge branch 'smattr/gitlab-358' into 'main'
Matthew Fernandez [Mon, 4 Jul 2022 21:23:10 +0000 (21:23 +0000)]
Merge branch 'smattr/gitlab-358' into 'main'

fix: Revert "rewrite versionStr2Version to use strtoul"

Closes #358

See merge request graphviz/graphviz!2733

2 years agofix: Revert "rewrite versionStr2Version to use strtoul"
Matthew Fernandez [Sat, 2 Jul 2022 03:23:27 +0000 (20:23 -0700)]
fix: Revert "rewrite versionStr2Version to use strtoul"

This reverts commit 5aa56175c4715700cc8bf9fecad7b27665c04379. This commit
inadvertently changed the parsing of the `xdotversion` attribute to make
something like “1.7” parse as version 1.

Gitlab: fixes #358

2 years agoadd a test case for #358
Matthew Fernandez [Sat, 2 Jul 2022 03:17:18 +0000 (20:17 -0700)]
add a test case for #358

2 years agoMerge branch 'smattr/gitlab-1801' into 'main'
Matthew Fernandez [Sun, 3 Jul 2022 05:49:31 +0000 (05:49 +0000)]
Merge branch 'smattr/gitlab-1801' into 'main'

Proutespline: remove exception-style control flow

See merge request graphviz/graphviz!2731

2 years agogrowops: squash a -Wsign-conversion warning
Matthew Fernandez [Tue, 28 Jun 2022 01:44:18 +0000 (18:44 -0700)]
growops: squash a -Wsign-conversion warning

By construction, `newopn` can only ever be non-negative here. Though in the long
term a more sweeping change should be done to count items in `size_t` variables
pervasively.

2 years agoreallyroutespline: squash a -Wsign-conversion warning
Matthew Fernandez [Tue, 28 Jun 2022 01:42:29 +0000 (18:42 -0700)]
reallyroutespline: squash a -Wsign-conversion warning

By construction, `inpn` can only ever be non-negative here. Though in the long
term a more sweeping change should be done to count items in `size_t` variables
pervasively.

2 years agoProutespline: remove exception-style control flow
Matthew Fernandez [Tue, 28 Jun 2022 01:40:07 +0000 (18:40 -0700)]
Proutespline: remove exception-style control flow

Memory allocation failures now result in a conventional return, propagated up
through the call stack.

Github: #1801