]> git.sesse.net Git - vlc/commitdiff
One more time removing of some useless tests.
authorRémi Duraffort <ivoire@videolan.org>
Wed, 12 Mar 2008 11:02:01 +0000 (12:02 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 12 Mar 2008 11:07:43 +0000 (12:07 +0100)
23 files changed:
modules/gui/fbosd.c
modules/gui/macosx/controls.m
modules/gui/macosx/prefs_widgets.m
modules/gui/ncurses.c
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/dialogs/interaction.cpp
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.hpp
modules/gui/skins2/src/theme_loader.cpp
modules/gui/wince/dialogs.cpp
modules/gui/wince/menus.cpp
modules/gui/wince/open.cpp
modules/gui/wince/preferences.cpp
modules/gui/wince/subtitles.cpp
modules/gui/wxwidgets/dialogs.cpp
modules/gui/wxwidgets/dialogs/bookmarks.cpp
modules/gui/wxwidgets/dialogs/open.cpp
modules/gui/wxwidgets/dialogs/preferences.cpp
modules/gui/wxwidgets/dialogs/preferences_widgets.cpp
modules/gui/wxwidgets/dialogs/subtitles.cpp
modules/gui/wxwidgets/dialogs/wizard.cpp
modules/gui/wxwidgets/menus.cpp
modules/gui/wxwidgets/wxwidgets.cpp

index 8daf1bc35ad3be535221ed75ed4e3fc093c085c2..c6d4b6302ba59ec707f1d54410bc90a81112cd1c 100644 (file)
@@ -580,7 +580,7 @@ static int OpenTextRenderer( intf_thread_t *p_intf )
         p_intf->p_sys->p_text->p_module =
             module_Need( p_intf->p_sys->p_text, "text renderer", 0, 0 );
     }
-    if( psz_modulename ) free( psz_modulename );
+    free( psz_modulename );
 
     if( !p_intf->p_sys->p_text->p_module )
         return VLC_EGENERIC;
@@ -684,9 +684,12 @@ static picture_t *AllocatePicture( vlc_object_t *p_this,
 static void DeAllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
                                video_format_t *p_fmt )
 {
-    if( p_pic && p_pic->p_data_orig ) free( p_pic->p_data_orig );
-    if( p_pic && p_pic->pf_release ) p_pic->pf_release( p_pic );
-    if( p_fmt && p_fmt->p_palette )
+    if( p_pic )
+    {
+        free( p_pic->p_data_orig );
+        if( p_pic->pf_release ) p_pic->pf_release( p_pic );
+    }
+    if( p_fmt )
     {
         free( p_fmt->p_palette );
         p_fmt->p_palette = NULL;
index 7a8d41b8af8965658c38eea4ff5969e3abd1dfd7..9ad5c89c3517bd52feb8266b1c96a742ca04eba8 100644 (file)
         [self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
                         var:psz_variable selector:pf_callback];
  
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
         break;
 
     default:
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
     if( ( i_type & VLC_VAR_TYPE ) == VLC_VAR_STRING ) free( val.psz_string );
-    if( text.psz_string ) free( text.psz_string );
+    free( text.psz_string );
 }
 
 
index 5769eaca9ecb35d051144d019023b640fd135118..2b0782c890e6d2196e02de240564f989912afc5f 100644 (file)
 - (void)dealloc
 {
     if( o_label ) [o_label release];
-    if( psz_name ) free( psz_name );
+    free( psz_name );
     [super dealloc];
 }
 
index 3f5f1f6e35fe00bb3010399b131de3243ac3b5e9..2d636472a5a7cec58162ebbdd66876b2a8fdfa98 100644 (file)
@@ -343,16 +343,16 @@ static void Close( vlc_object_t *p_this )
     for( i = 0; i < p_sys->i_dir_entries; i++ )
     {
         struct dir_entry_t *p_dir_entry = p_sys->pp_dir_entries[i];
-        if( p_dir_entry->psz_path ) free( p_dir_entry->psz_path );
+        free( p_dir_entry->psz_path );
         REMOVE_ELEM( p_sys->pp_dir_entries, p_sys->i_dir_entries, i );
-        if( p_dir_entry ) free( p_dir_entry );
+        free( p_dir_entry );
     }
     p_sys->pp_dir_entries = NULL;
 
-    if( p_sys->psz_current_dir ) free( p_sys->psz_current_dir );
-    if( p_sys->psz_search_chain ) free( p_sys->psz_search_chain );
-    if( p_sys->psz_old_search ) free( p_sys->psz_old_search );
-    if( p_sys->psz_open_chain ) free( p_sys->psz_open_chain );
+    free( p_sys->psz_current_dir );
+    free( p_sys->psz_search_chain );
+    free( p_sys->psz_old_search );
+    free( p_sys->psz_open_chain );
 
     if( p_sys->p_input )
     {
@@ -948,11 +948,8 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
                 break;
             }
         }
