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

@ -698,9 +698,11 @@ static bool rfcomm_hfp_ag(struct spa_source *source, char* buf)
/* retrieve supported codecs */
/* response has the form AT+BAC=<codecID1>,<codecID2>,<codecIDx>
strategy: split the string into tokens */
static const char separators[] = "=,";
char* token;
char separators[] = "=,";
int cntr = 0;
token = strtok (buf, separators);
while (token != NULL)
{
@ -855,13 +857,14 @@ static bool rfcomm_hfp_ag(struct spa_source *source, char* buf)
static bool rfcomm_hfp_hf(struct spa_source *source, char* buf)
{
static const char separators[] = "\r\n:";
struct rfcomm *rfcomm = source->data;
struct impl *backend = rfcomm->backend;
unsigned int features;
unsigned int gain;
unsigned int selected_codec;
char* token;
char separators[] = "\r\n:";
token = strtok(buf, separators);
while (token != NULL)