]> git.sesse.net Git - vlc/commitdiff
Fix threaded function declaration.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 7 Aug 2008 18:34:04 +0000 (20:34 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 7 Aug 2008 18:52:44 +0000 (20:52 +0200)
src/input/decoder.c
src/input/demux.c
src/input/input.c
src/input/vlm.c
src/interface/interaction.c
src/interface/interface.c
src/misc/beos_specific.cpp
src/misc/update.c
src/misc/win32_specific.c
src/network/httpd.c
src/playlist/services_discovery.c

index d0fdd1422945d69276357d49235d100a1dd2fc80..dace0f6d28aa81819540b3043071b761701e746d 100644 (file)
@@ -48,7 +48,7 @@
 static decoder_t * CreateDecoder( input_thread_t *, es_format_t *, int );
 static void        DeleteDecoder( decoder_t * );
 
-static int         DecoderThread( decoder_t * );
+static void*        DecoderThread( vlc_object_t * );
 static int         DecoderDecode( decoder_t * p_dec, block_t *p_block );
 
 /* Buffers allocation callbacks for the decoders */
@@ -576,8 +576,9 @@ static decoder_t * CreateDecoder( input_thread_t *p_input,
  * \param p_dec the decoder
  * \return 0
  */
-static int DecoderThread( decoder_t * p_dec )
+static void* DecoderThread( vlc_object_t *p_this )
 {
+    decoder_t * p_dec = (decoder_t *)p_this;
     block_t *p_block;
 
     /* The decoder's main loop */
index 9aa2105cf7835307ce2d8edec31b61206cb8a342..8b571fad6a0fa7443bba0defc2f8f184c7b08540 100644 (file)
@@ -309,7 +309,7 @@ typedef struct
 static int DStreamRead   ( stream_t *, void *p_read, int i_read );
 static int DStreamPeek   ( stream_t *, const uint8_t **pp_peek, int i_peek );
 static int DStreamControl( stream_t *, int i_query, va_list );
-static int DStreamThread ( stream_t * );
+static void* DStreamThread ( vlc_object_t * );
 
 
 stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux,
@@ -534,8 +534,9 @@ static int DStreamControl( stream_t *s, int i_query, va_list args )
     }
 }
 
-static int DStreamThread( stream_t *s )
+static void* DStreamThread( vlc_object_t* p_this )
 {
+    stream_t *s = (stream_t *)p_this;
     d_stream_sys_t *p_sys = (d_stream_sys_t*)s->p_sys;
     demux_t *p_demux;
 
@@ -543,7 +544,7 @@ static int DStreamThread( stream_t *s )
     if( !(p_demux = demux_New( s, "", p_sys->psz_name, "", s, p_sys->out,
                                false )) )
     {
-        return VLC_EGENERIC;
+        return NULL;
     }
 
     p_sys->p_demux = p_demux;
@@ -555,7 +556,7 @@ static int DStreamThread( stream_t *s )
     }
 
     vlc_object_kill( p_demux );
-    return VLC_SUCCESS;
+    return NULL;
 }
 
 /****************************************************************************
index cc5e82813212de27d1785821d6f8537a86a7bc99..01d52823fb342811d52cf128382cbe33401e2bb1 100644 (file)
@@ -53,8 +53,8 @@
  *****************************************************************************/
 static void Destructor( input_thread_t * p_input );
 
-static  int Run  ( input_thread_t *p_input );
-static  int RunAndDestroy  ( input_thread_t *p_input );
+static  void* Run            ( vlc_object_t *p_this );
+static  void* RunAndDestroy  ( vlc_object_t *p_this );
 
 static input_thread_t * Create  ( vlc_object_t *, input_item_t *,
                                   const char *, bool, sout_instance_t * );