-        if( p_sys->psz_old_search )
-        {
-            free( p_sys->psz_old_search );
-            p_sys->psz_old_search = NULL;
-        }
+        free( p_sys->psz_old_search );
+        p_sys->psz_old_search = NULL;
         SearchPlaylist( p_intf, p_sys->psz_search_chain );
         return 1;
     }
@@ -2361,7 +2358,7 @@ static void Eject( intf_thread_t *p_intf )
         intf_Eject( p_intf, psz_device );
     }
 
-    free(psz_device);
+    free( psz_device );
     return;
 }
 
index d64b207c609943febf6f123707a174570f7440ab..2346bfd5aaed07a85785940ad3d4039337af517d 100644 (file)
@@ -386,7 +386,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
        // this, like the one behind the refresh push button?
        p_module_config->b_dirty = VLC_FALSE;
 
-       if(val.psz_string) free(val.psz_string);
+       free( val.psz_string );
     }
 
     finish( p_module_config, bycat );
index 0cf4149906b04fd8adf9306289ecb377bb6b16c0..60f3acce05bc4309c456ac7012a6163f17806fa7 100644 (file)
@@ -190,6 +190,9 @@ void InteractionDialog::update()
     if( ( p_dialog->i_flags & DIALOG_INTF_PROGRESS ) &&
         ( p_dialog->val.f_float >= 100.0 ) )
         progressBar->hide();
+    if( ( p_dialog->i_flags & DIALOG_USER_PROGRESS ) &&
+        ( p_dialog->val.f_float >= 100.0 ) )
+        altButton->setText( qtr( "close" ) );
 }
 
 InteractionDialog::~InteractionDialog()
index e76a793c05f571c2bfeb242d66fe06e0f7fd45d4..0057d7495d77e378d3eff9238767f85847413a92 100644 (file)
@@ -960,7 +960,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
                         NOTCOMMAND && val.psz_string &&
                         !strcmp( val.psz_string, CURVAL.psz_string ) );
 
-                if( val.psz_string ) free( val.psz_string );
+                free( val.psz_string );
                 break;
 
             case VLC_VAR_INTEGER:
index f7d66f74999af7d5fc84f3a9d0449f4fd9d8e13a..b23da2b524cc72cb0b2b8bfb0186f319d4ed0a51 100644 (file)
@@ -58,9 +58,9 @@ public:
     }
     virtual ~MenuItemData()
     {
-        if( psz_var ) free( psz_var );
-        if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING)
-            && val.psz_string ) free( val.psz_string );
+        free( psz_var );
+        if( ( i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING )
+            free( val.psz_string );
     }
     int i_object_id;
     int i_val_type;
index 2100ba900dcbf6f96322bfd2d7ca54f04ca772d5..2f0c4c3728a84fd86214e61bab8d49d54a045fb0 100644 (file)
@@ -114,7 +114,7 @@ bool ThemeLoader::load( const string &fileName )
         // Show the windows
         pNewTheme->getWindowManager().showAll( true );
     }
-    if( skin_last ) free( skin_last );
+    free( skin_last );
 
     // The new theme cannot embed a video output yet
     VlcProc::instance( getIntf() )->dropVout();
