]> granicus.if.org Git - graphviz/log
graphviz
22 months agoMerge branch 'smattr/gitlab-799' into 'main'
Matthew Fernandez [Thu, 26 Jan 2023 02:37:23 +0000 (02:37 +0000)]
Merge branch 'smattr/gitlab-799' into 'main'

remove VML output renderer

Closes #799

See merge request graphviz/graphviz!3064

22 months agoremove VML output renderer
Matthew Fernandez [Sun, 22 Jan 2023 01:04:06 +0000 (17:04 -0800)]
remove VML output renderer

Gitlab: closes #799

23 months agoMerge branch 'libgd_cmake' into 'main'
Matthew Fernandez [Mon, 23 Jan 2023 17:07:14 +0000 (17:07 +0000)]
Merge branch 'libgd_cmake' into 'main'

CMake: Similar to 3fcf0968, use gdlib.pc if available

See merge request graphviz/graphviz!3044

23 months agoCMake: Similar to 3fcf0968, use gdlib.pc if available
Nehal J Wani [Mon, 2 Jan 2023 14:04:33 +0000 (14:04 +0000)]
CMake: Similar to 3fcf0968, use gdlib.pc if available

The gdlib-config program is no longer installed with the newer versions
of the library as it is deprecated. The CMake build on CI for Fedora
prints the following, which is no longer the case with this patch:

   CMake Warning at cmake/FindGD.cmake:63 (message):
     gdlib-config not found; skipping feature checks
   Call Stack (most recent call first):
     contrib/diffimg/CMakeLists.txt:1 (find_package)

xref: https://github.com/libgd/libgd/issues/376#issuecomment-276138975

Edits from Matthew Fernandez:
 - Wrap CMake line
 - Adjust #1786 work arounds

Gitlab: #1786

23 months agoCI: suppress leak checks for libfontconfig
Nehal J Wani [Sun, 15 Jan 2023 01:52:03 +0000 (01:52 +0000)]
CI: suppress leak checks for libfontconfig

For posterity, the reported leak is:
  =================================================================
  ==14034==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 256 byte(s) in 1 object(s) allocated from:
      #0 0x7ff0354c190f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
      #1 0x7ff03523e61f in FcPatternObjectInsertElt /root/fontconfig/src/fcpat.c:525
      #2 0x7ff035240846 in FcPatternObjectAddWithBinding /root/fontconfig/src/fcpat.c:711
      #3 0x7ff035245970 in FcPatternAppend /root/fontconfig/src/fcpat.c:1262
      #4 0x7ff035270c77 in FcParsePattern /root/fontconfig/src/fcxml.c:3110
      #5 0x7ff035271292 in FcEndElement /root/fontconfig/src/fcxml.c:3236
      #6 0x7ff02b099354  (/lib/x86_64-linux-gnu/libxml2.so.2+0x17d354)

  Indirect leak of 32 byte(s) in 1 object(s) allocated from:
      #0 0x7ff0354c12d7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
      #1 0x7ff035239d8b in FcValueListCreate /root/fontconfig/src/fcpat.c:136
      #2 0x7ff035240433 in FcPatternObjectAddWithBinding /root/fontconfig/src/fcpat.c:687
      #3 0x7ff035245970 in FcPatternAppend /root/fontconfig/src/fcpat.c:1262
      #4 0x7ff035270c77 in FcParsePattern /root/fontconfig/src/fcxml.c:3110
      #5 0x7ff035271292 in FcEndElement /root/fontconfig/src/fcxml.c:3236
      #6 0x7ff02b099354  (/lib/x86_64-linux-gnu/libxml2.so.2+0x17d354)

  SUMMARY: AddressSanitizer: 288 byte(s) leaked in 2 allocation(s).

xref: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/295#note_1033797

23 months agoMerge branch 'smattr/gitlab-2344' into 'main'
Matthew Fernandez [Sun, 22 Jan 2023 03:29:31 +0000 (03:29 +0000)]
Merge branch 'smattr/gitlab-2344' into 'main'

gv2gxl, gxl2gv: fix mode detection on Windows

Closes #2344

See merge request graphviz/graphviz!3058

23 months agogv2gxl, gxl2gv: fix mode detection on Windows
Matthew Fernandez [Wed, 18 Jan 2023 04:24:56 +0000 (20:24 -0800)]
gv2gxl, gxl2gv: fix mode detection on Windows

Gitlab: fixes #2344

