[PATCH 2/2] observer: Silence gcc warning

Andrea Canciani <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
GCC complains that:

cairo-surface-observer.c:289:26: warning: ignoring return value of
'cairo_device_acquire', declared with attribute warn_unused_result
[-Wunused-result]

Explain why it's safe to ignore it in a comment.
---
 src/cairo-surface-observer.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/cairo-surface-observer.c b/src/cairo-surface-observer.c
index 3ac0892..6d57bf6 100644
--- a/src/cairo-surface-observer.c
+++ b/src/cairo-surface-observer.c
@@ -286,7 +286,11 @@ static void
 _cairo_device_observer_lock (void *_device)
 {
     cairo_device_observer_t *device = (cairo_device_observer_t *) _device;
-    cairo_device_acquire (device->target);
+    cairo_status_t ignored;
+
+    /* cairo_device_acquire() can fail for nil and finished
+     * devices. We don't care about observing them. */
+    ignored = cairo_device_acquire (device->target);
 }
 
 static void
-- 
1.7.5.4

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.