Remove ASSERT_SIZE in favor of the safer DEFINE_SIZE_STATIC

This commit is contained in:
Behdad Esfahbod 2010-05-10 16:57:29 -04:00
parent 569da92bc6
commit b3651231bf
8 changed files with 109 additions and 65 deletions

View File

@ -139,8 +139,9 @@ struct TTCHeaderVersion1
LongOffsetLongArrayOf<OffsetTable> LongOffsetLongArrayOf<OffsetTable>
table; /* Array of offsets to the OffsetTable for each font table; /* Array of offsets to the OffsetTable for each font
* from the beginning of the file */ * from the beginning of the file */
public:
DEFINE_SIZE_STATIC (12);
}; };
ASSERT_SIZE (TTCHeaderVersion1, 12);
struct TTCHeader struct TTCHeader
{ {

View File

@ -96,6 +96,15 @@ inline Type& StructAfter(TObject &X)
static const unsigned int static_size = (size); \ static const unsigned int static_size = (size); \
static const unsigned int min_size = (size) static const unsigned int min_size = (size)
/* Size signifying variable-sized array */
#define VAR 1
#define VAR0 (VAR+0)
#define DEFINE_SIZE_VAR0(size) \
inline void _size_assertion (void) const \
{ ASSERT_STATIC (sizeof (*this) == (size)); } \
static const unsigned int min_size = (size)
#define DEFINE_SIZE_VAR(size, _var_type) \ #define DEFINE_SIZE_VAR(size, _var_type) \
inline void _size_assertion (void) const \ inline void _size_assertion (void) const \
{ ASSERT_STATIC (sizeof (*this) == (size) + VAR0 * sizeof (_var_type)); } \ { ASSERT_STATIC (sizeof (*this) == (size) + VAR0 * sizeof (_var_type)); } \
@ -397,8 +406,9 @@ struct Tag : ULONG
/* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */
inline operator const char* (void) const { return CharP(this); } inline operator const char* (void) const { return CharP(this); }
inline operator char* (void) { return CharP(this); } inline operator char* (void) { return CharP(this); }
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (Tag, 4);
DEFINE_NULL_DATA (Tag, " "); DEFINE_NULL_DATA (Tag, " ");
/* Glyph index number, same as uint16 (length = 16 bits) */ /* Glyph index number, same as uint16 (length = 16 bits) */
@ -423,8 +433,9 @@ struct CheckSum : ULONG
Sum += *Table++; Sum += *Table++;
return Sum; return Sum;
} }
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (CheckSum, 4);
/* /*
@ -442,8 +453,9 @@ struct FixedVersion
USHORT major; USHORT major;
USHORT minor; USHORT minor;
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (FixedVersion, 4);
@ -577,6 +589,8 @@ struct GenericArrayOf
public: public:
LenType len; LenType len;
/*Type array[VAR];*/ /*Type array[VAR];*/
public:
DEFINE_SIZE_VAR0 (sizeof (LenType));
}; };
/* An array with a USHORT number of elements. */ /* An array with a USHORT number of elements. */

View File

