Make data members of various OpenType structs protected instead of private
Should fix warnings generated when building with -Wunused-private-field.
Based on patch from Jonathan Kew.
diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh
index ce18580..e2d4a2c 100644
--- a/src/hb-open-file-private.hh
+++ b/src/hb-open-file-private.hh
@@ -105,7 +105,7 @@
return TRACE_RETURN (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables));
}
- private:
+ protected:
Tag sfnt_version; /* '\0\001\0\00' if TrueType / 'OTTO' if CFF */
USHORT numTables; /* Number of tables. */
USHORT searchRange; /* (Maximum power of 2 <= numTables) x 16 */
@@ -133,7 +133,7 @@
return TRACE_RETURN (table.sanitize (c, this));
}
- private:
+ protected:
Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */
FixedVersion version; /* Version of the TTC Header (1.0),
* 0x00010000 */
@@ -177,7 +177,7 @@
}
}
- private:
+ protected:
union {
struct {
Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */
@@ -242,7 +242,7 @@
}
}
- private:
+ protected:
union {
Tag tag; /* 4-byte identifier. */
OpenTypeFontFace fontFace;
diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh
index 32d64ca..bf2d245 100644
--- a/src/hb-ot-head-table.hh
+++ b/src/hb-ot-head-table.hh
@@ -54,7 +54,7 @@
return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1));
}
- private:
+ protected:
FixedVersion version; /* Version of the head table--currently
* 0x00010000 for version 1.0. */
FixedVersion fontRevision; /* Set by font manufacturer. */
diff --git a/src/hb-ot-hhea-table.hh b/src/hb-ot-hhea-table.hh
index 2eea05a..24f8bdc 100644
--- a/src/hb-ot-hhea-table.hh
+++ b/src/hb-ot-hhea-table.hh
@@ -47,7 +47,7 @@
return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1));
}
- private:
+ protected:
FixedVersion version; /* 0x00010000 for version 1.0. */
FWORD ascender; /* Typographic ascent. <a
* href="http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html">
diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh
index 35cfb48..cc7cfbb 100644
--- a/src/hb-ot-hmtx-table.hh
+++ b/src/hb-ot-hmtx-table.hh
@@ -57,7 +57,7 @@
return TRACE_RETURN (true);
}
- private:
+ protected:
LongHorMetric longHorMetric[VAR]; /* Paired advance width and left side
* bearing values for each glyph. The
* value numOfHMetrics comes from
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index a990b15..c7e458f 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -231,7 +231,7 @@
return TRACE_RETURN (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this));
}
- private:
+ protected:
OffsetTo<LangSys>
defaultLangSys; /* Offset to DefaultLangSys table--from
* beginning of Script table--may be Null */
@@ -379,7 +379,7 @@
unsigned int i;
};
- private:
+ protected:
USHORT coverageFormat; /* Format identifier--format = 1 */
SortedArrayOf<GlyphID>
glyphArray; /* Array of GlyphIDs--in numerical order */
@@ -454,7 +454,7 @@
unsigned int i, j, coverage;
};
- private:
+ protected:
USHORT coverageFormat; /* Format identifier--format = 2 */
SortedArrayOf<RangeRecord>
rangeRecord; /* Array of glyph ranges--ordered by
@@ -560,7 +560,7 @@
} u;
};
- private:
+ protected:
union {
USHORT format; /* Format identifier */
CoverageFormat1 format1;
@@ -600,6 +600,7 @@
return false;
}
+ protected:
USHORT classFormat; /* Format identifier--format = 1 */
GlyphID startGlyph; /* First GlyphID of the classValueArray */
ArrayOf<USHORT>
@@ -634,6 +635,7 @@
return false;
}
+ protected:
USHORT classFormat; /* Format identifier--format = 2 */
SortedArrayOf<RangeRecord>
rangeRecord; /* Array of glyph ranges--ordered by
@@ -673,7 +675,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
ClassDefFormat1 format1;
@@ -744,7 +746,7 @@
return TRACE_RETURN (c->check_struct (this) && c->check_range (this, this->get_size ()));
}
- private:
+ protected:
USHORT startSize; /* Smallest size to correct--in ppem */
USHORT endSize; /* Largest size to correct--in ppem */
USHORT deltaFormat; /* Format of DeltaValue array data: 1, 2, or 3
diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh
index f29fc14..54149d7 100644
--- a/src/hb-ot-layout-gdef-table.hh
+++ b/src/hb-ot-layout-gdef-table.hh
@@ -74,7 +74,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && attachPoint.sanitize (c, this));
}
- private:
+ protected:
OffsetTo<Coverage>
coverage; /* Offset to Coverage table -- from
* beginning of AttachList table */
@@ -104,7 +104,7 @@
return TRACE_RETURN (c->check_struct (this));
}
- private:
+ protected:
USHORT caretValueFormat; /* Format identifier--format = 1 */
SHORT coordinate; /* X or Y value, in design units */
public:
@@ -130,7 +130,7 @@
return TRACE_RETURN (c->check_struct (this));
}
- private:
+ protected:
USHORT caretValueFormat; /* Format identifier--format = 2 */
USHORT caretValuePoint; /* Contour point index on glyph */
public:
@@ -153,7 +153,7 @@
return TRACE_RETURN (c->check_struct (this) && deviceTable.sanitize (c, this));
}
- private:
+ protected:
USHORT caretValueFormat; /* Format identifier--format = 3 */
SHORT coordinate; /* X or Y value, in design units */
OffsetTo<Device>
@@ -187,7 +187,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
CaretValueFormat1 format1;
@@ -222,7 +222,7 @@
return TRACE_RETURN (carets.sanitize (c, this));
}
- private:
+ protected:
OffsetArrayOf<CaretValue>
carets; /* Offset array of CaretValue tables
* --from beginning of LigGlyph table
@@ -256,7 +256,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && ligGlyph.sanitize (c, this));
}
- private:
+ protected:
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of LigCaretList table */
@@ -278,7 +278,7 @@
return TRACE_RETURN (coverage.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
LongOffsetArrayOf<Coverage>
coverage; /* Array of long offsets to mark set
@@ -306,7 +306,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
MarkGlyphSetsFormat1 format1;
@@ -392,7 +392,7 @@
}
- private:
+ protected:
FixedVersion version; /* Version of the GDEF table--currently
* 0x00010002 */
OffsetTo<ClassDef>
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index 9eadbd6..e95aa3e 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -225,7 +225,7 @@
return TRACE_RETURN (c->check_struct (this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
SHORT xCoordinate; /* Horizontal value--in design units */
SHORT yCoordinate; /* Vertical value--in design units */
@@ -257,7 +257,7 @@
return TRACE_RETURN (c->check_struct (this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 2 */
SHORT xCoordinate; /* Horizontal value--in design units */
SHORT yCoordinate; /* Vertical value--in design units */
@@ -288,7 +288,7 @@
return TRACE_RETURN (c->check_struct (this) && xDeviceTable.sanitize (c, this) && yDeviceTable.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 3 */
SHORT xCoordinate; /* Horizontal value--in design units */
SHORT yCoordinate; /* Vertical value--in design units */
@@ -329,7 +329,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
AnchorFormat1 format1;
@@ -360,7 +360,7 @@
}
USHORT rows; /* Number of rows */
- private:
+ protected:
OffsetTo<Anchor>
matrix[VAR]; /* Matrix of offsets to Anchor tables--
* from beginning of AnchorMatrix table */
@@ -378,7 +378,7 @@
return TRACE_RETURN (c->check_struct (this) && markAnchor.sanitize (c, base));
}
- private:
+ protected:
USHORT klass; /* Class defined for this mark */
OffsetTo<Anchor>
markAnchor; /* Offset to Anchor table--from
@@ -447,7 +447,7 @@
return TRACE_RETURN (c->check_struct (this) && coverage.sanitize (c, this) && valueFormat.sanitize_value (c, this, values));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -487,7 +487,7 @@
return TRACE_RETURN (c->check_struct (this) && coverage.sanitize (c, this) && valueFormat.sanitize_values (c, this, values, valueCount));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -526,7 +526,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
SinglePosFormat1 format1;
@@ -539,7 +539,7 @@
{
friend struct PairSet;
- private:
+ protected:
GlyphID secondGlyph; /* GlyphID of second glyph in the
* pair--first glyph is listed in the
* Coverage table */
@@ -601,7 +601,7 @@
&& closure->valueFormats[1].sanitize_values_stride_unsafe (c, closure->base, &record->values[closure->len1], count, closure->stride));
}
- private:
+ protected:
USHORT len; /* Number of PairValueRecords */
USHORT array[VAR]; /* Array of PairValueRecords--ordered
* by GlyphID of the second glyph */
@@ -643,7 +643,7 @@
return TRACE_RETURN (c->check_struct (this) && coverage.sanitize (c, this) && pairSet.sanitize (c, this, &closure));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -715,7 +715,7 @@
valueFormat2.sanitize_values_stride_unsafe (c, this, &values[len1], count, stride));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -770,7 +770,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
PairPosFormat1 format1;
@@ -788,7 +788,7 @@
return TRACE_RETURN (entryAnchor.sanitize (c, base) && exitAnchor.sanitize (c, base));
}
- private:
+ protected:
OffsetTo<Anchor>
entryAnchor; /* Offset to EntryAnchor table--from
* beginning of CursivePos
@@ -893,7 +893,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -928,7 +928,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
CursivePosFormat1 format1;
@@ -977,7 +977,7 @@
markArray.sanitize (c, this) && baseArray.sanitize (c, this, (unsigned int) classCount));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
markCoverage; /* Offset to MarkCoverage table--from
@@ -1019,7 +1019,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
MarkBasePosFormat1 format1;
@@ -1092,7 +1092,7 @@
markArray.sanitize (c, this) && ligatureArray.sanitize (c, this, (unsigned int) classCount));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
markCoverage; /* Offset to Mark Coverage table--from
@@ -1135,7 +1135,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
MarkLigPosFormat1 format1;
@@ -1189,7 +1189,7 @@
&& mark2Array.sanitize (c, this, (unsigned int) classCount));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
mark1Coverage; /* Offset to Combining Mark1 Coverage
@@ -1233,7 +1233,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
MarkMarkPosFormat1 format1;
@@ -1359,7 +1359,7 @@
}
}
- private:
+ protected:
union {
struct {
USHORT sub_format;
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 007d21c..600a92a 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -75,7 +75,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && deltaGlyphID.sanitize (c));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -127,7 +127,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && substitute.sanitize (c));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -184,7 +184,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
SingleSubstFormat1 format1;
@@ -229,7 +229,7 @@
return TRACE_RETURN (substitute.sanitize (c));
}
- private:
+ protected:
ArrayOf<GlyphID>
substitute; /* String of GlyphIDs to substitute */
public:
@@ -272,7 +272,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && sequence.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -325,7 +325,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
MultipleSubstFormat1 format1;
@@ -394,7 +394,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && alternateSet.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -447,7 +447,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
AlternateSubstFormat1 format1;
@@ -544,7 +544,7 @@
return TRACE_RETURN (ligGlyph.sanitize (c) && component.sanitize (c));
}
- private:
+ protected:
GlyphID ligGlyph; /* GlyphID of ligature to substitute */
HeadlessArrayOf<GlyphID>
component; /* Array of component GlyphIDs--start
@@ -599,7 +599,7 @@
return TRACE_RETURN (ligature.sanitize (c, this));
}
- private:
+ protected:
OffsetArrayOf<Ligature>
ligature; /* Array LigatureSet tables
* ordered by preference */
@@ -647,7 +647,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && ligatureSet.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -700,7 +700,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
LigatureSubstFormat1 format1;
@@ -844,7 +844,7 @@
return TRACE_RETURN (substitute.sanitize (c));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -897,7 +897,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
ReverseChainSingleSubstFormat1 format1;
@@ -1013,7 +1013,7 @@
}
}
- private:
+ protected:
union {
struct {
USHORT sub_format;
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index d50c653..14d36b0 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -167,7 +167,7 @@
}
unsigned int idx;
- private:
+ protected:
hb_apply_context_t *c;
unsigned int num_items;
hb_mask_t mask;
@@ -216,7 +216,7 @@
}
unsigned int idx;
- private:
+ protected:
hb_apply_context_t *c;
unsigned int num_items;
hb_mask_t mask;
@@ -588,7 +588,7 @@
+ lookupRecordX[0].static_size * lookupCount);
}
- private:
+ protected:
USHORT inputCount; /* Total number of glyphs in input
* glyph sequence--includes the first
* glyph */
@@ -640,7 +640,7 @@
return TRACE_RETURN (rule.sanitize (c, this));
}
- private:
+ protected:
OffsetArrayOf<Rule>
rule; /* Array of Rule tables
* ordered by preference */
@@ -709,7 +709,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -786,7 +786,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -864,7 +864,7 @@
return TRACE_RETURN (c->check_array (lookupRecord, lookupRecord[0].static_size, lookupCount));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 3 */
USHORT glyphCount; /* Number of glyphs in the input glyph
* sequence */
@@ -925,7 +925,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
ContextFormat1 format1;
@@ -1079,7 +1079,7 @@
return TRACE_RETURN (lookup.sanitize (c));
}
- private:
+ protected:
ArrayOf<USHORT>
backtrack; /* Array of backtracking values
* (to be matched before the input
@@ -1134,7 +1134,7 @@
return TRACE_RETURN (rule.sanitize (c, this));
}
- private:
+ protected:
OffsetArrayOf<ChainRule>
rule; /* Array of ChainRule tables
* ordered by preference */
@@ -1199,7 +1199,7 @@
return TRACE_RETURN (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -1287,7 +1287,7 @@
ruleSet.sanitize (c, this));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
@@ -1392,7 +1392,7 @@
return TRACE_RETURN (lookup.sanitize (c));
}
- private:
+ protected:
USHORT format; /* Format identifier--format = 3 */
OffsetArrayOf<Coverage>
backtrack; /* Array of coverage tables
@@ -1460,7 +1460,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
ChainContextFormat1 format1;
@@ -1483,7 +1483,7 @@
return TRACE_RETURN (c->check_struct (this));
}
- private:
+ protected:
USHORT format; /* Format identifier. Set to 1. */
USHORT extensionLookupType; /* Lookup type of subtable referenced
* by ExtensionOffset (i.e. the
@@ -1520,7 +1520,7 @@
}
}
- private:
+ protected:
union {
USHORT format; /* Format identifier */
ExtensionFormat1 format1;
diff --git a/src/hb-ot-maxp-table.hh b/src/hb-ot-maxp-table.hh
index e270490..c2c90d1 100644
--- a/src/hb-ot-maxp-table.hh
+++ b/src/hb-ot-maxp-table.hh
@@ -52,7 +52,7 @@
}
/* We only implement version 0.5 as none of the extra fields in version 1.0 are useful. */
- private:
+ protected:
FixedVersion version; /* Version of the maxp table (0.5 or 1.0),
* 0x00005000 or 0x00010000. */
USHORT numGlyphs; /* The number of glyphs in the font. */
diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh
index 9077c8c..e0d2e89 100644
--- a/src/hb-ot-name-table.hh
+++ b/src/hb-ot-name-table.hh
@@ -114,7 +114,7 @@
}
/* We only implement format 0 for now. */
- private:
+ protected:
USHORT format; /* Format selector (=0/1). */
USHORT count; /* Number of name records. */
Offset stringOffset; /* Offset to start of string storage (from start of table). */