summaryrefslogtreecommitdiff
path: root/amixer
diff options
context:
space:
mode:
authorDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-11-21 13:10:02 +0100
committerDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-11-21 13:10:02 +0100
commit6232f1c96cde1fee247e95cd97235c48cc7b168d (patch)
treee21322f006201192768c2a01b4f7d7479e6c9d3a /amixer
parentca1ea1e90484bf8cd2a7ef78f29e4f02a457d584 (diff)
downloadalsa-utils-6232f1c96cde1fee247e95cd97235c48cc7b168d.tar.gz
Make some static tables and strings constants.
By doing this we move them from the .data section to .rodata setion, or from .data.rel to .data.rel.ro. The .rodata section is mapped directly from the on-disk file, which is always a save, while .data.rel.ro is mapped directly when using prelink, which is a save in a lot of cases. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Diffstat (limited to 'amixer')
-rw-r--r--amixer/amixer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/amixer/amixer.c b/amixer/amixer.c
index d5a77ba..9620721 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -310,7 +310,7 @@ static int set_capture_dB(snd_mixer_elem_t *elem,
return snd_mixer_selem_set_capture_dB(elem, c, value, 0);
}
-static struct volume_ops_set vol_ops[2] = {
+static const struct volume_ops_set vol_ops[2] = {
{
.has_volume = snd_mixer_selem_has_playback_volume,
.v = {{ snd_mixer_selem_get_playback_volume_range,
@@ -1346,7 +1346,7 @@ typedef struct channel_mask {
char *name;
unsigned int mask;
} channel_mask_t;
-static channel_mask_t chanmask[] = {
+static const channel_mask_t chanmask[] = {
{"frontleft", 1 << SND_MIXER_SCHN_FRONT_LEFT},
{"frontright", 1 << SND_MIXER_SCHN_FRONT_RIGHT},
{"frontcenter", 1 << SND_MIXER_SCHN_FRONT_CENTER},
@@ -1363,7 +1363,7 @@ static channel_mask_t chanmask[] = {
static unsigned int channels_mask(char **arg, unsigned int def)
{
- channel_mask_t *c;
+ const channel_mask_t *c;
for (c = chanmask; c->name; c++) {
if (strncasecmp(*arg, c->name, strlen(c->name)) == 0) {
@@ -1892,7 +1892,7 @@ int main(int argc, char *argv[])
{
int morehelp, level = 0;
int read_stdin = 0;
- static struct option long_option[] =
+ static const struct option long_option[] =
{
{"help", 0, NULL, 'h'},
{"card", 1, NULL, 'c'},