From 211da5efdcaff203eafda2a5081cd81e3d6cc35b Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Wed, 11 Apr 2018 17:41:24 +0430 Subject: [PATCH] [aat] Cosmetic changes (#964) --- src/hb-aat-gcid-table.hh | 4 ++-- src/hb-aat-layout-ankr-table.hh | 11 ++++++----- src/hb-aat-layout-common-private.hh | 6 +++--- src/hb-aat-layout-kerx-table.hh | 29 +++++++++++++++-------------- src/hb-aat-layout-morx-table.hh | 6 +++--- src/hb-aat-layout-trak-table.hh | 10 +++++----- src/hb-aat-ltag-table.hh | 8 ++++---- 7 files changed, 38 insertions(+), 36 deletions(-) diff --git a/src/hb-aat-gcid-table.hh b/src/hb-aat-gcid-table.hh index 57fbbad..d0c45df 100644 --- a/src/hb-aat-gcid-table.hh +++ b/src/hb-aat-gcid-table.hh @@ -52,10 +52,10 @@ struct gcid HBUINT16 format; /* Data format (set to 0) */ HBUINT32 size; /* Size of the table, including header */ HBUINT16 registry; /* The registry ID */ - uint8_t registryName[64]; + HBUINT8 registryName[64]; /* The registry name in ASCII */ HBUINT16 order; /* The order ID */ - uint8_t orderName[64]; /* The order name in ASCII */ + HBUINT8 orderName[64]; /* The order name in ASCII */ HBUINT16 supplementVersion; /* The supplement version */ ArrayOf diff --git a/src/hb-aat-layout-ankr-table.hh b/src/hb-aat-layout-ankr-table.hh index d0453bd..b3ff925 100644 --- a/src/hb-aat-layout-ankr-table.hh +++ b/src/hb-aat-layout-ankr-table.hh @@ -64,11 +64,12 @@ struct ankr } protected: - HBUINT16 version; /* Version number (set to zero) */ - HBUINT16 flags; /* Flags (currently unused; set to zero) */ - LOffsetTo > lookupTable; /* Offset to the table's lookup table */ - LOffsetTo > - anchors; /* Offset to the glyph data table */ + HBUINT16 version; /* Version number (set to zero) */ + HBUINT16 flags; /* Flags (currently unused; set to zero) */ + LOffsetTo > + lookupTable; /* Offset to the table's lookup table */ + LOffsetTo > + anchors; /* Offset to the glyph data table */ public: DEFINE_SIZE_STATIC (12); diff --git a/src/hb-aat-layout-common-private.hh b/src/hb-aat-layout-common-private.hh index 454b141..f7a7b86 100644 --- a/src/hb-aat-layout-common-private.hh +++ b/src/hb-aat-layout-common-private.hh @@ -511,11 +511,11 @@ struct StateTable protected: HBUINT32 nClasses; /* Number of classes, which is the number of indices * in a single line in the state array. */ - OffsetTo, HBUINT32> + LOffsetTo > classTable; /* Offset to the class table. */ - OffsetTo, HBUINT32> + LOffsetTo > stateArrayTable;/* Offset to the state array. */ - OffsetTo >, HBUINT32> + LOffsetTo > > entryTable; /* Offset to the entry array. */ public: diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index d0624ec..bee102d 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -71,21 +71,22 @@ struct KerxSubTableFormat0 { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && - c->check_array (records, records[0].static_size, nPairs)); + recordsZ.sanitize (c, nPairs)); } protected: // TODO(ebraminio): A custom version of "BinSearchArrayOf pairs;" is // needed here to use HBUINT32 instead - HBUINT32 nPairs; /* The number of kerning pairs in this subtable */ - HBUINT32 searchRange; /* The largest power of two less than or equal to the value of nPairs, - * multiplied by the size in bytes of an entry in the subtable. */ - HBUINT32 entrySelector; /* This is calculated as log2 of the largest power of two less - * than or equal to the value of nPairs. */ - HBUINT32 rangeShift; /* The value of nPairs minus the largest power of two less than or equal to nPairs. */ - KerxFormat0Records records[VAR]; /* VAR=nPairs */ + HBUINT32 nPairs; /* The number of kerning pairs in this subtable */ + HBUINT32 searchRange; /* The largest power of two less than or equal to the value of nPairs, + * multiplied by the size in bytes of an entry in the subtable. */ + HBUINT32 entrySelector; /* This is calculated as log2 of the largest power of two less + * than or equal to the value of nPairs. */ + HBUINT32 rangeShift; /* The value of nPairs minus the largest power of two less than or equal to nPairs. */ + UnsizedArrayOf + recordsZ; /* VAR=nPairs */ public: - DEFINE_SIZE_ARRAY (16, records); + DEFINE_SIZE_ARRAY (16, recordsZ); }; struct KerxSubTableFormat1 @@ -94,7 +95,7 @@ struct KerxSubTableFormat1 { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && - stateHeader.sanitize (c)); + stateHeader.sanitize (c)); } protected: @@ -196,10 +197,10 @@ struct KerxSubTableFormat6 { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && - rowIndexTable.sanitize (c, this) && - columnIndexTable.sanitize (c, this) && - kerningArray.sanitize (c, this) && - kerningVector.sanitize (c, this)); + rowIndexTable.sanitize (c, this) && + columnIndexTable.sanitize (c, this) && + kerningArray.sanitize (c, this) && + kerningVector.sanitize (c, this)); } protected: diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index 2ec2589..54255de 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -462,11 +462,11 @@ struct LigatureSubtable protected: StateTable machine; - OffsetTo, HBUINT32> + LOffsetTo > ligAction; /* Offset to the ligature action table. */ - OffsetTo, HBUINT32> + LOffsetTo > component; /* Offset to the component table. */ - OffsetTo, HBUINT32> + LOffsetTo > ligature; /* Offset to the actual ligature lists. */ public: DEFINE_SIZE_STATIC (28); diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index ab74373..d720b0c 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -122,12 +122,12 @@ struct TrackData } protected: - HBUINT16 nTracks; /* Number of separate tracks included in this table. */ - HBUINT16 nSizes; /* Number of point sizes included in this table. */ - LOffsetTo > /* Offset to array[nSizes] of size values. */ - sizeTable; + HBUINT16 nTracks; /* Number of separate tracks included in this table. */ + HBUINT16 nSizes; /* Number of point sizes included in this table. */ + LOffsetTo > + sizeTable; /* Offset to array[nSizes] of size values. */ UnsizedArrayOf - trackTable; /* Array[nTracks] of TrackTableEntry records. */ + trackTable; /* Array[nTracks] of TrackTableEntry records. */ public: DEFINE_SIZE_ARRAY (8, trackTable); diff --git a/src/hb-aat-ltag-table.hh b/src/hb-aat-ltag-table.hh index 61f69bc..2fd59b6 100644 --- a/src/hb-aat-ltag-table.hh +++ b/src/hb-aat-ltag-table.hh @@ -37,14 +37,14 @@ struct FTStringRange inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && tag (base).sanitize (c, length)); + return_trace (c->check_struct (this) && (base+tag).sanitize (c, length)); } protected: OffsetTo > - tag; /* Offset from the start of the table to - * the beginning of the string */ - HBUINT16 length; /* String length (in bytes) */ + tag; /* Offset from the start of the table to + * the beginning of the string */ + HBUINT16 length; /* String length (in bytes) */ public: DEFINE_SIZE_STATIC (4); }; -- 2.7.4