summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--audio/out/ao_sdl.c2
-rw-r--r--audio/out/ao_sndio.c6
-rw-r--r--common/msg.c2
-rw-r--r--common/msg_control.h2
-rw-r--r--demux/codec_tags.c4
-rw-r--r--sub/osd.h4
-rw-r--r--sub/osd_dummy.c4
-rw-r--r--sub/osd_libass.c4
-rw-r--r--video/out/gl_common.c2
9 files changed, 16 insertions, 14 deletions
diff --git a/audio/out/ao_sdl.c b/audio/out/ao_sdl.c
index d2362a723e..91554d71fe 100644
--- a/audio/out/ao_sdl.c
+++ b/audio/out/ao_sdl.c
@@ -38,7 +38,7 @@ struct priv
float buflen;
};
-static int fmtmap[][2] = {
+static const int fmtmap[][2] = {
{AF_FORMAT_U8, AUDIO_U8},
{AF_FORMAT_S8, AUDIO_S8},
{AF_FORMAT_U16, AUDIO_U16SYS},
diff --git a/audio/out/ao_sndio.c b/audio/out/ao_sndio.c
index 6afe0f9eaf..c528d5729d 100644
--- a/audio/out/ao_sndio.c
+++ b/audio/out/ao_sndio.c
@@ -111,7 +111,8 @@ static int init(struct ao *ao)
struct af_to_par {
int format, bits, sig;
- } static const af_to_par[] = {
+ };
+ static const struct af_to_par af_to_par[] = {
{AF_FORMAT_U8, 8, 0},
{AF_FORMAT_S8, 8, 1},
{AF_FORMAT_U16, 16, 0},
@@ -120,7 +121,8 @@ static int init(struct ao *ao)
{AF_FORMAT_S24, 24, 1},
{AF_FORMAT_U32, 32, 0},
{AF_FORMAT_S32, 32, 1},
- }, *ap;
+ };
+ const struct af_to_par *ap;
int i;
p->hdl = sio_open(p->dev, SIO_PLAY, 1);
diff --git a/common/msg.c b/common/msg.c
index ebd976eaa3..4a4ad80884 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -592,7 +592,7 @@ void mp_msg(struct mp_log *log, int lev, const char *format, ...)
va_end(va);
}
-const char *mp_log_levels[MSGL_MAX + 1] = {
+const char *const mp_log_levels[MSGL_MAX + 1] = {
[MSGL_FATAL] = "fatal",
[MSGL_ERR] = "error",
[MSGL_WARN] = "warn",
diff --git a/common/msg_control.h b/common/msg_control.h
index 151117a68d..b0ceef01df 100644
--- a/common/msg_control.h
+++ b/common/msg_control.h
@@ -31,7 +31,7 @@ int mp_msg_open_stats_file(struct mpv_global *global, const char *path);
struct bstr;
int mp_msg_split_msglevel(struct bstr *s, struct bstr *out_mod, int *out_level);
-extern const char *mp_log_levels[MSGL_MAX + 1];
+extern const char *const mp_log_levels[MSGL_MAX + 1];
extern const int mp_mpv_log_levels[MSGL_MAX + 1];
#endif
diff --git a/demux/codec_tags.c b/demux/codec_tags.c
index 451d9539df..9af4035ed1 100644
--- a/demux/codec_tags.c
+++ b/demux/codec_tags.c
@@ -352,8 +352,8 @@ static const char *lookup_tag(const struct mp_codec_tag *mp_table,
return id == AV_CODEC_ID_NONE ? NULL : mp_codec_from_av_codec_id(id);
}
-static const char *pcm_le[] = {"pcm_u8", "pcm_s16le", "pcm_s24le", "pcm_s32le"};
-static const char *pcm_be[] = {"pcm_s8", "pcm_s16be", "pcm_s24be", "pcm_s32be"};
+static const char *const pcm_le[] = {"pcm_u8", "pcm_s16le", "pcm_s24le", "pcm_s32le"};
+static const char *const pcm_be[] = {"pcm_s8", "pcm_s16be", "pcm_s24be", "pcm_s32be"};
static const char *map_audio_pcm_tag(uint32_t tag, int bits)
{
diff --git a/sub/osd.h b/sub/osd.h
index 2662e2b67f..e1da9bccd2 100644
--- a/sub/osd.h
+++ b/sub/osd.h
@@ -219,8 +219,8 @@ void osd_destroy_backend(struct osd_state *osd);
// doesn't need locking
void osd_get_function_sym(char *buffer, size_t buffer_size, int osd_function);
-extern const char *osd_ass_0;
-extern const char *osd_ass_1;
+extern const char *const osd_ass_0;
+extern const char *const osd_ass_1;
// defined in backend, but locks if required
void osd_object_get_resolution(struct osd_state *osd, int obj,
diff --git a/sub/osd_dummy.c b/sub/osd_dummy.c
index b9178e1925..5a33321d07 100644
--- a/sub/osd_dummy.c
+++ b/sub/osd_dummy.c
@@ -6,8 +6,8 @@
#include "talloc.h"
#include "osd.h"
-const char *osd_ass_0 = "";
-const char *osd_ass_1 = "";
+const char *const osd_ass_0 = "";
+const char *const osd_ass_1 = "";
void osd_init_backend(struct osd_state *osd)
{
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 03d5040dbf..3275cc59e6 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -160,8 +160,8 @@ void osd_get_function_sym(char *buffer, size_t buffer_size, int osd_function)
}
// Same trick as above: never valid UTF-8, so we expect it's free for use.
-const char *osd_ass_0 = "\xFD";
-const char *osd_ass_1 = "\xFE";
+const char *const osd_ass_0 = "\xFD";
+const char *const osd_ass_1 = "\xFE";
static void mangle_ass(bstr *dst, const char *in)
{
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index 49fd078f6c..7bffa486d2 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -343,7 +343,7 @@ static const struct gl_functions gl_functions[] = {
},
{
.extension = "GLX_SGI_video_sync",
- .functions = (struct gl_function[]) {
+ .functions = (const struct gl_function[]) {
DEF_FN_NAMES(GetVideoSync, "glXGetVideoSyncSGI"),
DEF_FN_NAMES(WaitVideoSync, "glXWaitVideoSyncSGI"),
{0},