Use NNOffsetTo<>

This commit is contained in:
Behdad Esfahbod 2019-01-17 18:17:04 -05:00
parent 205d72a198
commit b1152d5e66
11 changed files with 24 additions and 24 deletions

View File

@ -64,7 +64,7 @@ struct ankr
unsigned int i,
unsigned int num_glyphs) const
{
const OffsetTo<GlyphAnchors, HBUINT16, false> *offset = (this+lookupTable).get_value (glyph_id, num_glyphs);
const NNOffsetTo<GlyphAnchors> *offset = (this+lookupTable).get_value (glyph_id, num_glyphs);
if (!offset)
return Null(Anchor);
const GlyphAnchors &anchors = &(this+anchorData) + *offset;
@ -82,9 +82,9 @@ struct ankr
protected:
HBUINT16 version; /* Version number (set to zero) */
HBUINT16 flags; /* Flags (currently unused; set to zero) */
LOffsetTo<Lookup<OffsetTo<GlyphAnchors, HBUINT16, false> > >
LOffsetTo<Lookup<NNOffsetTo<GlyphAnchors> > >
lookupTable; /* Offset to the table's lookup table */
LOffsetTo<HBUINT8, false>
LNNOffsetTo<HBUINT8>
anchorData; /* Offset to the glyph data table */
public:

View File

@ -66,7 +66,7 @@ struct TrackTableEntry
NameID trackNameID; /* The 'name' table index for this track.
* (a short word or phrase like "loose"
* or "very tight") */
OffsetTo<UnsizedArrayOf<FWORD>, HBUINT16, false>
NNOffsetTo<UnsizedArrayOf<FWORD> >
valuesZ; /* Offset from start of tracking table to
* per-size tracking values for this track. */

View File

@ -50,7 +50,7 @@ struct FTStringRange
}
protected:
OffsetTo<UnsizedArrayOf<HBUINT8>, HBUINT16, false>
NNOffsetTo<UnsizedArrayOf<HBUINT8> >
tag; /* Offset from the start of the table to
* the beginning of the string */
HBUINT16 length; /* String length (in bytes) */

View File

@ -298,7 +298,7 @@ struct ResourceRecord
HBINT16 nameOffset; /* Offset from beginning of resource name list
* to resource name, -1 means there is none. */
HBUINT8 attrs; /* Resource attributes */
OffsetTo<LArrayOf<HBUINT8>, HBUINT24, false>
NNOffsetTo<LArrayOf<HBUINT8>, HBUINT24>
offset; /* Offset from beginning of data block to
* data for this resource */
HBUINT32 reserved; /* Reserved for handle to resource */
@ -333,7 +333,7 @@ struct ResourceTypeRecord
protected:
Tag tag; /* Resource type. */
HBUINT16 resCountM1; /* Number of resources minus 1. */
OffsetTo<UnsizedArrayOf<ResourceRecord>, HBUINT16, false>
NNOffsetTo<UnsizedArrayOf<ResourceRecord> >
resourcesZ; /* Offset from beginning of resource type list
* to reference item list for this type. */
public:
@ -389,7 +389,7 @@ struct ResourceMap
HBUINT32 reserved1; /* Reserved for handle to next resource map */
HBUINT16 resreved2; /* Reserved for file reference number */
HBUINT16 attrs; /* Resource fork attribute */
OffsetTo<ArrayOfM1<ResourceTypeRecord>, HBUINT16, false>
NNOffsetTo<ArrayOfM1<ResourceTypeRecord> >
typeList; /* Offset from beginning of map to
* resource type list */
Offset16 nameList; /* Offset from beginning of map to
@ -421,10 +421,10 @@ struct ResourceForkHeader
}
protected:
LOffsetTo<UnsizedArrayOf<HBUINT8>, false>
LNNOffsetTo<UnsizedArrayOf<HBUINT8> >
data; /* Offset from beginning of resource fork
* to resource data */
LOffsetTo<ResourceMap, false>
LNNOffsetTo<ResourceMap >
map; /* Offset from beginning of resource fork
* to resource map */
HBUINT32 dataLen; /* Length of resource data */

View File

@ -552,9 +552,9 @@ struct cff2
}
public:
FixedVersion<HBUINT8> version; /* Version of CFF2 table. set to 0x0200u */
OffsetTo<TopDict, HBUINT8, false> topDict; /* headerSize = Offset to Top DICT. */
HBUINT16 topDictSize; /* Top DICT size */
FixedVersion<HBUINT8> version; /* Version of CFF2 table. set to 0x0200u */
NNOffsetTo<TopDict, HBUINT8> topDict; /* headerSize = Offset to Top DICT. */
HBUINT16 topDictSize; /* Top DICT size */
public:
DEFINE_SIZE_STATIC (5);

