diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 0dfe0117b..1c771b098 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -685,6 +685,7 @@ struct Tag : HBUINT32 public: DEFINE_SIZE_STATIC (4); }; +DEFINE_NULL_DATA (OT, Tag, " "); /* Glyph index number, same as uint16 (length = 16 bits) */ typedef HBUINT16 GlyphID; @@ -696,6 +697,7 @@ typedef HBUINT16 NameID; struct Index : HBUINT16 { static const unsigned int NOT_FOUND_INDEX = 0xFFFFu; }; +DEFINE_NULL_DATA (OT, Index, "\xff\xff"); /* Offset, Null offset = 0 */ template diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 66e351106..763ea92f9 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -165,6 +165,7 @@ struct RangeRecord public: DEFINE_SIZE_STATIC (6); }; +DEFINE_NULL_DATA (OT, RangeRecord, "\000\001"); struct IndexArray : ArrayOf @@ -224,6 +225,7 @@ struct LangSys public: DEFINE_SIZE_ARRAY (6, featureIndex); }; +DEFINE_NULL_DATA (OT, LangSys, "\0\0\xFF\xFF"); struct Script @@ -245,16 +247,7 @@ struct Script { return langSys.find_index (tag, index); } inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; } - inline const LangSys& get_default_lang_sys (void) const - { - if (!defaultLangSys) - { - /* This is the ONLY place where our null data is not all zeros. - * So, return special data instead of using the null pool. */ - return *reinterpret_cast ("\0\0\xFF\xFF"); - } - return this+defaultLangSys; - } + inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } inline bool sanitize (hb_sanitize_context_t *c, const Record