summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-10 23:56:05 +0200
committerwm4 <wm4@nowhere>2014-06-11 00:39:14 +0200
commit99f5fef0ea5671d41fb7b737fbc3e4236542a757 (patch)
treec01912d00e64a7783cb7109b3d1e2dc2390b3a7d /player/command.c
parentad4b7a8c967f9d13ceeaffff25d156d848b68445 (diff)
downloadmpv-99f5fef0ea5671d41fb7b737fbc3e4236542a757.tar.bz2
mpv-99f5fef0ea5671d41fb7b737fbc3e4236542a757.tar.xz
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.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index 315013b0e8..87c91f295e 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2597,8 +2597,8 @@ static const m_option_t mp_properties[] = {
};
// Each entry describes which properties an event (possibly) changes.
-#define E(x, ...) [x] = (const char*[]){__VA_ARGS__, NULL}
-const char **mp_event_property_change[] = {
+#define E(x, ...) [x] = (const char*const[]){__VA_ARGS__, NULL}
+static const char *const *const mp_event_property_change[] = {
E(MPV_EVENT_START_FILE, "*"),
E(MPV_EVENT_END_FILE, "*"),
E(MPV_EVENT_FILE_LOADED, "*"),
@@ -2690,7 +2690,7 @@ void property_print_help(struct mp_log *log)
* terminal output if there is no video; it'll be a label shown together with
* percentage.
*/
-static struct property_osd_display {
+static const struct property_osd_display {
// property name
const char *name;
// name used on OSD
@@ -2763,7 +2763,7 @@ static void show_property_osd(MPContext *mpctx, const char *pname, int osd_mode)
{
struct MPOpts *opts = mpctx->opts;
struct m_option prop = {0};
- struct property_osd_display *p;
+ const struct property_osd_display *p;
const char *name = pname;
if (mp_property_do(pname, M_PROPERTY_GET_TYPE, &prop, mpctx) <= 0)
@@ -2875,7 +2875,7 @@ static bool reinit_filters(MPContext *mpctx, enum stream_type mediatype)
return false;
}
-static const char *filter_opt[STREAM_TYPE_COUNT] = {
+static const char *const filter_opt[STREAM_TYPE_COUNT] = {
[STREAM_VIDEO] = "vf",
[STREAM_AUDIO] = "af",
};