diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-18 09:11:06 +0100 | 
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-18 09:12:55 +0100 | 
| commit | 0e1617e876c59d4f4658ebf25630a1f1c7fa93cd (patch) | |
| tree | f00859018c12d5781c2e94fa207e1a8fbfa688c3 | |
| parent | 187f25aefdb9fd63b8465e8e661b942401addde0 (diff) | |
compat, x-plane: get rid of attribute unused macro
| -rw-r--r-- | compat/macros.hpp | 12 | ||||
| -rw-r--r-- | logic/shortcuts.cpp | 3 | ||||
| -rw-r--r-- | x-plane-plugin/plugin.c | 25 | 
3 files changed, 12 insertions, 28 deletions
| diff --git a/compat/macros.hpp b/compat/macros.hpp index 05a027bd..e27eb906 100644 --- a/compat/macros.hpp +++ b/compat/macros.hpp @@ -34,12 +34,6 @@  #   define force_inline inline  #endif -#if defined __GNUG__ -#   define flatten __attribute__((flatten, noinline)) -#else -#   define flatten -#endif -  #ifdef Q_CREATOR_RUN  #   define warn_result_unused  #elif defined(_MSC_VER) @@ -54,12 +48,6 @@  #   define unused(t, i) t  #endif -#if !defined(_WIN32) -#   define unused_on_unix(t, i) unused(t, i) -#else -#   define unused_on_unix(t, i) t i -#endif -  #if defined __GNUC__  #   define likely(x)       __builtin_expect(!!(x),1)  #   define unlikely(x)     __builtin_expect(!!(x),0) diff --git a/logic/shortcuts.cpp b/logic/shortcuts.cpp index 1ffecd3a..125d051f 100644 --- a/logic/shortcuts.cpp +++ b/logic/shortcuts.cpp @@ -29,9 +29,10 @@ void Shortcuts::free_binding(K& key)  #endif  } -void Shortcuts::bind_shortcut(K &key, const key_opts& k, unused_on_unix(bool, held)) +void Shortcuts::bind_shortcut(K &key, const key_opts& k, bool held)  {  #if !defined(_WIN32) +    (void)held;      using sh = QxtGlobalShortcut;      if (key)      { diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c index 88962442..bc9b013d 100644 --- a/x-plane-plugin/plugin.c +++ b/x-plane-plugin/plugin.c @@ -66,18 +66,13 @@ static void reinit_offset() {      offset_z = XPLMGetDataf(view_z);  } -#ifdef __GNUC__ -#   define unused(varname) varname __attribute__((__unused__)) -#else -#   define unused(varname) varname -#endif - -shm_wrapper* shm_wrapper_init(const char *shmName, const char *unused(mutexName), int mapSize) +shm_wrapper* shm_wrapper_init(const char *shm_name, const char *mutex_name, int mapSize)  { +    (void)mutex_name;      shm_wrapper* self = malloc(sizeof(shm_wrapper));      char shm_filename[NAME_MAX];      shm_filename[0] = '/'; -    strncpy(shm_filename+1, shmName, NAME_MAX-2); +    strncpy(shm_filename+1, shm_name, NAME_MAX-2);      shm_filename[NAME_MAX-1] = '\0';      /* (void) shm_unlink(shm_filename); */ @@ -106,10 +101,10 @@ void shm_wrapper_unlock(shm_wrapper* self)  }  float write_head_position( -        float                unused(inElapsedSinceLastCall), -        float                unused(inElapsedTimeSinceLastFlightLoop), -        int                  unused(inCounter), -        void *               unused(inRefcon) ) +        float                inElapsedSinceLastCall, +        float                inElapsedTimeSinceLastFlightLoop, +        int                  inCounter, +        void *               inRefcon )  {      if (lck_posix != NULL && shm_posix != NULL) {          shm_wrapper_lock(lck_posix); @@ -221,9 +216,9 @@ PLUGIN_API OTR_COMPAT_EXPORT void XPluginDisable ( void ) {  }  PLUGIN_API OTR_COMPAT_EXPORT void XPluginReceiveMessage( -        XPLMPluginID    unused(inFromWho), -        int             unused(inMessage), -        void *          unused(inParam)) +        XPLMPluginID    inFromWho, +        int             inMessage, +        void *          inParam)  {      if (inMessage == XPLM_MSG_AIRPORT_LOADED)          reinit_offset(); | 
