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

Unified Diff: src/utils/SkTFitsIn.h

Issue 1306443004: Use static_assert instead of SK_COMPILE_ASSERT. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « src/svg/SkSVGDevice.cpp ('k') | src/views/mac/SkNSView.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkTFitsIn.h
diff --git a/src/utils/SkTFitsIn.h b/src/utils/SkTFitsIn.h
index 1d04981c06f613e2e6b43665d82e917a7046042f..bbc22d410d87d08fe04276c1093b5f2f88fdbee2 100644
--- a/src/utils/SkTFitsIn.h
+++ b/src/utils/SkTFitsIn.h
@@ -39,7 +39,7 @@ template <typename D, typename S> struct SkTOutOfRange_LT_MinD {
typedef S source_type;
static bool apply(S s) {
typedef typename SkTHasMoreDigits<S, D>::type precondition;
- SK_COMPILE_ASSERT(precondition::value, SkTOutOfRange_LT_MinD__minS_gt_minD);
+ static_assert(precondition::value, "SkTOutOfRange_LT_MinD__minS_gt_minD");
return s < static_cast<S>((std::numeric_limits<D>::min)());
}
@@ -62,7 +62,7 @@ template <typename D, typename S> struct SkTOutOfRange_GT_MaxD {
typedef S source_type;
static bool apply(S s) {
typedef typename SkTHasMoreDigits<S, D>::type precondition;
- SK_COMPILE_ASSERT(precondition::value, SkTOutOfRange_GT_MaxD__maxS_lt_maxD);
+ static_assert(precondition::value, "SkTOutOfRange_GT_MaxD__maxS_lt_maxD");
return s > static_cast<S>((std::numeric_limits<D>::max)());
}
@@ -200,8 +200,8 @@ template<typename D, typename S> struct SkTFitsIn {
/** Returns true if the integer source value 's' will fit in the integer destination type 'D'. */
template <typename D, typename S> inline bool SkTFitsIn(S s) {
- SK_COMPILE_ASSERT(std::numeric_limits<S>::is_integer, SkTFitsIn_source_must_be_integer);
- SK_COMPILE_ASSERT(std::numeric_limits<D>::is_integer, SkTFitsIn_destination_must_be_integer);
+ static_assert(std::numeric_limits<S>::is_integer, "SkTFitsIn_source_must_be_integer");
+ static_assert(std::numeric_limits<D>::is_integer, "SkTFitsIn_destination_must_be_integer");
return !sktfitsin::Private::SkTFitsIn<D, S>::type::OutOfRange(s);
}
« no previous file with comments | « src/svg/SkSVGDevice.cpp ('k') | src/views/mac/SkNSView.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698