23 months agouse 'which' when accessing gv2gxl, gxl2gv in the test suite
Matthew Fernandez [Mon, 16 Jan 2023 03:24:30 +0000 (19:24 -0800)]
use 'which' when accessing gv2gxl, gxl2gv in the test suite

When running the Graphviz test suite on an installation that was built without
some optional components, calls to these missing components can incorrectly
resolve to those from a prior Graphviz installation that happens to be in your
`$PATH`. This issue was partly addressed in
515c86a923601db5cb704da93046800df7da030a. This change takes things further,
ensuring that invocations of `gv2gxl` and `gxl2gv` also land on the right
version under test.

This requires temporarily xfailing the test due to an unrelated issue with these
tools.

Gitlab: #2201, #2344

23 months agoMerge branch 'smattr/a1b8e698-f7ad-4b30-a48b-c30ea6f334e0' into 'main'
Matthew Fernandez [Sun, 22 Jan 2023 02:18:25 +0000 (02:18 +0000)]
Merge branch 'smattr/a1b8e698-f7ad-4b30-a48b-c30ea6f334e0' into 'main'

some extended guidance on testing

See merge request graphviz/graphviz!3057

23 months agofix typo in test assertion message
Matthew Fernandez [Mon, 16 Jan 2023 03:15:54 +0000 (19:15 -0800)]
fix typo in test assertion message

This looks to have been a mistake in 74238e979cecadf64e67c6f5bb822eae88278de0.

23 months agoextend documentation on Graphviz testing
Matthew Fernandez [Mon, 16 Jan 2023 03:08:12 +0000 (19:08 -0800)]
extend documentation on Graphviz testing

23 months agoglcomp: remove 'DEFAULT_GLUT_FONT'
Matthew Fernandez [Mon, 16 Jan 2023 00:50:44 +0000 (16:50 -0800)]
glcomp: remove 'DEFAULT_GLUT_FONT'

The last use of this was removed in 46d9ed13a72f626a8c59ca119868e8755210d2e7.

23 months agoMerge branch 'smattr/5821b3b1-1f91-487f-85cf-2fcdffdfc033' into 'main'
Matthew Fernandez [Sun, 22 Jan 2023 01:21:38 +0000 (01:21 +0000)]
Merge branch 'smattr/5821b3b1-1f91-487f-85cf-2fcdffdfc033' into 'main'

mingle, neatogen compiler warning squashing

See merge request graphviz/graphviz!3059

23 months agoneatogen: make 'overlap_scaling' static
Matthew Fernandez [Wed, 18 Jan 2023 16:38:39 +0000 (08:38 -0800)]
neatogen: make 'overlap_scaling' static

This function is unused outside of its containing file.

23 months agoneatogen overlap.c: squash some -Wunused-parameter warnings
Matthew Fernandez [Wed, 18 Jan 2023 16:34:52 +0000 (08:34 -0800)]
neatogen overlap.c: squash some -Wunused-parameter warnings

These functions are used as callbacks, so cannot easily have their parameters
removed.

23 months agoneatogen: squash a -Wundef warning for 'DEBUG'
Matthew Fernandez [Wed, 18 Jan 2023 16:33:01 +0000 (08:33 -0800)]
neatogen: squash a -Wundef warning for 'DEBUG'

23 months agoneatogen compute_new_weights: remove redundant zeroing
Matthew Fernandez [Wed, 18 Jan 2023 16:30:16 +0000 (08:30 -0800)]
neatogen compute_new_weights: remove redundant zeroing

The `gv_calloc` allocation does this for us.

23 months agoneatogen common_neighbors: fix comment typo
Matthew Fernandez [Wed, 18 Jan 2023 16:30:02 +0000 (08:30 -0800)]
neatogen common_neighbors: fix comment typo

23 months agoneatogen common_neighbors: remove unused 'v' parameter
Matthew Fernandez [Wed, 18 Jan 2023 16:29:46 +0000 (08:29 -0800)]
neatogen common_neighbors: remove unused 'v' parameter

23 months agomingle nearest_neighbor_graph: squash warnings when building without libANN
Matthew Fernandez [Wed, 18 Jan 2023 16:24:45 +0000 (08:24 -0800)]
mingle nearest_neighbor_graph: squash warnings when building without libANN

23 months agomingle nearest_neighbor_graph: fix typo in parameter name
Matthew Fernandez [Wed, 18 Jan 2023 16:24:14 +0000 (08:24 -0800)]
mingle nearest_neighbor_graph: fix typo in parameter name

