summaryrefslogtreecommitdiff
path: root/src/cairo-mutex-impl-private.h
diff options
context:
space:
mode:
authorJeff Muizelaar <jmuizelaar@mozilla.com>2009-01-28 17:16:32 -0500
committerJeff Muizelaar <jmuizelaar@mozilla.com>2009-01-28 17:16:32 -0500
commitf4ff6128d7fb6e4b5ba361a597fc6c0c88d5ec00 (patch)
treeed0c12668b7deb65c1e067d2a0b194d8e5fae179 /src/cairo-mutex-impl-private.h
parent41feeedcc14bf8caef3c039de49f4f28143712c7 (diff)
downloadcairo-f4ff6128d7fb6e4b5ba361a597fc6c0c88d5ec00.tar.gz
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.
Diffstat (limited to 'src/cairo-mutex-impl-private.h')
-rw-r--r--src/cairo-mutex-impl-private.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cairo-mutex-impl-private.h b/src/cairo-mutex-impl-private.h
index 239dbbb09..ad65c1117 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:
*