Skip to content

Commit

Permalink
Replace vlc_bool_t by bool, VLC_TRUE by true and VLC_FALSE by false.
Browse files Browse the repository at this point in the history
This improves readability a lot and prevent us from reinventing the wheel.
  • Loading branch information
pdherbemont committed Apr 14, 2008
1 parent 05eac2d commit 449fd28
Show file tree
Hide file tree
Showing 597 changed files with 6,381 additions and 6,407 deletions.
4 changes: 2 additions & 2 deletions include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/vlc/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
38 changes: 6 additions & 32 deletions include/vlc/deprecated.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ )
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/vlc/libvlc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 * );
Expand Down
2 changes: 1 addition & 1 deletion include/vlc/mediacontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
20 changes: 10 additions & 10 deletions include/vlc_access.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)*/
Expand All @@ -52,17 +52,17 @@ 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 */
ACCESS_SET_SEEKPOINT, /* arg1= int can fail */

/* 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 */
};
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions include/vlc_acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 11 additions & 11 deletions include/vlc_aout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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];
Expand All @@ -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 */
Expand Down Expand Up @@ -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 ) );
Expand Down Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion include/vlc_arrays.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion include/vlc_charset.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );

Expand Down
6 changes: 3 additions & 3 deletions include/vlc_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ** );
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions include/vlc_codec_synchro.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );

4 changes: 2 additions & 2 deletions include/vlc_codecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
10 changes: 5 additions & 5 deletions include/vlc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ \
Expand Down Expand Up @@ -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) */
Expand Down
Loading

0 comments on commit 449fd28

Please sign in to comment.