This check was forcing assertions off if using them depends on __eprintf. It is
unclear to me what the motivation for this is and it was introduced in the
initial revision with no further information. As far as I am aware, this is no
longer relevant. Modern libc is intended to provide everything necessary to
support assert, unless you are building freestanding which Graphviz does not
support.
remove pow micro-optimizations in spring_electrical.c
This code was attempting to optimize the case when the second argument to pow()
was 2. However, modern compilers are able to understand such nuances. In fact,
at -O3 recent Clang *undoes* this branching code into an unconditional call to
pow(). In other words, it considers this branch to multiplication to be a
de-optimization.
This change also incidentally removes 14 -Wfloat-equal warnings.
use a C99 bool array for checked in beautify_leaves
This change not only reduces the heap usage for this function (sizeof(bool) is
typically less than sizeof(int)), but also makes both allocation and
initialization more efficient.
avoid manual memory management of PairingHeap pointers in Block
Not only does this free us from having to think about allocation tracking and
memory leaks, because Block does not participate in any inheritance hierarchy we
can also remove its explicit destructor.
Objects of type Block were already unsafe to copy (or move). The class contains
raw pointers that are deleted in the destructor. So any attempt to copy an
object of this type would have eventually caused a use-after-free and/or a
double free. This change makes the situation more explicit by teaching the
compiler it is unsafe to copy or move objects of this type. If there is code that
implicitly does this, it will now be rejected at compile time.
remove unnecessary temporary vector in Blocks::cleanup
This code was taking a copy of every element in a set in order to iterate
through them while removing elements from the underlying set. However, this is
not necessary. This change replaces this code with the standard pattern for
deleting elements while iterating over a set.
return a value instead of pointer from Blocks::totalOrder
This function dynamically allocated a list and returned a pointer to this,
presumably under the assumption that copying this kind of object during return
is expensive. However, Named Return Value Optimization (NRVO) applies to this
function. So the compiler can elide the copy during return, making a value
cheaper than a heap pointer here.
In tclpkg/gv, the gv_doc_writer.tcl is run multiple times during
the build. It is ineffective, but it shouldn't cause any troubles
with the serial build. Unfortunately, this is not the case with
the parallel builds where multiple parallel runs of the
gv_doc_writer.tcl can cause races leading to empty corresponding
ps and pdf files.
The correct solution would be to use the Rules with Grouped Targets [1],
unfortunately this GNU make feature has been introduced quite
recently which would break backward compatibility.
The proposed hack should cause the gv_doc_writer.tcl to be run
only once during the build process and it should work also with
the older 'make'. It is inspired by [2].
remove Python 2 support from shapes regression test
Python 2 was EOLed in 2020. This change removes the ability to use Python 2 when
running the shapes test.
This is somewhat moot as the Makefile.am targets for this are not really usable
right now (see the commits merged in 7d0bd41a7ccac1d0d992e8c19ce08f62b85b16ad
that improved the situation but still did not make `make check-recursive`
runnable). Nevertheless this at least removes one legacy code path that does not
need to be worked on in future.
The existing CI tasks run an uncommon work flow: building distributable packages
on each operating system. A more common work flow end users will be following
with the portable source tarball is simply building and installing it. This
change adds a job that does this, to provide a safeguard against breaking this
work flow in future.
The added job runs on Ubuntu 21.04. The intent is to bump this job to the latest
each time there is a new Ubuntu release. There is no companion test job for the
build job because we assume the existing test jobs are providing sufficient
coverage.
The rules that generated these bindings were all removed in 3caeb0ae2a38fdefb9f302f41407f5038e374010 but the clean up steps were incorrectly
not removed at the same time. Related to #1992.
remove unnecessary casts of allocation function results in grammar.y
This input is only used to generate a parser in C. In C, void pointers (as are
the results of all the allocation functions) implicitly coerce to all other
pointer types.
remove unnecessary casts of allocation results in mklang.y
This input is only used to generate a C file. In C, void pointers (as are the
results of all the allocation functions) implicitly coerce to all other pointer
types.
remove unnecessary casts of allocation results in gmlparse.y
These functions all return void pointers and this input is only used for
generating a parser in C. In C, void pointers implicitly coerce to all other
pointers.