View File

@ -283,7 +283,7 @@ struct BitmapSizeTable
}
protected:
LOffsetTo<IndexSubtableArray, false>
LNNOffsetTo<IndexSubtableArray>
indexSubtableArrayOffset;
HBUINT32 indexTablesSize;
HBUINT32 numberOfIndexSubtables;

View File

@ -125,9 +125,9 @@ struct COLR
protected:
HBUINT16 version; /* Table version number (starts at 0). */
HBUINT16 numBaseGlyphs; /* Number of Base Glyph Records. */
LOffsetTo<SortedUnsizedArrayOf<BaseGlyphRecord>, false>
LNNOffsetTo<SortedUnsizedArrayOf<BaseGlyphRecord> >
baseGlyphsZ; /* Offset to Base Glyph records. */
LOffsetTo<UnsizedArrayOf<LayerRecord>, false>
LNNOffsetTo<UnsizedArrayOf<LayerRecord> >
layersZ; /* Offset to Layer Records. */
HBUINT16 numLayers; /* Number of Layer Records. */
public:

View File

@ -87,15 +87,15 @@ struct CPALV1Tail
}
protected:
LOffsetTo<UnsizedArrayOf<HBUINT32>, false>
LNNOffsetTo<UnsizedArrayOf<HBUINT32> >
paletteFlagsZ; /* Offset from the beginning of CPAL table to
* the Palette Type Array. Set to 0 if no array
* is provided. */
LOffsetTo<UnsizedArrayOf<NameID>, false>
LNNOffsetTo<UnsizedArrayOf<NameID> >
paletteLabelsZ; /* Offset from the beginning of CPAL table to
* the palette labels array. Set to 0 if no
* array is provided. */
LOffsetTo<UnsizedArrayOf<NameID>, false>
LNNOffsetTo<UnsizedArrayOf<NameID> >
colorLabelsZ; /* Offset from the beginning of CPAL table to
* the color labels array. Set to 0
* if no array is provided. */
@ -176,7 +176,7 @@ struct CPAL
HBUINT16 numPalettes; /* Number of palettes in the table. */
HBUINT16 numColorRecords; /* Total number of color records, combined for
* all palettes. */
LOffsetTo<UnsizedArrayOf<BGRAColor>, false>
LNNOffsetTo<UnsizedArrayOf<BGRAColor> >
colorRecordsZ; /* Offset from the beginning of CPAL table to
* the first ColorRecord. */
UnsizedArrayOf<HBUINT16>

View File

@ -62,7 +62,7 @@ struct SVGDocumentIndexEntry
* this index entry. */
HBUINT16 endGlyphID; /* The last glyph ID in the range described by
* this index entry. Must be >= startGlyphID. */
LOffsetTo<UnsizedArrayOf<HBUINT8>, false>
LNNOffsetTo<UnsizedArrayOf<HBUINT8> >
svgDoc; /* Offset from the beginning of the SVG Document Index
* to an SVG document. Must be non-zero. */
HBUINT32 svgDocLength; /* Length of the SVG document.

View File

@ -263,7 +263,7 @@ struct name
/* We only implement format 0 for now. */
HBUINT16 format; /* Format selector (=0/1). */
HBUINT16 count; /* Number of name records. */
OffsetTo<UnsizedArrayOf<HBUINT8>, HBUINT16, false>
NNOffsetTo<UnsizedArrayOf<HBUINT8> >
stringOffset; /* Offset to start of string storage (from start of table). */
UnsizedArrayOf<NameRecord>
nameRecordZ; /* The name records where count is the number of records. */

View File

@ -249,7 +249,7 @@ struct STAT
* in the 'fvar' table. In all fonts, must
* be greater than zero if axisValueCount
* is greater than zero. */
LOffsetTo<UnsizedArrayOf<StatAxisRecord>, false>
LNNOffsetTo<UnsizedArrayOf<StatAxisRecord> >
designAxesOffset;
/* Offset in bytes from the beginning of
* the STAT table to the start of the design
@ -257,7 +257,7 @@ struct STAT
* set to zero; if designAxisCount is greater
* than zero, must be greater than zero. */
HBUINT16 axisValueCount; /* The number of axis value tables. */
LOffsetTo<UnsizedArrayOf<OffsetTo<AxisValue> >, false>
LNNOffsetTo<UnsizedArrayOf<OffsetTo<AxisValue> > >
offsetToAxisValueOffsets;
/* Offset in bytes from the beginning of
* the STAT table to the start of the design