]>
granicus.if.org Git - graphviz/log
Matthew Fernandez [Tue, 5 Apr 2022 14:45:40 +0000 (07:45 -0700)]
gc: replace inline stack implementation with generic one
This code was using two abstractions, a block `blk_t` and stack `stk_t`, to
amortize the cost of allocations. We can remove the block abstraction and
rewrite the stack implementation to use the simpler generic stack while still
retaining these amortization benefits. Note that this refactoring also makes
initialization of the stack data structure unnecessary as a zeroed `gv_stack_t`
is also a valid empty stack.
The new code also deallocates the stack prior to exit, aiding tools like
Valgrind and Address Sanitizer.
This pattern of using both a hand-rolled block and hand-rolled stack appears in
numerous places in the Graphviz code base, of which this is just one instance.
Gitlab: #1793
Matthew Fernandez [Thu, 3 Feb 2022 04:37:13 +0000 (15:37 +1100)]
cgraph: implement a generic stack abstraction
Similar to prior abstractions like `bitarray_t`, this is implemented header-only
so as to be usable throughout the Graphviz tree, even by code that is not
linking against cgraph.
Given this implementation is header-only, it is natural to wonder why the type
needs a `gv_` prefix. The answer is that one of the macOS system headers flouts
the rule of `__` prefixing symbols that are part of the implementation and
defines a typedef of `__darwin_sigaltstack` under the name `stack_t`. Hence this
name is not usable by us.
Gitlab: #1793, #2222
Matthew Fernandez [Tue, 5 Apr 2022 00:13:37 +0000 (17:13 -0700)]
tests: unify 'bitarray' and 'sprint' test orchestrators
Matthew Fernandez [Tue, 5 Apr 2022 04:22:04 +0000 (21:22 -0700)]
cgraph: squash a macOS warning in 'sprint' tester
macOS provides an `INT8_C` macro that generates an `int`, not an `int8_t`, which
ends up resulting in this code generating `printf` format warnings. An upcoming
commit which enables `-Werror` on this code causes test failures without this.
Matthew Fernandez [Tue, 5 Apr 2022 00:09:22 +0000 (17:09 -0700)]
tests: rename and generalize 'sprint' test file
Matthew Fernandez [Mon, 11 Apr 2022 16:08:38 +0000 (16:08 +0000)]
Merge branch 'smattr/
24A46FC0 -701E-41A5-B90D-
09A92A2F3811 ' into 'main'
CI: standardize naming of platform-specific scripts
See merge request graphviz/graphviz!2578
Matthew Fernandez [Sat, 9 Apr 2022 04:08:46 +0000 (21:08 -0700)]
CI: consolidate Python requirements installation on macOS
Matthew Fernandez [Sat, 9 Apr 2022 04:01:14 +0000 (21:01 -0700)]
CI: rename Windows script to put 'windows' as a prefix instead of a suffix
This aligns with the pattern used for the other platform-specific CI scripts,
making the ci/ directory a little more intuitive.
Matthew Fernandez [Sat, 9 Apr 2022 03:59:52 +0000 (20:59 -0700)]
CI: rename macOS scripts to put 'macos' as a prefix instead of suffix
This aligns these with the pattern used for the MinGW and Cygwin builds, making
the ci/ directory a little more intuitive.
Matthew Fernandez [Mon, 11 Apr 2022 06:42:53 +0000 (06:42 +0000)]
Merge branch 'smattr/
5F630118 -D62C-4D9D-B333-
07E2F37D558F ' into 'main'
mm2gv: remove dead code
See merge request graphviz/graphviz!2574
Matthew Fernandez [Fri, 8 Apr 2022 15:26:09 +0000 (08:26 -0700)]
mm2gv: strip all formats except CSR from 'SparseMatrix_import_matrix_market'
Only `FORMAT_CSR` was being used when calling into this code.
Matthew Fernandez [Fri, 8 Apr 2022 15:19:12 +0000 (08:19 -0700)]
mm2gv: make 'mm_get_type' static
This function is unused outside of its containing file.
Matthew Fernandez [Fri, 8 Apr 2022 15:17:02 +0000 (08:17 -0700)]
mm2gv: remove unused 'mm_write_banner'
Matthew Fernandez [Fri, 8 Apr 2022 15:14:39 +0000 (08:14 -0700)]
mm2gv: remove unused 'SparseMatrix_export_matrix_market'
Matthew Fernandez [Fri, 8 Apr 2022 15:08:28 +0000 (08:08 -0700)]
mm2gv: remove unused 'mm_read_mtx_array_size'
Matthew Fernandez [Fri, 8 Apr 2022 15:07:45 +0000 (08:07 -0700)]
mm2gv: remove unused 'mm_write_mtx_crd_size'
Matthew Fernandez [Fri, 8 Apr 2022 15:07:10 +0000 (08:07 -0700)]
mm2gv: remove unused 'mm_write_mtx_array_size'
Matthew Fernandez [Fri, 8 Apr 2022 15:06:30 +0000 (08:06 -0700)]
mm2gv: remove unused 'mm_is_valid'
Matthew Fernandez [Fri, 8 Apr 2022 15:04:54 +0000 (08:04 -0700)]
mm2gv: remove unnused 'mm_write_mtx_crd'
Matthew Fernandez [Fri, 8 Apr 2022 15:03:42 +0000 (08:03 -0700)]
mm2gv: remove unused 'mm_read_mtx_crd_data'
Matthew Fernandez [Fri, 8 Apr 2022 15:03:01 +0000 (08:03 -0700)]
mm2gv: remove unused 'mm_read_mtx_crd_entry'
Matthew Fernandez [Fri, 8 Apr 2022 15:02:21 +0000 (08:02 -0700)]
mm2gv: remove unused 'mm_read_unsymmetric_sparse'
Matthew Fernandez [Mon, 11 Apr 2022 02:19:58 +0000 (02:19 +0000)]
Merge branch 'smattr/
2228889B -1687-4AC1-9529-
E3EE1B9D8237 ' into 'main'
CMake: enable Visio plugin
See merge request graphviz/graphviz!2571
Matthew Fernandez [Thu, 7 Apr 2022 01:06:53 +0000 (18:06 -0700)]
Visio plugin: remove unused #include
Matthew Fernandez [Thu, 7 Apr 2022 01:05:51 +0000 (18:05 -0700)]
CMake: enable Visio plugin
Gitlab: #1836
Matthew Fernandez [Thu, 7 Apr 2022 15:44:29 +0000 (08:44 -0700)]
Visio plugin: fix: remove typoed #pragma dependencies
It seems to have been an accidental omission that these were not removed in
2d95aab626184f35f779bbd02a000a992826047a when migrating to describing link
dependencies in the build system files. However, these dependencies are typoed
too (should be `cgraph.lib` not `graph.lib`), so it is unclear how they could
have ever worked. This seems to have gone undiscovered because the Visio plugin
is not integrated into the MS Build files nor built on any Windows platform in
CI. This changes in an upcoming commit, exposing:
LINK : fatal error LNK1104: cannot open file 'graph.lib'
Gitlab: #1836
Matthew Fernandez [Thu, 7 Apr 2022 01:32:13 +0000 (18:32 -0700)]
Visio plugin: fix use of dllimport
When enabling this plugin in the CMake build, the compiler complains:
…\plugin\visio\gvplugin_visio.c(30,69): error C2491:
'gvplugin_visio_LTX_library': definition of dllimport data not allowed
Gitlab: #1836
Matthew Fernandez [Mon, 11 Apr 2022 00:58:09 +0000 (00:58 +0000)]
Merge branch 'smattr/
FF232F75 -E08F-45C3-8684-
004C8B0B6422 ' into 'main'
CMake: enable Lasi plugin
See merge request graphviz/graphviz!2562
Matthew Fernandez [Sun, 3 Apr 2022 22:28:59 +0000 (15:28 -0700)]
CMake: add Lasi plugin
Gitlab: #1836
Matthew Fernandez [Tue, 5 Apr 2022 02:01:12 +0000 (19:01 -0700)]
LASi plugin lasi_textspan: remove unused 'str'
Matthew Fernandez [Tue, 5 Apr 2022 01:59:19 +0000 (18:59 -0700)]
LASi plugin: support newer Pango weights introduced ≥1.24
Squashes a number of compiler warnings that fail the upcoming CMake build of
this plugin. The version checks and mapping logic was derived from the Pango
docs¹ and the LASi.h header.
¹ https://docs.gtk.org/Pango/enum.Weight.html
Matthew Fernandez [Tue, 5 Apr 2022 01:48:58 +0000 (18:48 -0700)]
LASi plugin: work around LASi exporting Freetype’s config.h
Matthew Fernandez [Mon, 4 Apr 2022 14:40:29 +0000 (07:40 -0700)]
Lasi plugin: use '#ifdef' instead of '#if' for config checks
If sys/mman.h is absent, `HAVE_SYS_MMAN_H` ends up not defined at all. A result
of this would be pre-processor warnings, failing the CMake build.
Gitlab: #1836
Matthew Fernandez [Mon, 4 Apr 2022 02:33:29 +0000 (19:33 -0700)]
Lasi plugin: fix: use buffered I/O instead of raw I/O
On non-Windows operating systems that lack `mmap`, this code fell back to
calling `read` but was not #including unistd.h. The result was a compilation
failure:
plugin/lasi/gvloadimage_lasi.c:78:17: error: implicit declaration of function
'read'; did you mean 'fread'? [-Werror=implicit-function-declaration]
78 | read(fd, us->data, statbuf.st_size);
| ^~~~
| fread
By moving to the higher level `fread` function we fix this problem as well as
enabling prefetching optimizations and avoiding `EINTR` complications.
This issue was discovered while attempting to enable this plugin in the CMake
build system.
Gitlab: related to #1836
Matthew Fernandez [Sun, 10 Apr 2022 22:08:14 +0000 (22:08 +0000)]
Merge branch 'smattr/
A2FEDD11 -8CFC-45C2-91E8-
8A52A23097DA ' into 'main'
unflatten, etc: more #2204 progress
See merge request graphviz/graphviz!2575
Matthew Fernandez [Fri, 8 Apr 2022 02:02:33 +0000 (19:02 -0700)]
smyrna: remove unnecessary parens
Matthew Fernandez [Fri, 8 Apr 2022 02:02:15 +0000 (19:02 -0700)]
smyrna: remove unnecessary separation of declaration and definition
Matthew Fernandez [Fri, 8 Apr 2022 02:01:59 +0000 (19:01 -0700)]
smyrna: remove an open coded NULL
Matthew Fernandez [Fri, 8 Apr 2022 02:01:39 +0000 (19:01 -0700)]
smyrna: remove guard around call to 'free'
Calling `free(NULL)` is a well-defined no-op.
Matthew Fernandez [Fri, 8 Apr 2022 02:01:22 +0000 (19:01 -0700)]
smyrna: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Fri, 8 Apr 2022 01:55:26 +0000 (18:55 -0700)]
gc: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Fri, 8 Apr 2022 01:53:19 +0000 (18:53 -0700)]
gvcolor: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Fri, 8 Apr 2022 01:51:20 +0000 (18:51 -0700)]
gvcolor: remove open coded 'fmax'
Matthew Fernandez [Fri, 8 Apr 2022 01:48:55 +0000 (18:48 -0700)]
sccmap: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Fri, 8 Apr 2022 01:42:11 +0000 (18:42 -0700)]
unflatten: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Sun, 10 Apr 2022 20:40:50 +0000 (20:40 +0000)]
Merge branch 'smattr/
41BAD9A9 -91BB-466D-A2F4-
1FDC033B7C05 ' into 'main'
GTK plugin, tclpkg, prune: more #2204 progress
See merge request graphviz/graphviz!2576
Matthew Fernandez [Sat, 9 Apr 2022 04:42:13 +0000 (21:42 -0700)]
prune: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Sat, 9 Apr 2022 04:35:51 +0000 (21:35 -0700)]
tclpkg: remove unused unistd.h #includes
Gitlab: #2204
Matthew Fernandez [Sat, 9 Apr 2022 04:24:51 +0000 (21:24 -0700)]
GTK plugin: remove unnecessary pointer casts
Matthew Fernandez [Sat, 9 Apr 2022 04:24:35 +0000 (21:24 -0700)]
GTK plugin: remove unused unistd.h #includes
Gitlab: #2204
Matthew Fernandez [Sun, 10 Apr 2022 16:49:16 +0000 (16:49 +0000)]
Merge branch 'smattr/
B0F15680 -4145-49ED-9BA5-
7F69E867B2B2 ' into 'main'
enable Quartz plugin in CMake and squash compiler warnings
See merge request graphviz/graphviz!2570
Matthew Fernandez [Thu, 7 Apr 2022 00:36:42 +0000 (17:36 -0700)]
Quartz plugin quartz_textlayout: squash -Wunused-parameter warning
This parameter cannot be removed because this function is used as a callback.
Matthew Fernandez [Thu, 7 Apr 2022 00:35:39 +0000 (17:35 -0700)]
Quartz plugin quartzgen_bezier: squash -Wunused-parameter warnings
These parameters cannot be removed because this function is used as a callback.
Matthew Fernandez [Thu, 7 Apr 2022 00:34:09 +0000 (17:34 -0700)]
Quartz plugin quartzgen_begin_page: remove open coded 'MAP_FAILED'
Later on this code goes on to do an unchecked `mmap`, so it is unclear exactly
what the author believed the failure semantics of `mmap` are. Nevertheless, this
seems like a slight improvement.
Matthew Fernandez [Wed, 6 Apr 2022 15:11:35 +0000 (08:11 -0700)]
Quartz plugin: mark 'quartz_textlayout' static
This function is not used outside of its containing file.
Matthew Fernandez [Wed, 6 Apr 2022 15:04:55 +0000 (08:04 -0700)]
Quartz plugin: mark 'quartzgen_textspan' static
This function is not used outside of its containing file.
Matthew Fernandez [Wed, 6 Apr 2022 15:04:03 +0000 (08:04 -0700)]
Quartz plugin quartzgen_begin_anchor: squash -Wunused-parameter warnings
These parameters cannot be removed because this function is used as a callback.
Matthew Fernandez [Wed, 6 Apr 2022 15:03:17 +0000 (08:03 -0700)]
Quartz plugin: squash a -Wsign-compare warning
Matthew Fernandez [Wed, 6 Apr 2022 15:01:41 +0000 (08:01 -0700)]
Quartz plugin: remove unnecessary casts
Matthew Fernandez [Wed, 6 Apr 2022 14:50:54 +0000 (07:50 -0700)]
Quartz plugin: squash -Wundef warnings
Matthew Fernandez [Wed, 6 Apr 2022 14:49:12 +0000 (07:49 -0700)]
Quartz plugin quartz_loadimage_quartz: squash -Wunused-parameter warning
This parameter cannot be removed because this function is used as a callback.
Matthew Fernandez [Wed, 6 Apr 2022 14:46:08 +0000 (07:46 -0700)]
Quartz plugin quartz_format: squash -Wsign-conversion warning
We know `device.id` is always a valid `format_type` because its only possible
values are defined within this plugin.
Matthew Fernandez [Wed, 6 Apr 2022 14:43:26 +0000 (07:43 -0700)]
Quartz plugin: mark 'memory_data_consumer_get_byte_pointer' static
This function is not used outside of its containing file.
Matthew Fernandez [Wed, 6 Apr 2022 03:00:12 +0000 (20:00 -0700)]
CMake: enable Quartz plugin
It is unclear how valuable this is, given this is only applicable to macOS and
its dependency discovery (based on the Autotools behavior) is fairly ad hoc. But
we still drag it into the CMake world to make progress on unifying the Graphviz
build system.
Gitlab: #1836
Matthew Fernandez [Sun, 10 Apr 2022 06:59:37 +0000 (06:59 +0000)]
Merge branch 'smattr/
A76659AC -7B7E-4C6C-803F-
23D7EDCA5C11 ' into 'main'
CMake: enable GTK plugin
See merge request graphviz/graphviz!2561
Matthew Fernandez [Sun, 3 Apr 2022 22:19:54 +0000 (15:19 -0700)]
CMake: enable GTK plugin
Gitlab: #1836
Matthew Fernandez [Mon, 4 Apr 2022 02:39:33 +0000 (19:39 -0700)]
GTK plugin create_window1: remove unused 'tmp_toolbar_icon_size'
Matthew Fernandez [Sat, 9 Apr 2022 21:54:51 +0000 (21:54 +0000)]
Merge branch 'smattr/
AD90CABB -D995-48F5-84F6-
FAD9B13D0FB8 ' into 'main'
remove some more unused unistd.h #includes
See merge request graphviz/graphviz!2563
Matthew Fernandez [Tue, 5 Apr 2022 14:36:16 +0000 (07:36 -0700)]
nop: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Tue, 5 Apr 2022 14:35:25 +0000 (07:35 -0700)]
gv2gml: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Tue, 5 Apr 2022 14:32:09 +0000 (07:32 -0700)]
ccomps: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Sat, 9 Apr 2022 19:39:38 +0000 (19:39 +0000)]
Merge branch 'smattr/
5A077557 -8681-4EB9-BAD2-
0D329EBA379B ' into 'main'
CMake: enable Poppler plugin and squash compiler warnings
See merge request graphviz/graphviz!2564
Matthew Fernandez [Wed, 6 Apr 2022 02:38:18 +0000 (19:38 -0700)]
Poppler plugin gvloadimage_poppler_load: fix: match Glib allocation and free
The variable `absolute` is allocated using Glib’s `g_strdup` and friends.
Quoting the Glib docs:¹
It's important to match `g_malloc()` (and wrappers such as `g_new()`) with
`g_free()`, `g_slice_alloc()` (and wrappers such as `g_slice_new()`) with
`g_slice_free()`, plain `malloc()` with `free()`, and (if you're using C++)
`new` with `delete` and `new[]` with `delete[]`. Otherwise bad things can
happen, since these allocators may use different memory pools (and new/delete
call constructors and destructors).
So a custom allocation scheme or arena can be in play. Basically if you
`g_strdup` and then pair this with `free` (as was done in the code prior to this
commit), you risk leaking memory from the Glib pool and corrupting your system
allocator.
Having said that, this is no longer a concern in newer Glib:
Since GLib 2.46 `g_malloc()` is hardcoded to always use the system malloc
implementation.
Still, why tempt fate?
¹ https://developer-old.gnome.org/glib/stable/glib-Memory-Allocation.html
Matthew Fernandez [Wed, 6 Apr 2022 02:37:51 +0000 (19:37 -0700)]
Poppler plugin gvloadimage_poppler_load: remove open coded 'NULL'
Matthew Fernandez [Wed, 6 Apr 2022 02:37:34 +0000 (19:37 -0700)]
Poppler plugin gvloadimage_poppler_cairo: remove unnecessary cast
Matthew Fernandez [Wed, 6 Apr 2022 02:30:48 +0000 (19:30 -0700)]
Poppler plugin gvloadimage_poppler_cairo: squash -Wunused-parameter warning
This cannot be removed because this function is used as a callback.
Matthew Fernandez [Wed, 6 Apr 2022 02:29:34 +0000 (19:29 -0700)]
CMake: enable Poppler plugin
Gitlab: #1836
Matthew Fernandez [Sat, 9 Apr 2022 18:14:58 +0000 (18:14 +0000)]
Merge branch 'smattr/
3FCAE05F -BC51-4094-AEE1-
F3CD1E65AE93 ' into 'main'
WebP plugin: fix use of raw '%zu'
See merge request graphviz/graphviz!2573
Matthew Fernandez [Fri, 8 Apr 2022 03:39:41 +0000 (20:39 -0700)]
WebP plugin: fix use of raw '%zu'
03a5c3621e3185e4ca116805317a98cdc8595443 introduced another usage of the format
specifier `%zu` which has some compatibility issues on Windows. This change
switches to what it should have done to begin with, used the compatibility shim.
Matthew Fernandez [Sat, 9 Apr 2022 16:19:15 +0000 (16:19 +0000)]
Merge branch 'smattr/
5CA08F5D -25F7-4765-8FF7-
76F300F4DFD9 ' into 'main'
CMake: enable Rsvg plugin
See merge request graphviz/graphviz!2565
Matthew Fernandez [Thu, 7 Apr 2022 00:49:56 +0000 (17:49 -0700)]
CMake: enable Rsvg plugin
Gitlab: #1836
Matthew Fernandez [Sat, 9 Apr 2022 02:21:35 +0000 (02:21 +0000)]
Merge branch 'smattr/
73694127 -C889-4E10-B8C2-
D161D5177777 ' into 'main'
CMake: enable GDK plugin
See merge request graphviz/graphviz!2560
Matthew Fernandez [Sun, 3 Apr 2022 19:57:24 +0000 (12:57 -0700)]
GDK plugin gdk_loadimage_cairo: squash -Wunused-parameter warning
This parameter cannot be removed because this function is used as a callback.
Matthew Fernandez [Sun, 3 Apr 2022 19:56:15 +0000 (12:56 -0700)]
GDK plugin gdk_format: squash -Wsign-conversion warnings
Matthew Fernandez [Sun, 3 Apr 2022 19:52:32 +0000 (12:52 -0700)]
GDK plugin gdk_format: squash -Wswitch-default warning
The device ID can only be one of the values configured at the bottom of this
file, so this switch is exhaustive.
Matthew Fernandez [Sun, 3 Apr 2022 19:50:56 +0000 (12:50 -0700)]
GDK plugin writer: squash -Wunused-parameter warning
This function is used as a callback so the `error` parameter cannot be removed.
Matthew Fernandez [Sun, 3 Apr 2022 19:50:25 +0000 (12:50 -0700)]
GDK plugin writer: remove an unnecessary cast
Matthew Fernandez [Sun, 3 Apr 2022 19:50:03 +0000 (12:50 -0700)]
GDK plugin writer: abbreviate
Matthew Fernandez [Sun, 3 Apr 2022 19:47:40 +0000 (12:47 -0700)]
GDK plugin argb2rgba: squash -Wconversion warnings
Matthew Fernandez [Sun, 3 Apr 2022 19:08:28 +0000 (12:08 -0700)]
remove unused 'HAVE_GDK_PIXBUF'
Matthew Fernandez [Sun, 3 Apr 2022 19:07:55 +0000 (12:07 -0700)]
remove unused 'HAVE_GDK'
Matthew Fernandez [Sun, 3 Apr 2022 19:03:41 +0000 (12:03 -0700)]
CMake: enable GDK plugin
Gitlab: #1836
Mark Hansen [Fri, 8 Apr 2022 06:52:32 +0000 (06:52 +0000)]
Merge branch 'pinc' into 'main'
Remove unused constant PINC
See merge request graphviz/graphviz!2568
Mark Hansen [Fri, 8 Apr 2022 06:52:23 +0000 (06:52 +0000)]
Merge branch 'remove-dots' into 'main'
Remove now-unreferenced html{n} graphs.
See merge request graphviz/graphviz!2567
Matthew Fernandez [Fri, 8 Apr 2022 03:04:33 +0000 (03:04 +0000)]
Merge branch 'smattr/
D2614CA4 -AE24-4715-86E4-
D53125CA77C4 ' into 'main'
more #2204 progress
See merge request graphviz/graphviz!2557
Matthew Fernandez [Sun, 3 Apr 2022 16:46:12 +0000 (09:46 -0700)]
common: remove unused unistd.h #include
Matthew Fernandez [Sun, 3 Apr 2022 16:30:02 +0000 (09:30 -0700)]
gvpr: remove unnecessary casts
Matthew Fernandez [Sun, 3 Apr 2022 16:13:35 +0000 (09:13 -0700)]
gvc: remove a use of the deprecated 'bcopy'
As the man page for `bcopy` notes:
bcopy() was deprecated in IEEE Std 1003.1-2001 (“POSIX.1”) and removed in
IEEE Std 1003.1-2008 (“POSIX.1”).
Matthew Fernandez [Sun, 3 Apr 2022 16:13:11 +0000 (09:13 -0700)]
gvc: remove unused unistd.h #include
Gitlab: #2204
Matthew Fernandez [Sun, 3 Apr 2022 16:06:13 +0000 (09:06 -0700)]
tred: remove unused unistd.h #include
Gitlab: #2204