From 99f5fef0ea5671d41fb7b737fbc3e4236542a757 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 10 Jun 2014 23:56:05 +0200 Subject: Add more const While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need. --- audio/out/ao_alsa.c | 2 +- audio/out/ao_oss.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'audio/out') diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index 8bdf5e635c..25a051fee8 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -244,7 +244,7 @@ static int find_alsa_format(int af_format) // The second item must be resolvable with mp_chmap_from_str(). // Source: http://www.alsa-project.org/main/index.php/DeviceNames // (Speaker names are slightly different from mpv's.) -static const char *device_channel_layouts[][2] = { +static const char *const device_channel_layouts[][2] = { {"default", "fc"}, {"default", "fl-fr"}, {"rear", "bl-br"}, diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index 545ddca3f8..7698af4e0c 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -65,7 +65,7 @@ struct priv { char *cfg_oss_mixer_channel; }; -static const char *mixer_channels[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; +static const char *const mixer_channels[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; /* like alsa except for 6.1 and 7.1, from pcm/matrix_map.h */ static const struct mp_chmap oss_layouts[MP_NUM_CHANNELS + 1] = { @@ -80,7 +80,7 @@ static const struct mp_chmap oss_layouts[MP_NUM_CHANNELS + 1] = { MP_CHMAP8(FL, FR, BL, BR, FC, LFE, SL, SR), // 7.1 }; -static int format_table[][2] = { +static const int format_table[][2] = { {AFMT_U8, AF_FORMAT_U8}, {AFMT_S8, AF_FORMAT_S8}, {AFMT_U16_LE, AF_FORMAT_U16_LE}, -- cgit v1.2.3