summaryrefslogtreecommitdiffstats
path: root/oss
diff options
context:
space:
mode:
authorDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-11-21 02:11:44 +0100
committerDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-11-21 13:07:03 +0100
commit9d65155c28d4a47022a4de7e604187b8b2ad2137 (patch)
treee36aa03bed80065259ca8bfcde0662116c1dc26f /oss
parente4ce5402202d983a84d01555445eeb23e5a9268f (diff)
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 'oss')
-rw-r--r--oss/ctl_oss.c6
-rw-r--r--oss/pcm_oss.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/oss/ctl_oss.c b/oss/ctl_oss.c
index 716ab64..b589f74 100644
--- a/oss/ctl_oss.c
+++ b/oss/ctl_oss.c
@@ -40,7 +40,7 @@ typedef struct snd_ctl_oss {
unsigned int rec_item[SOUND_MIXER_NRDEVICES];
} snd_ctl_oss_t;
-static const char *vol_devices[SOUND_MIXER_NRDEVICES] = {
+static const char *const vol_devices[SOUND_MIXER_NRDEVICES] = {
[SOUND_MIXER_VOLUME] = "Master Playback Volume",
[SOUND_MIXER_BASS] = "Tone Control - Bass",
[SOUND_MIXER_TREBLE] = "Tone Control - Treble",
@@ -68,7 +68,7 @@ static const char *vol_devices[SOUND_MIXER_NRDEVICES] = {
[SOUND_MIXER_MONITOR] = "Monitor Playback Volume",
};
-static const char *rec_devices[SOUND_MIXER_NRDEVICES] = {
+static const char *const rec_devices[SOUND_MIXER_NRDEVICES] = {
[SOUND_MIXER_VOLUME] = "Mix Capture Switch",
[SOUND_MIXER_SYNTH] = "Synth Capture Switch",
[SOUND_MIXER_PCM] = "PCM Capture Switch",
@@ -86,7 +86,7 @@ static const char *rec_devices[SOUND_MIXER_NRDEVICES] = {
[SOUND_MIXER_RADIO] = "Radio Capture Switch",
};
-static const char *rec_items[SOUND_MIXER_NRDEVICES] = {
+static const char *const rec_items[SOUND_MIXER_NRDEVICES] = {
[SOUND_MIXER_VOLUME] = "Mix",
[SOUND_MIXER_SYNTH] = "Synth",
[SOUND_MIXER_PCM] = "PCM",
diff --git a/oss/pcm_oss.c b/oss/pcm_oss.c
index 16ba1f0..8a2a672 100644
--- a/oss/pcm_oss.c
+++ b/oss/pcm_oss.c
@@ -233,7 +233,7 @@ static int oss_hw_params(snd_pcm_ioplug_t *io,
static int oss_hw_constraint(snd_pcm_oss_t *oss)
{
snd_pcm_ioplug_t *io = &oss->io;
- static snd_pcm_access_t access_list[] = {
+ static const snd_pcm_access_t access_list[] = {
SND_PCM_ACCESS_RW_INTERLEAVED,
SND_PCM_ACCESS_MMAP_INTERLEAVED
};
@@ -242,7 +242,7 @@ static int oss_hw_constraint(snd_pcm_oss_t *oss)
unsigned int nchannels;
unsigned int channel[6];
/* period and buffer bytes must be power of two */
- static unsigned int bytes_list[] = {
+ static const unsigned int bytes_list[] = {
1U<<8, 1U<<9, 1U<<10, 1U<<11, 1U<<12, 1U<<13, 1U<<14, 1U<<15,
1U<<16, 1U<<17, 1U<<18, 1U<<19, 1U<<20, 1U<<21, 1U<<22, 1U<<23
};
@@ -329,7 +329,7 @@ static int oss_close(snd_pcm_ioplug_t *io)
return 0;
}
-static snd_pcm_ioplug_callback_t oss_playback_callback = {
+static const snd_pcm_ioplug_callback_t oss_playback_callback = {
.start = oss_start,
.stop = oss_stop,
.transfer = oss_write,
@@ -340,7 +340,7 @@ static snd_pcm_ioplug_callback_t oss_playback_callback = {
.drain = oss_drain,
};
-static snd_pcm_ioplug_callback_t oss_capture_callback = {
+static const snd_pcm_ioplug_callback_t oss_capture_callback = {
.start = oss_start,
.stop = oss_stop,
.transfer = oss_read,