@ -216,11 +216,11 @@ struct Script
RecordArrayOf<LangSys> RecordArrayOf<LangSys>
langSys; /* Array of LangSysRecords--listed langSys; /* Array of LangSysRecords--listed
* alphabetically by LangSysTag */ * alphabetically by LangSysTag */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (Script, 4);
typedef RecordListOf<Script> ScriptList; typedef RecordListOf<Script> ScriptList;
ASSERT_SIZE (ScriptList, 2);
struct Feature struct Feature
@ -247,11 +247,11 @@ struct Feature
* to the beginning of the Feature Table; = Null * to the beginning of the Feature Table; = Null
* if not required */ * if not required */
IndexArray lookupIndex; /* Array of LookupList indices */ IndexArray lookupIndex; /* Array of LookupList indices */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (Feature, 4);
typedef RecordListOf<Feature> FeatureList; typedef RecordListOf<Feature> FeatureList;
ASSERT_SIZE (FeatureList, 2);
struct LookupFlag : USHORT struct LookupFlag : USHORT
@ -266,8 +266,9 @@ struct LookupFlag : USHORT
Reserved = 0x00E0u, Reserved = 0x00E0u,
MarkAttachmentType = 0xFF00u MarkAttachmentType = 0xFF00u
}; };
public:
DEFINE_SIZE_STATIC (2);
}; };
ASSERT_SIZE (LookupFlag, 2);
struct Lookup struct Lookup
{ {
@ -310,7 +311,6 @@ struct Lookup
}; };
typedef OffsetListOf<Lookup> LookupList; typedef OffsetListOf<Lookup> LookupList;
ASSERT_SIZE (LookupList, 2);
/* /*
@ -345,8 +345,9 @@ struct CoverageFormat1
USHORT coverageFormat; /* Format identifier--format = 1 */ USHORT coverageFormat; /* Format identifier--format = 1 */
ArrayOf<GlyphID> ArrayOf<GlyphID>
glyphArray; /* Array of GlyphIDs--in numerical order */ glyphArray; /* Array of GlyphIDs--in numerical order */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (CoverageFormat1, 4);
struct CoverageRangeRecord struct CoverageRangeRecord
{ {
@ -405,8 +406,9 @@ struct CoverageFormat2
rangeRecord; /* Array of glyph ranges--ordered by rangeRecord; /* Array of glyph ranges--ordered by
* Start GlyphID. rangeCount entries * Start GlyphID. rangeCount entries
* long */ * long */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (CoverageFormat2, 4);
struct Coverage struct Coverage
{ {
@ -466,8 +468,9 @@ struct ClassDefFormat1
GlyphID startGlyph; /* First GlyphID of the classValueArray */ GlyphID startGlyph; /* First GlyphID of the classValueArray */
ArrayOf<USHORT> ArrayOf<USHORT>
classValue; /* Array of Class Values--one per GlyphID */ classValue; /* Array of Class Values--one per GlyphID */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (ClassDefFormat1, 6);
struct ClassRangeRecord struct ClassRangeRecord
{ {
@ -523,8 +526,9 @@ struct ClassDefFormat2
ArrayOf<ClassRangeRecord> ArrayOf<ClassRangeRecord>
rangeRecord; /* Array of glyph ranges--ordered by rangeRecord; /* Array of glyph ranges--ordered by
* Start GlyphID */ * Start GlyphID */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (ClassDefFormat2, 4);
struct ClassDef struct ClassDef
{ {

View File

@ -38,7 +38,6 @@
typedef ArrayOf<USHORT> AttachPoint; /* Array of contour point indices--in typedef ArrayOf<USHORT> AttachPoint; /* Array of contour point indices--in
* increasing numerical order */ * increasing numerical order */
ASSERT_SIZE (AttachPoint, 2);
struct AttachList struct AttachList
{ {
@ -80,8 +79,9 @@ struct AttachList
OffsetArrayOf<AttachPoint> OffsetArrayOf<AttachPoint>
attachPoint; /* Array of AttachPoint tables attachPoint; /* Array of AttachPoint tables
* in Coverage Index order */ * in Coverage Index order */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (AttachList, 4);
/* /*
* Ligature Caret Table * Ligature Caret Table
@ -106,8 +106,9 @@ struct CaretValueFormat1
private: private:
USHORT caretValueFormat; /* Format identifier--format = 1 */ USHORT caretValueFormat; /* Format identifier--format = 1 */
SHORT coordinate; /* X or Y value, in design units */ SHORT coordinate; /* X or Y value, in design units */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (CaretValueFormat1, 4);
struct CaretValueFormat2 struct CaretValueFormat2
{ {
@ -132,8 +133,9 @@ struct CaretValueFormat2
private: private:
USHORT caretValueFormat; /* Format identifier--format = 2 */ USHORT caretValueFormat; /* Format identifier--format = 2 */
USHORT caretValuePoint; /* Contour point index on glyph */ USHORT caretValuePoint; /* Contour point index on glyph */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (CaretValueFormat2, 4);
struct CaretValueFormat3 struct CaretValueFormat3
{ {
@ -159,8 +161,9 @@ struct CaretValueFormat3
deviceTable; /* Offset to Device table for X or Y deviceTable; /* Offset to Device table for X or Y
* value--from beginning of CaretValue * value--from beginning of CaretValue
* table */ * table */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (CaretValueFormat3, 6);
struct CaretValue struct CaretValue
{ {
@ -222,8 +225,9 @@ struct LigGlyph
carets; /* Offset array of CaretValue tables carets; /* Offset array of CaretValue tables
* --from beginning of LigGlyph table * --from beginning of LigGlyph table
* --in increasing coordinate order */ * --in increasing coordinate order */
public:
DEFINE_SIZE_STATIC (2);
}; };
ASSERT_SIZE (LigGlyph, 2);
struct LigCaretList struct LigCaretList
{ {
@ -257,8 +261,9 @@ struct LigCaretList
OffsetArrayOf<LigGlyph> OffsetArrayOf<LigGlyph>
ligGlyph; /* Array of LigGlyph tables ligGlyph; /* Array of LigGlyph tables
* in Coverage Index order */ * in Coverage Index order */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (LigCaretList, 4);
struct MarkGlyphSetsFormat1 struct MarkGlyphSetsFormat1
@ -276,8 +281,9 @@ struct MarkGlyphSetsFormat1
LongOffsetArrayOf<Coverage> LongOffsetArrayOf<Coverage>
coverage; /* Array of long offsets to mark set coverage; /* Array of long offsets to mark set
* coverage tables */ * coverage tables */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (MarkGlyphSetsFormat1, 4);
struct MarkGlyphSets struct MarkGlyphSets
{ {

View File

@ -202,7 +202,6 @@ struct ValueFormat : USHORT
return true; return true;
} }
}; };
ASSERT_SIZE (ValueFormat, 2);
struct AnchorFormat1 struct AnchorFormat1
@ -226,8 +225,9 @@ struct AnchorFormat1
USHORT format; /* Format identifier--format = 1 */ USHORT format; /* Format identifier--format = 1 */
SHORT xCoordinate; /* Horizontal value--in design units */ SHORT xCoordinate; /* Horizontal value--in design units */
SHORT yCoordinate; /* Vertical value--in design units */ SHORT yCoordinate; /* Vertical value--in design units */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (AnchorFormat1, 6);
struct AnchorFormat2 struct AnchorFormat2
{ {
@ -258,8 +258,9 @@ struct AnchorFormat2
SHORT xCoordinate; /* Horizontal value--in design units */ SHORT xCoordinate; /* Horizontal value--in design units */
SHORT yCoordinate; /* Vertical value--in design units */ SHORT yCoordinate; /* Vertical value--in design units */
USHORT anchorPoint; /* Index to glyph contour point */ USHORT anchorPoint; /* Index to glyph contour point */
public:
DEFINE_SIZE_STATIC (8);
}; };
ASSERT_SIZE (AnchorFormat2, 8);
struct AnchorFormat3 struct AnchorFormat3
{ {
@ -298,8 +299,9 @@ struct AnchorFormat3
yDeviceTable; /* Offset to Device table for Y yDeviceTable; /* Offset to Device table for Y
* coordinate-- from beginning of * coordinate-- from beginning of
* Anchor table (may be NULL) */ * Anchor table (may be NULL) */
public:
DEFINE_SIZE_STATIC (10);
}; };
ASSERT_SIZE (AnchorFormat3, 10);
struct Anchor struct Anchor
{ {
@ -421,8 +423,9 @@ struct MarkArray
private: private:
ArrayOf<MarkRecord> ArrayOf<MarkRecord>
markRecord; /* Array of MarkRecords--in Coverage order */ markRecord; /* Array of MarkRecords--in Coverage order */
public:
DEFINE_SIZE_STATIC (2);
}; };
ASSERT_SIZE (MarkArray, 2);
/* Lookups */ /* Lookups */
@ -669,8 +672,9 @@ struct PairPosFormat1
OffsetArrayOf<PairSet> OffsetArrayOf<PairSet>
pairSet; /* Array of PairSet tables pairSet; /* Array of PairSet tables
* ordered by Coverage Index */ * ordered by Coverage Index */
public:
DEFINE_SIZE_STATIC (10);
}; };
ASSERT_SIZE (PairPosFormat1, 10);
struct PairPosFormat2 struct PairPosFormat2
{ {
@ -1014,8 +1018,9 @@ struct CursivePosFormat1
ArrayOf<EntryExitRecord> ArrayOf<EntryExitRecord>
entryExitRecord; /* Array of EntryExit records--in entryExitRecord; /* Array of EntryExit records--in
* Coverage Index order */ * Coverage Index order */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (CursivePosFormat1, 6);
struct CursivePos struct CursivePos
{ {
@ -1075,11 +1080,9 @@ struct MarkBasePosFormat1
j--; j--;
} while (_hb_ot_layout_skip_mark (context->layout->face, IN_INFO (j), LookupFlag::IgnoreMarks, &property)); } while (_hb_ot_layout_skip_mark (context->layout->face, IN_INFO (j), LookupFlag::IgnoreMarks, &property));
#if 0 /* The following assertion is too strong, so we've disabled it. */
/* The following assertion is too strong. */ if (false && !(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH))
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH))
return false; return false;
#endif
unsigned int base_index = (this+baseCoverage) (IN_GLYPH (j)); unsigned int base_index = (this+baseCoverage) (IN_GLYPH (j));
if (base_index == NOT_COVERED) if (base_index == NOT_COVERED)
@ -1112,8 +1115,9 @@ struct MarkBasePosFormat1
OffsetTo<BaseArray> OffsetTo<BaseArray>
baseArray; /* Offset to BaseArray table--from baseArray; /* Offset to BaseArray table--from
* beginning of MarkBasePos subtable */ * beginning of MarkBasePos subtable */
public:
DEFINE_SIZE_STATIC (12);
}; };
ASSERT_SIZE (MarkBasePosFormat1, 12);
struct MarkBasePos struct MarkBasePos
{ {
@ -1178,11 +1182,9 @@ struct MarkLigPosFormat1
j--; j--;
} while (_hb_ot_layout_skip_mark (context->layout->face, IN_INFO (j), LookupFlag::IgnoreMarks, &property)); } while (_hb_ot_layout_skip_mark (context->layout->face, IN_INFO (j), LookupFlag::IgnoreMarks, &property));
#if 0 /* The following assertion is too strong, so we've disabled it. */
/* The following assertion is too strong. */ if (false && !(property & HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE))
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE))
return false; return false;
#endif
unsigned int lig_index = (this+ligatureCoverage) (IN_GLYPH (j)); unsigned int lig_index = (this+ligatureCoverage) (IN_GLYPH (j));
if (lig_index == NOT_COVERED) if (lig_index == NOT_COVERED)
@ -1237,8 +1239,9 @@ struct MarkLigPosFormat1
OffsetTo<LigatureArray> OffsetTo<LigatureArray>
ligatureArray; /* Offset to LigatureArray table--from ligatureArray; /* Offset to LigatureArray table--from
* beginning of MarkLigPos subtable */ * beginning of MarkLigPos subtable */
public:
DEFINE_SIZE_STATIC (12);
}; };
ASSERT_SIZE (MarkLigPosFormat1, 12);
struct MarkLigPos struct MarkLigPos
{ {
@ -1341,8 +1344,9 @@ struct MarkMarkPosFormat1
OffsetTo<Mark2Array> OffsetTo<Mark2Array>
mark2Array; /* Offset to Mark2Array table--from mark2Array; /* Offset to Mark2Array table--from
* beginning of MarkMarkPos subtable */ * beginning of MarkMarkPos subtable */
public:
DEFINE_SIZE_STATIC (12);
}; };
ASSERT_SIZE (MarkMarkPosFormat1, 12);
struct MarkMarkPos struct MarkMarkPos
{ {
@ -1567,7 +1571,6 @@ struct PosLookup : Lookup
}; };
typedef OffsetListOf<PosLookup> PosLookupList; typedef OffsetListOf<PosLookup> PosLookupList;
ASSERT_SIZE (PosLookupList, 2);
/* /*
* GPOS * GPOS
@ -1592,8 +1595,9 @@ struct GPOS : GSUBGPOS
OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList); OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
return list.sanitize (context, this); return list.sanitize (context, this);
} }
public:
DEFINE_SIZE_STATIC (10);
}; };
ASSERT_SIZE (GPOS, 10);
/* Out-of-class implementation for methods recursing */ /* Out-of-class implementation for methods recursing */

View File

@ -71,8 +71,9 @@ struct SingleSubstFormat1
* beginning of Substitution table */ * beginning of Substitution table */
SHORT deltaGlyphID; /* Add to original GlyphID to get SHORT deltaGlyphID; /* Add to original GlyphID to get
* substitute GlyphID */ * substitute GlyphID */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (SingleSubstFormat1, 6);
struct SingleSubstFormat2 struct SingleSubstFormat2
{ {
@ -115,8 +116,9 @@ struct SingleSubstFormat2
ArrayOf<GlyphID> ArrayOf<GlyphID>
substitute; /* Array of substitute substitute; /* Array of substitute
* GlyphIDs--ordered by Coverage Index */ * GlyphIDs--ordered by Coverage Index */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (SingleSubstFormat2, 6);
struct SingleSubst struct SingleSubst
{ {
@ -192,8 +194,9 @@ struct Sequence
private: private:
ArrayOf<GlyphID> ArrayOf<GlyphID>
substitute; /* String of GlyphIDs to substitute */ substitute; /* String of GlyphIDs to substitute */
public:
DEFINE_SIZE_STATIC (2);
}; };
ASSERT_SIZE (Sequence, 2);
struct MultipleSubstFormat1 struct MultipleSubstFormat1
{ {
@ -226,8 +229,9 @@ struct MultipleSubstFormat1
OffsetArrayOf<Sequence> OffsetArrayOf<Sequence>
sequence; /* Array of Sequence tables sequence; /* Array of Sequence tables
* ordered by Coverage Index */ * ordered by Coverage Index */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (MultipleSubstFormat1, 6);
struct MultipleSubst struct MultipleSubst
{ {
@ -263,7 +267,6 @@ struct MultipleSubst
typedef ArrayOf<GlyphID> AlternateSet; /* Array of alternate GlyphIDs--in typedef ArrayOf<GlyphID> AlternateSet; /* Array of alternate GlyphIDs--in
* arbitrary order */ * arbitrary order */
ASSERT_SIZE (AlternateSet, 2);
struct AlternateSubstFormat1 struct AlternateSubstFormat1
{ {
@ -322,8 +325,9 @@ struct AlternateSubstFormat1
OffsetArrayOf<AlternateSet> OffsetArrayOf<AlternateSet>
alternateSet; /* Array of AlternateSet tables alternateSet; /* Array of AlternateSet tables
* ordered by Coverage Index */ * ordered by Coverage Index */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (AlternateSubstFormat1, 6);
struct AlternateSubst struct AlternateSubst
{ {
@ -438,8 +442,9 @@ struct Ligature
component; /* Array of component GlyphIDs--start component; /* Array of component GlyphIDs--start
* with the second component--ordered * with the second component--ordered
* in writing direction */ * in writing direction */
public:
DEFINE_SIZE_STATIC (4);
}; };
ASSERT_SIZE (Ligature, 4);
struct LigatureSet struct LigatureSet
{ {
@ -470,8 +475,9 @@ struct LigatureSet
OffsetArrayOf<Ligature> OffsetArrayOf<Ligature>
ligature; /* Array LigatureSet tables ligature; /* Array LigatureSet tables
* ordered by preference */ * ordered by preference */
public:
DEFINE_SIZE_STATIC (2);
}; };
ASSERT_SIZE (LigatureSet, 2);
struct LigatureSubstFormat1 struct LigatureSubstFormat1
{ {
@ -507,8 +513,9 @@ struct LigatureSubstFormat1
OffsetArrayOf<LigatureSet> OffsetArrayOf<LigatureSet>
ligatureSet; /* Array LigatureSet tables ligatureSet; /* Array LigatureSet tables
* ordered by Coverage Index */ * ordered by Coverage Index */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (LigatureSubstFormat1, 6);
struct LigatureSubst struct LigatureSubst
{ {
@ -652,8 +659,9 @@ struct ReverseChainSingleSubstFormat1
ArrayOf<GlyphID> ArrayOf<GlyphID>
substituteX; /* Array of substitute substituteX; /* Array of substitute
* GlyphIDs--ordered by Coverage Index */ * GlyphIDs--ordered by Coverage Index */
public:
DEFINE_SIZE_STATIC (10);
}; };
ASSERT_SIZE (ReverseChainSingleSubstFormat1, 10);
struct ReverseChainSingleSubst struct ReverseChainSingleSubst
{ {
@ -865,7 +873,6 @@ struct SubstLookup : Lookup
}; };
typedef OffsetListOf<SubstLookup> SubstLookupList; typedef OffsetListOf<SubstLookup> SubstLookupList;
ASSERT_SIZE (SubstLookupList, 2);
/* /*
* GSUB * GSUB
@ -890,8 +897,9 @@ struct GSUB : GSUBGPOS
OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList); OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
return list.sanitize (context, this); return list.sanitize (context, this);
} }
public:
DEFINE_SIZE_STATIC (10);
}; };
ASSERT_SIZE (GSUB, 10);
/* Out-of-class implementation for methods recursing */ /* Out-of-class implementation for methods recursing */

View File

@ -367,8 +367,9 @@ struct ContextFormat1
OffsetArrayOf<RuleSet> OffsetArrayOf<RuleSet>
ruleSet; /* Array of RuleSet tables ruleSet; /* Array of RuleSet tables
* ordered by Coverage Index */ * ordered by Coverage Index */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (ContextFormat1, 6);
struct ContextFormat2 struct ContextFormat2
@ -414,8 +415,9 @@ struct ContextFormat2
OffsetArrayOf<RuleSet> OffsetArrayOf<RuleSet>
ruleSet; /* Array of RuleSet tables ruleSet; /* Array of RuleSet tables
* ordered by class */ * ordered by class */
public:
DEFINE_SIZE_STATIC (8);
}; };
ASSERT_SIZE (ContextFormat2, 8);
struct ContextFormat3 struct ContextFormat3
@ -590,8 +592,9 @@ struct ChainRule
ArrayOf<LookupRecord> ArrayOf<LookupRecord>
lookupX; /* Array of LookupRecords--in lookupX; /* Array of LookupRecords--in
* design order) */ * design order) */
public:
DEFINE_SIZE_STATIC (8);
}; };
ASSERT_SIZE (ChainRule, 8);
struct ChainRuleSet struct ChainRuleSet
{ {
@ -617,8 +620,9 @@ struct ChainRuleSet
OffsetArrayOf<ChainRule> OffsetArrayOf<ChainRule>
rule; /* Array of ChainRule tables rule; /* Array of ChainRule tables
* ordered by preference */ * ordered by preference */
public:
DEFINE_SIZE_STATIC (2);
}; };
ASSERT_SIZE (ChainRuleSet, 2);
struct ChainContextFormat1 struct ChainContextFormat1
{ {
@ -654,8 +658,9 @@ struct ChainContextFormat1
OffsetArrayOf<ChainRuleSet> OffsetArrayOf<ChainRuleSet>
ruleSet; /* Array of ChainRuleSet tables ruleSet; /* Array of ChainRuleSet tables
* ordered by Coverage Index */ * ordered by Coverage Index */
public:
DEFINE_SIZE_STATIC (6);
}; };
ASSERT_SIZE (ChainContextFormat1, 6);
struct ChainContextFormat2 struct ChainContextFormat2
{ {
@ -716,8 +721,9 @@ struct ChainContextFormat2
OffsetArrayOf<ChainRuleSet> OffsetArrayOf<ChainRuleSet>
ruleSet; /* Array of ChainRuleSet tables ruleSet; /* Array of ChainRuleSet tables
* ordered by class */ * ordered by class */
public:
DEFINE_SIZE_STATIC (12);
}; };
ASSERT_SIZE (ChainContextFormat2, 12);
struct ChainContextFormat3 struct ChainContextFormat3
{ {
@ -777,8 +783,9 @@ struct ChainContextFormat3
ArrayOf<LookupRecord> ArrayOf<LookupRecord>
lookupX; /* Array of LookupRecords--in lookupX; /* Array of LookupRecords--in
* design order) */ * design order) */
public:
DEFINE_SIZE_STATIC (10);
}; };
ASSERT_SIZE (ChainContextFormat3, 10);
struct ChainContext struct ChainContext
{ {
@ -835,8 +842,9 @@ struct ExtensionFormat1
* extension subtable). */ * extension subtable). */
ULONG extensionOffset; /* Offset to the extension subtable, ULONG extensionOffset; /* Offset to the extension subtable,
* of lookup type subtable. */ * of lookup type subtable. */
public:
DEFINE_SIZE_STATIC (8);
}; };
ASSERT_SIZE (ExtensionFormat1, 8);
struct Extension struct Extension
{ {
@ -929,8 +937,9 @@ struct GSUBGPOS
featureList; /* FeatureList table */ featureList; /* FeatureList table */
OffsetTo<LookupList> OffsetTo<LookupList>
lookupList; /* LookupList table */ lookupList; /* LookupList table */
public:
DEFINE_SIZE_STATIC (10);
}; };
ASSERT_SIZE (GSUBGPOS, 10);
#endif /* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH */ #endif /* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH */

View File

@ -83,8 +83,6 @@
/* Misc */ /* Misc */
#define ASSERT_SIZE(_type, _size) ASSERT_STATIC (sizeof (_type) == (_size))
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#define _HB_BOOLEAN_EXPR(expr) \ #define _HB_BOOLEAN_EXPR(expr) \