Further cleanup of sizeof
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 45ed801..c6c9811 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -120,7 +120,7 @@
/* Generic template for nul-content sizeof-sized Null objects. */
template <typename Type>
static inline const Type& Null () {
- ASSERT_STATIC (sizeof (Type) <= sizeof (_NullPool));
+ ASSERT_STATIC (Type::min_size <= sizeof (_NullPool));
return *CastP<Type> (_NullPool);
}
@@ -673,7 +673,10 @@
}
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 094f3a8..324b7bd 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -439,6 +439,8 @@
CoverageFormat1 format1[VAR];
CoverageFormat2 format2[VAR];
} u;
+ public:
+ DEFINE_SIZE_MIN (2);
};
@@ -559,6 +561,8 @@
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 20d6b92..456efca 100644
--- a/src/hb-ot-layout-gdef-private.hh
+++ b/src/hb-ot-layout-gdef-private.hh
@@ -195,6 +195,8 @@
CaretValueFormat2 format2[VAR];
CaretValueFormat3 format3[VAR];
} u;
+ public:
+ DEFINE_SIZE_MIN (2);
};
struct LigGlyph
@@ -309,6 +311,8 @@
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 c890585..a84210a 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -335,6 +335,8 @@
AnchorFormat2 format2[VAR];
AnchorFormat3 format3[VAR];
} u;
+ public:
+ DEFINE_SIZE_MIN (2);
};
@@ -460,7 +462,7 @@
* 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 @@
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 @@
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 @@
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 da32cb1..c562dea 100644
--- a/src/hb-ot-layout-gsub-private.hh
+++ b/src/hb-ot-layout-gsub-private.hh
@@ -443,7 +443,7 @@
* with the second component--ordered
* in writing direction */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, GlyphID);
};
struct LigatureSet
@@ -758,6 +758,8 @@
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 cc04de0..92521c5 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -330,6 +330,8 @@
OffsetArrayOf<Rule>
rule; /* Array of Rule tables
* ordered by preference */
+ public:
+ DEFINE_SIZE_VAR (2, OffsetTo<Rule>);
};