1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-25 04:38:01 +00:00

Add some missing "const"s

The one in msg.c was mistakenly removed with commit e99a37f6.

I didn't actually test the change in ao_sndio.c (but obviously "ap"
shouldn't be static).
This commit is contained in:
wm4 2014-10-10 13:44:08 +02:00
parent 7e4491a7a7
commit 26bc6b4831
9 changed files with 16 additions and 14 deletions

View File

@ -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},

View File

@ -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);

View File

@ -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",

View File

@ -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

View File

@ -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)
{

View File

@ -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,

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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},