manage events collections in vpsc as values instead of pointers
This removes some manual memory management and optimizes the layout of these
elements (note emplace_back). Memory for individual events is now retained
slightly longer because a manual deletion of pointers event-by-event was removed
and we now rely on the final vector clean up to free this memory. But the impact
of this is expected to be negligible and outweighed by the improved layout.
This is safer and has the potential to be more efficient. Note that this
required rewriting the involved comparator to judge less-than instead of a
three-outcome comparison.
make events a local variable in generateXConstraints and generateYConstraints
Not only is this variable not used outside its containing file (could be
declared static), but its lifetime within both these functions is entirely
contained. Reusing the same global in these functions has no advantage, but
impairs the compiler’s ability to optimize by potentially confusing its alias
analysis.
This removes a layer of indirection. Previously data was being written to the
persistent scratch space, ex->tmp, and then copied to a further temporary buffer
in tok. We now simply allocate to tok and write directly into it. This also
addresses an issue where the persistent buffer was being unconditionally used,
despite that it may have failed to be opened due to lack of memory.
This removes a layer of indirection. Previously data was being written to the
persistent scratch space, ex->tmp, and then copied to a further temporary buffer
in tok. We now simply allocate to tok and write directly into it. This also
addresses an issue where the persistent buffer was being unconditionally used,
despite that it may have failed to be opened due to lack of memory.
use a local buffer for expr sprintf instead of a persistent one
Though this introduces another call to sfstropen, it is actually a step towards
removing sfstropen calls. The first part of this is localizing existing usages;
avoiding the ex->tmp buffer. Then the implementation of expr’s sprintf itself
will need to be refactored to operate on a non-SFIO buffer.
Note that this also addresses an issue where expr’s sprintf would use the
persistent buffer even if prior opening of it had failed due to lack of memory.
Having unraveled the use of longjmp here, the jmp_buf and its setup are no
longer required.
On GCC 8.3.0 this removes a -Wclobbered warning. Though interestingly the
warning text itself is a false positive, referencing nverts that is not used in
the setjmp(…)!=0 path. The actual dangerously used variables in this scenario
were polygon_list and vertex_list. My take away here is that *any* -Wclobbered
warning is typically an indicator of incorrect code. I have never seen a
-Wclobbered warning (from any compiler) for code that was not buggy.
find_ints does not currently return negative values. It returns only 0 or 1.
However, we would like to unravel a use of longjmp within it, so returning a
negative value to indicate an error is convenient. This is preparation for
upcoming changes. Related to #1801.
If a test compiles and/or runs C code and that test fails, included in the test
suite output will now be the commands themselves that were run, echoed in the
style of Bash’s set -x.
support receiving C compiler flags in the test suite from the environment
The environment variables CFLAGS and LDFLAGS now also effect the flags used with
the C compiler in the test suite, in addition to the build system. Related to
#1881.
visio plugin: manage _chars member of Text as a value instead of a pointer
This member is never set to NULL and the Char class is not involved in any
inheritance hierarchy. So there is no need to heap-allocate it or pass it around
by pointer.
visio plugin: manage _para member of Text as a value instead of a pointer
This member is never set to NULL and the Para class is not involved in any
inheritance hierarchy. So there is no need to heap-allocate it or pass it around
by pointer.
visio plugin: manage _line member of Graphic as a value instead of pointer
This member is never set to NULL and the Line class is not involved in any
inheritance hierarchy. So there is no need to heap-allocate it or pass it around
by pointer.
Across the range of platforms Graphviz runs on, this is not a reasonable
default. E.g. Windows will have none of these paths and this is not even how one
separates paths in Windows $PATH. This is mostly a latent issue, as it is very
rare for $PATH to be unset.
This fixes some -Wsign-conversion warnings at the expense of introducing some
-Wsign-compare warnings. The latter should be removed as we migrate the cell
count in mazes to size_t.
This fixes one -Wsign-conversion warning, though introduces a -Wconversion
warning. We should be able to remove the latter as we continue cleaning up the
use of int for sizes.
The LASI plugin was using two global variables, making it impossible to process
multiple graphs with it at the same time. This change refactors it to use the
jobs context as other rendering plugins do.
This was added in the initial commit of VPSC, 03c20a55c921ac07599be2ae19ae34209ec0d02e. The comment was incorrect. This does
*not* limit iteration because the variable type is unsigned. That is, it is
always >= 0. This was caught by enabling CXXFLAGS+=-Wtype-limits.