[vlc-devel] commit: Don't bother with vlc_object_get() when you can keep pointers! ( Rémi Denis-Courmont )

lokidor lokidor at lokiserv.ath.cx
Fri May 16 22:09:55 CEST 2008


git version control a écrit :
> vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Thu May 15 19:58:57 2008 +0300| [a6a9c37e7d3d24ae6abb50561e1ea8a7b476ac0d]
>
> Don't bother with vlc_object_get() when you can keep pointers!
>
>   
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a6a9c37e7d3d24ae6abb50561e1ea8a7b476ac0d
>>     
> ---
>
>  modules/gui/wxwidgets/dialogs/preferences.cpp |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/modules/gui/wxwidgets/dialogs/preferences.cpp b/modules/gui/wxwidgets/dialogs/preferences.cpp
> index a24e983..a585787 100644
> --- a/modules/gui/wxwidgets/dialogs/preferences.cpp
> +++ b/modules/gui/wxwidgets/dialogs/preferences.cpp
> @@ -134,6 +134,7 @@ public:
>      PrefsPanel *panel;
>      wxBoxSizer *sizer;
>  
> +    module_t *p_module;
>      int i_object_id;
>      int i_subcat_id;
>      int i_type;
> @@ -584,9 +585,8 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
>          config_data->b_submodule = module_IsSubModule(p_module);
>  #endif
>          config_data->i_type = TYPE_MODULE;
> -        config_data->i_object_id = config_data->b_submodule ?
> -            ((vlc_object_t *)p_module)->p_parent->i_object_id :
> -            ((vlc_object_t *)p_module)->i_object_id;
> +        config_data->p_module = config_data->b_submodule ?
> +            p_module->p_parent : p_module;
>          config_data->psz_help = NULL;
>  
>          /* WXMSW doesn't know image -1 ... FIXME */
> @@ -769,7 +769,7 @@ ConfigTreeData *PrefsTreeCtrl::FindModuleConfig( ConfigTreeData *config_data )
>              {
>                  config_new = (ConfigTreeData *)GetItemData( module );
>                  if( config_new && !config_new->b_submodule &&
> -                    config_new->i_object_id == config_data->i_object_id )
> +                    config_new->p_module == config_data->p_module )
>                  {
>                      return config_new;
>                  }
> @@ -899,8 +899,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
>          /* Get a pointer to the module */
>          if( config_data->i_type == TYPE_MODULE )
>          {
> -            p_module = (module_t *)
> -                vlc_object_get( config_data->i_object_id );
> +            p_module = config_data->p_module;
>          }
>          else
>          {
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>   
I get the following error with this commit :

 g++ -DHAVE_CONFIG_H -I. -I../../.. -DSYS_LINUX -I../../../include 
-I../../../include -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 
-D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -DHAVE_RELEASE 
-D__LIBVLC__ -D__PLUGIN__ -DMODULE_NAME=wxwidgets 
-DMODULE_NAME_IS_wxwidgets -DMODULE_STRING=\"wxwidgets\" -O2 -ffast-math 
-funroll-loops -fomit-frame-pointer -fpermissive 
-I/usr/lib/wx/include/gtk2-unicode-release-static-2.8 
-I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ 
-pthread -D_UNICODE -DUNICODE -fno-strict-aliasing -g -O2 -MT 
libwxwidgets_plugin_la-preferences.lo -MD -MP -MF 
.deps/libwxwidgets_plugin_la-preferences.Tpo -c dialogs/preferences.cpp  
-fPIC -DPIC -o .libs/libwxwidgets_plugin_la-preferences.o
dialogs/preferences.cpp: In constructor 
`PrefsTreeCtrl::PrefsTreeCtrl(wxWindow*, intf_thread_t*, 
wxvlc::PrefsDialog*, wxBoxSizer*)':
dialogs/preferences.cpp:589: error: invalid use of undefined type 
`struct module_t'
../../../include/vlc_common.h:163: error: forward declaration of `struct 
module_t'
make[7]: *** [libwxwidgets_plugin_la-preferences.lo] Error 1
make[7]: Leaving directory 
`/home/lokidor/src/vlc/vlc-0.9.0-git20080516/modules/gui/wxwidgets'
make[6]: *** [all] Error 2
make[6]: Leaving directory 
`/home/lokidor/src/vlc/vlc-0.9.0-git20080516/modules/gui/wxwidgets'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory 
`/home/lokidor/src/vlc/vlc-0.9.0-git20080516/modules/gui'
make[4]: *** [all] Error 2
make[4]: Leaving directory 
`/home/lokidor/src/vlc/vlc-0.9.0-git20080516/modules/gui'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory 
`/home/lokidor/src/vlc/vlc-0.9.0-git20080516/modules'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/lokidor/src/vlc/vlc-0.9.0-git20080516'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/lokidor/src/vlc/vlc-0.9.0-git20080516'
make: *** [build-stamp] Error 2




More information about the vlc-devel mailing list