[MPlayer-dev-eng] [PATCH] Warning fixes for mplayer.c

Oded Shimon ods15 at ods15.dyndns.org
Sat Dec 17 20:52:44 CET 2005


warning fixes for mplayer.c, mostly printf '%d' for 'long' type stuff, also 
an unused variable.

One of these is actually my fault...

- ods15
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.894
diff -u -r1.894 mplayer.c
--- mplayer.c	7 Dec 2005 05:12:07 -0000	1.894
+++ mplayer.c	7 Dec 2005 10:49:35 -0000
@@ -1028,13 +1028,14 @@
     if (!f) return;
     fprintf(f, "----------------------------------------------------------\n");
     if (subdata->sub_uses_time) {
+	int start = vo_sub_last->start, end = vo_sub_last->end;
 	fprintf(f, "N: %s S: %02d:%02d:%02d.%02d E: %02d:%02d:%02d.%02d\n", filename, 
-		vo_sub_last->start/360000, (vo_sub_last->start/6000)%60,
-		(vo_sub_last->start/100)%60, vo_sub_last->start%100,
-		vo_sub_last->end/360000, (vo_sub_last->end/6000)%60,
-		(vo_sub_last->end/100)%60, vo_sub_last->end%100);
+		start/360000, (start/6000)%60,
+		(start/100)%60, start%100,
+		end/360000, (end/6000)%60,
+		(end/100)%60, end%100);
     } else {
-	fprintf(f, "N: %s S: %d E: %d\n", filename, vo_sub_last->start, vo_sub_last->end);
+	fprintf(f, "N: %s S: %d E: %d\n", filename, (int)vo_sub_last->start, (int)vo_sub_last->end);
     }
     for (i = 0; i < vo_sub_last->lines; i++) {
 	fprintf(f, "%s\n", vo_sub_last->text[i]);
@@ -2311,7 +2312,7 @@
   if (sh_video) {
     /* Assume FOURCC if all bytes >= 0x20 (' ') */
     if (sh_video->format >= 0x20202020)
-	mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_VIDEO_FORMAT=%.4s\n", &sh_video->format);
+	mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_VIDEO_FORMAT=%.4s\n", (char*)&sh_video->format);
     else
 	mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_VIDEO_FORMAT=0x%08X\n", sh_video->format);
     mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_VIDEO_BITRATE=%d\n", sh_video->i_bps*8);
@@ -2325,14 +2326,14 @@
       mp_msg(MSGT_GLOBAL,MSGL_INFO, "ID_AUDIO_CODEC=%s\n", sh_audio->codec->name);
     /* Assume FOURCC if all bytes >= 0x20 (' ') */
     if (sh_audio->format >= 0x20202020)
-      mp_msg(MSGT_GLOBAL,MSGL_INFO, "ID_AUDIO_FORMAT=%.4s\n", &sh_audio->format);
+      mp_msg(MSGT_GLOBAL,MSGL_INFO, "ID_AUDIO_FORMAT=%.4s\n", (char*)&sh_audio->format);
     else
       mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_AUDIO_FORMAT=%d\n", sh_audio->format);
     mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_AUDIO_BITRATE=%d\n", sh_audio->i_bps*8);
     mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_AUDIO_RATE=%d\n", sh_audio->samplerate);
     mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_AUDIO_NCH=%d\n", sh_audio->channels);
   }
-  mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_LENGTH=%.2lf\n", demuxer_get_time_length(demuxer));
+  mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_LENGTH=%.2f\n", demuxer_get_time_length(demuxer));
 }
 
 if(!sh_video) goto main; // audio-only
@@ -2435,7 +2436,6 @@
 //float num_frames=0;      // number of frames played
 int grab_frames=0;
 char osd_text_buffer[64];
-char osd_show_text_buffer[64];
 int drop_frame=0;     // current dropping status
 int dropped_frames=0; // how many frames dropped since last non-dropped frame
 int too_slow_frame_cnt=0;
@@ -3758,7 +3758,7 @@
 	{
 #ifdef USE_SUB
 	if (sh_video) {
-		mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_SUB_VISIBILITY=%ld\n", sub_visibility);
+		mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_SUB_VISIBILITY=%d\n", sub_visibility);
 	}
 #endif
 	} break;
@@ -3879,16 +3879,16 @@
 	break;
 	
     case MP_CMD_GET_TIME_LENGTH : {
-	mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_LENGTH=%.2lf\n", demuxer_get_time_length(demuxer));
+	mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_LENGTH=%.2f\n", demuxer_get_time_length(demuxer));
     } break;
 
 	case MP_CMD_GET_VO_FULLSCREEN : {
 	if(video_out && vo_config_count)
-		mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_VO_FULLSCREEN=%ld\n", vo_fs);
+		mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_VO_FULLSCREEN=%d\n", vo_fs);
 	} break;
     
     case MP_CMD_GET_PERCENT_POS : {
-	mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_PERCENT_POSITION=%ld\n", demuxer_get_percent_pos(demuxer));
+	mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_PERCENT_POSITION=%d\n", demuxer_get_percent_pos(demuxer));
     } break;
     case MP_CMD_GET_TIME_POS : {
       float pos = 0;


More information about the MPlayer-dev-eng mailing list