23 months agomingle edge_bundling: squash compilation warnings when building without libANN
Matthew Fernandez [Wed, 18 Jan 2023 16:22:35 +0000 (08:22 -0800)]
mingle edge_bundling: squash compilation warnings when building without libANN

23 months agoMerge branch 'smattr/gitlab-2338' into 'main'
Matthew Fernandez [Sun, 22 Jan 2023 00:16:51 +0000 (00:16 +0000)]
Merge branch 'smattr/gitlab-2338' into 'main'

sfio: make 'Sfio_t' definition entirely internal

Closes #2338

See merge request graphviz/graphviz!3060

23 months agosfio: make 'Sfio_t' definition entirely internal
Matthew Fernandez [Thu, 19 Jan 2023 16:24:02 +0000 (08:24 -0800)]
sfio: make 'Sfio_t' definition entirely internal

The definition of `Sfio_t` was structured to give it a public part and a private
part:

  struct _sfio_s {
    … public members …

    _SFIO_PRIVATE; // ← only visible if sfio_t.h is included
  };

This works only as long as no user ever allocates a `Sfio_t` themselves. If they
do, they will allocate too few bytes, based on their view of the size of
`Sfio_t` missing its private members.

A side effect of link-time optimization is that the compiler can see through
this trickery and witness both with-private and without-private definitions at
once. Creating objects of this type or pointers to objects of this type is a
violation of C’s strict aliasing rule and the compiler can now see this. This
can cause the compiler to make unsafe optimizations, like concluding any code
involving `Sfio_t*` variables must be unreachable.

The safer way to do a public/private class like this is with two structs, the
private one containing the public one as a member:

  struct foo_public {
    … public members …
  };

  struct foo_private {
    struct foo_public *public;

    … private members …
  };

Public API functions then accept `struct foo_public*` parameters and internally
convert them to `struct foo_private*` variables in order to access the
internals:

  int foo_do_something(struct foo_public *foo) {
    // use something like the Linux kernel’s container_of
    struct foo_private *f = container_of(foo, public);
    …
  }

But instead of this, we can observe that the definition of `Sfio_t` does not
need to have any public members at all, and we can make the entire type private.
We need an exception for libexpr which reaches into sfio internals.

Gitlab: fixes #2338

23 months agosfio: remove macro implementations of character functions
Matthew Fernandez [Thu, 19 Jan 2023 16:17:29 +0000 (08:17 -0800)]
sfio: remove macro implementations of character functions

These were implemented as an optimization to allow inlining. This is no longer
necessary on contemporary compilers with link-time optimization. Removing them
will unblock fixing some strict aliasing problems with the `Sfio_t` type.

Gitlab: #2338

23 months agosfio: fix missing SFIO components
Matthew Fernandez [Thu, 19 Jan 2023 16:13:22 +0000 (08:13 -0800)]
sfio: fix missing SFIO components

These are present in the Autotools build system as a separate library, libsfiof,
linked into libsfio. They are also present in the MS Build build system inlined
into libsfio itself. This change copies the MS Build approach.

This did not cause problems because these sources only exist as fallback
implementations for functions that are also implemented as macros. All current
usages see the macro definitions so never call these functions.

Fixing this will allow removing the macro versions in an upcoming change.

23 months agosfio: remove some open coded nulls
Matthew Fernandez [Thu, 19 Jan 2023 15:59:51 +0000 (07:59 -0800)]
sfio: remove some open coded nulls

23 months agoMerge branch 'smattr/9a877cda-3948-40d1-8ddf-64d09bc05660' into 'main'
Matthew Fernandez [Sat, 21 Jan 2023 22:34:15 +0000 (22:34 +0000)]
Merge branch 'smattr/9a877cda-3948-40d1-8ddf-64d09bc05660' into 'main'

smyrna, gvmap warning squashing

See merge request graphviz/graphviz!3061

23 months agogvmap plot_dot_polygons: use a 'size_t' for 'maxlen'
Matthew Fernandez [Fri, 20 Jan 2023 16:25:15 +0000 (08:25 -0800)]
gvmap plot_dot_polygons: use a 'size_t' for 'maxlen'

Squashes some -Wsign-conversion warnings.

23 months agogvmap make_map_internal: remove shadowing of 'nz' local
Matthew Fernandez [Fri, 20 Jan 2023 16:10:23 +0000 (08:10 -0800)]
gvmap make_map_internal: remove shadowing of 'nz' local

