This type discrimination did not seem to make much sense (why select between int
and short based on the sizes of long and int?), but more problematically was not
working as intended. This header does not include limits.h, so both LONG_MAX and
INT_MAX were undefined and this expression defaulted to 0 regardless of the
sizes of these types.
This removes yet another use of `ex->tmp` within exeval.c code. It is replaced
with a dynamically allocated buffer from vmalloc. This not only reduces reliance
on sfio, but is likely more efficient as data is written directly into a vmalloc
buffer rather than being written to an sfio buffer and then copied to a vmalloc
buffer. Related to #1998.
Upcoming changes refactor parts of this function and its current chaotic indent
style make these changes very error prone to apply. It is hoped that this
reformatting makes the upcoming change safer.
This reverts commit ab322d219b7dae03fe5f7114dfd0e1d2fc7d3b5d. A `realloc`
analogue appears to be the simplest way of removing sfputr/sfputc usage in
exeval.c. Related to #1998.
The externally-facing functions that take a `move_to_front` parameter cannot
easily be updated to take C99 bools without breaking API. But at least the
internal functions can use C99 bools to be clearer.
agbindrec: realign parameter names in prototype with definition
The C compiler does not care if these names mismatch, but it is less confusing
to be consistent. This change leaves the obj/arg_obj discrepancy alone under the
justification that "arg_obj" is not any more useful externally-facing and "obj"
internally would conflict with an already existing local.
add archiving of VERSION and COLLECTION to all build jobs
An upcoming commit will remove the dependency to the portable-source
job for all test jobs, so it must be possible the retrieve these files
from the corresponding build job instead. Note that this is used only
for jobs using the portable source which have these files built into
them. Other jobs generate these files as needed.
Magnus Jacobsson [Wed, 11 Aug 2021 18:21:39 +0000 (20:21 +0200)]
remove the dependency on the portable-source job for CMake test jobs
The dependency is unnecessary since both the VERSION and COLLECTION
files are now generated in the CMake test jobs. Note that there
probably is no latency benefit by removing it, since the
portable-source job normally is faster than the CMake builds jobs.
An upcoming commit will remove the dependency to the portable-source
job for all CMake test jobs, so this file instead needs to be
generated by these jobs. Note that the COLLECTION file is generated by
the CMake test jobs already before this commit.
don't read the VERSION file for CMake builds in ci/build.sh
The CMake build system generates this file itself and nothing in this
script uses it for the CMake builds.
An upcoming commit will change the CI configuration to start the CMake
builds jobs directly without waiting for the portable-source job and
since that job produces the VERSION file, it will no longer be present
when the CMake builds jobs start.
restructure "%.*s" handling to avoid sfio dynamic allocation in expr’s printf
Rather than using the temporary sfio buffer in this code, fmt->tmp, we can just
use the original string as-is as it does not need to be modified. Apart from
slightly accelerating this code, this makes yet more progress towards removing
fmt->tmp and sfio. Related to #1998.
remove fallback "%?%K" strftime format in expr’s printf
lib/expr’s printf implementation supports a "%t" format code to print a time. If
no format is provided for this, it would fallback to a default of "%?%K".
While working on #1998, one of my intermediate refactorings moved this string
literal into the actual call to strftime. At this point the compiler politely
interjected that neither "%?" nor "%K" are format strings understood by
strftime. So it seems this results in an invalid call to strftime.
To deal with this, we now throw an error when this function is called with no
format string instead of making an invalid strftime call.
The caching done by this function is no longer necessary. All usages of it have
been refactored to use standard library functionality which does caching at the
operating system level.
pathpath: replace PATH_REGULAR pathexists call with a stat.
This effectively inlines and simplifies the call to pathexists that previously
existed. The caching pathexists does is no longer relevant. An improved version
of this is provided by a modern operating system’s buffer cache.
pathpath: replace PATH_EXECUTE pathexists call with X_OK access call
This is equivalent and relies solely on standard library functionality. This
effectively inlines and simplifies the call to pathexists that previously
existed. The caching pathexists does is no longer relevant. An improved version
of this is provided by a modern operating system’s buffer cache.
This function is only ever called with a=="". There is probably more
simplification possible within pathpath, but the logic is convoluted. Better to
unwind this mess in a separate commit.
The first layout of a graph must be destroyed before a second layout
is created.
This failure went undetected in CI since no test programs ran, which
in turn was caused by not archiving the test programs or the
CTestTestfile.cmake files in the preceding build job.
The error message was:
-------------------------------------------------------------------------------
Multiple layouts of the same graph can use different contexts passed as rvalue
refs
-------------------------------------------------------------------------------
../tests/test_GVLayout_construction.cpp:139
...............................................................................
../tests/test_GVLayout_construction.cpp:139: FAILED:
due to unexpected exception with message:
Previous layout not yet destroyed
No CTestTestfile.cmake files were archived in the build job that
created them, which had the effect that the suceeding test job
silently did not find any ctest tests.
pathgetlink: use a ssize_t locally, squashing -Wsign-conversion warnings
The type of the local used now matches the return type of readlink. This avoids
several compiler warnings. pathgetlink.c now builds warning-free on Linux.
pathcanon: avoid reusing `dots` variable for unrelated values
This branch reuses the `dots` variable, previously used for counting the number
of periods in the path, for storing the result of symlink resolution. This is
unnecessary (`dots` is immediately overwritten with the value 4 after this), and
is getting in the way of cleaning up some compiler warnings in this area.