@@ -396,7 +396,7 @@ int __input_Read( vlc_object_t *p_parent, input_item_t *p_item,
 
     if( b_block )
     {
-        RunAndDestroy( p_input );
+        RunAndDestroy( VLC_OBJECT(p_input) );
         return VLC_SUCCESS;
     }
     else
@@ -484,8 +484,9 @@ sout_instance_t * input_DetachSout( input_thread_t *p_input )
  * This is the "normal" thread that spawns the input processing chain,
  * reads the stream, cleans up and waits
  *****************************************************************************/
-static int Run( input_thread_t *p_input )
+static void* Run( vlc_object_t *p_this )
 {
+    input_thread_t *p_input = (input_thread_t *)p_this;
     /* Signal that the thread is launched */
     vlc_thread_ready( p_input );
 
@@ -499,7 +500,7 @@ static int Run( input_thread_t *p_input )
         /* Tell we're dead */
         p_input->b_dead = true;
 
-        return 0;
+        return NULL;
     }
 
     MainLoop( p_input );
@@ -531,7 +532,7 @@ static int Run( input_thread_t *p_input )
     /* Clean up */
     End( p_input );
 
-    return 0;
+    return NULL;
 }
 
 /*****************************************************************************
@@ -539,8 +540,9 @@ static int Run( input_thread_t *p_input )
  * This is the "just forget me" thread that spawns the input processing chain,
  * reads the stream, cleans up and releases memory
  *****************************************************************************/
-static int RunAndDestroy( input_thread_t *p_input )
+static void* RunAndDestroy( vlc_object_t *p_this )
 {
+    input_thread_t *p_input = (input_thread_t *)p_this;
     /* Signal that the thread is launched */
     vlc_thread_ready( p_input );
 
index 69148f604bccb2baff57c3585dca609f1662fc99..9e989427ebf19be986a2a28ae07ac3c05c92413a 100644 (file)
@@ -62,7 +62,7 @@
  *****************************************************************************/
 
 static void vlm_Destructor( vlm_t *p_vlm );
-static int Manage( vlc_object_t * );
+static void* Manage( vlc_object_t * );
 static int vlm_MediaVodControl( void *, vod_media_t *, const char *, int, va_list );
 
 /*****************************************************************************
@@ -302,7 +302,7 @@ static int vlm_MediaVodControl( void *p_private, vod_media_t *p_vod_media,
 /*****************************************************************************
  * Manage:
  *****************************************************************************/
-static int Manage( vlc_object_t* p_object )
+static void* Manage( vlc_object_t* p_object )
 {
     vlm_t *vlm = (vlm_t*)p_object;
     int i, j;
@@ -412,7 +412,7 @@ static int Manage( vlc_object_t* p_object )
         msleep( 100000 );
     }
 
-    return VLC_SUCCESS;
+    return NULL;
 }
 
 /* New API
index e0920eaf50d62a70f0ff56f8e635f728233f828e..f58d757eb798b9e8762b7d46847ef298fe7887ab 100644 (file)
@@ -48,7 +48,7 @@
  *****************************************************************************/
 static interaction_t *          InteractionGet( vlc_object_t * );
 static void                     InteractionSearchInterface( interaction_t * );
-static void                     InteractionLoop( vlc_object_t * );
+static void*                    InteractionLoop( vlc_object_t * );
 static void                     InteractionManage( interaction_t * );
 
 static interaction_dialog_t    *DialogGetById( interaction_t* , int );
@@ -548,7 +548,7 @@ static int DialogSend( vlc_object_t *p_this, interaction_dialog_t *p_dialog )
     }
 }
 
-static void InteractionLoop( vlc_object_t *p_this )
+static void* InteractionLoop( vlc_object_t *p_this )
 {
     int i;
     interaction_t *p_interaction = (interaction_t*) p_this;
@@ -568,6 +568,7 @@ static void InteractionLoop( vlc_object_t *p_this )
         DialogDestroy( p_dialog );
         REMOVE_ELEM( p_interaction->pp_dialogs, p_interaction->i_dialogs, i );
     }
