[vlc-devel] [vlc-commits] Remove VLC_NORETURN, use standard syntax

Steve Lhomme robux4 at gmail.com
Tue Mar 14 09:57:46 CET 2017


On Sat, Feb 18, 2017 at 11:22 AM, Rémi Denis-Courmont <git at videolan.org> wrote:
> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 18 12:20:19 2017 +0200| [57b80197dd575dede0d4c9c5e10542b7b3857895] | committer: Rémi Denis-Courmont
>
> Remove VLC_NORETURN, use standard syntax
>
> Now this works not only on GCC.

We should bump the requirement for the C compiler to C11 compliance as
stdnoreturn.h was added in C11.

>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=57b80197dd575dede0d4c9c5e10542b7b3857895
> ---
>
>  include/vlc_common.h                 | 2 --
>  modules/access/mms/mmstu.c           | 4 ++--
>  modules/services_discovery/podcast.c | 4 ++--
>  src/posix/timer.c                    | 4 ++--
>  src/stream_output/sap.c              | 4 ++--
>  src/video_output/display.c           | 4 ++--
>  6 files changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/include/vlc_common.h b/include/vlc_common.h
> index 8b4f5a4..db5e6da 100644
> --- a/include/vlc_common.h
> +++ b/include/vlc_common.h
> @@ -92,7 +92,6 @@
>  # 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))
> @@ -105,7 +104,6 @@
>  # define VLC_FORMAT(x,y)
>  # define VLC_FORMAT_ARG(x)
>  # define VLC_MALLOC
> -# define VLC_NORETURN
>  # define VLC_USED
>  #endif
>
> diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
> index c55c288..ae19920 100644
> --- a/modules/access/mms/mmstu.c
> +++ b/modules/access/mms/mmstu.c
> @@ -34,6 +34,7 @@
>
>  #include <errno.h>
>  #include <assert.h>
> +#include <stdnoreturn.h>
>
>  #include <sys/types.h>
>  #include <unistd.h>
> @@ -1598,8 +1599,7 @@ static int mms_HeaderMediaRead( access_t *p_access, int i_type )
>      return -1;
>  }
>
> -VLC_NORETURN
> -static void *KeepAliveThread( void *p_data )
> +noreturn static void *KeepAliveThread( void *p_data )
>  {
>      access_t *p_access = p_data;
>
> diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c
> index 265c251..a99c0c1 100644
> --- a/modules/services_discovery/podcast.c
> +++ b/modules/services_discovery/podcast.c
> @@ -36,6 +36,7 @@
>  #include <vlc_network.h>
>
>  #include <assert.h>
> +#include <stdnoreturn.h>
>  #include <unistd.h>
>
>  /************************************************************************
> @@ -205,8 +206,7 @@ static void Close( vlc_object_t *p_this )
>  /*****************************************************************************
>   * Run: main thread
>   *****************************************************************************/
> -VLC_NORETURN
> -static void *Run( void *data )
> +noreturn static void *Run( void *data )
>  {
>      services_discovery_t *p_sd = data;
>      services_discovery_sys_t *p_sys  = p_sd->p_sys;
> diff --git a/src/posix/timer.c b/src/posix/timer.c
> index 73d84de..9c2420e 100644
> --- a/src/posix/timer.c
> +++ b/src/posix/timer.c
> @@ -22,6 +22,7 @@
>  # include "config.h"
>  #endif
>
> +#include <stdnoreturn.h>
>  #include <stdlib.h>
>  #include <errno.h>
>  #include <assert.h>
> @@ -49,8 +50,7 @@ struct vlc_timer
>      atomic_uint  overruns;
>  };
>
> -VLC_NORETURN
> -static void *vlc_timer_thread (void *data)
> +noreturn static void *vlc_timer_thread (void *data)
>  {
>      struct vlc_timer *timer = data;
>
> diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c
> index 23d0528..6bac144 100644
> --- a/src/stream_output/sap.c
> +++ b/src/stream_output/sap.c
> @@ -28,6 +28,7 @@
>
>  #include <vlc_common.h>
>
> +#include <stdnoreturn.h>
>  #include <stdlib.h>                                                /* free() */
>  #include <stdio.h>                                              /* sprintf() */
>  #include <string.h>
> @@ -130,8 +131,7 @@ static void AddressDestroy (sap_address_t *addr)
>   * \param p_this the SAP Handler object
>   * \return nothing
>   */
> -VLC_NORETURN
> -static void *RunThread (void *self)
> +noreturn static void *RunThread (void *self)
>  {
>      sap_address_t *addr = self;
>
> diff --git a/src/video_output/display.c b/src/video_output/display.c
> index 3fb8970..6899054 100644
> --- a/src/video_output/display.c
> +++ b/src/video_output/display.c
> @@ -28,6 +28,7 @@
>  # include "config.h"
>  #endif
>  #include <assert.h>
> +#include <stdnoreturn.h>
>
>  #include <vlc_common.h>
>  #include <vlc_video_splitter.h>
> @@ -599,8 +600,7 @@ static void VoutDisplayEventMouse(vout_display_t *vd, int event, va_list args)
>      vlc_mutex_unlock(&osys->lock);
>  }
>
> -VLC_NORETURN
> -static void *VoutDisplayEventKeyDispatch(void *data)
> +noreturn static void *VoutDisplayEventKeyDispatch(void *data)
>  {
>      vout_display_owner_sys_t *osys = data;
>
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits


More information about the vlc-devel mailing list