23 months agogvmap make_map_internal: operate directly on 'xcombined' instead of 'xtemp'
Matthew Fernandez [Fri, 20 Jan 2023 16:05:58 +0000 (08:05 -0800)]
gvmap make_map_internal: operate directly on 'xcombined' instead of 'xtemp'

Nothing appears to alias `xcombined` within this block. So we can save an
intermediate allocation and the cost of data movement by simply writing results
into their final destination.

23 months agogvmap get_polygon_solids: remove unused 'x_poly' parameter
Matthew Fernandez [Fri, 20 Jan 2023 15:59:32 +0000 (07:59 -0800)]
gvmap get_polygon_solids: remove unused 'x_poly' parameter

23 months agosmyrna on_txtAttr_changed: squash -Wunused-parameter warning
Matthew Fernandez [Fri, 20 Jan 2023 15:55:00 +0000 (07:55 -0800)]
smyrna on_txtAttr_changed: squash -Wunused-parameter warning

This function is used as a callback, so the parameter cannot easily be removed.

23 months agoMerge branch 'smattr/48b6e6c6-75e1-4359-a9d7-eed440bfcf03' into 'main'
Matthew Fernandez [Sat, 21 Jan 2023 21:42:38 +0000 (21:42 +0000)]
Merge branch 'smattr/48b6e6c6-75e1-4359-a9d7-eed440bfcf03' into 'main'

gvrender_core_pic.c: Distinguish between PIC and troff comments

Closes #2341

See merge request graphviz/graphviz!3063

23 months agoadd a changelog entry for the prior fix
Matthew Fernandez [Sat, 21 Jan 2023 19:30:41 +0000 (11:30 -0800)]
add a changelog entry for the prior fix

Gitlab: fixes #2341
Reported-by: Philip Kaludercic <philipk@posteo.net>
23 months agogvrender_core_pic.c: Distinguish between PIC and troff comments
Philip Kaludercic [Tue, 10 Jan 2023 23:31:13 +0000 (00:31 +0100)]
gvrender_core_pic.c: Distinguish between PIC and troff comments

23 months agoadd a test case for #2341
Matthew Fernandez [Sat, 21 Jan 2023 19:23:40 +0000 (11:23 -0800)]
add a test case for #2341

23 months agoMerge branch 'smattr/f05e3fc0-e087-4e7c-b988-577ed0336677' into 'main'
Matthew Fernandez [Sat, 21 Jan 2023 20:49:02 +0000 (20:49 +0000)]
Merge branch 'smattr/f05e3fc0-e087-4e7c-b988-577ed0336677' into 'main'

Start 7.1.1 development

See merge request graphviz/graphviz!3062

23 months agoStart 7.1.1 development
Matthew Fernandez [Sat, 21 Jan 2023 19:58:26 +0000 (11:58 -0800)]
Start 7.1.1 development

23 months agoMerge branch 'smattr/68782f21-a0fd-4857-b70a-1ce1504a5446' into 'main'
Matthew Fernandez [Sat, 21 Jan 2023 19:56:31 +0000 (19:56 +0000)]
Merge branch 'smattr/68782f21-a0fd-4857-b70a-1ce1504a5446' into 'main'

Stable release 7.1.0

See merge request graphviz/graphviz!3055

23 months agoStable Release 7.1.0
Matthew Fernandez [Sun, 15 Jan 2023 22:49:28 +0000 (14:49 -0800)]
Stable Release 7.1.0

23 months agobump minor version number for the addition of '--help', '--version'
Matthew Fernandez [Sun, 15 Jan 2023 22:47:50 +0000 (14:47 -0800)]
bump minor version number for the addition of '--help', '--version'

23 months agoMerge branch 're-enable-cygwin' into 'main'
Magnus Jacobsson [Sat, 21 Jan 2023 15:29:43 +0000 (15:29 +0000)]
Merge branch 're-enable-cygwin' into 'main'

Revert "CI: disable Cygwin jobs"

Closes #2329

See merge request graphviz/graphviz!3054

23 months agoRevert "CI: disable Cygwin jobs"
Magnus Jacobsson [Sun, 15 Jan 2023 11:37:14 +0000 (12:37 +0100)]
Revert "CI: disable Cygwin jobs"

This reverts commit 709acef44e13332a3c961bed3a2478c002f7b25f.

