@@ -186,7 +186,8 @@ bool MPlayer::launch_player(void)
186186
187187
188188 char t_widbuf[20 ];
189- sprintf (t_widbuf, " %d" , m_window);
189+ // MDW-2013-04-16: m_window is an XID so needs "%ld"
190+ sprintf (t_widbuf, " %ld" , m_window);
190191
191192 // TS-2007-12-17 : Added in the ability to drop down to use the native X11 video driver if Xv is not present (i.e. no hardware
192193 // video support.
@@ -373,7 +374,8 @@ void MPlayer::play ( bool p_play )
373374 {
374375 if ( m_playing != p_play )
375376 {
376- write_command (" pause" );
377+ // MDW-2013-04-16: avoiding compiler warning by casting char *
378+ write_command (const_cast <char *>(" pause" ));
377379 m_playing = !m_playing ;
378380 }
379381 }
@@ -410,7 +412,8 @@ void MPlayer::seek ( int4 p_amount )
410412
411413void MPlayer::seek (void )
412414{
413- write_command (" frame_step" );
415+ // MDW-2013-04-16: avoiding compiler warning by casting char *
416+ write_command (const_cast <char *>(" frame_step" ));
414417}
415418
416419void MPlayer::osd ( uint4 p_level = 0 )
@@ -422,15 +425,17 @@ void MPlayer::osd ( uint4 p_level = 0 )
422425
423426void MPlayer::osd (void )
424427{
425- write_command (" pausing_keep osd" );
428+ // MDW-2013-04-16: avoiding compiler warning by casting char *
429+ write_command (const_cast <char *>(" pausing_keep osd" ));
426430}
427431
428432void MPlayer::quit (void )
429433{
430434 if ( m_cpid > -1 && m_window != DNULL )
431435 {
432436 int t_status ;
433- write_command (" quit" );
437+ // MDW-2013-04-16: avoiding compiler warning by casting char *
438+ write_command (const_cast <char *>(" quit" ));
434439 // Wait for the child to quit.
435440 waitpid (m_cpid, &t_status, 0 ) ;
436441 shutdown ();
@@ -457,7 +462,8 @@ void MPlayer::set_property ( char * p_prop, char * p_value )
457462char * MPlayer::get_property ( char * p_prop )
458463{
459464 if ( m_window == DNULL )
460- return " -1" ;
465+ // MDW-2013-04-16: avoiding compiler warning by casting char *
466+ return const_cast <char *>(" -1" );
461467
462468 char t_response[1024 ] ;
463469 char t_question[1024 ];
@@ -473,7 +479,8 @@ uint4 MPlayer::getduration(void)
473479 if ( m_duration == -1 )
474480 {
475481 char * t_ret ;
476- t_ret = get_property (" stream_length" ) ;
482+ // MDW-2013-04-16: avoiding compiler warning by casting char *
483+ t_ret = get_property (const_cast <char *>(" stream_length" )) ;
477484 if ( t_ret != NULL )
478485 m_duration = atoi (t_ret);
479486 else
@@ -486,7 +493,8 @@ uint4 MPlayer::getduration(void)
486493uint4 MPlayer::getcurrenttime (void )
487494{
488495 char * t_ret ;
489- t_ret = get_property (" stream_pos" ) ;
496+ // MDW-2013-04-16: avoiding compiler warning by casting char *
497+ t_ret = get_property (const_cast <char *>(" stream_pos" )) ;
490498 if ( t_ret != NULL )
491499 return atoi (t_ret);
492500 else
@@ -501,7 +509,8 @@ uint4 MPlayer::gettimescale(void)
501509 {
502510 double t_length ;
503511 char * t_ret ;
504- t_ret = get_property (" length" ) ;
512+ // MDW-2013-04-16: avoiding compiler warning by casting char *
513+ t_ret = get_property (const_cast <char *>(" length" )) ;
505514 if ( t_ret != NULL )
506515 {
507516 t_length = atof (t_ret);
@@ -518,27 +527,31 @@ void MPlayer::setspeed(double p_speed)
518527{
519528 char t_buffer[100 ];
520529 sprintf (t_buffer, " %f" , p_speed);
521- set_property (" speed" , t_buffer);
530+ // MDW-2013-04-16: avoiding compiler warning by casting char *
531+ set_property (const_cast <char *>(" speed" ), t_buffer);
522532}
523533
524534void MPlayer::setlooping (bool p_loop)
525535{
526- set_property (" looping" , (char *)(p_loop ? " 0" : " -1" ) ) ;
536+ // MDW-2013-04-16: avoiding compiler warning by casting char *
537+ set_property (const_cast <char *>(" looping" ), (char *)(p_loop ? " 0" : " -1" ) ) ;
527538}
528539
529540void MPlayer::setloudness (uint4 p_volume )
530541{
531542 char t_buffer[4 ] ;
532543 sprintf (t_buffer," %d" , p_volume);
533- set_property (" volume" , t_buffer);
544+ // MDW-2013-04-16: avoiding compiler warning by casting char *
545+ set_property (const_cast <char *>(" volume" ), t_buffer);
534546}
535547
536548uint4 MPlayer::getloudness (void )
537549{
538550 if ( m_loudness == -1 )
539551 {
540552 char * t_ret ;
541- t_ret = get_property (" volume" ) ;
553+ // MDW-2013-04-16: avoiding compiler warning by casting char *
554+ t_ret = get_property (const_cast <char *>(" volume" )) ;
542555 if ( t_ret != NULL )
543556 m_loudness = atoi (t_ret);
544557 else
0 commit comments