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

Unified Diff: src/ports/SkFontMgr_android_parser.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/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_android_parser.h
diff --git a/src/ports/SkFontMgr_android_parser.h b/src/ports/SkFontMgr_android_parser.h
index 175a6fa1fe7b8584daaa12dd90fdc2bfd9fb2386..ca66c43410b43a1394eb3f7ca4ee9d112186c4c9 100644
--- a/src/ports/SkFontMgr_android_parser.h
+++ b/src/ports/SkFontMgr_android_parser.h
@@ -126,7 +126,7 @@ void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies,
* If the string cannot be parsed into 'value', returns false and does not change 'value'.
*/
template <typename T> static bool parse_non_negative_integer(const char* s, T* value) {
- SK_COMPILE_ASSERT(std::numeric_limits<T>::is_integer, T_must_be_integer);
+ static_assert(std::numeric_limits<T>::is_integer, "T_must_be_integer");
if (*s == '\0') {
return false;
@@ -163,9 +163,9 @@ template <typename T> static bool parse_non_negative_integer(const char* s, T* v
* If the string cannot be parsed into 'value', returns false and does not change 'value'.
*/
template <int N, typename T> static bool parse_fixed(const char* s, T* value) {
- SK_COMPILE_ASSERT(std::numeric_limits<T>::is_integer, T_must_be_integer);
- SK_COMPILE_ASSERT(std::numeric_limits<T>::is_signed, T_must_be_signed);
- SK_COMPILE_ASSERT(sizeof(T) * CHAR_BIT - N >= 5, N_must_leave_four_bits_plus_sign);
+ static_assert(std::numeric_limits<T>::is_integer, "T_must_be_integer");
+ static_assert(std::numeric_limits<T>::is_signed, "T_must_be_signed");
+ static_assert(sizeof(T) * CHAR_BIT - N >= 5, "N_must_leave_four_bits_plus_sign");
bool negate = false;
if (*s == '-') {
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698