23 months agoMerge branch 'smattr/dc382b2a-6441-4f7b-a3a0-a66d40319ea8' into 'main'
Matthew Fernandez [Sat, 21 Jan 2023 05:39:14 +0000 (05:39 +0000)]
Merge branch 'smattr/dc382b2a-6441-4f7b-a3a0-a66d40319ea8' into 'main'

compiler warning squashing, fix a memory leak, remove some 'sprintf'

See merge request graphviz/graphviz!3056

23 months agocommon graph_init: fix memory leak
Matthew Fernandez [Sun, 15 Jan 2023 22:20:06 +0000 (14:20 -0800)]
common graph_init: fix memory leak

Gitlab: #1950

23 months agogvcolor nameOf: use an agxbuf instead of raw char buffer for names
Matthew Fernandez [Sun, 15 Jan 2023 22:13:19 +0000 (14:13 -0800)]
gvcolor nameOf: use an agxbuf instead of raw char buffer for names

This leads to slightly simpler code and fewer things to worry about.

Gitlab: #1950

23 months agogvcolor: remove assumption that color values fit in 64 characters
Matthew Fernandez [Sun, 15 Jan 2023 21:58:56 +0000 (13:58 -0800)]
gvcolor: remove assumption that color values fit in 64 characters

This code is still pretty challenging to follow, but at least we remove one
more thing the reader had to worry about.

Gitlab: #1950

23 months agogvcolor: remove unused 'Agnodeinfo_t' name
Matthew Fernandez [Sun, 15 Jan 2023 21:40:22 +0000 (13:40 -0800)]
gvcolor: remove unused 'Agnodeinfo_t' name

23 months agogvcolor: remove unused 'hsbcolor_t' name
Matthew Fernandez [Sun, 15 Jan 2023 21:39:40 +0000 (13:39 -0800)]
gvcolor: remove unused 'hsbcolor_t' name

23 months agogvcolor: squash -Wmissing-prototypes warning
Matthew Fernandez [Sun, 15 Jan 2023 21:38:55 +0000 (13:38 -0800)]
gvcolor: squash -Wmissing-prototypes warning

23 months agogvcolor colorxlate: remove unused return value
Matthew Fernandez [Sun, 15 Jan 2023 21:29:38 +0000 (13:29 -0800)]
gvcolor colorxlate: remove unused return value

23 months agogvcolor: remove 'NOCOLORNAMES' code path
Matthew Fernandez [Sun, 15 Jan 2023 21:28:12 +0000 (13:28 -0800)]
gvcolor: remove 'NOCOLORNAMES' code path

Nothing in the build systems define this. Furthermore, this code does not work.
It reads uninitialized memory from `buf`.

23 months agoMerge branch 'smattr/c0d7ef68-360e-47ba-96a8-fa27138de3b9' into 'main'
Matthew Fernandez [Sun, 15 Jan 2023 23:07:22 +0000 (23:07 +0000)]
Merge branch 'smattr/c0d7ef68-360e-47ba-96a8-fa27138de3b9' into 'main'

GD plugin gd_alternate_fontlist: fix unchecked allocation

See merge request graphviz/graphviz!3051

23 months agoGD plugin gd_alternate_fontlist: fix unchecked allocation
Matthew Fernandez [Sun, 15 Jan 2023 03:18:53 +0000 (19:18 -0800)]
GD plugin gd_alternate_fontlist: fix unchecked allocation

This function was calling `realloc` and not checking the return value. To fix
this, we rephrase it into using string views and then a final checked
allocation. This removes the long lived static allocation here, now requiring
the caller to free the returned value. This function is not on a hot path, so
removing this optimization is fine.

23 months agoMerge branch 'smattr/50a7856c-303a-4293-ad75-d1c983ace0f7' into 'main'
Matthew Fernandez [Sun, 15 Jan 2023 22:01:51 +0000 (22:01 +0000)]
Merge branch 'smattr/50a7856c-303a-4293-ad75-d1c983ace0f7' into 'main'

tclpkg buildBindings: fix incorrect allocation calculations and unchecked allocations

See merge request graphviz/graphviz!3052

23 months agotclpkg buildBindings: mark 's2' parameter as const
Matthew Fernandez [Sun, 15 Jan 2023 04:22:10 +0000 (20:22 -0800)]
tclpkg buildBindings: mark 's2' parameter as const

23 months agotclpkg buildBindings: fix remaining unchecked allocations
Matthew Fernandez [Sun, 15 Jan 2023 04:19:04 +0000 (20:19 -0800)]
tclpkg buildBindings: fix remaining unchecked allocations

