Commit 2e7e2246 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use native C/C++ boolean type

parent 709f415c
...@@ -38,12 +38,14 @@ ...@@ -38,12 +38,14 @@
# ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
# else
# include <stdbool.h>
# endif # endif
/***************************************************************************** /*****************************************************************************
* Our custom types * Our custom types
*****************************************************************************/ *****************************************************************************/
typedef int vlc_bool_t; typedef bool vlc_bool_t;
typedef struct vlc_list_t vlc_list_t; typedef struct vlc_list_t vlc_list_t;
typedef struct vlc_object_t vlc_object_t; typedef struct vlc_object_t vlc_object_t;
...@@ -131,8 +133,8 @@ struct vlc_list_t ...@@ -131,8 +133,8 @@ struct vlc_list_t
/***************************************************************************** /*****************************************************************************
* Booleans * Booleans
*****************************************************************************/ *****************************************************************************/
#define VLC_FALSE 0 #define VLC_FALSE false
#define VLC_TRUE 1 #define VLC_TRUE true
/***************************************************************************** /*****************************************************************************
* Playlist * Playlist
......
...@@ -525,7 +525,7 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -525,7 +525,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_PRIVATE_ID_STATE: /* 11 */ case ACCESS_SET_PRIVATE_ID_STATE: /* 11 */
i_int = (int)va_arg( args, int ); i_int = (int)va_arg( args, int );
b_bool = (vlc_bool_t)va_arg( args, vlc_bool_t ); b_bool = (bool)va_arg( args, int );
break; break;
case ACCESS_SET_PRIVATE_ID_CA: /* 12 -From Demux */ case ACCESS_SET_PRIVATE_ID_CA: /* 12 -From Demux */
break; break;
......
...@@ -551,7 +551,7 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -551,7 +551,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_PRIVATE_ID_STATE: case ACCESS_SET_PRIVATE_ID_STATE:
i_int = (int)va_arg( args, int ); /* Private data (pid for now)*/ i_int = (int)va_arg( args, int ); /* Private data (pid for now)*/
b_bool = (vlc_bool_t)va_arg( args, vlc_bool_t ); /* b_selected */ b_bool = (bool)va_arg( args, int ); /* b_selected */
if( !p_sys->b_budget_mode ) if( !p_sys->b_budget_mode )
{ {
/* FIXME we may want to give the real type (me ?, I don't ;) */ /* FIXME we may want to give the real type (me ?, I don't ;) */
......
...@@ -153,7 +153,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -153,7 +153,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_SUCCESS; return VLC_SUCCESS;
case DEMUX_SET_PAUSE_STATE: case DEMUX_SET_PAUSE_STATE:
b = (vlc_bool_t)va_arg( args, vlc_bool_t ); b = (bool)va_arg( args, int );
if ( b ) if ( b )
{ {
p_sys->i_pause_pts = mdate(); p_sys->i_pause_pts = mdate();
......
...@@ -1374,7 +1374,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1374,7 +1374,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
double d_npt = (double) p_sys->i_npt / I64C(1000000); double d_npt = (double) p_sys->i_npt / I64C(1000000);
int i; int i;
b_bool = (vlc_bool_t)va_arg( args, vlc_bool_t ); b_bool = (bool)va_arg( args, int );
if( p_sys->rtsp == NULL ) if( p_sys->rtsp == NULL )
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -271,7 +271,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -271,7 +271,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
switch( i_query ) switch( i_query )
{ {
case VOUT_SET_STAY_ON_TOP: case VOUT_SET_STAY_ON_TOP:
b_arg = va_arg( args, vlc_bool_t ); b_arg = (bool) va_arg( args, int );
[p_vout->p_sys->o_vout_view setOnTop: b_arg]; [p_vout->p_sys->o_vout_view setOnTop: b_arg];
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -459,7 +459,7 @@ static int ControlVideo( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -459,7 +459,7 @@ static int ControlVideo( vout_thread_t *p_vout, int i_query, va_list args )
switch( i_query ) switch( i_query )
{ {
case VOUT_SET_STAY_ON_TOP: case VOUT_SET_STAY_ON_TOP:
b_arg = va_arg( args, vlc_bool_t ); b_arg = (bool) va_arg( args, int );
[p_vout->p_sys->o_vout_view setOnTop: b_arg]; [p_vout->p_sys->o_vout_view setOnTop: b_arg];
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -147,7 +147,7 @@ int cocoaglvoutviewControl( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -147,7 +147,7 @@ int cocoaglvoutviewControl( vout_thread_t *p_vout, int i_query, va_list args )
switch( i_query ) switch( i_query )
{ {
case VOUT_SET_STAY_ON_TOP: case VOUT_SET_STAY_ON_TOP:
b_arg = va_arg( args, vlc_bool_t ); b_arg = (bool) va_arg( args, int );
[[p_vout->p_sys->o_glview container] setOnTop: b_arg]; [[p_vout->p_sys->o_glview container] setOnTop: b_arg];
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -1129,7 +1129,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -1129,7 +1129,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
#ifdef MODULE_NAME_IS_wingapi #ifdef MODULE_NAME_IS_wingapi
case VOUT_SET_FOCUS: case VOUT_SET_FOCUS:
b_bool = va_arg( args, vlc_bool_t ); b_bool = (bool) va_arg( args, int );
p_vout->p_sys->b_parent_focus = b_bool; p_vout->p_sys->b_parent_focus = b_bool;
if( b_bool ) GXResume(); if( b_bool ) GXResume();
else if( !p_vout->p_sys->b_focus ) GXSuspend(); else if( !p_vout->p_sys->b_focus ) GXSuspend();
......
...@@ -3139,7 +3139,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -3139,7 +3139,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
return vout_ControlWindow( p_vout, return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->p_win->owner_window, i_query, args); (void *)p_vout->p_sys->p_win->owner_window, i_query, args);
b_arg = va_arg( args, vlc_bool_t ); b_arg = (bool) va_arg( args, int );
vlc_mutex_lock( &p_vout->p_sys->lock ); vlc_mutex_lock( &p_vout->p_sys->lock );
#ifdef MODULE_NAME_IS_xvmc #ifdef MODULE_NAME_IS_xvmc
xvmc_context_reader_lock( &p_vout->p_sys->xvmc_lock ); xvmc_context_reader_lock( &p_vout->p_sys->xvmc_lock );
......
...@@ -1562,7 +1562,7 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args ) ...@@ -1562,7 +1562,7 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
{ {
case ES_OUT_SET_ES_STATE: case ES_OUT_SET_ES_STATE:
es = (es_out_id_t*) va_arg( args, es_out_id_t * ); es = (es_out_id_t*) va_arg( args, es_out_id_t * );
b = (vlc_bool_t) va_arg( args, vlc_bool_t ); b = (bool) va_arg( args, int );
if( b && !EsIsSelected( es ) ) if( b && !EsIsSelected( es ) )
{ {
EsSelect( out, es ); EsSelect( out, es );
...@@ -1584,7 +1584,7 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args ) ...@@ -1584,7 +1584,7 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
case ES_OUT_SET_ACTIVE: case ES_OUT_SET_ACTIVE:
{ {
b = (vlc_bool_t) va_arg( args, vlc_bool_t ); b = (bool) va_arg( args, int );
p_sys->b_active = b; p_sys->b_active = b;
/* Needed ? */ /* Needed ? */
if( b ) if( b )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment