[os2] Replace null pool addr compare by checking vital fields (#1896)

This commit is contained in:
Ebrahim Byagowi 2019-08-10 01:26:55 +04:30 committed by GitHub
parent 1f926fb2b6
commit 8762676e34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ struct OS2V1Tail
struct OS2V2Tail struct OS2V2Tail
{ {
bool has_data () const { return this != &Null (OS2V2Tail); } bool has_data () const { return sxHeight || sCapHeight; }
const OS2V2Tail * operator -> () const { return this; } const OS2V2Tail * operator -> () const { return this; }
@ -115,7 +115,7 @@ struct OS2
{ {
static constexpr hb_tag_t tableTag = HB_OT_TAG_OS2; static constexpr hb_tag_t tableTag = HB_OT_TAG_OS2;
bool has_data () const { return this != &Null (OS2); } bool has_data () const { return usWeightClass || usWidthClass || usFirstCharIndex || usLastCharIndex; }
const OS2V1Tail &v1 () const { return version >= 1 ? v1X : Null (OS2V1Tail); } const OS2V1Tail &v1 () const { return version >= 1 ? v1X : Null (OS2V1Tail); }
const OS2V2Tail &v2 () const { return version >= 2 ? v2X : Null (OS2V2Tail); } const OS2V2Tail &v2 () const { return version >= 2 ? v2X : Null (OS2V2Tail); }