mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05:00
treewide: mark things static and const
Mark some structures, arrays static/const at various places. In some cases this prevents unnecessary initialization when a function is entered. All in all, the text segments across all shared libraries are reduced by about 2 KiB. However, the total size increases by about 2 KiB as well.
This commit is contained in:
parent
48dbb4da3c
commit
f5d51162c4
54 changed files with 303 additions and 241 deletions
|
|
@ -36,13 +36,12 @@ do { \
|
|||
|
||||
static void test_abi(void)
|
||||
{
|
||||
struct pw_stream_events ev;
|
||||
struct {
|
||||
static const struct {
|
||||
uint32_t version;
|
||||
void (*destroy) (void *data);
|
||||
void (*state_changed) (void *data, enum pw_stream_state old,
|
||||
enum pw_stream_state state, const char *error);
|
||||
void (*control_info) (void *data, uint32_t id, const struct pw_stream_control *control);
|
||||
void (*control_info) (void *data, uint32_t id, const struct pw_stream_control *control);
|
||||
void (*io_changed) (void *data, uint32_t id, void *area, uint32_t size);
|
||||
void (*param_changed) (void *data, uint32_t id, const struct spa_pod *param);
|
||||
void (*add_buffer) (void *data, struct pw_buffer *buffer);
|
||||
|
|
@ -51,6 +50,8 @@ static void test_abi(void)
|
|||
void (*drained) (void *data);
|
||||
} test = { PW_VERSION_STREAM_EVENTS, NULL };
|
||||
|
||||
struct pw_stream_events ev;
|
||||
|
||||
TEST_FUNC(ev, test, destroy);
|
||||
TEST_FUNC(ev, test, state_changed);
|
||||
TEST_FUNC(ev, test, control_info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue