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'
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.
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.
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.
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.
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.
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.
Costa Shulyupin [Sun, 3 Apr 2022 08:10:56 +0000 (11:10 +0300)]
squash warning in mm_read_unsymmetric_sparse
warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
On success, these functions return the number of input items
successfully matched and assigned; this can be fewer than
provided for, or even zero, in the event of an early
matching failure.
Costa Shulyupin [Sun, 3 Apr 2022 08:10:41 +0000 (11:10 +0300)]
squash warning in SparseMatrix_import_matrix_market/MATRIX_TYPE_COMPLEX
warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
On success, these functions return the number of input items
successfully matched and assigned; this can be fewer than
provided for, or even zero, in the event of an early
matching failure.
Costa Shulyupin [Sun, 3 Apr 2022 08:10:29 +0000 (11:10 +0300)]
squash warning in SparseMatrix_import_matrix_market/MATRIX_TYPE_PATTERN
warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
On success, these functions return the number of input items
successfully matched and assigned; this can be fewer than
provided for, or even zero, in the event of an early
matching failure.
Costa Shulyupin [Sun, 3 Apr 2022 08:08:47 +0000 (11:08 +0300)]
squash warning in SparseMatrix_import_matrix_market/MATRIX_TYPE_INTEGER
warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
On success, these functions return the number of input items
successfully matched and assigned; this can be fewer than
provided for, or even zero, in the event of an early
matching failure.
Costa Shulyupin [Sun, 3 Apr 2022 08:04:41 +0000 (11:04 +0300)]
squash warning in SparseMatrix_import_matrix_market/MATRIX_TYPE_REAL
warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
On success, these functions return the number of input items
successfully matched and assigned; this can be fewer than
provided for, or even zero, in the event of an early
matching failure.