+    return NULL;
 }
 
 /**
index e6349841b568db19c93ca4c365fdab7a64e85b5d..7e4c845cb26560b8a11e8006c7c183dcb6aa5eda 100644 (file)
@@ -49,7 +49,7 @@
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static void RunInterface( intf_thread_t *p_intf );
+static void* RunInterface( vlc_object_t *p_this );
 #ifdef __APPLE__
 static void MonitorLibVLCDeath( intf_thread_t *p_intf );
 #endif
@@ -193,8 +193,9 @@ void intf_StopThread( intf_thread_t *p_intf )
 /*****************************************************************************
  * RunInterface: setups necessary data and give control to the interface
  *****************************************************************************/
-static void RunInterface( intf_thread_t *p_intf )
+static void* RunInterface( vlc_object_t *p_this )
 {
+    intf_thread_t *p_intf = (intf_thread_t *)p_this;
     vlc_value_t val, text;
     char *psz_intf;
 
@@ -257,6 +258,7 @@ static void RunInterface( intf_thread_t *p_intf )
         p_intf->p_module = module_Need( p_intf, "interface", psz_intf, 0 );
     }
     while( p_intf->p_module );
+    return NULL;
 }
 
 #ifdef __APPLE__
index 321db791f4ce923b955b882094f03a70f21fef23..226725b42b39412db04807f50ea37d57e5a96db1 100644 (file)
@@ -79,7 +79,7 @@ extern "C"
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-static void AppThread( vlc_object_t *p_appthread );
+static void* AppThread( vlc_object_t *p_appthread );
 
 /*****************************************************************************
  * system_Init: create a BApplication object and fill in program path.
@@ -120,7 +120,7 @@ void system_End( libvlc_int_t *p_this )
 /*****************************************************************************
  * AppThread: the BApplication thread.
  *****************************************************************************/
-static void AppThread( vlc_object_t * p_this )
+static void* AppThread( vlc_object_t * p_this )
 {
     VlcApplication * BeApp =
         new VlcApplication("application/x-vnd.videolan-vlc");
@@ -129,6 +129,7 @@ static void AppThread( vlc_object_t * p_this )
     BeApp->Run();
     vlc_object_detach( p_this );
     delete BeApp;
+    return NULL;
 }
 
 } /* extern "C" */
index b421034bef33066211ac2335ab1407a52f632ac1..4e83249b840cd902834f3f01c1b886c92994260a 100644 (file)
@@ -1352,7 +1352,7 @@ error:
     return false;
 }
 
-static void update_CheckReal( update_check_thread_t *p_uct );
+static void* update_CheckReal( vlc_object_t *p_this );
 
 /**
  * Check for updates
@@ -1380,8 +1380,9 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void
                        VLC_THREAD_PRIORITY_LOW, false );
 }
 
-void update_CheckReal( update_check_thread_t *p_uct )
+void* update_CheckReal( vlc_object_t* p_this )
 {
+    update_check_thread_t *p_uct = (update_check_thread_t *)p_this;
     bool b_ret;
     vlc_mutex_lock( &p_uct->p_update->lock );
 
@@ -1395,6 +1396,7 @@ void update_CheckReal( update_check_thread_t *p_uct )
     p_uct->p_update->p_check = NULL;
 
     vlc_object_release( p_uct );
+    return NULL;
 }
 
 /**
@@ -1453,7 +1455,7 @@ static char *size_str( long int l_size )
     return i_retval == -1 ? NULL : psz_tmp;
 }
 
-static void update_DownloadReal( update_download_thread_t *p_udt );
+static void* update_DownloadReal( vlc_object_t *p_this );
 
 /**
  * Download the file given in the update_t
@@ -1480,8 +1482,9 @@ void update_Download( update_t *p_update, const char *psz_destdir )
                        VLC_THREAD_PRIORITY_LOW, false );
 }
 
-static void update_DownloadReal( update_download_thread_t *p_udt )
+static void* update_DownloadReal( vlc_object_t *p_this )
 {
+    update_download_thread_t *p_udt = (update_download_thread_t *)p_this;
     int i_progress = 0;
     long int l_size;
     long int l_downloaded = 0;
@@ -1682,6 +1685,7 @@ end:
     p_udt->p_update->p_download = NULL;
 
     vlc_object_release( p_udt );
+    return NULL;
 }
 
 update_release_t *update_GetRelease( update_t *p_update )
index 17af95b2cdb9c91bc29a197f7617c5e855158d23..c45075db2bab6b1b085ace92dd05f5c277cfdcad 100644 (file)
@@ -120,7 +120,7 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
 /*****************************************************************************
  * system_Configure: check for system specific configuration options.
  *****************************************************************************/
