[MPlayer-dev-eng] [PATCH 3/3] Fix a few warnings

Jiang Jiang gzjjgod at gmail.com
Sun Jul 14 14:38:58 CEST 2013


---
 bstr.c                 |  2 +-
 cfg-common.h           | 24 ++++++++++++------------
 cfg-mplayer.h          |  8 ++++----
 codec-cfg.c            |  4 ++--
 m_config.h             |  2 +-
 m_option.c             |  2 +-
 mpcommon.c             |  8 ++++----
 mplayer.c              |  6 +++---
 stream/asf_streaming.c |  2 +-
 stream/stream_dvd.c    |  4 ++--
 stream/stream_dvd.h    |  4 ++--
 stream/stream_dvdnav.c |  4 ++--
 stream/stream_dvdnav.h |  4 ++--
 sub/vobsub.c           |  2 +-
 sub/vobsub.h           |  2 +-
 15 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/bstr.c b/bstr.c
index c0f6239..7e8a2bf 100644
--- a/bstr.c
+++ b/bstr.c
@@ -40,7 +40,7 @@ int bstrcmp(struct bstr str1, struct bstr str2)
 
 int bstrcasecmp(struct bstr str1, struct bstr str2)
 {
-    int ret = strncasecmp(str1.start, str2.start, FFMIN(str1.len, str2.len));
+    int ret = strncasecmp((const char *)str1.start, (const char *)str2.start, FFMIN(str1.len, str2.len));
 
     if (!ret) {
         if (str1.len == str2.len)
diff --git a/cfg-common.h b/cfg-common.h
index b44956b..5e295bd 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -298,7 +298,7 @@ const m_option_t common_opts[] = {
     {"noquiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
     {"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_PRE_PARSE, 0, -10, NULL},
     {"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL},
-    {"msglevel", msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+    {"msglevel", (void*)msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
     {"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
     {"nomsgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
     {"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
@@ -311,7 +311,7 @@ const m_option_t common_opts[] = {
     {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
 #endif
     {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL},
-    {"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
+    {"noconfig", (void*)noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
 
 // ------------------------- stream options --------------------
 
@@ -439,8 +439,8 @@ const m_option_t common_opts[] = {
     { "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL },
     { "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL},
 
-    { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
-    { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+    { "rawaudio", (void*)&demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+    { "rawvideo", (void*)&demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
 
 #ifdef CONFIG_CDDA
     { "cdda", &cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
@@ -456,7 +456,7 @@ const m_option_t common_opts[] = {
     { "extbased", &extension_parsing, CONF_TYPE_FLAG, 0, 0, 1, NULL },
     { "noextbased", &extension_parsing, CONF_TYPE_FLAG, 0, 1, 0, NULL },
 
-    {"mf", mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
+    {"mf", (void*)mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
 #ifdef CONFIG_RADIO
     {"radio", radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
 #else
@@ -472,7 +472,7 @@ const m_option_t common_opts[] = {
 #else
     {"pvr", "MPlayer was compiled without V4L2/PVR interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
 #endif /* CONFIG_PVR */
-    {"vivo", vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+    {"vivo", (void*)vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
 #ifdef CONFIG_DVBIN
     {"dvbin", dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
 #endif
@@ -514,10 +514,10 @@ const m_option_t common_opts[] = {
     {"nosound", &audio_id, CONF_TYPE_FLAG, 0, -1, -2, NULL},
 
     {"af*", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
-    {"af-adv", audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+    {"af-adv", (void*)audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
 
     {"vop", "-vop has been removed, use -vf instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL},
-    {"vf*", &vf_settings, CONF_TYPE_OBJ_SETTINGS_LIST, 0, 0, 0, &vf_obj_list},
+    {"vf*", &vf_settings, CONF_TYPE_OBJ_SETTINGS_LIST, 0, 0, 0, (void*)&vf_obj_list},
     // select audio/video codec (by name) or codec family (by number):
     {"afm", &audio_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
     {"vfm", &video_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
@@ -527,12 +527,12 @@ const m_option_t common_opts[] = {
     // postprocessing:
 #ifdef CONFIG_POSTPROC
     {"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0, NULL},
-    {"pphelp", pp_help, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+    {"pphelp", (void*)pp_help, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
 #endif
 
     // scaling:
     {"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL},
-    {"ssf", scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+    {"ssf", (void*)scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
     {"zoom", &softzoom, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL},
     {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.1, 10.0, NULL},
@@ -554,8 +554,8 @@ const m_option_t common_opts[] = {
     {"field-dominance", &field_dominance, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL},
 
 #ifdef CONFIG_FFMPEG
-    {"lavdopts", lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
-    {"lavfdopts",  lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+    {"lavdopts", (void*)lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+    {"lavfdopts", (void*)lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
 #endif
 #ifdef CONFIG_XVID4
     {"xvidopts", xvid_dec_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index b57ac0d..e70c46c 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -353,11 +353,11 @@ const m_option_t mplayer_opts[]={
 
     {"list-properties", &list_properties, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
     {"identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_FLAG, CONF_GLOBAL, 0, MSGL_V, NULL},
-    {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
-    {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
-    {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
+    {"-help", (void*)help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
+    {"help", (void*)help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
+    {"h", (void*)help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
 
-    {"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+    {"vd", (void*)vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
     {"progbar-align", &progbar_align, CONF_TYPE_INT, CONF_GLOBAL, 0, 100, NULL},
     {NULL, NULL, 0, 0, 0, 0, NULL}
 };
diff --git a/codec-cfg.c b/codec-cfg.c
index 4ca7ae6..f33c001 100644
--- a/codec-cfg.c
+++ b/codec-cfg.c
@@ -577,8 +577,8 @@ int parse_codec_cfg(const char *cfgfile)
 #ifdef CODECS2HTML
         return 0;
 #else
-        video_codecs = builtin_video_codecs;
-        audio_codecs = builtin_audio_codecs;
+        video_codecs = (codecs_t*)builtin_video_codecs;
+        audio_codecs = (codecs_t*)builtin_audio_codecs;
         nr_vcodecs = sizeof(builtin_video_codecs)/sizeof(codecs_t);
         nr_acodecs = sizeof(builtin_audio_codecs)/sizeof(codecs_t);
         return 1;
diff --git a/m_config.h b/m_config.h
index 2a336db..f69fc01 100644
--- a/m_config.h
+++ b/m_config.h
@@ -50,7 +50,7 @@ struct m_config_save_slot {
 struct m_config_option {
   m_config_option_t* next;
   /// Full name (ie option:subopt).
-  char* name;
+  const char* name;
   /// Option description.
   const struct m_option* opt;
   /// Save slot stack.
diff --git a/m_option.c b/m_option.c
index fe458ff..9146253 100644
--- a/m_option.c
+++ b/m_option.c
@@ -334,7 +334,7 @@ static int parse_position(const m_option_t* opt,const char *name, const char *pa
   if (param == NULL)
     return M_OPT_MISSING_PARAM;
   if (sscanf(param, sizeof(off_t) == sizeof(int) ?
-	     "%d%c" : "%"PRId64"%c", &tmp_off, &dummy) != 1) {
+	     "%lld%c" : "%"PRId64"%c", &tmp_off, &dummy) != 1) {
     mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must be an integer: %s\n",opt->name,param);
     return M_OPT_INVALID;
   }
diff --git a/mpcommon.c b/mpcommon.c
index ae611bf..c9d815b 100644
--- a/mpcommon.c
+++ b/mpcommon.c
@@ -319,16 +319,16 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd
                 if (!ass_track) continue;
                 if (type == 'a') { // ssa/ass subs with libass
                     if (len > 10 && memcmp(packet, "Dialogue: ", 10) == 0)
-                        ass_process_data(ass_track, packet, len);
+                        ass_process_data(ass_track, (char*)packet, len);
                     else
-                        ass_process_chunk(ass_track, packet, len,
+                        ass_process_chunk(ass_track, (char*)packet, len,
                                           (long long)(subpts*1000 + 0.5),
                                           (long long)((endpts-subpts)*1000 + 0.5));
                 } else { // plaintext subs with libass
                     if (subpts != MP_NOPTS_VALUE) {
                         subtitle tmp_subs = {0};
                         if (endpts == MP_NOPTS_VALUE) endpts = subpts + 3;
-                        sub_add_text(&tmp_subs, packet, len, endpts, 0);
+                        sub_add_text(&tmp_subs, (const char*)packet, len, endpts, 0);
                         tmp_subs.start = subpts * 100;
                         tmp_subs.end = endpts * 100;
                         ass_process_subtitle(ass_track, &tmp_subs);
@@ -356,7 +356,7 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd
                     packet = p;
                 }
                 if (endpts == MP_NOPTS_VALUE) endpts = subpts + 4;
-                sub_add_text(&subs, packet, len, endpts, 1);
+                sub_add_text(&subs, (const char*)packet, len, endpts, 1);
                 set_osd_subtitle(&subs);
             }
             if (d_dvdsub->non_interleaved)
diff --git a/mplayer.c b/mplayer.c
index ee9a5f0..c12af0b 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3258,7 +3258,7 @@ play_next_file:
     mpctx->stream->start_pos += seek_to_byte;
 
     if (stream_dump_type == 5) {
-        unsigned char buf[4096];
+        char buf[4096];
         int len;
         FILE *f;
         current_module = "dumpstream";
@@ -3358,11 +3358,11 @@ goto_enable_cache:
 
     // HACK to get MOV Reference Files working
     if (mpctx->demuxer && mpctx->demuxer->type == DEMUXER_TYPE_PLAYLIST) {
-        unsigned char *playlist_entry;
+        char *playlist_entry;
         play_tree_t *list = NULL, *entry = NULL;
 
         current_module = "handle_demux_playlist";
-        while (ds_get_packet(mpctx->demuxer->video, &playlist_entry) > 0) {
+        while (ds_get_packet(mpctx->demuxer->video, (unsigned char **)&playlist_entry) > 0) {
             char *temp;
             const char *bname;
 
diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c
index 5fa2f95..dfe5621 100644
--- a/stream/asf_streaming.c
+++ b/stream/asf_streaming.c
@@ -52,7 +52,7 @@ static int asf_http_streaming_start(stream_t *stream, int *demuxer_type);
 static int asf_read_wrapper(int fd, void *buffer, int len, streaming_ctrl_t *stream_ctrl) {
     uint8_t *buf = buffer;
     while (len > 0) {
-        int got = nop_streaming_read(fd, buf, len, stream_ctrl);
+        int got = nop_streaming_read(fd, (char*)buf, len, stream_ctrl);
         if (got <= 0) {
             mp_msg(MSGT_NETWORK, MSGL_ERR, MSGTR_MPDEMUX_ASF_ErrReadingNetworkStream);
             return got;
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 7567599..3dbd1da 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -126,7 +126,7 @@ static int dvd_lang_from_aid(stream_t *stream, int id) {
   return 0;
 }
 
-int dvd_aid_from_lang(stream_t *stream, const unsigned char* lang) {
+int dvd_aid_from_lang(stream_t *stream, const char* lang) {
   dvd_priv_t *d=stream->priv;
   int code,i;
   if(lang) {
@@ -170,7 +170,7 @@ static int dvd_lang_from_sid(stream_t *stream, int id) {
   return 0;
 }
 
-int dvd_sid_from_lang(stream_t *stream, const unsigned char* lang) {
+int dvd_sid_from_lang(stream_t *stream, const char* lang) {
   dvd_priv_t *d=stream->priv;
   int code,i;
   while(lang && strlen(lang)>=2) {
diff --git a/stream/stream_dvd.h b/stream/stream_dvd.h
index 1125627..a5b7129 100644
--- a/stream/stream_dvd.h
+++ b/stream/stream_dvd.h
@@ -56,8 +56,8 @@ typedef struct {
 } dvd_priv_t;
 
 int dvd_number_of_subs(stream_t *stream);
-int dvd_aid_from_lang(stream_t *stream, const unsigned char* lang);
-int dvd_sid_from_lang(stream_t *stream, const unsigned char* lang);
+int dvd_aid_from_lang(stream_t *stream, const char* lang);
+int dvd_sid_from_lang(stream_t *stream, const char* lang);
 int dvd_chapter_from_cell(dvd_priv_t *dvd,int title,int cell);
 
 #endif /* MPLAYER_STREAM_DVD_H */
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index 6c87c7e..65c3198 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -758,7 +758,7 @@ static int mp_dvdnav_get_aid_from_format (stream_t *stream, int index, uint8_t l
  * \param lang: 2-characters language code[s], eventually separated by spaces of commas
  * \return -1 on error, current subtitle id if successful
  */
-int mp_dvdnav_aid_from_lang(stream_t *stream, const unsigned char *language) {
+int mp_dvdnav_aid_from_lang(stream_t *stream, const char *language) {
   dvdnav_priv_t * priv = stream->priv;
   int k;
   uint8_t lg;
@@ -806,7 +806,7 @@ static int mp_dvdnav_lang_from_aid(stream_t *stream, int aid) {
  * \param lang: 2-characters language code[s], eventually separated by spaces of commas
  * \return -1 on error, current subtitle id if successful
  */
-int mp_dvdnav_sid_from_lang(stream_t *stream, const unsigned char *language) {
+int mp_dvdnav_sid_from_lang(stream_t *stream, const char *language) {
   dvdnav_priv_t * priv = stream->priv;
   uint8_t lg, k;
   uint16_t lang, lcode;
diff --git a/stream/stream_dvdnav.h b/stream/stream_dvdnav.h
index 5a06e33..5b03c08 100644
--- a/stream/stream_dvdnav.h
+++ b/stream/stream_dvdnav.h
@@ -30,8 +30,8 @@ typedef struct {
 
 int mp_dvdnav_number_of_subs(stream_t *stream);
 int mp_dvdnav_aid_from_audio_num(stream_t *stream, int audio_num);
-int mp_dvdnav_aid_from_lang(stream_t *stream, const unsigned char *language);
-int mp_dvdnav_sid_from_lang(stream_t *stream, const unsigned char *language);
+int mp_dvdnav_aid_from_lang(stream_t *stream, const char *language);
+int mp_dvdnav_sid_from_lang(stream_t *stream, const char *language);
 void mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button);
 void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button);
 void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl);
diff --git a/sub/vobsub.c b/sub/vobsub.c
index fdb3e69..e05ab7f 100644
--- a/sub/vobsub.c
+++ b/sub/vobsub.c
@@ -1064,7 +1064,7 @@ int vobsub_get_index_by_id(void *vobhandle, int id)
     return j;
 }
 
-int vobsub_set_from_lang(void *vobhandle, unsigned char * lang)
+int vobsub_set_from_lang(void *vobhandle, char * lang)
 {
     int i;
     vobsub_t *vob= vobhandle;
diff --git a/sub/vobsub.h b/sub/vobsub.h
index b076e4b..743b8bf 100644
--- a/sub/vobsub.h
+++ b/sub/vobsub.h
@@ -41,7 +41,7 @@ unsigned int vobsub_rgb_to_yuv(unsigned int rgb);
 void *vobsub_out_open(const char *basename, const unsigned int *palette, unsigned int orig_width, unsigned int orig_height, const char *id, unsigned int index);
 void vobsub_out_output(void *me, const unsigned char *packet, int len, double pts);
 void vobsub_out_close(void *me);
-int vobsub_set_from_lang(void *vobhandle, unsigned char * lang);
+int vobsub_set_from_lang(void *vobhandle, char * lang);
 void vobsub_seek(void * vobhandle, float pts);
 
 #endif /* MPLAYER_VOBSUB_H */
-- 
1.8.3.1 (Apple Git-46)



More information about the MPlayer-dev-eng mailing list