From 6dda67bc5167ad5caa2f93fd95d0405620baf654 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 9 Jun 2013 19:21:16 +0200 Subject: [PATCH] wmaker: Added attribute 'noreturn' to appropriate functions Signed-off-by: Christophe CURIS --- src/event.c | 2 +- src/event.h | 8 +++++++- src/main.c | 4 ++-- src/main.h | 10 ++++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/event.c b/src/event.c index 7a1993c7..c6951bb4 100644 --- a/src/event.c +++ b/src/event.c @@ -387,7 +387,7 @@ static void handle_inotify_events(int fd, int wd) * Calls inotifyGetEvents if defaults database changes. *---------------------------------------------------------------------- */ -void EventLoop(void) +noreturn void EventLoop(void) { XEvent event; #ifdef HAVE_INOTIFY diff --git a/src/event.h b/src/event.h index cfc245d4..7208b6e2 100644 --- a/src/event.h +++ b/src/event.h @@ -22,9 +22,15 @@ #ifndef WMEVENT_H #define WMEVENT_H +#include "config.h" + +#ifdef HAVE_STDNORETURN +#include +#endif + typedef void (WDeathHandler)(pid_t pid, unsigned int status, void *cdata); -void EventLoop(void); +noreturn void EventLoop(void); void DispatchEvent(XEvent *event); void ProcessPendingEvents(void); WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata); diff --git a/src/main.c b/src/main.c index a0c096e3..5497e535 100644 --- a/src/main.c +++ b/src/main.c @@ -269,7 +269,7 @@ static int initWVisualID(const char *user_str) return 0; } -void Exit(int status) +noreturn void Exit(int status) { if (dpy) XCloseDisplay(dpy); @@ -464,7 +464,7 @@ Bool RelaunchWindow(WWindow *wwin) * *---------------------------------------------------------------------- */ -void wAbort(Bool dumpCore) +noreturn void wAbort(Bool dumpCore) { int i; WScreen *scr; diff --git a/src/main.h b/src/main.h index 2198b746..585ea344 100644 --- a/src/main.h +++ b/src/main.h @@ -22,12 +22,18 @@ #ifndef WMMAIN_H_ #define WMMAIN_H_ -void Exit(int status) __attribute__((noreturn)); +#include "config.h" + +#ifdef HAVE_STDNORETURN +#include +#endif + +noreturn void Exit(int status); void Restart(char *manager, Bool abortOnFailure); void SetupEnvironment(WScreen *scr); void ExecuteShellCommand(WScreen *scr, char *command); Bool RelaunchWindow(WWindow *wwin); -void wAbort(Bool dumpCore); +noreturn void wAbort(Bool dumpCore); void ExecExitScript(void); int getWVisualID(int screen);