-static void IPCHelperThread( vlc_object_t * );
+static void* IPCHelperThread( vlc_object_t * );
 LRESULT CALLBACK WMCOPYWNDPROC( HWND, UINT, WPARAM, LPARAM );
 typedef struct
 {
@@ -262,7 +262,7 @@ void system_Configure( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv
 #endif
 }
 
-static void IPCHelperThread( vlc_object_t *p_this )
+static void* IPCHelperThread( vlc_object_t *p_this )
 {
     HWND ipcwindow;
     MSG message;
@@ -291,6 +291,7 @@ static void IPCHelperThread( vlc_object_t *p_this )
         TranslateMessage( &message );
         DispatchMessage( &message );
     }
+    return NULL;
 }
 
 LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
index 910d9c6cb9b22128f98c27b924a1d91a0dac4520..c98b51c22797faa21727b9ff2256a6661d1e7bde 100644 (file)
@@ -960,7 +960,7 @@ void httpd_StreamDelete( httpd_stream_t *stream )
 /*****************************************************************************
  * Low level
  *****************************************************************************/
-static void httpd_HostThread( httpd_host_t * );
+static void* httpd_HostThread( vlc_object_t * );
 
 /* create a new host */
 httpd_host_t *httpd_HostNew( vlc_object_t *p_this, const char *psz_host,
@@ -2019,8 +2019,9 @@ static void httpd_ClientTlsHsOut( httpd_client_t *cl )
     }
 }
 
-static void httpd_HostThread( httpd_host_t *host )
+static void* httpd_HostThread( vlc_object_t *p_this )
 {
+    httpd_host_t *host = (httpd_host_t *)p_this;
     tls_session_t *p_tls = NULL;
     counter_t *p_total_counter = stats_CounterCreate( host, VLC_VAR_INTEGER, STATS_COUNTER );
     counter_t *p_active_counter = stats_CounterCreate( host, VLC_VAR_INTEGER, STATS_COUNTER );
@@ -2567,6 +2568,7 @@ retry:
         stats_CounterClean( p_total_counter );
     if( p_active_counter )
         stats_CounterClean( p_active_counter );
+    return NULL;
 }
 
 #else /* ENABLE_HTTPD */
index 76ce11dc5588f04348ad503b4131bcf23338289a..1f2d9bf25b21a35a20bd8ba7d18387038c519c27 100644 (file)
@@ -31,7 +31,7 @@
 #include "playlist_internal.h"
 #include "../libvlc.h"
 
-static void RunSD( services_discovery_t *p_sd );
+static void* RunSD( vlc_object_t *p_this );
 
 /*
  * Services discovery
@@ -202,8 +202,9 @@ services_discovery_RemoveItem ( services_discovery_t * p_sd, input_item_t * p_it
 /***********************************************************************
  * RunSD (Private)
  ***********************************************************************/
-static void RunSD( services_discovery_t *p_sd )
+static void* RunSD( vlc_object_t *p_this )
 {
+    services_discovery_t *p_sd = (services_discovery_t *)p_this;
     vlc_event_t event;
 
     event.type = vlc_ServicesDiscoveryStarted;
@@ -213,7 +214,7 @@ static void RunSD( services_discovery_t *p_sd )
 
     event.type = vlc_ServicesDiscoveryEnded;
     vlc_event_send( &p_sd->event_manager, &event );
-    return;
+    return NULL;
 }
 
 /*