From 7870e9b5cda06d8da423ce0472bdfd085f4dc3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Duraffort?= Date: Mon, 21 Mar 2011 22:21:51 +0100 Subject: [PATCH] Remove obvious statement. --- include/vlc_media_library.h | 2 +- modules/access/dvb/en50221.c | 10 +++++----- modules/access/dvb/http.c | 4 ++-- modules/access/http.c | 2 +- modules/codec/schroedinger.c | 2 +- modules/control/http/mvar.c | 2 +- modules/control/rc.c | 6 +++--- modules/gui/qt4/components/complete_preferences.cpp | 2 +- modules/gui/qt4/components/preferences_widgets.cpp | 2 +- modules/gui/qt4/util/searchlineedit.cpp | 4 ++-- modules/media_library/sql_media_library.c | 2 +- modules/media_library/sql_search.c | 2 +- modules/misc/gnutls.c | 4 ++-- modules/misc/notify/growl_udp.c | 2 +- modules/video_filter/atmo/atmo.cpp | 11 +++++------ modules/video_filter/deinterlace.c | 2 +- modules/video_filter/dynamicoverlay/dynamicoverlay.c | 3 +-- .../dynamicoverlay/dynamicoverlay_commands.c | 2 +- .../video_filter/dynamicoverlay/dynamicoverlay_list.c | 2 +- modules/video_filter/remoteosd.c | 4 ++-- src/input/vlm.c | 2 +- src/input/vlmshell.c | 8 ++++---- src/libvlc.c | 2 +- src/misc/stats.c | 4 ++-- 24 files changed, 42 insertions(+), 44 deletions(-) diff --git a/include/vlc_media_library.h b/include/vlc_media_library.h index f682753ab1..7179ac3149 100644 --- a/include/vlc_media_library.h +++ b/include/vlc_media_library.h @@ -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 ) diff --git a/modules/access/dvb/en50221.c b/modules/access/dvb/en50221.c index 2c1e9835b0..cc391c5e6f 100644 --- a/modules/access/dvb/en50221.c +++ b/modules/access/dvb/en50221.c @@ -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; } diff --git a/modules/access/dvb/http.c b/modules/access/dvb/http.c index c03efcd974..a13abf06f9 100644 --- a/modules/access/dvb/http.c +++ b/modules/access/dvb/http.c @@ -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(""); diff --git a/modules/access/http.c b/modules/access/http.c index 926435d4cd..b45485835d 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -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 ) diff --git a/modules/codec/schroedinger.c b/modules/codec/schroedinger.c index 5770dc44b8..4d458bfc11 100644 --- a/modules/codec/schroedinger.c +++ b/modules/codec/schroedinger.c @@ -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; diff --git a/modules/control/http/mvar.c b/modules/control/http/mvar.c index 89db173529..39098eb738 100644 --- a/modules/control/http/mvar.c +++ b/modules/control/http/mvar.c @@ -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 ); } diff --git a/modules/control/rc.c b/modules/control/rc.c index 473b81d883..708f4d120d 100644 --- a/modules/control/rc.c +++ b/modules/control/rc.c @@ -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; diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp index 747fd10e69..9702c6f93f 100644 --- a/modules/gui/qt4/components/complete_preferences.cpp +++ b/modules/gui/qt4/components/complete_preferences.cpp @@ -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 ) { diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index f98215a42c..b97521a5df 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -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)) ); } diff --git a/modules/gui/qt4/util/searchlineedit.cpp b/modules/gui/qt4/util/searchlineedit.cpp index 58b825139b..9b3abdb189 100644 --- a/modules/gui/qt4/util/searchlineedit.cpp +++ b/modules/gui/qt4/util/searchlineedit.cpp @@ -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(); } diff --git a/modules/media_library/sql_media_library.c b/modules/media_library/sql_media_library.c index bfdb552051..c56479bd6a 100644 --- a/modules/media_library/sql_media_library.c +++ b/modules/media_library/sql_media_library.c @@ -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 ); diff --git a/modules/media_library/sql_search.c b/modules/media_library/sql_search.c index fdd632a184..439b580c1e 100644 --- a/modules/media_library/sql_search.c +++ b/modules/media_library/sql_search.c @@ -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 ) { diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c index 1aba7daaff..f5c2b12357 100644 --- a/modules/misc/gnutls.c +++ b/modules/misc/gnutls.c @@ -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 ); diff --git a/modules/misc/notify/growl_udp.c b/modules/misc/notify/growl_udp.c index 2356593f14..2bf12af5e2 100644 --- a/modules/misc/notify/growl_udp.c +++ b/modules/misc/notify/growl_udp.c @@ -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++; diff --git a/modules/video_filter/atmo/atmo.cpp b/modules/video_filter/atmo/atmo.cpp index ca3e44995a..d91442be4c 100644 --- a/modules/video_filter/atmo/atmo.cpp +++ b/modules/video_filter/atmo/atmo.cpp @@ -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); diff --git a/modules/video_filter/deinterlace.c b/modules/video_filter/deinterlace.c index a3a439bdfb..43843da3b4 100644 --- a/modules/video_filter/deinterlace.c +++ b/modules/video_filter/deinterlace.c @@ -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 */ diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay.c b/modules/video_filter/dynamicoverlay/dynamicoverlay.c index d389893bc6..c7d20bb065 100644 --- a/modules/video_filter/dynamicoverlay/dynamicoverlay.c +++ b/modules/video_filter/dynamicoverlay/dynamicoverlay.c @@ -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 ); diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c index d119ed3290..a7d3b477ab 100644 --- a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c +++ b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c @@ -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; } diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay_list.c b/modules/video_filter/dynamicoverlay/dynamicoverlay_list.c index 66ad130a1b..ff620a5728 100644 --- a/modules/video_filter/dynamicoverlay/dynamicoverlay_list.c +++ b/modules/video_filter/dynamicoverlay/dynamicoverlay_list.c @@ -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; diff --git a/modules/video_filter/remoteosd.c b/modules/video_filter/remoteosd.c index cd1b28453e..e5319556ea 100644 --- a/modules/video_filter/remoteosd.c +++ b/modules/video_filter/remoteosd.c @@ -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; diff --git a/src/input/vlm.c b/src/input/vlm.c index 070754afcd..83990ed61e 100644 --- a/src/input/vlm.c +++ b/src/input/vlm.c @@ -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 ! { diff --git a/src/input/vlmshell.c b/src/input/vlmshell.c index d1c51ba432..1656c28e4a 100644 --- a/src/input/vlmshell.c +++ b/src/input/vlmshell.c @@ -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, diff --git a/src/libvlc.c b/src/libvlc.c index 1d4a1d579f..dabca3197c 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -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 ) diff --git a/src/misc/stats.c b/src/misc/stats.c index 77e123584f..293f8db057 100644 --- a/src/misc/stats.c +++ b/src/misc/stats.c @@ -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;