Commit 7870e9b5 authored by Rémi Duraffort's avatar Rémi Duraffort

Remove obvious statement.

parent f972ae13
......@@ -783,7 +783,7 @@ static inline void ml_GenericFreeFindTree( ml_ftree_t* tree, bool freestrings )
free( tree->right );
}
if( tree->op == ML_OP_NONE && ml_AttributeIsString( tree->criteria )
&& freestrings == true)
&& freestrings)
{
free( tree->value.str );
if( tree->criteria == ML_PEOPLE )
......
......@@ -1627,7 +1627,7 @@ static void MMISendObject( cam_t *p_cam, int i_session_id,
i_tag = AOT_ANSW;
i_size = 1 + strlen( p_object->u.answ.psz_answ );
p_data = xmalloc( i_size );
p_data[0] = (p_object->u.answ.b_ok == true) ? 0x1 : 0x0;
p_data[0] = p_object->u.answ.b_ok ? 0x1 : 0x0;
strncpy( (char *)&p_data[1], p_object->u.answ.psz_answ, i_size - 1 );
break;
......@@ -1723,7 +1723,7 @@ static void MMIHandleEnq( cam_t *p_cam, int i_session_id,
p_mmi->u.enq.psz_text[l] = '\0';
msg_Dbg( p_cam->obj, "MMI enq: %s%s", p_mmi->u.enq.psz_text,
p_mmi->u.enq.b_blind == true ? " (blind)" : "" );
p_mmi->u.enq.b_blind ? " (blind)" : "" );
p_cam->pb_slot_mmi_expected[i_slot] = false;
p_cam->pb_slot_mmi_undisplayed[i_slot] = true;
}
......@@ -2355,7 +2355,7 @@ static int en50221_CloseMMI( cam_t * p_cam, unsigned i_slot )
*****************************************************************************/
static mmi_t *en50221_GetMMIObject( cam_t * p_cam, unsigned i_slot )
{
if( p_cam->pb_slot_mmi_expected[i_slot] == true )
if( p_cam->pb_slot_mmi_expected[i_slot] )
return NULL; /* should not happen */
for( unsigned i = 1; i <= MAX_SESSIONS; i++ )
......@@ -2403,7 +2403,7 @@ char *en50221_Status( cam_t *p_cam, char *psz_request )
* the user input to avoid confusing the CAM. */
for ( unsigned i_slot = 0; i_slot < p_cam->i_nb_slots; i_slot++ )
{
if ( p_cam->pb_slot_mmi_undisplayed[i_slot] == true )
if ( p_cam->pb_slot_mmi_undisplayed[i_slot] )
{
psz_request = NULL;
msg_Dbg( p_cam->obj,
......@@ -2497,7 +2497,7 @@ char *en50221_Status( cam_t *p_cam, char *psz_request )
/* Check that we have all necessary MMI information. */
for( unsigned i_slot = 0; i_slot < p_cam->i_nb_slots; i_slot++ )
{
if ( p_cam->pb_slot_mmi_expected[i_slot] == true )
if ( p_cam->pb_slot_mmi_expected[i_slot] )
return NULL;
}
......
......@@ -187,12 +187,12 @@ void HTTPClose( access_t *p_access )
{
/* Unlock the thread if it is stuck in HttpCallback */
vlc_mutex_lock( &p_sys->httpd_mutex );
if ( p_sys->b_request_frontend_info == true )
if ( p_sys->b_request_frontend_info )
{
p_sys->b_request_frontend_info = false;
p_sys->psz_frontend_info = strdup("");
}
if ( p_sys->b_request_mmi_info == true )
if ( p_sys->b_request_mmi_info )
{
p_sys->b_request_mmi_info = false;
p_sys->psz_mmi_info = strdup("");
......
......@@ -1162,7 +1162,7 @@ static int Connect( access_t *p_access, uint64_t i_tell )
setsockopt (p_sys->fd, SOL_SOCKET, SO_KEEPALIVE, &(int){ 1 }, sizeof (int));
/* Initialize TLS/SSL session */
if( p_sys->b_ssl == true )
if( p_sys->b_ssl )
{
/* CONNECT to establish TLS tunnel through HTTP proxy */
if( p_sys->b_proxy )
......
......@@ -822,7 +822,7 @@ static int OpenEncoder( vlc_object_t *p_this )
b_tmp = var_GetBool( p_enc, ENC_CFG_PREFIX ENC_CODINGMODE );
if( b_tmp == true )
if( b_tmp )
p_sys->b_auto_field_coding = true;
else
p_sys->b_auto_field_coding = false;
......
......@@ -625,7 +625,7 @@ static void mvar_VlmSetNewLoop( char *name, vlm_t *vlm, mvar_t *s,
/* Add a node with name and info */
set = mvar_New( name, "set" );
if( b_name == true )
if( b_name )
{
mvar_AppendNewVar( set, "name", el->psz_name );
}
......
......@@ -1270,7 +1270,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
if( strlen( newval.psz_string ) > 0 )
{
if ( ( !strncmp( newval.psz_string, "on", 2 ) && ( val.b_bool == true ) ) ||
if ( ( !strncmp( newval.psz_string, "on", 2 ) && ( val.b_bool ) ) ||
( !strncmp( newval.psz_string, "off", 3 ) && ( val.b_bool == false ) ) )
{
b_update = false;
......@@ -1292,7 +1292,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
if( strlen( newval.psz_string ) > 0 )
{
if ( ( !strncmp( newval.psz_string, "on", 2 ) && ( val.b_bool == true ) ) ||
if ( ( !strncmp( newval.psz_string, "on", 2 ) && ( val.b_bool ) ) ||
( !strncmp( newval.psz_string, "off", 3 ) && ( val.b_bool == false ) ) )
{
b_update = false;
......@@ -1314,7 +1314,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
if( strlen( newval.psz_string ) > 0 )
{
if ( ( !strncmp( newval.psz_string, "on", 2 ) && ( val.b_bool == true ) ) ||
if ( ( !strncmp( newval.psz_string, "on", 2 ) && ( val.b_bool ) ) ||
( !strncmp( newval.psz_string, "off", 3 ) && ( val.b_bool == false ) ) )
{
b_update = false;
......
......@@ -441,7 +441,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
( p_item->i_type == CONFIG_CATEGORY ||
p_item->i_type == CONFIG_SUBCATEGORY ) )
break;
if( p_item->b_internal == true ) continue;
if( p_item->b_internal ) continue;
if( p_item->i_type == CONFIG_SECTION )
{
......
......@@ -1122,7 +1122,7 @@ BoolConfigControl::BoolConfigControl( vlc_object_t *_p_this,
void BoolConfigControl::finish()
{
checkbox->setChecked( p_item->value.i == true );
checkbox->setChecked( p_item->value.i );
if( p_item->psz_longtext )
checkbox->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
}
......
......@@ -65,7 +65,7 @@ void ClickLineEdit::setText( const QString &txt )
void ClickLineEdit::paintEvent( QPaintEvent *pe )
{
QLineEdit::paintEvent( pe );
if ( mDrawClickMsg == true && !hasFocus() ) {
if ( mDrawClickMsg && !hasFocus() ) {
QPainter p( this );
QPen tmp = p.pen();
p.setPen( palette().color( QPalette::Disabled, QPalette::Text ) );
......@@ -86,7 +86,7 @@ void ClickLineEdit::dropEvent( QDropEvent *ev )
void ClickLineEdit::focusInEvent( QFocusEvent *ev )
{
if ( mDrawClickMsg == true ) {
if ( mDrawClickMsg ) {
mDrawClickMsg = false;
repaint();
}
......
......@@ -1128,7 +1128,7 @@ ml_media_t* GetMedia( media_library_t* p_ml, int id,
else
{
ml_LockMedia( p_media );
if( p_media->b_sparse == true && select == ML_MEDIA )
if( p_media->b_sparse && select == ML_MEDIA )
reload = true;
/* Utilise ML_MEDIA_EXTRA load? TODO */
ml_UnlockMedia( p_media );
......
......@@ -764,7 +764,7 @@ int BuildSelect( media_library_t *p_ml,
psz_on2 == NULL ? "" : " AND " );
}
}
if( join == true )
if( join )
{
if( psz_peoplerole && *psz_peoplerole )
{
......
......@@ -753,7 +753,7 @@ static void CloseClient (vlc_object_t *obj)
tls_session_t *client = (tls_session_t *)obj;
tls_client_sys_t *p_sys = (tls_client_sys_t *)(client->p_sys);
if (p_sys->session.b_handshaked == true)
if (p_sys->session.b_handshaked)
gnutls_bye (p_sys->session.session, GNUTLS_SHUT_WR);
gnutls_deinit (p_sys->session.session);
/* credentials must be free'd *after* gnutls_deinit() */
......@@ -902,7 +902,7 @@ gnutls_SessionClose (tls_server_t *p_server, tls_session_t *p_session)
tls_session_sys_t *p_sys = p_session->p_sys;
(void)p_server;
if( p_sys->b_handshaked == true )
if( p_sys->b_handshaked )
gnutls_bye( p_sys->session, GNUTLS_SHUT_WR );
gnutls_deinit( p_sys->session );
......
......@@ -236,7 +236,7 @@ static int RegisterToGrowl( vlc_object_t *p_this )
psz_encoded[4] = j;
for( j = 0 ; psz_notifications[j] != NULL ; j++)
{
if(pb_defaults[j] == true)
if(pb_defaults[j])
{
psz_encoded[i++] = (uint8_t)j;
i_defaults++;
......
......@@ -1086,7 +1086,7 @@ static void Atmo_Shutdown(filter_t *p_filter)
{
filter_sys_t *p_sys = p_filter->p_sys;
if(p_sys->b_enabled == true)
if(p_sys->b_enabled)
{
msg_Dbg( p_filter, "shut down atmo!");
/*
......@@ -2252,7 +2252,7 @@ static void CreateMiniImage( filter_t *p_filter, picture_t *p_inpic)
/*
if debugging enabled save every 128th image to disk
*/
if((p_sys->b_saveframes == true) && (p_sys->sz_framepath[0] != 0 ))
if(p_sys->b_saveframes && p_sys->sz_framepath[0] != 0 )
{
if((p_sys->ui_frame_counter & 127) == 0)
......@@ -2301,9 +2301,8 @@ static picture_t * Filter( filter_t *p_filter, picture_t *p_pic )
vlc_mutex_lock( &p_sys->filter_lock );
if((p_sys->b_enabled == true) &&
(p_sys->pf_extract_mini_image != NULL) &&
(p_sys->b_pause_live == false))
if(p_sys->b_enabled && p_sys->pf_extract_mini_image &&
!p_sys->b_pause_live)
{
p_sys->i_crop_x_offset = p_filter->fmt_in.video.i_x_offset;
p_sys->i_crop_y_offset = p_filter->fmt_in.video.i_y_offset;
......@@ -2458,7 +2457,7 @@ static int StateCallback( vlc_object_t *p_this, char const *psz_cmd,
filter_t *p_filter = (filter_t *)p_data;
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
if((p_sys->b_usepausecolor == true) && (p_sys->b_enabled == true))
if(p_sys->b_usepausecolor && p_sys->b_enabled)
{
msg_Dbg(p_filter, "state change from: %"PRId64" to %"PRId64, oldval.i_int,
newval.i_int);
......
......@@ -1785,7 +1785,7 @@ static picture_t *Deinterlace( filter_t *p_filter, picture_t *p_pic )
Note that now p_dst[i] != NULL for 0 <= i < i_double_rate_alloc_end. */
}
assert( p_sys->b_double_rate == true || p_dst[1] == NULL );
assert( p_sys->b_double_rate || p_dst[1] == NULL );
assert( i_nb_fields > 2 || p_dst[2] == NULL );
/* Render */
......
......@@ -273,8 +273,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_cmddesc->p_command->pf_parser( p_cmd, p_end,
&p_cmddesc->params );
if( ( p_cmddesc->p_command->b_atomic == true ) &&
( p_sys->b_atomic == true ) )
if( p_cmddesc->p_command->b_atomic && p_sys->b_atomic )
QueueEnqueue( &p_sys->atomic, p_cmddesc );
else
QueueEnqueue( &p_sys->pending, p_cmddesc );
......
......@@ -664,7 +664,7 @@ static int exec_GetVisibility( filter_t *p_filter,
if( p_ovl == NULL )
return VLC_EGENERIC;
p_results->b_visible = ( p_ovl->b_active == true ) ? 1 : 0;
p_results->b_visible = p_ovl->b_active ? 1 : 0;
return VLC_SUCCESS;
}
......
......@@ -130,7 +130,7 @@ overlay_t *ListWalk( list_t *p_list )
for( ; pp_cur < p_list->pp_tail; ++pp_cur )
{
if( ( *pp_cur != NULL ) &&
( (*pp_cur)->b_active == true )&&
( (*pp_cur)->b_active )&&
( (*pp_cur)->format.i_chroma != VLC_FOURCC( '\0','\0','\0','\0') ) )
{
return *pp_cur;
......
......@@ -1012,7 +1012,7 @@ static bool process_server_message ( filter_t *p_filter,
msg->scme.nColours = htons(msg->scme.nColours);
msg->scme.firstColour = htons(msg->scme.firstColour);
int i_datasize;
if ( p_sys->b_alpha_from_vnc == true )
if ( p_sys->b_alpha_from_vnc )
{
i_datasize = 2 * msg->scme.nColours * 4;
}
......@@ -1041,7 +1041,7 @@ static bool process_server_message ( filter_t *p_filter,
for (int i = 0; i < msg->scme.nColours; i++)
{
i_color_index = i+msg->scme.firstColour;
if ( p_sys->b_alpha_from_vnc == true )
if ( p_sys->b_alpha_from_vnc )
{
i_alpha = p_sys->read_buffer[i_offset];
i_offset += 2;
......
......@@ -472,7 +472,7 @@ static void* Manage( void* p_object )
{
mtime_t i_real_date = vlm->schedule[i]->i_date;
if( vlm->schedule[i]->b_enabled == true )
if( vlm->schedule[i]->b_enabled )
{
if( vlm->schedule[i]->i_date == 0 ) // now !
{
......
......@@ -1592,12 +1592,12 @@ static char *Save( vlm_t *vlm )
else
i_length += strlen( "new * broadcast " ) + strlen(p_cfg->psz_name);
if( p_cfg->b_enabled == true )
if( p_cfg->b_enabled )
i_length += strlen( "enabled" );
else
i_length += strlen( "disabled" );
if( !p_cfg->b_vod && p_cfg->broadcast.b_loop == true )
if( !p_cfg->b_vod && p_cfg->broadcast.b_loop )
i_length += strlen( " loop\n" );
else
i_length += strlen( "\n" );
......@@ -1621,7 +1621,7 @@ static char *Save( vlm_t *vlm )
i_length += strlen( "new schedule " ) + strlen( schedule->psz_name );
if( schedule->b_enabled == true )
if( schedule->b_enabled )
{
i_length += strlen( "date //-:: enabled\n" ) + 14;
}
......@@ -1712,7 +1712,7 @@ static char *Save( vlm_t *vlm )
localtime_r( &i_time, &date);
p += sprintf( p, "new %s schedule ", schedule->psz_name);
if( schedule->b_enabled == true )
if( schedule->b_enabled )
{
p += sprintf( p, "date %d/%d/%d-%d:%d:%d enabled\n",
date.tm_year + 1900, date.tm_mon + 1, date.tm_mday,
......
......@@ -799,7 +799,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
#if defined(MEDIA_LIBRARY)
/* Get the ML */
if( var_GetBool( p_libvlc, "load-media-library-on-startup" ) == true )
if( var_GetBool( p_libvlc, "load-media-library-on-startup" ) )
{
priv->p_ml = ml_Create( VLC_OBJECT( p_libvlc ), NULL );
if( !priv->p_ml )
......
......@@ -289,7 +289,7 @@ void stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
p_counter->i_samples, p_sample );
p_sample->date = 0; p_sample->value.i_int = 0;
}
if( p_counter->pp_samples[0]->value.b_bool == true )
if( p_counter->pp_samples[0]->value.b_bool )
{
msg_Warn( p_obj, "timer '%s' was already started !", psz_name );
goto out;
......@@ -568,7 +568,7 @@ static void TimerDump( vlc_object_t *p_obj, counter_t *p_counter,
}
i_total = p_counter->pp_samples[1]->value.i_int;
total = p_counter->pp_samples[1]->date;
if( p_counter->pp_samples[0]->value.b_bool == true )
if( p_counter->pp_samples[0]->value.b_bool )
{
last = mdate() - p_counter->pp_samples[0]->date;
i_total += 1;
......
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