Commit 449fd28a authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Replace vlc_bool_t by bool, VLC_TRUE by true and VLC_FALSE by false.

This improves readability a lot and prevent us from reinventing the wheel.
parent 05eac2db
......@@ -64,13 +64,13 @@ struct libvlc_int_t
/* Messages */
msg_bank_t msg_bank; ///< The message bank
int i_verbose; ///< info messages
vlc_bool_t b_color; ///< color messages?
bool b_color; ///< color messages?
module_t * p_memcpy_module; ///< Fast memcpy plugin used
void* ( *pf_memcpy ) ( void *, const void *, size_t ); ///< fast memcpy
void* ( *pf_memset ) ( void *, int, size_t ); ///< fast memset
vlc_bool_t b_stats; ///< Should we collect stats ?
bool b_stats; ///< Should we collect stats ?
vlc_mutex_t timer_lock; ///< Lock to protect timers
int i_timers; ///< Number of timers
counter_t **pp_timers; ///< Array of all timers
......
......@@ -61,7 +61,7 @@ typedef signed long long vlc_int64_t;
typedef union
{
int i_int;
vlc_bool_t b_bool;
bool b_bool;
float f_float;
char * psz_string;
void * p_address;
......
......@@ -252,32 +252,6 @@ VLC_DEPRECATED_API libvlc_media_player_t * libvlc_playlist_get_media_player(
#define VLC_EEXITSUCCESS -999 /* Program exited successfully */
#define VLC_EGENERIC -666 /* Generic error */
/*****************************************************************************
* Booleans
*****************************************************************************/
#define VLC_FALSE false
#define VLC_TRUE true
/**
* \defgroup var_type Variable types
* These are the different types a vlc variable can have.
* @{
*/
#define VLC_VAR_VOID 0x0010
#define VLC_VAR_BOOL 0x0020
#define VLC_VAR_INTEGER 0x0030
#define VLC_VAR_HOTKEY 0x0031
#define VLC_VAR_STRING 0x0040
#define VLC_VAR_MODULE 0x0041
#define VLC_VAR_FILE 0x0042
#define VLC_VAR_DIRECTORY 0x0043
#define VLC_VAR_VARIABLE 0x0044
#define VLC_VAR_FLOAT 0x0050
#define VLC_VAR_TIME 0x0060
#define VLC_VAR_ADDRESS 0x0070
#define VLC_VAR_MUTEX 0x0080
#define VLC_VAR_LIST 0x0090
/**@}*/
#if !defined( __LIBVLC__ )
......@@ -381,12 +355,12 @@ VLC_DEPRECATED_API int VLC_Init( int, int, const char *[] );
* \param b_play start playing when the interface is done loading
* \return VLC_SUCCESS on success
*/
VLC_DEPRECATED_API int VLC_AddIntf( int, char const *, vlc_bool_t, vlc_bool_t );
VLC_DEPRECATED_API int VLC_AddIntf( int, char const *, bool, bool );
/**
* Ask vlc to die
*
* This function sets p_libvlc->b_die to VLC_TRUE, but does not do any other
* This function sets p_libvlc->b_die to true, but does not do any other
* task. It is your duty to call VLC_CleanUp and VLC_Destroy afterwards.
*
* \param i_object a vlc object id
......@@ -517,12 +491,12 @@ VLC_DEPRECATED_API int VLC_Stop( int );
* Tell if VLC is playing
*
* If an item is currently playing, it returns
* VLC_TRUE, else VLC_FALSE
* true, else false
*
* \param i_object a vlc object id
* \return VLC_TRUE or VLC_FALSE
* \return true or false
*/
VLC_DEPRECATED_API vlc_bool_t VLC_IsPlaying( int );
VLC_DEPRECATED_API bool VLC_IsPlaying( int );
/**
* Get the current position in a input
......@@ -573,7 +547,7 @@ VLC_DEPRECATED_API int VLC_TimeGet( int );
* \param b_relative seek relative from current position
* \return VLC_SUCCESS on success
*/
VLC_DEPRECATED_API int VLC_TimeSet( int, int, vlc_bool_t );
VLC_DEPRECATED_API int VLC_TimeSet( int, int, bool );
/**
* Get the total length of a input
......
......@@ -682,7 +682,7 @@ VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_
* Set mute status.
*
* \param p_instance libvlc instance
* \param status If status is VLC_TRUE then mute, otherwise unmute
* \param status If status is true then mute, otherwise unmute
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
......
......@@ -312,7 +312,7 @@ VLC_PUBLIC_API void mediacontrol_sound_set_volume( mediacontrol_Instance *self,
* \param visual_id the Xid or HWND, depending on the platform
* \param exception an initialized exception pointer
*/
VLC_PUBLIC_API vlc_bool_t mediacontrol_set_visual( mediacontrol_Instance *self,
VLC_PUBLIC_API bool mediacontrol_set_visual( mediacontrol_Instance *self,
WINDOWHANDLE visual_id,
mediacontrol_Exception *exception );
......
......@@ -38,10 +38,10 @@
enum access_query_e
{
/* capabilities */
ACCESS_CAN_SEEK, /* arg1= vlc_bool_t* cannot fail */
ACCESS_CAN_FASTSEEK, /* arg1= vlc_bool_t* cannot fail */
ACCESS_CAN_PAUSE, /* arg1= vlc_bool_t* cannot fail */
ACCESS_CAN_CONTROL_PACE,/* arg1= vlc_bool_t* cannot fail */
ACCESS_CAN_SEEK, /* arg1= bool* cannot fail */
ACCESS_CAN_FASTSEEK, /* arg1= bool* cannot fail */
ACCESS_CAN_PAUSE, /* arg1= bool* cannot fail */
ACCESS_CAN_CONTROL_PACE,/* arg1= bool* cannot fail */
/* */
ACCESS_GET_MTU, /* arg1= int* cannot fail(0 if no sense)*/
......@@ -52,7 +52,7 @@ enum access_query_e
ACCESS_GET_META, /* arg1= vlc_meta_t ** res=can fail */
/* */
ACCESS_SET_PAUSE_STATE, /* arg1= vlc_bool_t can fail */
ACCESS_SET_PAUSE_STATE, /* arg1= bool can fail */
/* */
ACCESS_SET_TITLE, /* arg1= int can fail */
......@@ -60,9 +60,9 @@ enum access_query_e
/* Special mode for access/demux communication
* XXX: avoid to use it unless you can't */
ACCESS_SET_PRIVATE_ID_STATE, /* arg1= int i_private_data, vlc_bool_t b_selected can fail */
ACCESS_SET_PRIVATE_ID_STATE, /* arg1= int i_private_data, bool b_selected can fail */
ACCESS_SET_PRIVATE_ID_CA, /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */
ACCESS_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=vlc_bool_t * res=can fail */
ACCESS_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=bool * res=can fail */
ACCESS_GET_CONTENT_TYPE, /* arg1=char **ppsz_content_type */
};
......@@ -107,12 +107,12 @@ struct access_t
int64_t i_size; /* Write only for access, read only for input */
int64_t i_pos; /* idem */
vlc_bool_t b_eof; /* idem */
bool b_eof; /* idem */
int i_title; /* idem, start from 0 (could be menu) */
int i_seekpoint;/* idem, start from 0 */
vlc_bool_t b_prebuffered; /* Read only for input */
bool b_prebuffered; /* Read only for input */
} info;
access_sys_t *p_sys;
};
......@@ -148,7 +148,7 @@ static inline void access_InitFields( access_t *p_a )
p_a->info.i_update = 0;
p_a->info.i_size = 0;
p_a->info.i_pos = 0;
p_a->info.b_eof = VLC_FALSE;
p_a->info.b_eof = false;
p_a->info.i_title = 0;
p_a->info.i_seekpoint = 0;
}
......
......@@ -33,12 +33,12 @@
#define ACL_Duplicate(a,b) __ACL_Duplicate(VLC_OBJECT(a),b)
VLC_EXPORT( int, ACL_Check, ( vlc_acl_t *p_acl, const char *psz_ip ) );
VLC_EXPORT( vlc_acl_t *, __ACL_Create, ( vlc_object_t *p_this, vlc_bool_t b_allow ) );
VLC_EXPORT( vlc_acl_t *, __ACL_Create, ( vlc_object_t *p_this, bool b_allow ) );
VLC_EXPORT( vlc_acl_t *, __ACL_Duplicate, ( vlc_object_t *p_this, const vlc_acl_t *p_acl ) );
VLC_EXPORT( void, ACL_Destroy, ( vlc_acl_t *p_acl ) );
#define ACL_AddHost(a,b,c) ACL_AddNet(a,b,-1,c)
VLC_EXPORT( int, ACL_AddNet, ( vlc_acl_t *p_acl, const char *psz_ip, int i_len, vlc_bool_t b_allow ) );
VLC_EXPORT( int, ACL_AddNet, ( vlc_acl_t *p_acl, const char *psz_ip, int i_len, bool b_allow ) );
VLC_EXPORT( int, ACL_LoadFile, ( vlc_acl_t *p_acl, const char *path ) );
#endif
......@@ -144,7 +144,7 @@ struct aout_buffer_t
size_t i_size, i_nb_bytes;
unsigned int i_nb_samples;
mtime_t start_date, end_date;
vlc_bool_t b_discontinuity; /* Set on discontinuity (for non pcm stream) */
bool b_discontinuity; /* Set on discontinuity (for non pcm stream) */
struct aout_buffer_t * p_next;
......@@ -205,7 +205,7 @@ typedef struct aout_mixer_t
struct aout_buffer_t * );
/** If b_error == 1, there is no mixer. */
vlc_bool_t b_error;
bool b_error;
/** Multiplier used to raise or lower the volume of the sound in
* software. Beware, this creates sound distortion and should be avoided
* as much as possible. This isn't available for non-float32 mixer. */
......@@ -235,8 +235,8 @@ struct aout_filter_t
struct aout_filter_t *,
struct aout_buffer_t *,
struct aout_buffer_t * );
vlc_bool_t b_in_place;
vlc_bool_t b_continuity;
bool b_in_place;
bool b_continuity;
};
#define AOUT_RESAMPLING_NONE 0
......@@ -274,13 +274,13 @@ struct aout_input_t
float f_multiplier;
/* If b_restart == 1, the input pipeline will be re-created. */
vlc_bool_t b_restart;
bool b_restart;
/* If b_error == 1, there is no input pipeline. */
vlc_bool_t b_error;
bool b_error;
/* Did we just change the output format? (expect buffer inconsistencies) */
vlc_bool_t b_changed;
bool b_changed;
/* last rate from input */
int i_last_input_rate;
......@@ -297,7 +297,7 @@ typedef struct aout_output_t
audio_sample_format_t output;
/* Indicates whether the audio output is currently starving, to avoid
* printing a 1,000 "output is starving" messages. */
vlc_bool_t b_starving;
bool b_starving;
/* post-filters */
aout_filter_t * pp_filters[AOUT_MAX_FILTERS];
......@@ -318,7 +318,7 @@ typedef struct aout_output_t
audio_volume_t i_volume;
/* If b_error == 1, there is no audio output pipeline. */
vlc_bool_t b_error;
bool b_error;
} aout_output_t;
/** audio output thread descriptor */
......@@ -363,7 +363,7 @@ VLC_EXPORT( void, aout_DateMove, ( audio_date_t *, mtime_t ) );
VLC_EXPORT( mtime_t, aout_DateGet, ( const audio_date_t * ) );
VLC_EXPORT( mtime_t, aout_DateIncrement, ( audio_date_t *, uint32_t ) );
VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t, vlc_bool_t ) );
VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t, bool ) );
VLC_EXPORT( int, aout_CheckChannelReorder, ( const uint32_t *, const uint32_t *, uint32_t, int, int * ) );
VLC_EXPORT( void, aout_ChannelReorder, ( uint8_t *, int, int, const int *, int ) );
......@@ -394,7 +394,7 @@ VLC_EXPORT( int, __aout_VolumeMute, ( vlc_object_t *, audio_volume_t * ) );
VLC_EXPORT( int, aout_FindAndRestart, ( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * ) );
VLC_EXPORT( int, aout_ChannelsRestart, ( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * ) );
VLC_EXPORT( void, aout_EnableFilter, (vlc_object_t *, const char *, vlc_bool_t ));
VLC_EXPORT( void, aout_EnableFilter, (vlc_object_t *, const char *, bool ));
#define aout_VisualNext(a) aout_VisualChange( VLC_OBJECT(a),1 )
#define aout_VisualPrev(a) aout_VisualChange( VLC_OBJECT(a),-1 )
......
......@@ -514,7 +514,7 @@ vlc_dictionary_all_keys( const vlc_dictionary_t * p_dict )
static inline void
__vlc_dictionary_insert( vlc_dictionary_t * p_dict, const char * psz_key,
void * p_value, vlc_bool_t rebuild )
void * p_value, bool rebuild )
{
if( !p_dict->p_entries )
vlc_dictionary_init( p_dict, 1 );
......
......@@ -76,7 +76,7 @@ static inline char *FromWide (const wchar_t *wide)
#endif
VLC_INTERNAL( char *, vlc_fix_readdir, ( const char * ) );
VLC_INTERNAL( vlc_bool_t, vlc_current_charset, ( char ** ) );
VLC_INTERNAL( bool, vlc_current_charset, ( char ** ) );
VLC_EXPORT( const char *, GetFallbackEncoding, ( void ) );
......
......@@ -66,10 +66,10 @@ struct decoder_t
es_format_t fmt_out;
/* Some decoders only accept packetized data (ie. not truncated) */
vlc_bool_t b_need_packetized;
bool b_need_packetized;
/* Tell the decoder if it is allowed to drop frames */
vlc_bool_t b_pace_control;
bool b_pace_control;
/* */
picture_t * ( * pf_decode_video )( decoder_t *, block_t ** );
......@@ -83,7 +83,7 @@ struct decoder_t
* last pf_packetize/pf_decode_video call only,
* pb_present will be used to known which cc channel are present (but
* globaly, not necessary for the current packet */
block_t * ( * pf_get_cc ) ( decoder_t *, vlc_bool_t pb_present[4] );
block_t * ( * pf_get_cc ) ( decoder_t *, bool pb_present[4] );
/*
* Buffers allocation
......
......@@ -44,10 +44,10 @@
VLC_EXPORT( decoder_synchro_t *, decoder_SynchroInit, ( decoder_t *, int ) );
VLC_EXPORT( void, decoder_SynchroRelease, ( decoder_synchro_t * ) );
VLC_EXPORT( void, decoder_SynchroReset, ( decoder_synchro_t * ) );
VLC_EXPORT( vlc_bool_t, decoder_SynchroChoose, ( decoder_synchro_t *, int, int, vlc_bool_t ) );
VLC_EXPORT( bool, decoder_SynchroChoose, ( decoder_synchro_t *, int, int, bool ) );
VLC_EXPORT( void, decoder_SynchroTrash, ( decoder_synchro_t * ) );
VLC_EXPORT( void, decoder_SynchroDecode, ( decoder_synchro_t * ) );
VLC_EXPORT( void, decoder_SynchroEnd, ( decoder_synchro_t *, int, vlc_bool_t ) );
VLC_EXPORT( void, decoder_SynchroEnd, ( decoder_synchro_t *, int, bool ) );
VLC_EXPORT( mtime_t, decoder_SynchroDate, ( decoder_synchro_t * ) );
VLC_EXPORT( void, decoder_SynchroNewPicture, ( decoder_synchro_t *, int, int, mtime_t, mtime_t, int, vlc_bool_t ) );
VLC_EXPORT( void, decoder_SynchroNewPicture, ( decoder_synchro_t *, int, int, mtime_t, mtime_t, int, bool ) );
......@@ -421,12 +421,12 @@ typedef struct es_sys_t
unsigned int i_scale_h;
unsigned int i_scale_v;
unsigned int i_alpha;
vlc_bool_t b_smooth;
bool b_smooth;
mtime_t i_fade_in;
mtime_t i_fade_out;
unsigned int i_align;
mtime_t i_time_offset;
vlc_bool_t b_forced_subs;
bool b_forced_subs;
unsigned int palette[16];
unsigned int colors[4];
......
......@@ -534,10 +534,10 @@ typedef struct vlc_object_internals_t vlc_object_internals_t;
vlc_cond_t object_wait; \
\
/* Object properties */ \
volatile vlc_bool_t b_error; /**< set by the object */ \
volatile vlc_bool_t b_die; /**< set by the outside */ \
volatile vlc_bool_t b_dead; /**< set by the object */ \
vlc_bool_t b_force; /**< set by the outside (eg. module_Need()) */ \
volatile bool b_error; /**< set by the object */ \
volatile bool b_die; /**< set by the outside */ \
volatile bool b_dead; /**< set by the object */ \
bool b_force; /**< set by the outside (eg. module_Need()) */ \
\
/* Stuff related to the libvlc structure */ \
libvlc_int_t *p_libvlc; /**< (root of all evil) - 1 */ \
......@@ -977,7 +977,7 @@ VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) );
# include <tchar.h>
#endif
VLC_EXPORT( vlc_bool_t, vlc_ureduce, ( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t ) );
VLC_EXPORT( bool, vlc_ureduce, ( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t ) );
VLC_EXPORT( char **, vlc_parse_cmdline, ( const char *, int * ) );
/* vlc_wraptext (defined in src/extras/libc.c) */
......
......@@ -178,21 +178,21 @@ struct module_config_t
/* Misc */
vlc_mutex_t *p_lock; /* Lock to use when modifying the config */
vlc_bool_t b_dirty; /* Dirty flag to indicate a config change */
vlc_bool_t b_advanced; /* Flag to indicate an advanced option */
vlc_bool_t b_internal; /* Flag to indicate option is not to be shown */
vlc_bool_t b_restart; /* Flag to indicate the option needs a restart */
bool b_dirty; /* Dirty flag to indicate a config change */
bool b_advanced; /* Flag to indicate an advanced option */
bool b_internal; /* Flag to indicate option is not to be shown */
bool b_restart; /* Flag to indicate the option needs a restart */
/* to take effect */
/* Deprecated */
char *psz_oldname; /* Old option name */
vlc_bool_t b_removed;
bool b_removed;
/* Option values loaded from config file */
vlc_bool_t b_autosave; /* Config will be auto-saved at exit time */
vlc_bool_t b_unsaveable; /* Config should not be saved */
bool b_autosave; /* Config will be auto-saved at exit time */
bool b_unsaveable; /* Config should not be saved */
vlc_bool_t b_safe;
bool b_safe;
};
/*****************************************************************************
......@@ -218,7 +218,7 @@ VLC_EXPORT(const char *, config_GetDataDir, ( void ));
VLC_EXPORT( void, __config_AddIntf, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, __config_RemoveIntf, ( vlc_object_t *, const char * ) );
VLC_EXPORT( vlc_bool_t, __config_ExistIntf, ( vlc_object_t *, const char * ) );
VLC_EXPORT( bool, __config_ExistIntf, ( vlc_object_t *, const char * ) );
#define config_GetType(a,b) __config_GetType(VLC_OBJECT(a),b)
#define config_GetInt(a,b) __config_GetInt(VLC_OBJECT(a),b)
......@@ -403,7 +403,7 @@ VLC_EXPORT( int, vlc_config_set, (module_config_t *, int, ...) );
#define add_bool( name, v, p_callback, text, longtext, advc ) \
add_typename_inner( CONFIG_ITEM_BOOL, name, text, longtext, advc, p_callback ); \
if (v) vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)VLC_TRUE)
if (v) vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)true)
/* For removed option */
#define add_obsolete_inner( name, type ) \
......
......@@ -118,30 +118,30 @@ enum demux_query_e
/* Meta data */
DEMUX_GET_META, /* arg1= vlc_meta_t ** res=can fail */
DEMUX_HAS_UNSUPPORTED_META, /* arg1= vlc_bool_t * res can fail */
DEMUX_HAS_UNSUPPORTED_META, /* arg1= bool * res can fail */
/* Attachments */
DEMUX_GET_ATTACHMENTS, /* arg1=input_attachment_t***, int* res=can fail */
/* II. Specific access_demux queries */
DEMUX_CAN_PAUSE, /* arg1= vlc_bool_t* can fail (assume false)*/
DEMUX_SET_PAUSE_STATE, /* arg1= vlc_bool_t can fail */
DEMUX_CAN_PAUSE, /* arg1= bool* can fail (assume false)*/
DEMUX_SET_PAUSE_STATE, /* arg1= bool can fail */
DEMUX_GET_PTS_DELAY, /* arg1= int64_t* cannot fail */
/* DEMUX_CAN_CONTROL_PACE returns true (*pb_pace) if we can read the
* data at our pace */
DEMUX_CAN_CONTROL_PACE, /* arg1= vlc_bool_t*pb_pace can fail (assume false) */
DEMUX_CAN_CONTROL_PACE, /* arg1= bool*pb_pace can fail (assume false) */
/* DEMUX_CAN_CONTROL_RATE is called only if DEMUX_CAN_CONTROL_PACE has returned false.
* *pb_rate should be true when the rate can be changed (using DEMUX_SET_RATE)
* *pb_ts_rescale should be true when the timestamps (pts/dts/pcr) have to be rescaled */
DEMUX_CAN_CONTROL_RATE, /* arg1= vlc_bool_t*pb_rate arg2= vlc_bool_t*pb_ts_rescale can fail(assume false) */
DEMUX_CAN_CONTROL_RATE, /* arg1= bool*pb_rate arg2= bool*pb_ts_rescale can fail(assume false) */
/* DEMUX_SET_RATE is called only if DEMUX_CAN_CONTROL_RATE has returned true.
* It should return the value really used in *pi_rate */
DEMUX_SET_RATE, /* arg1= int*pi_rate can fail */
DEMUX_CAN_SEEK, /* arg1= vlc_bool_t* can fail (assume false)*/
DEMUX_CAN_SEEK, /* arg1= bool* can fail (assume false)*/
};
VLC_EXPORT( int, demux2_vaControlHelper, ( stream_t *, int64_t i_start, int64_t i_end, int i_bitrate, int i_align, int i_query, va_list args ) );
......@@ -150,19 +150,19 @@ VLC_EXPORT( int, demux2_vaControlHelper, ( stream_t *, int64_t i_start, in
* Miscellaneous helpers for demuxers
*************************************************************************/
static inline vlc_bool_t demux2_IsPathExtension( demux_t *p_demux, const char *psz_extension )
static inline bool demux2_IsPathExtension( demux_t *p_demux, const char *psz_extension )
{
const char *psz_ext = strrchr ( p_demux->psz_path, '.' );
if( !psz_ext || strcasecmp( psz_ext, psz_extension ) )
return VLC_FALSE;
return VLC_TRUE;
return false;
return true;
}
static inline vlc_bool_t demux2_IsForced( demux_t *p_demux, const char *psz_name )
static inline bool demux2_IsForced( demux_t *p_demux, const char *psz_name )
{
if( !p_demux->psz_demux || strcmp( p_demux->psz_demux, psz_name ) )
return VLC_FALSE;