[vlc-devel] commit: Use sizeof(vlc_object_t) as appropriate ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jun 28 20:34:16 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jun 28 21:31:20 2008 +0300| [219e1deaa769e4f693cb41c59b2bf7c368a62f2c]

Use sizeof(vlc_object_t) as appropriate

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=219e1deaa769e4f693cb41c59b2bf7c368a62f2c
---

 modules/misc/gtk_main.c           |    2 +-
 modules/misc/testsuite/test4.c    |    8 ++++----
 modules/video_filter/remoteosd.c  |    5 +++--
 modules/video_output/msw/wingdi.c |    2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/modules/misc/gtk_main.c b/modules/misc/gtk_main.c
index 15282f4..c5b0d98 100644
--- a/modules/misc/gtk_main.c
+++ b/modules/misc/gtk_main.c
@@ -99,7 +99,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_SUCCESS;
     }
 
-    p_gtk_main = vlc_object_create( p_this, VLC_OBJECT_GENERIC );
+    p_gtk_main = vlc_object_create( p_this, sizeof( vlc_object_t ) );
 
     /* Only initialize gthreads if it's the first time we do it */
     if( !g_thread_supported() )
diff --git a/modules/misc/testsuite/test4.c b/modules/misc/testsuite/test4.c
index 931a98a..f07a6a1 100644
--- a/modules/misc/testsuite/test4.c
+++ b/modules/misc/testsuite/test4.c
@@ -168,7 +168,7 @@ static int Callback( vlc_object_t *p_this, char const *psz_cmd,
 
     for( i = 0; i < 10; i++ )
     {
-        pp_objects[i] = vlc_object_create( p_this, VLC_OBJECT_GENERIC );
+        pp_objects[i] = vlc_object_create( p_this, sizeof( vlc_object_t ) );
         vlc_object_attach( pp_objects[i], p_this );
         vlc_thread_create( pp_objects[i], "foo", MyThread, 0, true );
     }
@@ -300,7 +300,7 @@ static int Stress( vlc_object_t *p_this, char const *psz_cmd,
     start = mdate();
     for( i = 0; i < MAXOBJ * i_level; i++ )
     {
-        pp_objects[i] = vlc_object_create( p_this, VLC_OBJECT_GENERIC );
+        pp_objects[i] = vlc_object_create( p_this, sizeof( vlc_object_t ) );
     }
 
     printf( " - randomly looking up %i objects\n", MAXLOOK * i_level );
@@ -385,7 +385,7 @@ static int Stress( vlc_object_t *p_this, char const *psz_cmd,
             MAXTH * i_level, MAXOBJ/MAXTH );
     for( i = 0; i < MAXTH * i_level; i++ )
     {
-        pp_objects[i] = vlc_object_create( p_this, VLC_OBJECT_GENERIC );
+        pp_objects[i] = vlc_object_create( p_this, sizeof( vlc_object_t ) );
         vlc_thread_create( pp_objects[i], "foo", Dummy, 0, true );
     }
 
@@ -417,7 +417,7 @@ static void * Dummy( vlc_object_t *p_this )
 
     for( i = 0; i < MAXOBJ/MAXTH; i++ )
     {
-        pp_objects[i] = vlc_object_create( p_this, VLC_OBJECT_GENERIC );
+        pp_objects[i] = vlc_object_create( p_this, sizeof( vlc_object_t ) );
     }
 
     vlc_thread_ready( p_this );
diff --git a/modules/video_filter/remoteosd.c b/modules/video_filter/remoteosd.c
index 1b84c18..ab76504 100644
--- a/modules/video_filter/remoteosd.c
+++ b/modules/video_filter/remoteosd.c
@@ -333,7 +333,8 @@ static int CreateFilter ( vlc_object_t *p_this )
     vlc_gcrypt_init();
 
     /* create the vnc worker thread */
-    p_sys->p_worker_thread = vlc_object_create( p_this, VLC_OBJECT_GENERIC );
+    p_sys->p_worker_thread = vlc_object_create( p_this,
+                                                sizeof( vlc_object_t ) );
     vlc_object_attach( p_sys->p_worker_thread, p_this );
     if( vlc_thread_create( p_sys->p_worker_thread, "vnc worker thread",
                            vnc_worker_thread,
@@ -732,7 +733,7 @@ static void vnc_worker_thread( vlc_object_t *p_thread_obj )
 
     /* create the update request thread */
     p_sys->p_update_request_thread = vlc_object_create( p_filter,
-                                                        VLC_OBJECT_GENERIC );
+                                                     sizeof( vlc_object_t ) );
     vlc_object_attach( p_sys->p_update_request_thread, p_filter );
     if( vlc_thread_create( p_sys->p_update_request_thread,
                            "vnc update request thread",
diff --git a/modules/video_output/msw/wingdi.c b/modules/video_output/msw/wingdi.c
index b2a9165..1dbd899 100755
--- a/modules/video_output/msw/wingdi.c
+++ b/modules/video_output/msw/wingdi.c
@@ -199,7 +199,7 @@ static int OpenVideo ( vlc_object_t *p_this )
 #endif
 
     p_vout->p_sys->p_event = (vlc_object_t *)
-        vlc_object_create( p_vout, VLC_OBJECT_GENERIC );
+        vlc_object_create( p_vout, sizeof( vlc_object_t ) );
     if( !p_vout->p_sys->p_event )
     {
         free( p_vout->p_sys );




More information about the vlc-devel mailing list