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

@ -2015,7 +2015,7 @@ pw_protocol_native_registry_event_demarshal[PW_REGISTRY_EVENT_NUM] =
[PW_REGISTRY_EVENT_GLOBAL_REMOVE] = { &registry_demarshal_global_remove, 0, }
};
const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
static const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
PW_TYPE_INTERFACE_Registry,
PW_VERSION_REGISTRY,
0,
@ -2050,7 +2050,7 @@ pw_protocol_native_module_method_demarshal[PW_MODULE_METHOD_NUM] =
[PW_MODULE_METHOD_ADD_LISTENER] = { NULL, 0, },
};
const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
static const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
PW_TYPE_INTERFACE_Module,
PW_VERSION_MODULE,
0,
@ -2084,7 +2084,7 @@ pw_protocol_native_factory_method_demarshal[PW_FACTORY_METHOD_NUM] =
[PW_FACTORY_METHOD_ADD_LISTENER] = { NULL, 0, },
};
const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
static const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
PW_TYPE_INTERFACE_Factory,
PW_VERSION_FACTORY,
0,

View file

@ -1,5 +1,4 @@
const struct type_info {
static const struct type_info {
const char *type;
const char *name;
uint32_t id;