index 4fee91c4432faabf3e1c64d766890e60d2a3824b..83ba42d44252ee95e7317fb80f2154b9cc623d78 100644 (file)
@@ -320,8 +320,8 @@ void DialogsProvider::OnOpenFileGeneric( intf_dialog_args_t *p_arg )
         }
         free( p_arg->psz_results );
     }
-    if( p_arg->psz_title ) free( p_arg->psz_title );
-    if( p_arg->psz_extensions ) free( p_arg->psz_extensions );
+    free( p_arg->psz_title );
+    free( p_arg->psz_extensions );
 
     free( p_arg );
 }
index 9aed3fba0edd342af330f06f8bed7775cef5d71e..f9a9b5b4790a01041acba04b0f776dc17963f9d0 100644 (file)
@@ -558,7 +558,7 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
         AppendMenu( hMenu, MF_STRING | MF_POPUP, (UINT)hMenuItem,
                     _FROMMB(text.psz_string ? text.psz_string : psz_var) );
         if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
@@ -585,12 +585,12 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
         break;
 
     default:
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
     if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
-    if( text.psz_string ) free( text.psz_string );
+    free( text.psz_string );
 }
 
 HMENU CreateChoicesMenu( intf_thread_t *p_intf,
@@ -802,9 +802,9 @@ MenuItemExt::MenuItemExt( intf_thread_t *p_intf, int _id, char *_psz_var,
 
 MenuItemExt::~MenuItemExt()
 {
-    if( psz_var ) free( psz_var );
-    if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING)
-        && val.psz_string ) free( val.psz_string );
+    free( psz_var );
+    if( ( i_val_type & VLC_VAR_TYPE ) == VLC_VAR_STRING )
+        free( val.psz_string );
 };
 
 void MenuItemExt::ClearList( vector<MenuItemExt*> *p_menu_list )
index e5be15c1e069c8690a55d7f5528c125393122dda..1805617b89844966f793fba826a7480846d11634 100644 (file)
@@ -310,7 +310,7 @@ void OpenDialog::FilePanel( HWND hwnd )
         sz_subsfile += psz_subsfile;
         subsfile_mrl.push_back( sz_subsfile );
     }
-    if( psz_subsfile ) free( psz_subsfile );
+    free( psz_subsfile );
 }
 
 void OpenDialog::NetPanel( HWND hwnd )
index 1193418a03cddcb3646e4318cebae705eee2bee2..7a158af6e6b9af3848fcb7da134c6d2dcd2defa7 100644 (file)
@@ -128,9 +128,9 @@ public:
 
     ConfigTreeData() { b_submodule = 0; panel = NULL; psz_section = NULL;
                        psz_help = NULL; }
-    virtual ~ConfigTreeData() { if( panel ) delete panel;
-                                if( psz_section) free(psz_section);
-                                if( psz_help) free(psz_help); }
+    virtual ~ConfigTreeData() { delete panel;
+                                free( psz_section );
+                                free( psz_help ); }
 
     vlc_bool_t b_submodule;
 
index 9cff6611a4fd679d7b0f912eba4f83b0b9286e9b..175e7e109d9cee5f2cc7c4bd9e0c39009150c0b8 100644 (file)
@@ -116,7 +116,7 @@ LRESULT SubsFileDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
             10, 10 + 15 + 10 - 3, rcClient.right - 2*10, 5*15 + 6,
             hwnd, NULL, hInst, NULL );
 
-        if( psz_subsfile ) free( psz_subsfile );
+        free( psz_subsfile );
 
         browse_button = CreateWindow( _T("BUTTON"), _T("Browse..."),
                         WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
index 2701e7932c38150783ce2dcae10e598fdbe8d57c..b62632be84e30a9ed40ca592859eed25931973e0 100644 (file)
@@ -427,8 +427,8 @@ void DialogsProvider::OnOpenFileGeneric( wxCommandEvent& event )
         }
         free( p_arg->psz_results );
     }
-    if( p_arg->psz_title ) free( p_arg->psz_title );
-    if( p_arg->psz_extensions ) free( p_arg->psz_extensions );
+    free( p_arg->psz_title );
+    free( p_arg->psz_extensions );
 
     free( p_arg );
 }
