Cleanup DEFINE_SIZE_VAR2
This commit is contained in:
parent
33afa4e2dc
commit
596e471aa5
|
@ -81,13 +81,13 @@ inline Type& StructAfter(TObject &X)
|
|||
* Size checking
|
||||
*/
|
||||
|
||||
#define _DEFINE_SIZE_ASSERTION(_compare) \
|
||||
#define _DEFINE_SIZE_ASSERTION(_assertion) \
|
||||
inline void _size_assertion (void) const \
|
||||
{ ASSERT_STATIC ((sizeof (*this)) _compare); }
|
||||
{ ASSERT_STATIC (_assertion); }
|
||||
|
||||
|
||||
#define DEFINE_SIZE_STATIC(size) \
|
||||
_DEFINE_SIZE_ASSERTION (== (size)); \
|
||||
_DEFINE_SIZE_ASSERTION (sizeof (*this) == (size)); \
|
||||
static const unsigned int static_size = (size); \
|
||||
static const unsigned int min_size = (size)
|
||||
|
||||
|
@ -95,16 +95,20 @@ inline Type& StructAfter(TObject &X)
|
|||
#define VAR 1
|
||||
#define VAR0 (VAR+0)
|
||||
|
||||
#define DEFINE_SIZE_UNION(size, _member) \
|
||||
_DEFINE_SIZE_ASSERTION (this->u._member.static_size == (size)); \
|
||||
static const unsigned int min_size = (size)
|
||||
|
||||
#define DEFINE_SIZE_MIN(size) \
|
||||
_DEFINE_SIZE_ASSERTION (>= (size)); \
|
||||
_DEFINE_SIZE_ASSERTION (sizeof (*this) >= (size)); \
|
||||
static const unsigned int min_size = (size)
|
||||
|
||||
#define DEFINE_SIZE_VAR(size, _var_type) \
|
||||
_DEFINE_SIZE_ASSERTION (== (size) + VAR0 * sizeof (_var_type)); \
|
||||
_DEFINE_SIZE_ASSERTION (sizeof (*this) == (size) + VAR0 * sizeof (_var_type)); \
|
||||
static const unsigned int min_size = (size)
|
||||
|
||||
#define DEFINE_SIZE_VAR2(size, _var_type1, _var_type2) \
|
||||
_DEFINE_SIZE_ASSERTION (== (size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2)); \
|
||||
#define DEFINE_SIZE_VAR2(size, array1, array2) \
|
||||
_DEFINE_SIZE_ASSERTION (sizeof (*this) == (size) + this->array1[0].static_size + this->array2[0].static_size); \
|
||||
static const unsigned int min_size = (size)
|
||||
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ struct Lookup
|
|||
* structure. This field is only present if bit
|
||||
* UseMarkFilteringSet of lookup flags is set. */
|
||||
public:
|
||||
DEFINE_SIZE_VAR2 (6, Offset, USHORT);
|
||||
DEFINE_SIZE_VAR2 (6, subTable, markFilteringSetX);
|
||||
};
|
||||
|
||||
typedef OffsetListOf<Lookup> LookupList;
|
||||
|
@ -440,7 +440,7 @@ struct Coverage
|
|||
CoverageFormat2 format2[VAR];
|
||||
} u;
|
||||
public:
|
||||
DEFINE_SIZE_MIN (2);
|
||||
DEFINE_SIZE_UNION (2, format);
|
||||
};
|
||||
|
||||
|
||||
|
@ -562,7 +562,7 @@ struct ClassDef
|
|||
ClassDefFormat2 format2[VAR];
|
||||
} u;
|
||||
public:
|
||||
DEFINE_SIZE_MIN (2);
|
||||
DEFINE_SIZE_UNION (2, format);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ struct CaretValue
|
|||
CaretValueFormat3 format3[VAR];
|
||||
} u;
|
||||
public:
|
||||
DEFINE_SIZE_MIN (2);
|
||||
DEFINE_SIZE_UNION (2, format);
|
||||
};
|
||||
|
||||
struct LigGlyph
|
||||
|
@ -312,7 +312,7 @@ struct MarkGlyphSets
|
|||
MarkGlyphSetsFormat1 format1[VAR];
|
||||
} u;
|
||||
public:
|
||||
DEFINE_SIZE_MIN (2);
|
||||
DEFINE_SIZE_UNION (2, format);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -336,7 +336,7 @@ struct Anchor
|
|||
AnchorFormat3 format3[VAR];
|
||||
} u;
|
||||
public:
|
||||
DEFINE_SIZE_MIN (2);
|
||||
DEFINE_SIZE_UNION (2, format);
|
||||
};
|
||||
|
||||
|
||||
|
@ -1490,7 +1490,7 @@ struct PosLookupSubTable
|
|||
ExtensionPos extension[VAR];
|
||||
} u;
|
||||
public:
|
||||
DEFINE_SIZE_MIN (2);
|
||||
DEFINE_SIZE_UNION (2, format);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -759,7 +759,7 @@ struct SubstLookupSubTable
|
|||
ReverseChainSingleSubst reverseChainContextSingle[VAR];
|
||||
} u;
|
||||
public:
|
||||
DEFINE_SIZE_MIN (2);
|
||||
DEFINE_SIZE_UNION (2, format);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ struct Rule
|
|||
LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in
|
||||
* design order */
|
||||
public:
|
||||
DEFINE_SIZE_VAR2 (4, USHORT, LookupRecord);
|
||||
DEFINE_SIZE_VAR2 (4, input, lookupRecordX);
|
||||
};
|
||||
|
||||
struct RuleSet
|
||||
|
@ -467,7 +467,7 @@ struct ContextFormat3
|
|||
LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in
|
||||
* design order */
|
||||
public:
|
||||
DEFINE_SIZE_VAR2 (6, OffsetTo<Coverage>, LookupRecord);
|
||||
DEFINE_SIZE_VAR2 (6, coverage, lookupRecordX);
|
||||
};
|
||||
|
||||
struct Context
|
||||
|
|
Loading…
Reference in New Issue