Clang 15 at least with my build configuration emits warnings about
function prototypes that lack argument types. Most notably this
happens with functions that take no arguments which in compiler view
equates to the void type i.e. void f(void) instead of void f(). As I
understand, this will become an error in some future Clang release,
so might as well fix it now.
Since these were discovered not by a linter but by the actual compiler
for my particular build configuration, some f() may have escaped for
now. But at least it's enough to build PipeWire with most optional
features enabled even when -Werror=strict-prototypes is enabled.
For anyone else wanting to have a go at this, these can be upgraded
from warnings to errors by adding -Werror=strict-prototypes to the
custom CFLAGS which probably works with GCC, too, but has only been
done with Clang 15.0.2.
Finally my editor automatically stripped trailing spaces upon saving
the modified files. I assume it's probably not worth keeping those
invisible bytes around but this may have slightly dubious implications
as it did also turn indented empty lines of JACK license header into
regular empty lines.
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
Since 01c6fd0a88 the
minimum required meson version is 0.59.0, and since
meson 0.58.0, `get_variable()` on a dependency object
accepts a positional argument. The "type" of variable
(internal, pkgconfig, etc.) in that case does not need
to be specified explicitly.
Use `meson.project_{build,source}_root()` instead of
`meson.{build,source}_root()` because those functions
do not work as expected when used inside a subproject,
and they have been deprecated in meson 0.56.0.
Previously, the configured test file would be named like the following:
spa-include-test-spa_control_control_h..cpp
fix that by removing one of the dots.
Furthermore, use the already existing `find` object instead of
calling `find_program` one more time.
Move the spa tests to the pwtest framework. The pod tests have only been
wrapped in the function callers, they don't use the variuos pwtest helpers -
too much work for very little gain here. Can be done incrementally if needed.
Note that this removes the spa tests from the installed tests. Arguably,
installing those tests was unnecessary anyway since they are static binaries
and don't load anything. So having them installed runs the same tests as
having them run in the source tree.
Goal for the pwtest framework is to allow for installed tests, just not there
yet.
If we have a C++ compiler, compile all the #include tests with that - it'll
pick up any issues that a C compiler will pick up anyway. This saves us from
having a separate C++ compiler test and it'll test each header separately for
C++ compatibility..
For each header in the spa directory, generate a compilation test that
includes just that header. This way we can pick up missing #includes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Replace the manually maintained header list with a Python script that finds
all header files and includes them in order. This adds another 25 or so
previously headers to the C++ compilation tests.
Wraps the glibc snprintf/vsnprintf calls, but aborts if given a negative size
and zero-terminates the buffer on error.
The returned value is clipped to size - 1 which avoids issues like the one
fixed in c851349f17.
This replaces the manual check for "true" and some (inconsistent) return value
of atoi. All those instances now require either "true" or "1" to parse as
true, any other value (including NULL) is boolean false.
Easier to use than strcmp() since their return value matches expectations. And
they do what is expected with NULL strings, two NULL pointers are equal, one
NULL pointer is not equal.
Most of the time when we convert a string to an integer we only care about
success. Let's wrap this with a helper function that sets the value to the
result and returns true on success.
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
Make info parsing a bit easier to read by assigning the key and
value to temporary variables.
Improve the parsing of channelmap using json parser to make it
support more cases.
Add a unit test for channelmap parsing options.
Use a different way to generate the upper bits of the ASYNC mask
instead of undefined shift as warned by sanitizer
Add some unit test for this
See #497
Clear the hook before adding it so that we are sure the removed
callback doesn't contain garbage and cause a crash on disconnect.
Mark the removed and priv fields as private. Make sure to add the
removed callback after adding the hook.
Fixes a crash in kwin
The __x86_64__ macro identifies a CPU family, and is unfortunately not
enough to identify a concrete ABI.
The normal x86_64 ABI that is used by practical Linux distributions is
LP64 (i.e. 32-bit int, and 64-bit long and pointer), and defines
__x86_64__ and __LP64__.
x32 is a niche ILP32 ABI (i.e. 32-bit int, long and pointer) for x86_64
CPUs, which has different struct sizes due to sizeof(long) and
sizeof(void *) being smaller. It defines __x86_64__ and __ILP32__.
Signed-off-by: Simon McVittie <smcv@debian.org>