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 @@
# ifdef __cplusplus
extern "C" {
# else
# include <stdbool.h>
# endif
/*****************************************************************************
* Our custom types
*****************************************************************************/
typedef int vlc_bool_t;
typedef bool vlc_bool_t;
typedef struct vlc_list_t vlc_list_t;
typedef struct vlc_object_t vlc_object_t;
......@@ -131,8 +133,8 @@ struct vlc_list_t
/*****************************************************************************
* Booleans
*****************************************************************************/
#define VLC_FALSE 0
#define VLC_TRUE 1
#define VLC_FALSE false
#define VLC_TRUE true
/*****************************************************************************
* Playlist
......
......@@ -525,7 +525,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_PRIVATE_ID_STATE: /* 11 */
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;
case ACCESS_SET_PRIVATE_ID_CA: /* 12 -From Demux */
break;
......
......@@ -551,7 +551,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_PRIVATE_ID_STATE:
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 )
{
/* 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 )
return VLC_SUCCESS;
case DEMUX_SET_PAUSE_STATE:
b = (vlc_bool_t)va_arg( args, vlc_bool_t );
b = (bool)va_arg( args, int );
if ( b )
{
p_sys->i_pause_pts = mdate();
......
......@@ -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);
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 )
return VLC_EGENERIC;
......
......@@ -271,7 +271,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
switch( i_query )
{
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];
return VLC_SUCCESS;
......
......@@ -459,7 +459,7 @@ static int ControlVideo( vout_thread_t *p_vout, int i_query, va_list args )
switch( i_query )
{
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];
return VLC_SUCCESS;
......
......@@ -147,7 +147,7 @@ int cocoaglvoutviewControl( vout_thread_t *p_vout, int i_query, va_list args )
switch( i_query )
{
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];
return VLC_SUCCESS;
......
......@@ -1129,7 +1129,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
#ifdef MODULE_NAME_IS_wingapi
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;
if( b_bool ) GXResume();
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 )
return vout_ControlWindow( p_vout,
(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 );
#ifdef MODULE_NAME_IS_xvmc
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 )
{
case ES_OUT_SET_ES_STATE:
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 ) )
{
EsSelect( out, es );
......@@ -1584,7 +1584,7 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
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;
/* Needed ? */
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