23 months agotclpkg buildBindings: swap unchecked allocation for agxbuf
Matthew Fernandez [Sun, 15 Jan 2023 04:15:30 +0000 (20:15 -0800)]
tclpkg buildBindings: swap unchecked allocation for agxbuf

Apart from fixing an unchecked allocation, this is shorter with fewer things to
worry about.

23 months agotclpkg buildBindings: fix incorrect allocation calculations
Matthew Fernandez [Sun, 15 Jan 2023 04:11:12 +0000 (20:11 -0800)]
tclpkg buildBindings: fix incorrect allocation calculations

From context, these appear to be attempting to account for the trailing '\0'.
But they allocate one too many bytes.

23 months agoMerge branch 'smattr/e1a77fd6-85ed-4678-9fbe-bb6276c7e71b' into 'main'
Matthew Fernandez [Sun, 15 Jan 2023 18:41:39 +0000 (18:41 +0000)]
Merge branch 'smattr/e1a77fd6-85ed-4678-9fbe-bb6276c7e71b' into 'main'

sprintf migration and compiler waring squashing

See merge request graphviz/graphviz!3050

23 months agographml2gv main: remove shadowing of 'G'
Matthew Fernandez [Sun, 15 Jan 2023 00:09:41 +0000 (16:09 -0800)]
graphml2gv main: remove shadowing of 'G'

23 months agographml2gv initargs: squash -Wswitch-default warning
Matthew Fernandez [Sat, 14 Jan 2023 23:32:18 +0000 (15:32 -0800)]
graphml2gv initargs: squash -Wswitch-default warning

The default case is unreachable due to the preceding `getopt` call.

23 months agographml2gv graphml_to_gv: remove shadowing of 'gname'
Matthew Fernandez [Sun, 15 Jan 2023 00:07:13 +0000 (16:07 -0800)]
graphml2gv graphml_to_gv: remove shadowing of 'gname'

23 months agogv2gml initargs: squash -Wswitch-default warning
Matthew Fernandez [Sat, 14 Jan 2023 23:32:18 +0000 (15:32 -0800)]
gv2gml initargs: squash -Wswitch-default warning

The default case is unreachable due to the preceding `getopt` call.

23 months agodijkstra init: squash -Wswitch-default warning
Matthew Fernandez [Sat, 14 Jan 2023 23:32:18 +0000 (15:32 -0800)]
dijkstra init: squash -Wswitch-default warning

The default case is unreachable due to the preceding `getopt` call.

23 months agounflatten scanargs: squash -Wswitch-default warning
Matthew Fernandez [Sat, 14 Jan 2023 23:32:18 +0000 (15:32 -0800)]
unflatten scanargs: squash -Wswitch-default warning

The default case is unreachable due to the preceding `getopt` call.

23 months agotred init: squash -Wswitch-default warning
Matthew Fernandez [Sat, 14 Jan 2023 23:32:18 +0000 (15:32 -0800)]
tred init: squash -Wswitch-default warning

The default case is unreachable due to the preceding `getopt` call.

23 months agosccmap scanArgs: squash -Wswitch-default warning
Matthew Fernandez [Sat, 14 Jan 2023 23:32:18 +0000 (15:32 -0800)]
sccmap scanArgs: squash -Wswitch-default warning

The default case is unreachable due to the preceding `getopt` call.

23 months agoccomps process: replace 'sprintf' with 'agxbprint'
Matthew Fernandez [Sat, 14 Jan 2023 23:52:55 +0000 (15:52 -0800)]
ccomps process: replace 'sprintf' with 'agxbprint'

This replaces some error prone manual calculation with a dynamic buffer that
handles the calculation of needed allocations. This also potentially saves
memory in cases of short strings where an agxbuf can use inline storage.

Gitlab: #1950

23 months agoccomps processClusters: replace 'sprintf' with 'agxbprint'
Matthew Fernandez [Sat, 14 Jan 2023 23:52:55 +0000 (15:52 -0800)]
ccomps processClusters: replace 'sprintf' with 'agxbprint'

This replaces some error prone manual calculation with a dynamic buffer that
handles the calculation of needed allocations. This also potentially saves
memory in cases of short strings where an agxbuf can use inline storage.

Gitlab: #1950

23 months agoccomps getName: remove long lived allocation
Matthew Fernandez [Sat, 14 Jan 2023 23:38:40 +0000 (15:38 -0800)]
ccomps getName: remove long lived allocation