index 5f6ebed466c812df3515d9c49ee176f4ccb2bcc0..e2f138c4e8ae2a87d03ba04f3a2118de3ed045a7 100644 (file)
@@ -118,7 +118,7 @@ BookmarkEditDialog::~BookmarkEditDialog()
 }
 void BookmarkEditDialog::OnOK( wxCommandEvent &event )
 {
-    if( p_seekpoint->psz_name ) free( p_seekpoint->psz_name );
+    free( p_seekpoint->psz_name );
     p_seekpoint->psz_name = strdup( name_text->GetValue().mb_str(wxConvUTF8) );
     p_seekpoint->i_byte_offset = atoi( bytes_text->GetValue().mb_str(wxConvUTF8) );
     p_seekpoint->i_time_offset =  1000000 *
index 3b92e19fd212f43cc1e4d3fa15479fa579005b4b..df988e4a8c97927267513c970d80fc998ebad1b6 100644 (file)
@@ -444,7 +444,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
             sout_button->Enable();
             subsfile_mrl.Add( wxString(wxT("sout=")) + wxL2U(psz_sout) );
         }
-        if( psz_sout ) free( psz_sout );
+        free( psz_sout );
 
         common_opt_sizer->Add( sout_button, 1, wxALIGN_LEFT |
                                wxALIGN_CENTER_VERTICAL );
@@ -661,7 +661,7 @@ wxPanel *OpenDialog::FilePanel( wxWindow* parent )
                         0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
     subfile_combo = new wxComboBox( panel, SubFileName_Event,
                                     wxL2U( psz_subsfile ) );
-    if( psz_subsfile ) free( psz_subsfile );
+    free( psz_subsfile );
     subbrowse_button = new wxButton( panel, SubFileBrowse_Event,
                                      wxU(_("Browse...")) );
     subfile_sizer->Add( subfile_combo, 1, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
@@ -1632,7 +1632,7 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
         break;
     }
 
-    free(psz_device);
+    free( psz_device );
     disc_probe->SetValue(FALSE);
 
     UpdateMRL( DISC_ACCESS );
@@ -1746,7 +1746,7 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
     disc_title->SetValue( 0 ); i_disc_title = 0;
     disc_chapter->SetValue( 0 ); i_disc_chapter = 0;
 
-    if( psz_device ) free( psz_device );
+    free( psz_device );
 
     UpdateMRL( DISC_ACCESS );
 }
index 8dbbda7823fc49aed3be2e1cb416f4f6922853d5..a6a2a844794988a24c8ff68b12610fac29b8f864 100644 (file)
@@ -124,9 +124,9 @@ public:
     ConfigTreeData() { b_submodule = 0; panel = NULL; psz_name = NULL;
                        psz_help = NULL; }
     virtual ~ConfigTreeData() {
-                                 if( panel ) delete panel;
-                                 if( psz_name ) free( psz_name );
-                                 if( psz_help ) free( psz_help );
+                                 delete panel;
+                                 free( psz_name );
+                                 free( psz_help );
                               };
 
     vlc_bool_t b_submodule;
@@ -435,10 +435,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
                                             GetItemData( current_item );
                     cd->i_type = TYPE_CATSUBCAT;
                     cd->i_subcat_id = p_item->value.i;
-                    if( cd->psz_name ) free( cd->psz_name );
+                    free( cd->psz_name );
                     cd->psz_name = strdup(  config_CategoryNameGet(
                                                       p_item->value.i ) );
-                    if( cd->psz_help ) free( cd->psz_help );
+                    free( cd->psz_help );
                     const char *psz_help = config_CategoryHelpGet( p_item->value.i );
                     if( psz_help )
                     {
index 692c5896f6feae8fb2e3132def17134ef741781d..34ca3fc1de9eb9863270aef2b45396be4e61ec5e 100644 (file)
@@ -579,7 +579,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *p_this,
        // this, like the one behind the refresh push button?
        p_module_config->b_dirty = VLC_FALSE;
 
-       if(val.psz_string) free(val.psz_string);
+       free( val.psz_string );
     }
 
     UpdateCombo( p_module_config );
