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:
Barnabás Pőcze 2021-06-27 17:47:13 +02:00
parent 48dbb4da3c
commit f5d51162c4
54 changed files with 303 additions and 241 deletions

View file

@ -220,11 +220,7 @@ PWTEST(context_properties)
PWTEST(context_support)
{
struct pw_main_loop *loop;
struct pw_context *context;
const struct spa_support *support;
uint32_t n_support;
const char * types[] = {
static const char * const types[] = {
SPA_TYPE_INTERFACE_DataSystem,
SPA_TYPE_INTERFACE_DataLoop,
SPA_TYPE_INTERFACE_System,
@ -234,6 +230,11 @@ PWTEST(context_support)
SPA_TYPE_INTERFACE_DBus,
SPA_TYPE_INTERFACE_CPU
};
struct pw_main_loop *loop;
struct pw_context *context;
const struct spa_support *support;
uint32_t n_support;
size_t i;
pw_init(0, NULL);