This code is not on a hot path, so we can afford to use clearer scoping and
ownership semantics.

Gitlab: #1950

23 months agoccomps gwrite: fix crash when failing to open files
Matthew Fernandez [Sat, 14 Jan 2023 23:42:55 +0000 (15:42 -0800)]
ccomps gwrite: fix crash when failing to open files

This code looks as if it and the similar code in bcomps.c were copy-pasted from
the same common source. Except the bcomps.c version remembered to exit when
failing to open the output file, whereas the ccomps.c code would go on to crash
when using the null `outf`.

23 months agobcomps getName: remove long lived allocation
Matthew Fernandez [Sat, 14 Jan 2023 23:38:40 +0000 (15:38 -0800)]
bcomps getName: remove long lived allocation

This code is not on a hot path, so we can afford to use clearer scoping and
ownership semantics.

Gitlab: #1950

23 months agobcomps init: squash -Wswitch-default warning
Matthew Fernandez [Sat, 14 Jan 2023 23:32:18 +0000 (15:32 -0800)]
bcomps init: squash -Wswitch-default warning

The default case is unreachable due to the preceding `getopt` call.

23 months agobcomps split: use a more appropriate type for 'size'
Matthew Fernandez [Sat, 14 Jan 2023 23:30:32 +0000 (15:30 -0800)]
bcomps split: use a more appropriate type for 'size'

Squashes 2 -Wconversion warnings.

23 months agobcomps blockName: remove long lived allocation
Matthew Fernandez [Sat, 14 Jan 2023 23:27:43 +0000 (15:27 -0800)]
bcomps blockName: remove long lived allocation

It looks like a mistake in the initial revision of Graphviz that this function
never wrote to `bufsz`. The effect of this was that this function would
reallocate on every single call. So empirically it seems there was no need to
avoid allocating new memory on each call, which is what this commit does.

Gitlab: #1950

23 months agosmyrna smyrnaPath: replace 'sprintf' calls with 'snprintf'
Matthew Fernandez [Sat, 14 Jan 2023 23:20:22 +0000 (15:20 -0800)]
smyrna smyrnaPath: replace 'sprintf' calls with 'snprintf'

Gitlab: #1950

23 months agoMerge branch 'smattr/1b897ee0-27b1-49d6-9891-9f9a72c96a15' into 'main'
Matthew Fernandez [Sun, 15 Jan 2023 17:49:00 +0000 (17:49 +0000)]
Merge branch 'smattr/1b897ee0-27b1-49d6-9891-9f9a72c96a15' into 'main'

smyrna, glcomp, tclpkg compiler warning squashing

See merge request graphviz/graphviz!3048

23 months agoglcomp: remove 'type' that is always set to 'pangotext'
Matthew Fernandez [Sat, 14 Jan 2023 05:39:59 +0000 (21:39 -0800)]
glcomp: remove 'type' that is always set to 'pangotext'

23 months agoglcomp: remove 'borderType' that is always set to 'glBorderSolid'
Matthew Fernandez [Sat, 14 Jan 2023 05:31:47 +0000 (21:31 -0800)]
glcomp: remove 'borderType' that is always set to 'glBorderSolid'

23 months agosmyrna DrawEllipse: use doubles for local temporaries
Matthew Fernandez [Sat, 14 Jan 2023 05:26:25 +0000 (21:26 -0800)]
smyrna DrawEllipse: use doubles for local temporaries

Values being stored into these were doubles and later use of these promoted them
to double. So it is not clear why they were not double to begin with. Squashes 2
-Wfloat-conversion warnings.

23 months agosmyrna drawCircle: abbreviate a float literal
Matthew Fernandez [Sat, 14 Jan 2023 05:22:26 +0000 (21:22 -0800)]
smyrna drawCircle: abbreviate a float literal

23 months agosmyrna: abbreviate some accumulations
Matthew Fernandez [Sat, 14 Jan 2023 05:22:16 +0000 (21:22 -0800)]
smyrna: abbreviate some accumulations

23 months agosmyrna: use a double for 'global_z'
Matthew Fernandez [Sat, 14 Jan 2023 05:21:09 +0000 (21:21 -0800)]
smyrna: use a double for 'global_z'

Most of the calculations with this and uses of it are with doubles. So making it
a double as well avoids losing intermediate precision. Squashes 5
-Wfloat-conversion warnings.