@@ -601,7 +601,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *p_this,
 
 StringListConfigControl::~StringListConfigControl()
 {
-    if( psz_default_value ) free( psz_default_value );
+    free( psz_default_value );
 }
 
 void StringListConfigControl::UpdateCombo( module_config_t *p_item )
index 2de103a2b1740c0d2f90a6183bd05db0663ba488..22c5682b161d0214ad14ed9da9c265bd82010b1e 100644 (file)
@@ -77,7 +77,7 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
     if( !psz_subsfile ) psz_subsfile = strdup("");
     file_combo = new wxComboBox( panel, -1, wxL2U(psz_subsfile),
                                  wxPoint(20,25), wxSize(300, -1) );
-    if( psz_subsfile ) free( psz_subsfile );
+    free( psz_subsfile );
     wxButton *browse_button = new wxButton( panel, FileBrowse_Event,
                                             wxU(_("Browse...")) );
     file_sizer->Add( file_combo, 1, wxALL, 5 );
index c41448912c4bdfed4b0b8db01ad01d0e48cd7c72..0f444f80a0cf9558de5294618c9481252b4c16b4 100644 (file)
@@ -899,8 +899,8 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
 
 wizTranscodeCodecPage::~wizTranscodeCodecPage()
 {
-    if( acodec ) free( acodec );
-    if( vcodec ) free( vcodec );
+    free( acodec );
+    free( vcodec );
 }
 
 void wizTranscodeCodecPage::OnEnableVideo(wxCommandEvent& event)
@@ -1605,7 +1605,7 @@ void WizardDialog::Run()
                       ":sout=#%smux=%s,dst=%s%s%s%s}", method,
                       mux, v6 ? "[" : "", address, v6 ? "]" : "",
                       psz_sap_option ?: "" );
-            if( psz_sap_option ) free( psz_sap_option );
+            free( psz_sap_option );
         }
 
         playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
index 2600e9232de9bdbee133500e0906fead3502a2b2..57b96ef3b8be659438375389f32225da787d174d 100644 (file)
@@ -703,7 +703,7 @@ void Menu::CreateMenuItem( wxMenu *menu, const char *psz_var,
                       CreateChoicesMenu( psz_var, p_object, TRUE ),
                       wxT("")/* Nothing for now (maybe use a GETLONGTEXT) */ );
 
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
@@ -733,7 +733,7 @@ void Menu::CreateMenuItem( wxMenu *menu, const char *psz_var,
         break;
     }
 
-    if( text.psz_string ) free( text.psz_string );
+    free( text.psz_string );
 }
 
 wxMenu *Menu::CreateChoicesMenu( const char *psz_var, vlc_object_t *p_object,
@@ -808,7 +808,7 @@ wxMenu *Menu::CreateChoicesMenu( const char *psz_var, vlc_object_t *p_object,
                        val_list.p_list->p_values[i].psz_string ) )
               menu->Check( i_item_id, TRUE );
 
-          if( val.psz_string ) free( val.psz_string );
+          free( val.psz_string );
           break;
 
         case VLC_VAR_INTEGER:
@@ -1043,7 +1043,7 @@ wxMenuItemExt::wxMenuItemExt( wxMenu* parentMenu, int id, const wxString& text,
 
 wxMenuItemExt::~wxMenuItemExt()
 {
-    if( psz_var ) free( psz_var );
-    if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING)
-        && val.psz_string ) free( val.psz_string );
+    free( psz_var );
+    if( ( i_val_type & VLC_VAR_TYPE ) == VLC_VAR_STRING )
+        free( val.psz_string );
 };
index 591b54e76b7e01e1fa7052ef666b9900cf2cfe1c..706f456d4a0bc294c2341aecb7d1ee045f000c17 100644 (file)
@@ -560,7 +560,7 @@ WindowSettings::WindowSettings( intf_thread_t *_p_intf )
         }
     }
 
-    if( psz_org ) free( psz_org );
+    free( psz_org );
     return;
 
 invalid:
@@ -572,7 +572,7 @@ invalid:
         position[i] = wxDefaultPosition;
         size[i] = wxDefaultSize;
     }
-    if( psz_org ) free( psz_org );
+    free( psz_org );
 }