From f4ff6128d7fb6e4b5ba361a597fc6c0c88d5ec00 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Wed, 28 Jan 2009 17:16:32 -0500 Subject: Avoid "empty body in an if-statement" warning Use '(void)expr;' instead of 'if (expr) ;' to avoid getting the warning. 'if (expr) {}' is an option, however '(void)expr;' seems like a more common idiom and getting warnings for __attribute__((warn_unsed_result)) functions is probably prefered. --- src/cairo-mutex-impl-private.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cairo-mutex-impl-private.h') diff --git a/src/cairo-mutex-impl-private.h b/src/cairo-mutex-impl-private.h index 239dbbb0..ad65c111 100644 --- a/src/cairo-mutex-impl-private.h +++ b/src/cairo-mutex-impl-private.h @@ -54,8 +54,9 @@ /* A fully qualified no-operation statement */ #define CAIRO_MUTEX_IMPL_NOOP do {/*no-op*/} while (0) /* And one that evaluates it's argument once */ -#define CAIRO_MUTEX_IMPL_NOOP1(expr) do { if (expr) ; } while (0) - +#define CAIRO_MUTEX_IMPL_NOOP1(expr) do { (void)(expr); } while (0) +/* NOTE: 'if (expr) {}' is an alternative to '(void)(expr);' that will 'use' the + * result of __attribute__((warn_used_result)) functions. */ /* Cairo mutex implementation: * -- cgit v1.2.3