23 months agosmyrna: remove some unhelpful comments
Matthew Fernandez [Sat, 14 Jan 2023 04:58:18 +0000 (20:58 -0800)]
smyrna: remove some unhelpful comments

23 months agosmyrna glcreate_gl_topview_menu: squash -Wfloat-conversion warning
Matthew Fernandez [Sat, 14 Jan 2023 04:57:00 +0000 (20:57 -0800)]
smyrna glcreate_gl_topview_menu: squash -Wfloat-conversion warning

23 months agotclpkg insert_poly: remove shadowing of 'polyid'
Matthew Fernandez [Sat, 14 Jan 2023 04:41:25 +0000 (20:41 -0800)]
tclpkg insert_poly: remove shadowing of 'polyid'

23 months agotclpkg remove_poly: remove shadowing of 'polyid'
Matthew Fernandez [Sat, 14 Jan 2023 04:40:49 +0000 (20:40 -0800)]
tclpkg remove_poly: remove shadowing of 'polyid'

23 months agotclpkg Plegal_arrangement: remove shadowing of 'i'
Matthew Fernandez [Sat, 14 Jan 2023 04:39:11 +0000 (20:39 -0800)]
tclpkg Plegal_arrangement: remove shadowing of 'i'

23 months agoMerge branch 'smattr/gitlab-2340' into 'main'
Matthew Fernandez [Sun, 15 Jan 2023 16:58:53 +0000 (16:58 +0000)]
Merge branch 'smattr/gitlab-2340' into 'main'

Autotools: fix non-portable syntax in configure.ac

Closes #2340

See merge request graphviz/graphviz!3049

23 months agoMerge branch 'smattr/gitlab-1950' into 'main'
Matthew Fernandez [Sat, 14 Jan 2023 18:45:15 +0000 (18:45 +0000)]
Merge branch 'smattr/gitlab-1950' into 'main'

migrate some 'sprintf' to agxbufs

See merge request graphviz/graphviz!3036

23 months agopack: remove some unhelpful comments
Matthew Fernandez [Mon, 2 Jan 2023 03:17:01 +0000 (19:17 -0800)]
pack: remove some unhelpful comments

23 months agopack: use an agxbuf to simplify some code
Matthew Fernandez [Mon, 2 Jan 2023 02:47:13 +0000 (18:47 -0800)]
pack: use an agxbuf to simplify some code

Gitlab: #1950

23 months agocore plugin mp_bezier: use an agxbuf to simplify some code
Matthew Fernandez [Mon, 2 Jan 2023 02:47:13 +0000 (18:47 -0800)]
core plugin mp_bezier: use an agxbuf to simplify some code

Gitlab: #1950

23 months agocore plugin fig_bezier: use an agxbuf to simplify some code
Matthew Fernandez [Mon, 2 Jan 2023 02:47:13 +0000 (18:47 -0800)]
core plugin fig_bezier: use an agxbuf to simplify some code

Gitlab: #1950

23 months agosfdpgen spring_electrical_spring_embedding: use an agxbuf instead of 'sprintf'
Matthew Fernandez [Mon, 2 Jan 2023 02:39:27 +0000 (18:39 -0800)]
sfdpgen spring_electrical_spring_embedding: use an agxbuf instead of 'sprintf'

This leads to less manual memory management and fewer problems to think about.

Gitlab: #1950

23 months agosfdpgen spring_maxent_embedding: use an agxbuf instead of 'sprintf'
Matthew Fernandez [Mon, 2 Jan 2023 02:39:27 +0000 (18:39 -0800)]
sfdpgen spring_maxent_embedding: use an agxbuf instead of 'sprintf'

This leads to less manual memory management and fewer problems to think about.

Gitlab: #1950

23 months agosfdpgen spring_electrical_embedding: use an agxbuf instead of 'sprintf'
Matthew Fernandez [Mon, 2 Jan 2023 02:39:27 +0000 (18:39 -0800)]
sfdpgen spring_electrical_embedding: use an agxbuf instead of 'sprintf'

This leads to less manual memory management and fewer problems to think about.

Gitlab: #1950

23 months agosfdpgen spring_electrical_embedding_slow: use an agxbuf instead of 'sprintf'
Matthew Fernandez [Mon, 2 Jan 2023 02:39:27 +0000 (18:39 -0800)]
sfdpgen spring_electrical_embedding_slow: use an agxbuf instead of 'sprintf'

This leads to less manual memory management and fewer problems to think about.

Gitlab: #1950