From 9d65155c28d4a47022a4de7e604187b8b2ad2137 Mon Sep 17 00:00:00 2001 From: "Diego E. 'Flameeyes' Pettenò" Date: Fri, 21 Nov 2008 02:11:44 +0100 Subject: Make some static tables and strings constants. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ò --- oss/ctl_oss.c | 6 +++--- oss/pcm_oss.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'oss') 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, -- cgit