diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 45ed801a1..c6c9811a0 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -120,7 +120,7 @@ static const void *_NullPool[32 / sizeof (void *)]; /* Generic template for nul-content sizeof-sized Null objects. */ template static inline const Type& Null () { - ASSERT_STATIC (sizeof (Type) <= sizeof (_NullPool)); + ASSERT_STATIC (Type::min_size <= sizeof (_NullPool)); return *CastP (_NullPool); } @@ -673,7 +673,10 @@ struct HeadlessArrayOf } USHORT len; -/*Type array[VAR];*/ + private: + Type arrayX[VAR]; + public: + DEFINE_SIZE_VAR (sizeof (USHORT), Type); }; diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 094f3a8c1..324b7bded 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -439,6 +439,8 @@ struct Coverage CoverageFormat1 format1[VAR]; CoverageFormat2 format2[VAR]; } u; + public: + DEFINE_SIZE_MIN (2); }; @@ -559,6 +561,8 @@ struct ClassDef ClassDefFormat1 format1[VAR]; ClassDefFormat2 format2[VAR]; } u; + public: + DEFINE_SIZE_MIN (2); }; diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh index 20d6b922a..456efcaf1 100644 --- a/src/hb-ot-layout-gdef-private.hh +++ b/src/hb-ot-layout-gdef-private.hh @@ -195,6 +195,8 @@ struct CaretValue CaretValueFormat2 format2[VAR]; CaretValueFormat3 format3[VAR]; } u; + public: + DEFINE_SIZE_MIN (2); }; struct LigGlyph @@ -309,6 +311,8 @@ struct MarkGlyphSets USHORT format; /* Format identifier */ MarkGlyphSetsFormat1 format1[VAR]; } u; + public: + DEFINE_SIZE_MIN (2); }; diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index c89058560..a84210ad6 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -335,6 +335,8 @@ struct Anchor AnchorFormat2 format2[VAR]; AnchorFormat3 format3[VAR]; } u; + public: + DEFINE_SIZE_MIN (2); }; @@ -460,7 +462,7 @@ struct SinglePosFormat1 * value(s)--applied to all glyphs in * the Coverage table */ public: - DEFINE_SIZE_VAR (6, ValueRecord); + DEFINE_SIZE_VAR (6, Value); }; struct SinglePosFormat2 @@ -504,7 +506,7 @@ struct SinglePosFormat2 ValueRecord values; /* Array of ValueRecords--positioning * values applied to glyphs */ public: - DEFINE_SIZE_VAR (8, ValueRecord); + DEFINE_SIZE_VAR (8, Value); }; struct SinglePos @@ -552,7 +554,7 @@ struct PairValueRecord ValueRecord values; /* Positioning data for the first glyph * followed by for second glyph */ public: - DEFINE_SIZE_VAR (2, ValueRecord); + DEFINE_SIZE_VAR (2, Value); }; struct PairSet @@ -1487,6 +1489,8 @@ struct PosLookupSubTable ChainContextPos chainContext[VAR]; ExtensionPos extension[VAR]; } u; + public: + DEFINE_SIZE_MIN (2); }; diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index da32cb1b0..c562deac4 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -443,7 +443,7 @@ struct Ligature * with the second component--ordered * in writing direction */ public: - DEFINE_SIZE_STATIC (4); + DEFINE_SIZE_VAR (4, GlyphID); }; struct LigatureSet @@ -758,6 +758,8 @@ struct SubstLookupSubTable ExtensionSubst extension[VAR]; ReverseChainSingleSubst reverseChainContextSingle[VAR]; } u; + public: + DEFINE_SIZE_MIN (2); }; diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index cc04de0d0..92521c544 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -330,6 +330,8 @@ struct RuleSet OffsetArrayOf rule; /* Array of Rule tables * ordered by preference */ + public: + DEFINE_SIZE_VAR (2, OffsetTo); };