Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: include/core/SkTypes.h

Issue 1955263002: No error if function marked with SK_WARN_UNUSED_RESULT is used in SkAssertResult (Closed) Base URL: https://skia.googlesource.com/skia.git@resscale
Patch Set: Remove dependency, update comment Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTypes.h
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index f99bb019498a5c15db390d668f34f67fb5811df9..b44df0de485056969550fc0428374f7d25ee6315 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -148,8 +148,9 @@ inline void operator delete(void* p) {
#define SkDECLAREPARAM(type, var)
#define SkPARAM(var)
- // unlike SkASSERT, this guy executes its condition in the non-debug build
- #define SkAssertResult(cond) cond
+ // unlike SkASSERT, this guy executes its condition in the non-debug build.
+ // It casts to void to allow use with functions declared with SK_WARN_RESULT_UNUSED.
+ #define SkAssertResult(cond) (void)(cond)
#endif
// Legacy macro names for SK_ABORT
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698