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

@ -658,9 +658,11 @@ spa_v4l2_enum_format(struct impl *this, int seq,
goto exit;
}
if (filter) {
static const struct spa_rectangle step = {1, 1};
const struct spa_rectangle *values;
const struct spa_pod_prop *p;
struct spa_pod *val;
const struct spa_rectangle step = { 1, 1 }, *values;
uint32_t choice, i, n_values;
/* check if we have a fixed frame size */
@ -749,10 +751,12 @@ spa_v4l2_enum_format(struct impl *this, int seq,
goto exit;
}
if (filter) {
static const struct spa_fraction step = {1, 1};
const struct spa_fraction *values;
const struct spa_pod_prop *p;
struct spa_pod *val;
uint32_t i, n_values, choice;
const struct spa_fraction step = { 1, 1 }, *values;
if (!(p = spa_pod_find_prop(filter, NULL, SPA_FORMAT_VIDEO_framerate)))
goto have_framerate;