Commit graph

23 commits

Author SHA1 Message Date
Diego Viola
7410755c03 Fix typos
found them with codespell.

Signed-off-by: Diego Viola <diego.viola@gmail.com>
2024-05-22 09:19:34 +02:00
Wim Taymans
adbd081b12 array: improve pw_array
Handle extend == 0 and don't expand the array but return -ENOSPC.
This makes it possible to handle static arrays, make a function to
make this easier. Remove pw_array_add_fixed() now that we support
this with extend==0 and because it was not used.

Round up the required space to next extend so that the total allocated
size if always a multiple of the extend.

Make pw_array_add_ptr() check for allocation errors instead of crashing.
2024-01-12 12:06:13 +01:00
Demi Marie Obenour
0f533c6d64 docs: Multiple clarifications to documentation
See !1817
2024-01-12 11:55:28 +01:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Demi Marie Obenour
671a7102ff Fix some badly-behaved macros
Some macros evaluated their arguments more than once when it was not
needed, or were missing parentheses.
2022-09-23 11:39:33 -04:00
Peter Hutterer
e36183d3cf array: re-initialize the array in pw_array_clear()
Leaving the data nonzero is a use-after-free bug waiting to happen.
2021-10-07 15:08:57 +10:00
Pauli Virtanen
8159797f89 doc: reorganize Doxygen groups/modules to make more sense
The Doxygen "Modules" page is not very illuminative, as different parts
of the API are mixed together and not all parts are included.

Try to address this:

Put all parts of the public API to some Doxygen group, usually one group
per header file. Use short, systematic names.

Make these groups sub-groups of a few top-level groups, roughly
corresponding to the different logical parts of the API (core, impl,
stream, filter, spa, utilities).
2021-10-03 15:39:27 +03:00
Peter Hutterer
4cb87317a7 pipewire: assert a nonzero array allocation size
If pw_array_ensure_size() is called on an array that has not been initialized
with an extend, assert. Otherwise we get stuck in an infinite loop since
doubling our zero allocation size will never reach "need".
2021-06-04 09:00:34 +10:00
Peter Hutterer
cbe29c070c doc: switch doxygen to using groups instead of pages and classes
C code doesn't lend itself well to using classes and pages are best for prose.
A doxygen group is a set of related functions - which is exactly what we have
here, e.g. pw_context.

This patch basically adds the following lines to each header:
\defgroup pw_whatever
\addtogroup pw_whatever
\{
....  function declarations ....
\}

Doxygen is smart enough to merge documentation in the header with
documentation in the correspondin .c file where the function is implemented.
2021-05-21 15:05:30 +10:00
Peter Hutterer
2405f0942b spa/buffer: rename SPA_MEMBER to SPA_PTROFF
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).
2021-05-06 09:39:39 +00:00
Wim Taymans
649448fb5f array: add and use pw_array_consume 2020-05-06 15:56:31 +02:00
Wim Taymans
6cf6af6620 array: add multistatement macro in parenthesis 2019-12-16 10:12:50 +01:00
Wim Taymans
504d78cd18 improve error handling
Set errno for functions returning NULL if relevant.
Propagate errno and result codes better.
Handle more error cases.
2019-06-07 10:11:23 +02:00
Wim Taymans
c348790ca1 map: handle more error cases 2019-05-15 15:19:25 +02:00
Wim Taymans
3dc6820e9e Don't use __ in defines or declarations, it's reserved
SPA_TYPE -> SPA_TYPE_INFO for type info strings
improve includes

Fixes #115
2019-01-14 13:00:00 +01:00
Wim Taymans
fb5ae6df43 tests: add array test 2019-01-08 13:40:41 +01:00
Wim Taymans
85f2e93c54 Relicense as MIT/X11
Remove some obsolete files
2018-11-05 17:48:52 +01:00
Wim Taymans
d4fa4e63e8 remove unused type map
Add reset methods for array and map
Signal disconnect before destroying the proxies in remote.
2018-09-26 13:11:23 +02:00
Wim Taymans
e0676fcef8 array: update size on delete 2018-07-07 11:29:45 +02:00
Wim Taymans
fe03ec8bde array: add some more helpers 2018-07-03 21:35:47 +02:00
Wim Taymans
f049d3dc7f Fix compiler issues with c++ 2018-02-08 10:49:08 +01:00
Wim Taymans
caaeaff223 Reorganise SPA tree
Reorganise the SPA includes to make it more extensible later
Simplify the naming of the buffer and meta params
2017-11-10 13:36:14 +01:00
Wim Taymans
d1655196c3 move things around 2017-07-11 16:08:22 +02:00
Renamed from pipewire/client/array.h (Browse further)