changeset 25495:5cbf0cbeef7c

Add some const/static qualifiers as appropriate
author reimar
date Mon, 24 Dec 2007 16:27:52 +0000
parents e88c0aa4bb96
children 63234bdc80e4
files command.c libmpdemux/demux_ogg.c libmpdemux/demuxer.h
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Mon Dec 24 16:05:09 2007 +0000
+++ b/command.c	Mon Dec 24 16:27:52 2007 +0000
@@ -1305,7 +1305,7 @@
 	}
 #ifdef HAVE_OGGVORBIS
 	if (mpctx->demuxer->type == DEMUXER_TYPE_OGG && d_sub && dvdsub_id >= 0) {
-	    char *lang = demux_ogg_sub_lang(mpctx->demuxer, dvdsub_id);
+	    const char *lang = demux_ogg_sub_lang(mpctx->demuxer, dvdsub_id);
 	    if (!lang)
 		lang = MSGTR_Unknown;
 	    snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang);
--- a/libmpdemux/demux_ogg.c	Mon Dec 24 16:05:09 2007 +0000
+++ b/libmpdemux/demux_ogg.c	Mon Dec 24 16:27:52 2007 +0000
@@ -326,9 +326,9 @@
 }
 
 // check if clang has substring from comma separated langlist
-static int demux_ogg_check_lang(const char *clang, char *langlist)
+static int demux_ogg_check_lang(const char *clang, const char *langlist)
 {
-  char *c;
+  const char *c;
 
   if (!langlist || !*langlist)
     return 0;
@@ -352,7 +352,7 @@
   char **cmt = vc->user_comments;
   int index, i;
   ogg_demuxer_t *ogg_d = d->priv;
-  struct table {
+  static const struct table {
     const char *ogg;
     const char *mp;
   } table[] = {
@@ -649,7 +649,7 @@
  *  \param demuxer The demuxer about whose subtitles we are inquiring.
  *  \param index The subtitle number.
  */
-char *demux_ogg_sub_lang(demuxer_t *demuxer, int index) {
+const char *demux_ogg_sub_lang(demuxer_t *demuxer, int index) {
   ogg_demuxer_t *ogg_d = demuxer->priv;
   return (index < 0) ? NULL : (index >= ogg_d->n_text) ? NULL : ogg_d->text_langs[index];
 }
--- a/libmpdemux/demuxer.h	Mon Dec 24 16:05:09 2007 +0000
+++ b/libmpdemux/demuxer.h	Mon Dec 24 16:27:52 2007 +0000
@@ -370,7 +370,7 @@
 /* Found in demux_ogg.c */
 int demux_ogg_num_subs(demuxer_t *demuxer);
 int demux_ogg_sub_id(demuxer_t *demuxer, int index);
-char *demux_ogg_sub_lang(demuxer_t *demuxer, int index);
+const char *demux_ogg_sub_lang(demuxer_t *demuxer, int index);
 #endif
 
 extern int demuxer_get_current_time(demuxer_t *demuxer);