Add SXE_SET_UNUSED to shut unused warnings.
authorNelson Ferreira <nelson.ferreira@ieee.org>
Sun, 27 Sep 2015 21:26:39 +0000 (17:26 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Sun, 6 Dec 2015 18:07:09 +0000 (13:07 -0500)
* src/sxe-utils.h (SXE_SET_UNUSED): Define macro to mark variables
set but unused, aka, dummy vars.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/sxe-utils.h

index 2a6d166..60b526d 100644 (file)
@@ -54,11 +54,17 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 #else
 # define SXE_UNUSED(x) x
 #endif
 #else
 # define SXE_UNUSED(x) x
 #endif
+
 #ifdef UNUSED
 #undef UNUSED
 #define UNUSED(x) SXE_UNUSED(x)
 #endif
 
 #ifdef UNUSED
 #undef UNUSED
 #define UNUSED(x) SXE_UNUSED(x)
 #endif
 
+#ifdef SXE_SET_UNUSED
+#else
+#  define SXE_SET_UNUSED(x) ((void)(x))
+#endif
+
 #ifdef WEAK_EXTERN
 #elif defined(__GNUC__)
 # define WEAK_EXTERN   extern __attribute__((weak))
 #ifdef WEAK_EXTERN
 #elif defined(__GNUC__)
 # define WEAK_EXTERN   extern __attribute__((weak))
@@ -78,6 +84,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 #else
 #define LIKELY(_x)     __builtin_expect(!!(_x), 1)
 #endif
 #else
 #define LIKELY(_x)     __builtin_expect(!!(_x), 1)
 #endif
+
 #ifdef UNLIKELY
 #else
 #define UNLIKELY(_x)   __builtin_expect(!!(_x), 0)
 #ifdef UNLIKELY
 #else
 #define UNLIKELY(_x)   __builtin_expect(!!(_x), 0)