mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -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
|
|
@ -220,7 +220,7 @@ enum {
|
|||
SOURCE_FLAT_VOLUME = 0x0080U,
|
||||
};
|
||||
|
||||
static const char *port_types[] = {
|
||||
static const char * const port_types[] = {
|
||||
"unknown",
|
||||
"aux",
|
||||
"speaker",
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ bool channel_map_valid(const struct channel_map *map)
|
|||
}
|
||||
|
||||
|
||||
static const char *encoding_names[] = {
|
||||
static const char * const encoding_names[] = {
|
||||
[ENCODING_ANY] = "ANY",
|
||||
[ENCODING_PCM] = "PCM",
|
||||
[ENCODING_AC3_IEC61937] = "AC3-IEC61937",
|
||||
|
|
|
|||
|
|
@ -379,16 +379,16 @@ static void service_entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupStat
|
|||
|
||||
static void publish_service(struct service *s)
|
||||
{
|
||||
AvahiStringList *txt = NULL;
|
||||
const char *t;
|
||||
char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
|
||||
|
||||
const char * const subtype_text[] = {
|
||||
static const char * const subtype_text[] = {
|
||||
[SUBTYPE_HARDWARE] = "hardware",
|
||||
[SUBTYPE_VIRTUAL] = "virtual",
|
||||
[SUBTYPE_MONITOR] = "monitor"
|
||||
};
|
||||
|
||||
AvahiStringList *txt = NULL;
|
||||
const char *t;
|
||||
char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
|
||||
|
||||
spa_assert(s);
|
||||
|
||||
if (!s->userdata->client || avahi_client_get_state(s->userdata->client) != AVAHI_CLIENT_S_RUNNING)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue