Warn when ignoring result of SkMatrix::invert.
authorbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 Apr 2012 22:33:11 +0000 (22:33 +0000)
committerbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 Apr 2012 22:33:11 +0000 (22:33 +0000)
http://codereview.appspot.com/5989067/

git-svn-id: http://skia.googlecode.com/svn/trunk@3637 2bbb7eff-a529-9590-31e7-b0007b416f81

include/core/SkMatrix.h
include/core/SkPreConfig.h

index 8c878c5..1350e8f 100644 (file)
@@ -336,7 +336,7 @@ public:
         set inverse to be the inverse of this matrix. If this matrix cannot be
         inverted, ignore inverse and return false
     */
-    bool invert(SkMatrix* inverse) const;
+    bool SK_WARN_UNUSED_RESULT invert(SkMatrix* inverse) const;
 
     /** Fills the passed array with affine identity values
         in column major order.
index 4485f1d..46c6929 100644 (file)
@@ -68,6 +68,9 @@
     #if !defined(SK_RESTRICT)
         #define SK_RESTRICT __restrict
     #endif
+    #if !defined(SK_WARN_UNUSED_RESULT)
+        #define SK_WARN_UNUSED_RESULT
+    #endif
     #include "sk_stdint.h"
 #endif
 
     #define SK_RESTRICT __restrict__
 #endif
 
+#if !defined(SK_WARN_UNUSED_RESULT)
+    #define SK_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#endif
+
 //////////////////////////////////////////////////////////////////////
 
 #if !defined(SK_SCALAR_IS_FLOAT) && !defined(SK_SCALAR_IS_FIXED)