Remove SANITIZE_THIS2

This commit is contained in:
Behdad Esfahbod 2010-05-04 14:57:55 -04:00
parent 26bfcb64e4
commit 4d4cce9626
6 changed files with 30 additions and 19 deletions

View File

@ -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)

View File

@ -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:

View File

@ -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]));
}

View File

@ -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:

View File

@ -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))

View File

@ -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: