]> git.sesse.net Git - vlc/commitdiff
Introduce VLC_NORETURN function attribute and use it
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 17 Aug 2011 15:42:04 +0000 (18:42 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 17 Aug 2011 15:21:32 +0000 (18:21 +0300)
Note that this attribute implies that the function never returns in
any circumstances (it exits, it aborts or it gets cancelled).
Do not use this attribute for function that do not return at the end
but may return from other branches.

include/vlc_common.h
modules/access/mms/mmstu.c
modules/demux/live555.cpp
modules/misc/inhibit/xdg.c
modules/services_discovery/podcast.c
src/posix/thread.c
src/stream_output/sap.c
src/video_output/display.c

index 0c7966faa0de67dc4ec191a971d19fe40696dd32..337fd8a0b7005eadec1f1cfb63af2d804f598887 100644 (file)
@@ -92,6 +92,7 @@
 # define VLC_FORMAT_ARG(x) __attribute__ ((format_arg(x)))
 
 # define VLC_MALLOC __attribute__ ((malloc))
+# define VLC_NORETURN __attribute__ ((noreturn))
 
 # if VLC_GCC_VERSION(3,4)
 #  define VLC_USED __attribute__ ((warn_unused_result))
 # define VLC_FORMAT(x,y)
 # define VLC_FORMAT_ARG(x)
 # define VLC_MALLOC
+# define VLC_NORETURN
 # define VLC_USED
 #endif
 
index 4ea1cca33589e705d1a544c1043679fa157a5370..b4b8bdbaa3443d5a0e856eac5a552aaff1622746 100644 (file)
@@ -1554,6 +1554,7 @@ static int mms_HeaderMediaRead( access_t *p_access, int i_type )
     return -1;
 }
 
+VLC_NORETURN
 static void *KeepAliveThread( void *p_data )
 {
     access_t *p_access = p_data;
index ed08dbeaa60f6e77578e3ba2b6a01e4bf75542fd..abbc0caa917f7e007dfee87cc83bf26d90acdc69 100644 (file)
@@ -1963,6 +1963,7 @@ static void TaskInterruptData( void *p_private )
 /*****************************************************************************
  *
  *****************************************************************************/
+VLC_NORETURN
 static void* TimeoutPrevention( void *p_data )
 {
     timeout_thread_t *p_timeout = (timeout_thread_t *)p_data;
index 20a24ff1ea2fb53d509a57e4f9dd7256687bcfdb..ac69a3dbfffe2b1798a2705ce35eaf3b25269569 100644 (file)
@@ -112,6 +112,7 @@ static void Inhibit (vlc_inhibit_t *ih, bool suspend)
 
 extern char **environ;
 
+VLC_NORETURN
 static void *Thread (void *data)
 {
     vlc_inhibit_t *ih = data;
index 5c936cfca87711cd103d92426db7f66705de9945..2ad6356170fc1cc0d8c6aa1eaa4e5a5291cf17eb 100644 (file)
@@ -200,6 +200,7 @@ static void Close( vlc_object_t *p_this )
 /*****************************************************************************
  * Run: main thread
  *****************************************************************************/
+VLC_NORETURN
 static void *Run( void *data )
 {
     services_discovery_t *p_sd = data;
index 966c74cc5f07bd7134b466016ad43581f20cb9f9..90645635fda41fa9150cd6d3aad2eb12937fff86 100644 (file)
@@ -1018,6 +1018,7 @@ struct vlc_timer
     vlc_atomic_t overruns;
 };
 
+VLC_NORETURN
 static void *vlc_timer_thread (void *data)
 {
     struct vlc_timer *timer = data;
index 4a3b7c258cb480747eb5a134712011edaae39fa2..181a423aa5bdf94e1cdde0df34922a184216a8fd 100644 (file)
@@ -170,6 +170,7 @@ static void AddressDestroy (sap_address_t *addr)
  * \param p_this the SAP Handler object
  * \return nothing
  */
+VLC_NORETURN
 static void *RunThread (void *self)
 {
     sap_address_t *addr = self;
index a25c3bef72d3474a1dfd98a054b617dc973af2ba..c743836a01572a096808b021322771019164e883 100644 (file)
@@ -538,9 +538,7 @@ static void VoutDisplayEventMouse(vout_display_t *vd, int event, va_list args)
     vlc_mutex_unlock(&osys->lock);
 }
 
-#ifdef __GNUC__
-static void *VoutDisplayEventKeyDispatch(void *data) __attribute__((noreturn));
-#endif
+VLC_NORETURN
 static void *VoutDisplayEventKeyDispatch(void *data)
 {
     vout_display_owner_sys_t *osys = data;