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

Unified Diff: sync/internal_api/public/base/ordinal.h

Issue 809073005: replace COMPILE_ASSERT with static_assert in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 5 years, 11 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 | « sync/internal_api/public/base/node_ordinal.h ('k') | sync/internal_api/public/base/ordinal_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/public/base/ordinal.h
diff --git a/sync/internal_api/public/base/ordinal.h b/sync/internal_api/public/base/ordinal.h
index cb67b4518b10b48b83046a2b95b278bd9bc8c368..32d2ff67fb39cdf3c82b0badc7f1d92a46273087 100644
--- a/sync/internal_api/public/base/ordinal.h
+++ b/sync/internal_api/public/base/ordinal.h
@@ -141,15 +141,13 @@ class Ordinal {
static const unsigned int kMaxDigitValue = kMaxDigit - kZeroDigit;
static const unsigned int kRadix = kMaxDigitValue + 1;
- COMPILE_ASSERT(kOneDigit > kZeroDigit, OrdinalOneDigitGreaterThanMinDigit);
- COMPILE_ASSERT(kMidDigit > kOneDigit, OrdinalMidDigitGreaterThanOneDigit);
- COMPILE_ASSERT(kMaxDigit > kMidDigit, OrdinalMaxDigitGreaterThanMidDigit);
- COMPILE_ASSERT(kMinLength > 0, OrdinalMinLengthIsPositive);
- COMPILE_ASSERT(kMidDigitValue > 1, OrdinalMidDigitValueGreaterThanOne);
- COMPILE_ASSERT(kMaxDigitValue > kMidDigitValue,
- OrdinalMaxDigitValueGreaterThanMidDigitValue);
- COMPILE_ASSERT(kRadix == kMaxDigitValue + 1,
- OrdinalRadixIsMaxDigitValuePlusOne);
+ static_assert(kOneDigit > kZeroDigit, "incorrect ordinal one digit");
+ static_assert(kMidDigit > kOneDigit, "incorrect ordinal mid digit");
+ static_assert(kMaxDigit > kMidDigit, "incorrect ordinal max digit");
+ static_assert(kMinLength > 0, "incorrect ordinal min length");
+ static_assert(kMidDigitValue > 1, "incorrect ordinal mid digit");
+ static_assert(kMaxDigitValue > kMidDigitValue, "incorrect ordinal max digit");
+ static_assert(kRadix == kMaxDigitValue + 1, "incorrect ordinal radix");
private:
// Returns true iff the given byte string satisfies the criteria for
« no previous file with comments | « sync/internal_api/public/base/node_ordinal.h ('k') | sync/internal_api/public/base/ordinal_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698