[HarfBuzz] harfbuzz-ng: Branch 'master' - 11 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Tue May 4 12:30:00 PDT 2010
src/hb-open-file-private.hh | 6 +-
src/hb-open-type-private.hh | 47 ++++++++++++-----------
src/hb-ot-layout-common-private.hh | 6 +-
src/hb-ot-layout-gdef-private.hh | 24 ++++++-----
src/hb-ot-layout-gpos-private.hh | 71 ++++++++++++++++++++++-------------
src/hb-ot-layout-gsub-private.hh | 28 ++++++++-----
src/hb-ot-layout-gsubgpos-private.hh | 37 ++++++++++--------
src/main.cc | 6 ++
8 files changed, 136 insertions(+), 89 deletions(-)
New commits:
commit bb029af943faa9905e652d58856998687e60c31d
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 15:28:52 2010 -0400
Remove SANITIZE_THIS
diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh
index e09bd80..547cef0 100644
--- a/src/hb-open-file-private.hh
+++ b/src/hb-open-file-private.hh
@@ -126,7 +126,7 @@ struct TTCHeaderVersion1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (table);
+ return SANITIZE_WITH_BASE (this, table);
}
private:
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 82f92c1..75a539b 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -229,8 +229,7 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define SANITIZE(X) likely ((X).sanitize (SANITIZE_ARG))
-#define SANITIZE_THIS(X) likely ((X).sanitize (SANITIZE_ARG, CharP(this)))
-#define SANITIZE_WITH_BASE(B,X) likely ((X).sanitize (SANITIZE_ARG, (B)))
+#define SANITIZE_WITH_BASE(B,X) likely ((X).sanitize (SANITIZE_ARG, CharP(B)))
#define SANITIZE_SELF() SANITIZE_MEM(this, sizeof (*this))
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index 1b3e278..2c1c988 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -203,8 +203,8 @@ struct Script
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (defaultLangSys)
- && SANITIZE_THIS (langSys);
+ return SANITIZE_WITH_BASE (this, defaultLangSys)
+ && SANITIZE_WITH_BASE (this, langSys);
}
private:
diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh
index e5d092e..da49fac 100644
--- a/src/hb-ot-layout-gdef-private.hh
+++ b/src/hb-ot-layout-gdef-private.hh
@@ -69,8 +69,8 @@ struct AttachList
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (attachPoint);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, attachPoint);
}
private:
@@ -148,7 +148,8 @@ struct CaretValueFormat3
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_THIS (deviceTable);
+ return SANITIZE_SELF ()
+ && SANITIZE_WITH_BASE (this, deviceTable);
}
private:
@@ -213,7 +214,7 @@ struct LigGlyph
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (carets);
+ return SANITIZE_WITH_BASE (this, carets);
}
private:
@@ -245,8 +246,8 @@ struct LigCaretList
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (ligGlyph);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, ligGlyph);
}
private:
@@ -267,7 +268,7 @@ struct MarkGlyphSetsFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage);
+ return SANITIZE_WITH_BASE (this, coverage);
}
private:
@@ -350,10 +351,12 @@ struct GDEF
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE (version) && likely (version.major == 1) &&
- SANITIZE_THIS (glyphClassDef) && SANITIZE_THIS (attachList) &&
- SANITIZE_THIS (ligCaretList) && SANITIZE_THIS (markAttachClassDef) &&
- (version < 0x00010002 || SANITIZE_THIS (markGlyphSetsDef[0]));
+ return SANITIZE (version) && likely (version.major == 1)
+ && SANITIZE_WITH_BASE (this, glyphClassDef)
+ && SANITIZE_WITH_BASE (this, attachList)
+ && SANITIZE_WITH_BASE (this, ligCaretList)
+ && SANITIZE_WITH_BASE (this, markAttachClassDef)
+ && (version < 0x00010002 || SANITIZE_WITH_BASE (this, markGlyphSetsDef[0]));
}
private:
diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh
index 36345cb..5f38751 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -271,8 +271,8 @@ struct AnchorFormat3
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
return SANITIZE_SELF ()
- && SANITIZE_THIS (xDeviceTable)
- && SANITIZE_THIS (yDeviceTable);
+ && SANITIZE_WITH_BASE (this, xDeviceTable)
+ && SANITIZE_WITH_BASE (this, yDeviceTable);
}
private:
@@ -339,7 +339,7 @@ struct AnchorMatrix
unsigned int count = rows * cols;
if (!SANITIZE_ARRAY (matrix, matrix[0].get_size (), count)) return false;
for (unsigned int i = 0; i < count; i++)
- if (!SANITIZE_THIS (matrix[i])) return false;
+ if (!SANITIZE_WITH_BASE (this, matrix[i])) return false;
return true;
}
@@ -404,7 +404,7 @@ struct MarkArray
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (markRecord);
+ return SANITIZE_WITH_BASE (this, markRecord);
}
private:
@@ -436,8 +436,9 @@ struct SinglePosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
- valueFormat.sanitize_value (SANITIZE_ARG, CharP(this), values);
+ return SANITIZE_SELF ()
+ && SANITIZE_WITH_BASE (this, coverage)
+ && valueFormat.sanitize_value (SANITIZE_ARG, CharP(this), values);
}
private:
@@ -478,8 +479,9 @@ struct SinglePosFormat2
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
- valueFormat.sanitize_values (SANITIZE_ARG, CharP(this), values, valueCount);
+ return SANITIZE_SELF ()
+ && SANITIZE_WITH_BASE (this, coverage)
+ && valueFormat.sanitize_values (SANITIZE_ARG, CharP(this), values, valueCount);
}
private:
@@ -616,8 +618,9 @@ struct PairPosFormat1
unsigned int len1 = valueFormat1.get_len ();
unsigned int len2 = valueFormat2.get_len ();
- if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
- likely (pairSet.sanitize (SANITIZE_ARG, CharP(this), len1 + len2)))) return false;
+ if (!(SANITIZE_SELF ()
+ && SANITIZE_WITH_BASE (this, coverage)
+ && likely (pairSet.sanitize (SANITIZE_ARG, CharP(this), len1 + len2)))) return false;
if (!(valueFormat1.has_device () || valueFormat2.has_device ())) return true;
@@ -700,8 +703,10 @@ struct PairPosFormat2
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
- SANITIZE_THIS (classDef1) && SANITIZE_THIS (classDef2))) return false;
+ if (!(SANITIZE_SELF ()
+ && SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, classDef1)
+ && SANITIZE_WITH_BASE (this, classDef2))) return false;
unsigned int len1 = valueFormat1.get_len ();
unsigned int len2 = valueFormat2.get_len ();
@@ -979,8 +984,8 @@ struct CursivePosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (entryExitRecord);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, entryExitRecord);
}
private:
@@ -1068,9 +1073,9 @@ struct MarkBasePosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
return SANITIZE_SELF ()
- && SANITIZE_THIS (markCoverage)
- && SANITIZE_THIS (baseCoverage)
- && SANITIZE_THIS (markArray)
+ && SANITIZE_WITH_BASE (this, markCoverage)
+ && SANITIZE_WITH_BASE (this, baseCoverage)
+ && SANITIZE_WITH_BASE (this, markArray)
&& likely (baseArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
}
@@ -1192,9 +1197,9 @@ struct MarkLigPosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
return SANITIZE_SELF ()
- && SANITIZE_THIS (markCoverage)
- && SANITIZE_THIS (ligatureCoverage)
- && SANITIZE_THIS (markArray)
+ && SANITIZE_WITH_BASE (this, markCoverage)
+ && SANITIZE_WITH_BASE (this, ligatureCoverage)
+ && SANITIZE_WITH_BASE (this, markArray)
&& likely (ligatureArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
}
@@ -1295,9 +1300,9 @@ struct MarkMarkPosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
return SANITIZE_SELF ()
- && SANITIZE_THIS (mark1Coverage)
- && SANITIZE_THIS (mark2Coverage)
- && SANITIZE_THIS (mark1Array)
+ && SANITIZE_WITH_BASE (this, mark1Coverage)
+ && SANITIZE_WITH_BASE (this, mark2Coverage)
+ && SANITIZE_WITH_BASE (this, mark1Array)
&& likely (mark2Array.sanitize (SANITIZE_ARG, CharP(this), classCount));
}
@@ -1535,7 +1540,7 @@ struct PosLookup : Lookup
TRACE_SANITIZE ();
if (unlikely (!Lookup::sanitize (SANITIZE_ARG))) return false;
OffsetArrayOf<PosLookupSubTable> &list = CastR<OffsetArrayOf<PosLookupSubTable> > (subTable);
- return SANITIZE_THIS (list);
+ return SANITIZE_WITH_BASE (this, list);
}
};
@@ -1563,7 +1568,7 @@ struct GPOS : GSUBGPOS
TRACE_SANITIZE ();
if (unlikely (!GSUBGPOS::sanitize (SANITIZE_ARG))) return false;
OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
- return SANITIZE_THIS (list);
+ return SANITIZE_WITH_BASE (this, list);
}
};
ASSERT_SIZE (GPOS, 10);
diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh
index 170ec96..3632c1f 100644
--- a/src/hb-ot-layout-gsub-private.hh
+++ b/src/hb-ot-layout-gsub-private.hh
@@ -56,7 +56,8 @@ struct SingleSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage) && SANITIZE (deltaGlyphID);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE (deltaGlyphID);
}
private:
@@ -98,7 +99,8 @@ struct SingleSubstFormat2
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage) && SANITIZE (substitute);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE (substitute);
}
private:
@@ -208,8 +210,8 @@ struct MultipleSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (sequence);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, sequence);
}
private:
@@ -304,8 +306,8 @@ struct AlternateSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (alternateSet);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, alternateSet);
}
private:
@@ -456,7 +458,7 @@ struct LigatureSet
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (ligature);
+ return SANITIZE_WITH_BASE (this, ligature);
}
private:
@@ -488,8 +490,8 @@ struct LigatureSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (ligatureSet);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, ligatureSet);
}
private:
@@ -619,10 +621,11 @@ struct ReverseChainSingleSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- if (!(SANITIZE_THIS (coverage) && SANITIZE_THIS (backtrack)))
+ if (!(SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, backtrack)))
return false;
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
- if (!SANITIZE_THIS (lookahead))
+ if (!SANITIZE_WITH_BASE (this, lookahead))
return false;
ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
return SANITIZE (substitute);
@@ -848,7 +851,7 @@ struct SubstLookup : Lookup
TRACE_SANITIZE ();
if (unlikely (!Lookup::sanitize (SANITIZE_ARG))) return false;
OffsetArrayOf<SubstLookupSubTable> &list = CastR<OffsetArrayOf<SubstLookupSubTable> > (subTable);
- return SANITIZE_THIS (list);
+ return SANITIZE_WITH_BASE (this, list);
}
};
@@ -877,7 +880,7 @@ struct GSUB : GSUBGPOS
TRACE_SANITIZE ();
if (unlikely (!GSUBGPOS::sanitize (SANITIZE_ARG))) return false;
OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
- return SANITIZE_THIS (list);
+ return SANITIZE_WITH_BASE (this, list);
}
};
ASSERT_SIZE (GSUB, 10);
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 63239e5..c3a622b 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -326,7 +326,7 @@ struct RuleSet
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (rule);
+ return SANITIZE_WITH_BASE (this, rule);
}
private:
@@ -358,8 +358,8 @@ struct ContextFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (ruleSet);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, ruleSet);
}
private:
@@ -401,9 +401,9 @@ struct ContextFormat2
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (classDef)
- && SANITIZE_THIS (ruleSet);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, classDef)
+ && SANITIZE_WITH_BASE (this, ruleSet);
}
private:
@@ -450,7 +450,7 @@ struct ContextFormat3
unsigned int count = glyphCount;
if (!SANITIZE_ARRAY (coverage, OffsetTo<Coverage>::get_size (), glyphCount)) return false;
for (unsigned int i = 0; i < count; i++)
- if (!SANITIZE_THIS (coverage[i])) return false;
+ if (!SANITIZE_WITH_BASE (this, coverage[i])) return false;
LookupRecord &lookupRecord = StructAtOffset<LookupRecord> (coverage, OffsetTo<Coverage>::get_size () * glyphCount);
return SANITIZE_ARRAY (&lookupRecord, LookupRecord::get_size (), lookupCount);
}
@@ -613,7 +613,7 @@ struct ChainRuleSet
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (rule);
+ return SANITIZE_WITH_BASE (this, rule);
}
private:
@@ -645,8 +645,8 @@ struct ChainContextFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (ruleSet);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, ruleSet);
}
private:
@@ -692,11 +692,11 @@ struct ChainContextFormat2
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS (coverage)
- && SANITIZE_THIS (backtrackClassDef)
- && SANITIZE_THIS (inputClassDef)
- && SANITIZE_THIS (lookaheadClassDef)
- && SANITIZE_THIS (ruleSet);
+ return SANITIZE_WITH_BASE (this, coverage)
+ && SANITIZE_WITH_BASE (this, backtrackClassDef)
+ && SANITIZE_WITH_BASE (this, inputClassDef)
+ && SANITIZE_WITH_BASE (this, lookaheadClassDef)
+ && SANITIZE_WITH_BASE (this, ruleSet);
}
private:
@@ -754,11 +754,11 @@ struct ChainContextFormat3
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- if (!SANITIZE_THIS (backtrack)) return false;
+ if (!SANITIZE_WITH_BASE (this, backtrack)) return false;
OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
- if (!SANITIZE_THIS (input)) return false;
+ if (!SANITIZE_WITH_BASE (this, input)) return false;
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
- if (!SANITIZE_THIS (lookahead)) return false;
+ if (!SANITIZE_WITH_BASE (this, lookahead)) return false;
ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
return SANITIZE (lookup);
}
@@ -918,9 +918,9 @@ struct GSUBGPOS
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
return SANITIZE (version) && likely (version.major == 1)
- && SANITIZE_THIS (scriptList)
- && SANITIZE_THIS (featureList)
- && SANITIZE_THIS (lookupList);
+ && SANITIZE_WITH_BASE (this, scriptList)
+ && SANITIZE_WITH_BASE (this, featureList)
+ && SANITIZE_WITH_BASE (this, lookupList);
}
protected:
commit 2226fc93d1427b8830bfb892fe1b25b488ea36dc
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 15:12:17 2010 -0400
Rename SANITIZE_BASE to SANITIZE_WITH_BASE
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index bb1b930..82f92c1 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -230,7 +230,7 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define SANITIZE(X) likely ((X).sanitize (SANITIZE_ARG))
#define SANITIZE_THIS(X) likely ((X).sanitize (SANITIZE_ARG, CharP(this)))
-#define SANITIZE_BASE(X,B) likely ((X).sanitize (SANITIZE_ARG, B))
+#define SANITIZE_WITH_BASE(B,X) likely ((X).sanitize (SANITIZE_ARG, (B)))
#define SANITIZE_SELF() SANITIZE_MEM(this, sizeof (*this))
@@ -443,21 +443,24 @@ struct GenericOffsetTo : OffsetType
if (!SANITIZE_SELF ()) return false;
unsigned int offset = *this;
if (unlikely (!offset)) return true;
- return SANITIZE (StructAtOffset<Type> (*CharP(base), offset)) || neuter (SANITIZE_ARG);
+ Type &obj = StructAtOffset<Type> (*CharP(base), offset);
+ return likely (obj.sanitize (SANITIZE_ARG)) || neuter (SANITIZE_ARG);
}
inline bool sanitize (SANITIZE_ARG_DEF, void *base, void *base2) {
TRACE_SANITIZE ();
if (!SANITIZE_SELF ()) return false;
unsigned int offset = *this;
if (unlikely (!offset)) return true;
- return SANITIZE_BASE (StructAtOffset<Type> (*CharP(base), offset), base2) || neuter (SANITIZE_ARG);
+ Type &obj = StructAtOffset<Type> (*CharP(base), offset);
+ return likely (obj.sanitize (SANITIZE_ARG, base2)) || neuter (SANITIZE_ARG);
}
inline bool sanitize (SANITIZE_ARG_DEF, void *base, unsigned int user_data) {
TRACE_SANITIZE ();
if (!SANITIZE_SELF ()) return false;
unsigned int offset = *this;
if (unlikely (!offset)) return true;
- return SANITIZE_BASE (StructAtOffset<Type> (*CharP(base), offset), user_data) || neuter (SANITIZE_ARG);
+ Type &obj = StructAtOffset<Type> (*CharP(base), offset);
+ return likely (obj.sanitize (SANITIZE_ARG, user_data)) || neuter (SANITIZE_ARG);
}
private:
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index 7ecc5bd..1b3e278 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -55,7 +55,8 @@ struct Record
inline bool sanitize (SANITIZE_ARG_DEF, void *base) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_BASE (offset, base);
+ return SANITIZE_SELF ()
+ && SANITIZE_WITH_BASE (base, offset);
}
Tag tag; /* 4-byte Tag identifier */
diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh
index 4fce10a..36345cb 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -137,10 +137,10 @@ struct ValueFormat : USHORT
if (format & xAdvance) values++;
if (format & yAdvance) values++;
- if ((format & xPlaDevice) && !SANITIZE_BASE (*(OffsetTo<Device>*)values++, base)) return false;
- if ((format & yPlaDevice) && !SANITIZE_BASE (*(OffsetTo<Device>*)values++, base)) return false;
- if ((format & xAdvDevice) && !SANITIZE_BASE (*(OffsetTo<Device>*)values++, base)) return false;
- if ((format & yAdvDevice) && !SANITIZE_BASE (*(OffsetTo<Device>*)values++, base)) return false;
+ if ((format & xPlaDevice) && !SANITIZE_WITH_BASE (base, *(OffsetTo<Device>*)values++)) return false;
+ if ((format & yPlaDevice) && !SANITIZE_WITH_BASE (base, *(OffsetTo<Device>*)values++)) return false;
+ if ((format & xAdvDevice) && !SANITIZE_WITH_BASE (base, *(OffsetTo<Device>*)values++)) return false;
+ if ((format & yAdvDevice) && !SANITIZE_WITH_BASE (base, *(OffsetTo<Device>*)values++)) return false;
return true;
}
@@ -360,7 +360,8 @@ struct MarkRecord
inline bool sanitize (SANITIZE_ARG_DEF, void *base) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_BASE (markAnchor, base);
+ return SANITIZE_SELF ()
+ && SANITIZE_WITH_BASE (base, markAnchor);
}
private:
@@ -781,8 +782,8 @@ struct EntryExitRecord
inline bool sanitize (SANITIZE_ARG_DEF, void *base) {
TRACE_SANITIZE ();
- return SANITIZE_BASE (entryAnchor, base)
- && SANITIZE_BASE (exitAnchor, base);
+ return SANITIZE_WITH_BASE (base, entryAnchor)
+ && SANITIZE_WITH_BASE (base, exitAnchor);
}
OffsetTo<Anchor>
commit 89da1346ec3a8dec8a368df46d61ca75356e22fa
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 15:01:45 2010 -0400
Remove SANITIZE_OBJ
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 7f442d0..bb1b930 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -232,8 +232,7 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define SANITIZE_THIS(X) likely ((X).sanitize (SANITIZE_ARG, CharP(this)))
#define SANITIZE_BASE(X,B) likely ((X).sanitize (SANITIZE_ARG, B))
-#define SANITIZE_SELF() SANITIZE_OBJ (*this)
-#define SANITIZE_OBJ(X) SANITIZE_MEM(&(X), sizeof (X))
+#define SANITIZE_SELF() SANITIZE_MEM(this, sizeof (*this))
#define SANITIZE_MEM(B,L) likely (_hb_sanitize_check (SANITIZE_ARG, CharP(B), (L)))
commit 4d4cce96266b777a01cec03e8766dc8c0b159351
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 14:57:55 2010 -0400
Remove SANITIZE_THIS2
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index da2f0cd..7f442d0 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -230,8 +230,6 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define SANITIZE(X) likely ((X).sanitize (SANITIZE_ARG))
#define SANITIZE_THIS(X) likely ((X).sanitize (SANITIZE_ARG, CharP(this)))
-#define SANITIZE_THIS2(X,Y) (SANITIZE_THIS (X) && SANITIZE_THIS (Y))
-
#define SANITIZE_BASE(X,B) likely ((X).sanitize (SANITIZE_ARG, B))
#define SANITIZE_SELF() SANITIZE_OBJ (*this)
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index 94bbff3..7ecc5bd 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -202,7 +202,8 @@ struct Script
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (defaultLangSys, langSys);
+ return SANITIZE_THIS (defaultLangSys)
+ && SANITIZE_THIS (langSys);
}
private:
diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh
index c1e021b..e5d092e 100644
--- a/src/hb-ot-layout-gdef-private.hh
+++ b/src/hb-ot-layout-gdef-private.hh
@@ -69,7 +69,8 @@ struct AttachList
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, attachPoint);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (attachPoint);
}
private:
@@ -244,7 +245,8 @@ struct LigCaretList
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, ligGlyph);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (ligGlyph);
}
private:
@@ -349,8 +351,8 @@ struct GDEF
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
return SANITIZE (version) && likely (version.major == 1) &&
- SANITIZE_THIS2 (glyphClassDef, attachList) &&
- SANITIZE_THIS2 (ligCaretList, markAttachClassDef) &&
+ SANITIZE_THIS (glyphClassDef) && SANITIZE_THIS (attachList) &&
+ SANITIZE_THIS (ligCaretList) && SANITIZE_THIS (markAttachClassDef) &&
(version < 0x00010002 || SANITIZE_THIS (markGlyphSetsDef[0]));
}
diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh
index 6504077..4fce10a 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -270,7 +270,9 @@ struct AnchorFormat3
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_THIS2 (xDeviceTable, yDeviceTable);
+ return SANITIZE_SELF ()
+ && SANITIZE_THIS (xDeviceTable)
+ && SANITIZE_THIS (yDeviceTable);
}
private:
@@ -698,7 +700,7 @@ struct PairPosFormat2
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
- SANITIZE_THIS2 (classDef1, classDef2))) return false;
+ SANITIZE_THIS (classDef1) && SANITIZE_THIS (classDef2))) return false;
unsigned int len1 = valueFormat1.get_len ();
unsigned int len2 = valueFormat2.get_len ();
@@ -976,7 +978,8 @@ struct CursivePosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, entryExitRecord);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (entryExitRecord);
}
private:
diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh
index d2890b0..170ec96 100644
--- a/src/hb-ot-layout-gsub-private.hh
+++ b/src/hb-ot-layout-gsub-private.hh
@@ -208,7 +208,8 @@ struct MultipleSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, sequence);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (sequence);
}
private:
@@ -303,7 +304,8 @@ struct AlternateSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, alternateSet);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (alternateSet);
}
private:
@@ -486,7 +488,8 @@ struct LigatureSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, ligatureSet);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (ligatureSet);
}
private:
@@ -616,7 +619,7 @@ struct ReverseChainSingleSubstFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- if (!SANITIZE_THIS2 (coverage, backtrack))
+ if (!(SANITIZE_THIS (coverage) && SANITIZE_THIS (backtrack)))
return false;
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
if (!SANITIZE_THIS (lookahead))
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index d07fe25..63239e5 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -358,7 +358,8 @@ struct ContextFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, ruleSet);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (ruleSet);
}
private:
@@ -644,7 +645,8 @@ struct ChainContextFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, ruleSet);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (ruleSet);
}
private:
@@ -690,9 +692,11 @@ struct ChainContextFormat2
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS2 (coverage, backtrackClassDef) &&
- SANITIZE_THIS2 (inputClassDef, lookaheadClassDef) &&
- SANITIZE_THIS (ruleSet);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (backtrackClassDef)
+ && SANITIZE_THIS (inputClassDef)
+ && SANITIZE_THIS (lookaheadClassDef)
+ && SANITIZE_THIS (ruleSet);
}
private:
commit 26bfcb64e473c40e439d6efbe974781dada28eca
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 14:49:45 2010 -0400
Cosmetic
diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh
index e63ec73..c1e021b 100644
--- a/src/hb-ot-layout-gdef-private.hh
+++ b/src/hb-ot-layout-gdef-private.hh
@@ -348,9 +348,8 @@ struct GDEF
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- if (!SANITIZE (version)) return false;
- if (unlikely (version.major != 1)) return false;
- return SANITIZE_THIS2 (glyphClassDef, attachList) &&
+ return SANITIZE (version) && likely (version.major == 1) &&
+ SANITIZE_THIS2 (glyphClassDef, attachList) &&
SANITIZE_THIS2 (ligCaretList, markAttachClassDef) &&
(version < 0x00010002 || SANITIZE_THIS (markGlyphSetsDef[0]));
}
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index f945ed9..d07fe25 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -913,10 +913,9 @@ struct GSUBGPOS
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- if (!SANITIZE (version)) return false;
- if (unlikely (version.major != 1)) return false;
- return SANITIZE_THIS (scriptList)
- && SANITIZE_THIS (featureList)
+ return SANITIZE (version) && likely (version.major == 1)
+ && SANITIZE_THIS (scriptList)
+ && SANITIZE_THIS (featureList)
&& SANITIZE_THIS (lookupList);
}
commit be74284673a1944e0f1884e861c3fe8f9855172c
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 14:47:05 2010 -0400
Remove SANITIZE_THIS3
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 9713da0..da2f0cd 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -231,7 +231,6 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define SANITIZE_THIS(X) likely ((X).sanitize (SANITIZE_ARG, CharP(this)))
#define SANITIZE_THIS2(X,Y) (SANITIZE_THIS (X) && SANITIZE_THIS (Y))
-#define SANITIZE_THIS3(X,Y,Z) (SANITIZE_THIS (X) && SANITIZE_THIS (Y) && SANITIZE_THIS(Z))
#define SANITIZE_BASE(X,B) likely ((X).sanitize (SANITIZE_ARG, B))
diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh
index 5736a5f..6504077 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -1063,8 +1063,11 @@ struct MarkBasePosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_THIS3 (markCoverage, baseCoverage, markArray) &&
- likely (baseArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
+ return SANITIZE_SELF ()
+ && SANITIZE_THIS (markCoverage)
+ && SANITIZE_THIS (baseCoverage)
+ && SANITIZE_THIS (markArray)
+ && likely (baseArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
}
private:
@@ -1184,8 +1187,11 @@ struct MarkLigPosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_THIS3 (markCoverage, ligatureCoverage, markArray) &&
- likely (ligatureArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
+ return SANITIZE_SELF ()
+ && SANITIZE_THIS (markCoverage)
+ && SANITIZE_THIS (ligatureCoverage)
+ && SANITIZE_THIS (markArray)
+ && likely (ligatureArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
}
private:
@@ -1284,8 +1290,11 @@ struct MarkMarkPosFormat1
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_SELF () && SANITIZE_THIS3 (mark1Coverage, mark2Coverage, mark1Array) &&
- likely (mark2Array.sanitize (SANITIZE_ARG, CharP(this), classCount));
+ return SANITIZE_SELF ()
+ && SANITIZE_THIS (mark1Coverage)
+ && SANITIZE_THIS (mark2Coverage)
+ && SANITIZE_THIS (mark1Array)
+ && likely (mark2Array.sanitize (SANITIZE_ARG, CharP(this), classCount));
}
private:
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 2808601..f945ed9 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -400,7 +400,9 @@ struct ContextFormat2
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE_THIS3 (coverage, classDef, ruleSet);
+ return SANITIZE_THIS (coverage)
+ && SANITIZE_THIS (classDef)
+ && SANITIZE_THIS (ruleSet);
}
private:
@@ -913,7 +915,9 @@ struct GSUBGPOS
TRACE_SANITIZE ();
if (!SANITIZE (version)) return false;
if (unlikely (version.major != 1)) return false;
- return SANITIZE_THIS3 (scriptList, featureList, lookupList);
+ return SANITIZE_THIS (scriptList)
+ && SANITIZE_THIS (featureList)
+ && SANITIZE_THIS (lookupList);
}
protected:
commit fbab9f9bd8ba59e7e5811f33c1dda198f95cf05a
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 14:42:10 2010 -0400
Remove SANITIZE_BASE2
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index bc7e7be..9713da0 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -234,7 +234,6 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define SANITIZE_THIS3(X,Y,Z) (SANITIZE_THIS (X) && SANITIZE_THIS (Y) && SANITIZE_THIS(Z))
#define SANITIZE_BASE(X,B) likely ((X).sanitize (SANITIZE_ARG, B))
-#define SANITIZE_BASE2(X,Y,B) (SANITIZE_BASE (X,B) && SANITIZE_BASE (Y,B))
#define SANITIZE_SELF() SANITIZE_OBJ (*this)
#define SANITIZE_OBJ(X) SANITIZE_MEM(&(X), sizeof (X))
diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh
index a2c5a1a..5736a5f 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -779,7 +779,8 @@ struct EntryExitRecord
inline bool sanitize (SANITIZE_ARG_DEF, void *base) {
TRACE_SANITIZE ();
- return SANITIZE_BASE2 (entryAnchor, exitAnchor, base);
+ return SANITIZE_BASE (entryAnchor, base)
+ && SANITIZE_BASE (exitAnchor, base);
}
OffsetTo<Anchor>
commit 73c7dbf7f5433c0cdd467ef32402f52867e9798e
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 14:40:55 2010 -0400
Remove SANITIZE2
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 48455ec..bc7e7be 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -228,7 +228,6 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
}
#define SANITIZE(X) likely ((X).sanitize (SANITIZE_ARG))
-#define SANITIZE2(X,Y) (SANITIZE (X) && SANITIZE (Y))
#define SANITIZE_THIS(X) likely ((X).sanitize (SANITIZE_ARG, CharP(this)))
#define SANITIZE_THIS2(X,Y) (SANITIZE_THIS (X) && SANITIZE_THIS (Y))
diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh
index 889baa7..d2890b0 100644
--- a/src/hb-ot-layout-gsub-private.hh
+++ b/src/hb-ot-layout-gsub-private.hh
@@ -420,7 +420,7 @@ struct Ligature
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
- return SANITIZE2 (ligGlyph, component);
+ return SANITIZE (ligGlyph) && SANITIZE (component);
}
private:
commit c9f14687a30866181feb57ee2736a147ec9f25a1
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 14:38:08 2010 -0400
Remove the NEUTER macro, move code to a method
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 786c08d..48455ec 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -244,11 +244,6 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define SANITIZE_ARRAY(A,S,L) likely (_hb_sanitize_array (SANITIZE_ARG, CharP(A), S, L))
-#define NEUTER(Obj, Val) \
- (SANITIZE_OBJ (Obj) && \
- _hb_sanitize_edit (SANITIZE_ARG, CharP(&(Obj)), (Obj).get_size ()) && \
- ((Obj).set (Val), true))
-
/* Template to sanitize an object. */
template <typename Type>
@@ -454,21 +449,31 @@ struct GenericOffsetTo : OffsetType
if (!SANITIZE_SELF ()) return false;
unsigned int offset = *this;
if (unlikely (!offset)) return true;
- return SANITIZE (StructAtOffset<Type> (*CharP(base), offset)) || NEUTER (*this, 0);
+ return SANITIZE (StructAtOffset<Type> (*CharP(base), offset)) || neuter (SANITIZE_ARG);
}
inline bool sanitize (SANITIZE_ARG_DEF, void *base, void *base2) {
TRACE_SANITIZE ();
if (!SANITIZE_SELF ()) return false;
unsigned int offset = *this;
if (unlikely (!offset)) return true;
- return SANITIZE_BASE (StructAtOffset<Type> (*CharP(base), offset), base2) || NEUTER (*this, 0);
+ return SANITIZE_BASE (StructAtOffset<Type> (*CharP(base), offset), base2) || neuter (SANITIZE_ARG);
}
inline bool sanitize (SANITIZE_ARG_DEF, void *base, unsigned int user_data) {
TRACE_SANITIZE ();
if (!SANITIZE_SELF ()) return false;
unsigned int offset = *this;
if (unlikely (!offset)) return true;
- return SANITIZE_BASE (StructAtOffset<Type> (*CharP(base), offset), user_data) || NEUTER (*this, 0);
+ return SANITIZE_BASE (StructAtOffset<Type> (*CharP(base), offset), user_data) || neuter (SANITIZE_ARG);
+ }
+
+ private:
+ /* Set the offset to Null */
+ inline bool neuter (SANITIZE_ARG_DEF) {
+ if (_hb_sanitize_edit (SANITIZE_ARG, CharP(this), this->get_size ())) {
+ this->set (0); /* 0 is Null offset */
+ return true;
+ }
+ return false;
}
};
template <typename Base, typename OffsetType, typename Type>
commit 30fa2821c277df99a14089749313dfe2b541e2d0
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 14:28:18 2010 -0400
Make internal method private
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index a3e6f4d..786c08d 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -511,11 +511,6 @@ struct GenericArrayOf
inline unsigned int get_size () const
{ return len.get_size () + len * Type::get_size (); }
- inline bool sanitize_shallow (SANITIZE_ARG_DEF) {
- TRACE_SANITIZE ();
- return SANITIZE_SELF() && SANITIZE_ARRAY (this, Type::get_size (), len);
- }
-
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
if (!likely (sanitize_shallow (SANITIZE_ARG))) return false;
@@ -561,6 +556,13 @@ struct GenericArrayOf
return true;
}
+ private:
+ inline bool sanitize_shallow (SANITIZE_ARG_DEF) {
+ TRACE_SANITIZE ();
+ return SANITIZE_SELF() && SANITIZE_ARRAY (this, Type::get_size (), len);
+ }
+
+ public:
LenType len;
/*Type array[VAR];*/
};
commit ce5694c79671bf75990923c1da17bb611e4e7d15
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 4 14:10:18 2010 -0400
[main] Recognize Apple SFNTs
diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh
index f25522e..e09bd80 100644
--- a/src/hb-open-file-private.hh
+++ b/src/hb-open-file-private.hh
@@ -193,8 +193,8 @@ struct OpenTypeFontFile
static const hb_tag_t CFFTag = HB_TAG ('O','T','T','O'); /* OpenType with Postscript outlines */
static const hb_tag_t TrueTypeTag = HB_TAG ( 0 , 1 , 0 , 0 ); /* OpenType with TrueType outlines */
static const hb_tag_t TTCTag = HB_TAG ('t','t','c','f'); /* TrueType Collection */
- static const hb_tag_t TrueTag = HB_TAG ('t','r','u','e'); /* Apple obsolete tag */
- static const hb_tag_t Typ1Tag = HB_TAG ('t','y','p','1'); /* Apple obsolete tag */
+ static const hb_tag_t TrueTag = HB_TAG ('t','r','u','e'); /* Obsolete Apple TrueType */
+ static const hb_tag_t Typ1Tag = HB_TAG ('t','y','p','1'); /* Obsolete Apple Type1 font in SFNT container */
inline hb_tag_t get_tag (void) const { return u.tag; }
diff --git a/src/main.cc b/src/main.cc
index 2e0927a..b3b12d0 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -73,6 +73,12 @@ main (int argc, char **argv)
case OpenTypeFontFile::TTCTag:
printf ("TrueType Collection of OpenType fonts\n");
break;
+ case OpenTypeFontFile::TrueTag:
+ printf ("Obsolete Apple TrueType font\n");
+ break;
+ case OpenTypeFontFile::Typ1Tag:
+ printf ("Obsolete Apple Type1 font in SFNT container\n");
+ break;
default:
printf ("Unknown font format\n");
break;
More information about the HarfBuzz
mailing list