aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sfnt
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-08-20 07:57:51 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-20 07:57:52 -0700
commit99fe82260633fcf5d92cca38d12ef0937ecca61c (patch)
tree258dedccd2b908de58f6b1ae7c67dbfbe7208866 /src/sfnt
parent915881fe743f9a789037695f543bc6ea189cd0cb (diff)
Use static_assert instead of SK_COMPILE_ASSERT.
Now that static_assert is allowed, there is no need to use a non- standard compile time assertion Review URL: https://codereview.chromium.org/1306443004
Diffstat (limited to 'src/sfnt')
-rw-r--r--src/sfnt/SkIBMFamilyClass.h2
-rw-r--r--src/sfnt/SkOTTableTypes.h4
-rw-r--r--src/sfnt/SkOTTable_OS_2.h12
-rw-r--r--src/sfnt/SkOTTable_OS_2_V0.h2
-rw-r--r--src/sfnt/SkOTTable_OS_2_V1.h2
-rw-r--r--src/sfnt/SkOTTable_OS_2_V2.h2
-rw-r--r--src/sfnt/SkOTTable_OS_2_V3.h2
-rw-r--r--src/sfnt/SkOTTable_OS_2_V4.h2
-rw-r--r--src/sfnt/SkOTTable_OS_2_VA.h2
-rw-r--r--src/sfnt/SkOTTable_gasp.h4
-rw-r--r--src/sfnt/SkOTTable_head.h4
-rw-r--r--src/sfnt/SkOTTable_hhea.h4
-rw-r--r--src/sfnt/SkOTTable_maxp_CFF.h4
-rw-r--r--src/sfnt/SkOTTable_maxp_TT.h4
-rw-r--r--src/sfnt/SkOTTable_name.h8
-rw-r--r--src/sfnt/SkOTTable_post.h4
-rw-r--r--src/sfnt/SkPanose.h2
-rw-r--r--src/sfnt/SkSFNTHeader.h4
-rw-r--r--src/sfnt/SkTTCFHeader.h2
19 files changed, 35 insertions, 35 deletions
diff --git a/src/sfnt/SkIBMFamilyClass.h b/src/sfnt/SkIBMFamilyClass.h
index 45d9822f50..1572011215 100644
--- a/src/sfnt/SkIBMFamilyClass.h
+++ b/src/sfnt/SkIBMFamilyClass.h
@@ -169,6 +169,6 @@ struct SkIBMFamilyClass {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkIBMFamilyClass) == 2, sizeof_SkIBMFamilyClass_not_2);
+static_assert(sizeof(SkIBMFamilyClass) == 2, "sizeof_SkIBMFamilyClass_not_2");
#endif
diff --git a/src/sfnt/SkOTTableTypes.h b/src/sfnt/SkOTTableTypes.h
index fa76b207ea..119f17ef77 100644
--- a/src/sfnt/SkOTTableTypes.h
+++ b/src/sfnt/SkOTTableTypes.h
@@ -47,14 +47,14 @@ public:
/** SkOTSetUSHORTBit<N>::value is an SK_OT_USHORT with the Nth BE bit set. */
template <unsigned N> struct SkOTSetUSHORTBit {
- SK_COMPILE_ASSERT(N < 16, NTooBig);
+ static_assert(N < 16, "NTooBig");
static const uint16_t bit = 1u << N;
static const SK_OT_USHORT value = SkTEndian_SwapBE16(bit);
};
/** SkOTSetULONGBit<N>::value is an SK_OT_ULONG with the Nth BE bit set. */
template <unsigned N> struct SkOTSetULONGBit {
- SK_COMPILE_ASSERT(N < 32, NTooBig);
+ static_assert(N < 32, "NTooBig");
static const uint32_t bit = 1u << N;
static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit);
};
diff --git a/src/sfnt/SkOTTable_OS_2.h b/src/sfnt/SkOTTable_OS_2.h
index c4dbc5336c..4a09a78605 100644
--- a/src/sfnt/SkOTTable_OS_2.h
+++ b/src/sfnt/SkOTTable_OS_2.h
@@ -42,11 +42,11 @@ struct SkOTTableOS2 {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2::Version::VA) == 68, sizeof_SkOTTableOS2__VA_not_68);
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2::Version::V0) == 78, sizeof_SkOTTableOS2__V0_not_78);
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2::Version::V1) == 86, sizeof_SkOTTableOS2__V1_not_86);
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2::Version::V2) == 96, sizeof_SkOTTableOS2__V2_not_96);
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2::Version::V3) == 96, sizeof_SkOTTableOS2__V3_not_96);
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2::Version::V4) == 96, sizeof_SkOTTableOS2__V4_not_96);
+static_assert(sizeof(SkOTTableOS2::Version::VA) == 68, "sizeof_SkOTTableOS2__VA_not_68");
+static_assert(sizeof(SkOTTableOS2::Version::V0) == 78, "sizeof_SkOTTableOS2__V0_not_78");
+static_assert(sizeof(SkOTTableOS2::Version::V1) == 86, "sizeof_SkOTTableOS2__V1_not_86");
+static_assert(sizeof(SkOTTableOS2::Version::V2) == 96, "sizeof_SkOTTableOS2__V2_not_96");
+static_assert(sizeof(SkOTTableOS2::Version::V3) == 96, "sizeof_SkOTTableOS2__V3_not_96");
+static_assert(sizeof(SkOTTableOS2::Version::V4) == 96, "sizeof_SkOTTableOS2__V4_not_96");
#endif
diff --git a/src/sfnt/SkOTTable_OS_2_V0.h b/src/sfnt/SkOTTable_OS_2_V0.h
index b65bcf7f63..4dff413770 100644
--- a/src/sfnt/SkOTTable_OS_2_V0.h
+++ b/src/sfnt/SkOTTable_OS_2_V0.h
@@ -144,6 +144,6 @@ struct SkOTTableOS2_V0 {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_V0) == 78, sizeof_SkOTTableOS2_V0_not_78);
+static_assert(sizeof(SkOTTableOS2_V0) == 78, "sizeof_SkOTTableOS2_V0_not_78");
#endif
diff --git a/src/sfnt/SkOTTable_OS_2_V1.h b/src/sfnt/SkOTTable_OS_2_V1.h
index e53c0e67a5..43e61d41cc 100644
--- a/src/sfnt/SkOTTable_OS_2_V1.h
+++ b/src/sfnt/SkOTTable_OS_2_V1.h
@@ -513,6 +513,6 @@ struct SkOTTableOS2_V1 {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_V1) == 86, sizeof_SkOTTableOS2_V1_not_86);
+static_assert(sizeof(SkOTTableOS2_V1) == 86, "sizeof_SkOTTableOS2_V1_not_86");
#endif
diff --git a/src/sfnt/SkOTTable_OS_2_V2.h b/src/sfnt/SkOTTable_OS_2_V2.h
index 52f946057a..30ad016790 100644
--- a/src/sfnt/SkOTTable_OS_2_V2.h
+++ b/src/sfnt/SkOTTable_OS_2_V2.h
@@ -535,6 +535,6 @@ struct SkOTTableOS2_V2 {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_V2) == 96, sizeof_SkOTTableOS2_V2_not_96);
+static_assert(sizeof(SkOTTableOS2_V2) == 96, "sizeof_SkOTTableOS2_V2_not_96");
#endif
diff --git a/src/sfnt/SkOTTable_OS_2_V3.h b/src/sfnt/SkOTTable_OS_2_V3.h
index 8d4fa6b574..00df2891f1 100644
--- a/src/sfnt/SkOTTable_OS_2_V3.h
+++ b/src/sfnt/SkOTTable_OS_2_V3.h
@@ -545,6 +545,6 @@ struct SkOTTableOS2_V3 {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_V3) == 96, sizeof_SkOTTableOS2_V3_not_96);
+static_assert(sizeof(SkOTTableOS2_V3) == 96, "sizeof_SkOTTableOS2_V3_not_96");
#endif
diff --git a/src/sfnt/SkOTTable_OS_2_V4.h b/src/sfnt/SkOTTable_OS_2_V4.h
index fc64b2257b..3d22a1b2d1 100644
--- a/src/sfnt/SkOTTable_OS_2_V4.h
+++ b/src/sfnt/SkOTTable_OS_2_V4.h
@@ -580,6 +580,6 @@ struct SkOTTableOS2_V4 {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_V4) == 96, sizeof_SkOTTableOS2_V4_not_96);
+static_assert(sizeof(SkOTTableOS2_V4) == 96, "sizeof_SkOTTableOS2_V4_not_96");
#endif
diff --git a/src/sfnt/SkOTTable_OS_2_VA.h b/src/sfnt/SkOTTable_OS_2_VA.h
index bc45da2021..1dc95b5af7 100644
--- a/src/sfnt/SkOTTable_OS_2_VA.h
+++ b/src/sfnt/SkOTTable_OS_2_VA.h
@@ -137,6 +137,6 @@ struct SkOTTableOS2_VA {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_VA) == 68, sizeof_SkOTTableOS2_VA_not_68);
+static_assert(sizeof(SkOTTableOS2_VA) == 68, "sizeof_SkOTTableOS2_VA_not_68");
#endif
diff --git a/src/sfnt/SkOTTable_gasp.h b/src/sfnt/SkOTTable_gasp.h
index ca2d265e22..c6d8aa6550 100644
--- a/src/sfnt/SkOTTable_gasp.h
+++ b/src/sfnt/SkOTTable_gasp.h
@@ -67,7 +67,7 @@ struct SkOTTableGridAndScanProcedure {
#include <stddef.h>
-SK_COMPILE_ASSERT(offsetof(SkOTTableGridAndScanProcedure, numRanges) == 2, SkOTTableGridAndScanProcedure_numRanges_not_at_2);
-SK_COMPILE_ASSERT(sizeof(SkOTTableGridAndScanProcedure) == 4, sizeof_SkOTTableGridAndScanProcedure_not_4);
+static_assert(offsetof(SkOTTableGridAndScanProcedure, numRanges) == 2, "SkOTTableGridAndScanProcedure_numRanges_not_at_2");
+static_assert(sizeof(SkOTTableGridAndScanProcedure) == 4, "sizeof_SkOTTableGridAndScanProcedure_not_4");
#endif
diff --git a/src/sfnt/SkOTTable_head.h b/src/sfnt/SkOTTable_head.h
index 3d2c0f1113..52970b0f3b 100644
--- a/src/sfnt/SkOTTable_head.h
+++ b/src/sfnt/SkOTTable_head.h
@@ -144,7 +144,7 @@ struct SkOTTableHead {
#include <stddef.h>
-SK_COMPILE_ASSERT(offsetof(SkOTTableHead, glyphDataFormat) == 52, SkOTTableHead_glyphDataFormat_not_at_52);
-SK_COMPILE_ASSERT(sizeof(SkOTTableHead) == 54, sizeof_SkOTTableHead_not_54);
+static_assert(offsetof(SkOTTableHead, glyphDataFormat) == 52, "SkOTTableHead_glyphDataFormat_not_at_52");
+static_assert(sizeof(SkOTTableHead) == 54, "sizeof_SkOTTableHead_not_54");
#endif
diff --git a/src/sfnt/SkOTTable_hhea.h b/src/sfnt/SkOTTable_hhea.h
index b8a2070199..a3b9cad725 100644
--- a/src/sfnt/SkOTTable_hhea.h
+++ b/src/sfnt/SkOTTable_hhea.h
@@ -50,7 +50,7 @@ struct SkOTTableHorizontalHeader {
#include <stddef.h>
-SK_COMPILE_ASSERT(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, SkOTTableHorizontalHeader_numberOfHMetrics_not_at_34);
-SK_COMPILE_ASSERT(sizeof(SkOTTableHorizontalHeader) == 36, sizeof_SkOTTableHorizontalHeader_not_36);
+static_assert(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, "SkOTTableHorizontalHeader_numberOfHMetrics_not_at_34");
+static_assert(sizeof(SkOTTableHorizontalHeader) == 36, "sizeof_SkOTTableHorizontalHeader_not_36");
#endif
diff --git a/src/sfnt/SkOTTable_maxp_CFF.h b/src/sfnt/SkOTTable_maxp_CFF.h
index f97bff9efc..435d823886 100644
--- a/src/sfnt/SkOTTable_maxp_CFF.h
+++ b/src/sfnt/SkOTTable_maxp_CFF.h
@@ -24,7 +24,7 @@ struct SkOTTableMaximumProfile_CFF {
#include <stddef.h>
-SK_COMPILE_ASSERT(offsetof(SkOTTableMaximumProfile_CFF, numGlyphs) == 4, SkOTTableMaximumProfile_CFF_numGlyphs_not_at_4);
-SK_COMPILE_ASSERT(sizeof(SkOTTableMaximumProfile_CFF) == 6, sizeof_SkOTTableMaximumProfile_CFF_not_6);
+static_assert(offsetof(SkOTTableMaximumProfile_CFF, numGlyphs) == 4, "SkOTTableMaximumProfile_CFF_numGlyphs_not_at_4");
+static_assert(sizeof(SkOTTableMaximumProfile_CFF) == 6, "sizeof_SkOTTableMaximumProfile_CFF_not_6");
#endif
diff --git a/src/sfnt/SkOTTable_maxp_TT.h b/src/sfnt/SkOTTable_maxp_TT.h
index 9aa557ff30..1fdd0edc83 100644
--- a/src/sfnt/SkOTTable_maxp_TT.h
+++ b/src/sfnt/SkOTTable_maxp_TT.h
@@ -44,7 +44,7 @@ struct SkOTTableMaximumProfile_TT {
#include <stddef.h>
-SK_COMPILE_ASSERT(offsetof(SkOTTableMaximumProfile_TT, maxComponentDepth) == 30, SkOTTableMaximumProfile_TT_maxComponentDepth_not_at_30);
-SK_COMPILE_ASSERT(sizeof(SkOTTableMaximumProfile_TT) == 32, sizeof_SkOTTableMaximumProfile_TT_not_32);
+static_assert(offsetof(SkOTTableMaximumProfile_TT, maxComponentDepth) == 30, "SkOTTableMaximumProfile_TT_maxComponentDepth_not_at_30");
+static_assert(sizeof(SkOTTableMaximumProfile_TT) == 32, "sizeof_SkOTTableMaximumProfile_TT_not_32");
#endif
diff --git a/src/sfnt/SkOTTable_name.h b/src/sfnt/SkOTTable_name.h
index ab38d72992..6b25a2d1c8 100644
--- a/src/sfnt/SkOTTable_name.h
+++ b/src/sfnt/SkOTTable_name.h
@@ -576,9 +576,9 @@ struct SkOTTableName {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkOTTableName) == 6, sizeof_SkOTTableName_not_6);
-SK_COMPILE_ASSERT(sizeof(SkOTTableName::Format1Ext) == 2, sizeof_SkOTTableNameF1_not_2);
-SK_COMPILE_ASSERT(sizeof(SkOTTableName::Format1Ext::LangTagRecord) == 4, sizeof_SkOTTableNameLangTagRecord_not_4);
-SK_COMPILE_ASSERT(sizeof(SkOTTableName::Record) == 12, sizeof_SkOTTableNameRecord_not_12);
+static_assert(sizeof(SkOTTableName) == 6, "sizeof_SkOTTableName_not_6");
+static_assert(sizeof(SkOTTableName::Format1Ext) == 2, "sizeof_SkOTTableNameF1_not_2");
+static_assert(sizeof(SkOTTableName::Format1Ext::LangTagRecord) == 4, "sizeof_SkOTTableNameLangTagRecord_not_4");
+static_assert(sizeof(SkOTTableName::Record) == 12, "sizeof_SkOTTableNameRecord_not_12");
#endif
diff --git a/src/sfnt/SkOTTable_post.h b/src/sfnt/SkOTTable_post.h
index f563b08b22..7461d5283e 100644
--- a/src/sfnt/SkOTTable_post.h
+++ b/src/sfnt/SkOTTable_post.h
@@ -46,7 +46,7 @@ struct SkOTTablePostScript {
#include <stddef.h>
-SK_COMPILE_ASSERT(offsetof(SkOTTablePostScript, maxMemType1) == 28, SkOTTablePostScript_maxMemType1_not_at_28);
-SK_COMPILE_ASSERT(sizeof(SkOTTablePostScript) == 32, sizeof_SkOTTablePostScript_not_32);
+static_assert(offsetof(SkOTTablePostScript, maxMemType1) == 28, "SkOTTablePostScript_maxMemType1_not_at_28");
+static_assert(sizeof(SkOTTablePostScript) == 32, "sizeof_SkOTTablePostScript_not_32");
#endif
diff --git a/src/sfnt/SkPanose.h b/src/sfnt/SkPanose.h
index 873c093f5e..9561e56fb0 100644
--- a/src/sfnt/SkPanose.h
+++ b/src/sfnt/SkPanose.h
@@ -634,6 +634,6 @@ struct SkPanose {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkPanose) == 10, sizeof_SkPanose_not_10);
+static_assert(sizeof(SkPanose) == 10, "sizeof_SkPanose_not_10");
#endif
diff --git a/src/sfnt/SkSFNTHeader.h b/src/sfnt/SkSFNTHeader.h
index 9071696c99..c2ea1e0b25 100644
--- a/src/sfnt/SkSFNTHeader.h
+++ b/src/sfnt/SkSFNTHeader.h
@@ -64,7 +64,7 @@ struct SkSFNTHeader {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkSFNTHeader) == 12, sizeof_SkSFNTHeader_not_12);
-SK_COMPILE_ASSERT(sizeof(SkSFNTHeader::TableDirectoryEntry) == 16, sizeof_SkSFNTHeader_TableDirectoryEntry_not_16);
+static_assert(sizeof(SkSFNTHeader) == 12, "sizeof_SkSFNTHeader_not_12");
+static_assert(sizeof(SkSFNTHeader::TableDirectoryEntry) == 16, "sizeof_SkSFNTHeader_TableDirectoryEntry_not_16");
#endif
diff --git a/src/sfnt/SkTTCFHeader.h b/src/sfnt/SkTTCFHeader.h
index 8f53c03229..2dc77eea57 100644
--- a/src/sfnt/SkTTCFHeader.h
+++ b/src/sfnt/SkTTCFHeader.h
@@ -51,6 +51,6 @@ struct SkTTCFHeader {
#pragma pack(pop)
-SK_COMPILE_ASSERT(sizeof(SkTTCFHeader) == 12, sizeof_SkTTCFHeader_not_12);
+static_assert(sizeof(SkTTCFHeader) == 12, "sizeof_SkTTCFHeader_not_12");
#endif