From 3e2401f6c53d2b047954d75c37aef5e5e7cdc51a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 28 Aug 2009 17:17:11 -0400 Subject: [PATCH] [HB] Rename DEBUG to TRACE where appropriate --- src/hb-open-file-private.hh | 8 +-- src/hb-open-type-private.hh | 50 +++++++-------- src/hb-ot-layout-common-private.hh | 32 +++++----- src/hb-ot-layout-gdef-private.hh | 20 +++--- src/hb-ot-layout-gpos-private.hh | 92 ++++++++++++++-------------- src/hb-ot-layout-gsub-private.hh | 72 +++++++++++----------- src/hb-ot-layout-gsubgpos-private.hh | 78 +++++++++++------------ 7 files changed, 176 insertions(+), 176 deletions(-) diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh index 4bf70ed3d..47d4e04ff 100644 --- a/src/hb-open-file-private.hh +++ b/src/hb-open-file-private.hh @@ -48,7 +48,7 @@ struct TTCHeader; typedef struct TableDirectory { inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE (tag) && SANITIZE_MEM (CONST_CHARP(base) + (unsigned long) offset, length); } @@ -107,7 +107,7 @@ typedef struct OffsetTable public: inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!(SANITIZE_SELF () && SANITIZE_MEM (tableDir, sizeof (tableDir[0]) * numTables))) return false; unsigned int count = numTables; for (unsigned int i = 0; i < count; i++) @@ -144,7 +144,7 @@ struct TTCHeader } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (version)) return false; if (version.major < 1 || version.major > 2) return true; /* TODO Maybe we shouldn't NEUTER these offsets, they may cause a full copy @@ -203,7 +203,7 @@ struct OpenTypeFontFile } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; switch (tag) { default: return true; diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index aec4b8e47..4061cfe88 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -114,10 +114,10 @@ struct Null \ #endif #if HB_DEBUG_SANITIZE -#define SANITIZE_DEBUG_ARG_DEF , unsigned int sanitize_depth -#define SANITIZE_DEBUG_ARG , sanitize_depth + 1 -#define SANITIZE_DEBUG_ARG_INIT , 1 -#define SANITIZE_DEBUG() \ +#define TRACE_SANITIZE_ARG_DEF , unsigned int sanitize_depth +#define TRACE_SANITIZE_ARG , sanitize_depth + 1 +#define TRACE_SANITIZE_ARG_INIT , 1 +#define TRACE_SANITIZE() \ HB_STMT_START { \ if (sanitize_depth < HB_DEBUG_SANITIZE) \ fprintf (stderr, "SANITIZE(%p) %-*d-> %s\n", \ @@ -126,18 +126,18 @@ struct Null \ __PRETTY_FUNCTION__); \ } HB_STMT_END #else -#define SANITIZE_DEBUG_ARG_DEF -#define SANITIZE_DEBUG_ARG -#define SANITIZE_DEBUG_ARG_INIT -#define SANITIZE_DEBUG() HB_STMT_START {} HB_STMT_END +#define TRACE_SANITIZE_ARG_DEF +#define TRACE_SANITIZE_ARG +#define TRACE_SANITIZE_ARG_INIT +#define TRACE_SANITIZE() HB_STMT_START {} HB_STMT_END #endif #define SANITIZE_ARG_DEF \ - hb_sanitize_context_t *context SANITIZE_DEBUG_ARG_DEF + hb_sanitize_context_t *context TRACE_SANITIZE_ARG_DEF #define SANITIZE_ARG \ - context SANITIZE_DEBUG_ARG + context TRACE_SANITIZE_ARG #define SANITIZE_ARG_INIT \ - &context SANITIZE_DEBUG_ARG_INIT + &context TRACE_SANITIZE_ARG_INIT typedef struct _hb_sanitize_context_t hb_sanitize_context_t; struct _hb_sanitize_context_t @@ -349,7 +349,7 @@ struct Sanitizer inline operator TYPE(void) const { return BIG_ENDIAN ((TYPE&) v); } \ inline bool operator== (NAME o) const { return (TYPE&) v == (TYPE&) o.v; } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ - SANITIZE_DEBUG (); \ + TRACE_SANITIZE (); \ return SANITIZE_SELF (); \ } \ private: unsigned char v[BYTES]; \ @@ -363,7 +363,7 @@ struct Sanitizer inline operator TYPE(void) const { return BIG_ENDIAN##_get_unaligned (v); } \ inline bool operator== (NAME o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ - SANITIZE_DEBUG (); \ + TRACE_SANITIZE (); \ return SANITIZE_SELF (); \ } \ private: unsigned char v[BYTES]; \ @@ -392,7 +392,7 @@ struct Tag : ULONG inline operator char* (void) { return CHARP(this); } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); /* Note: Only accept ASCII-visible tags (mind DEL) * This is one of the few times (only time?) we check * for data integrity, as opposed o just boundary checks @@ -440,7 +440,7 @@ struct FixedVersion inline operator uint32_t (void) const { return (major << 16) + minor; } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -467,21 +467,21 @@ struct GenericOffsetTo : OffsetType } inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; unsigned int offset = *this; if (HB_UNLIKELY (!offset)) return true; return SANITIZE (CAST(Type, *DECONST_CHARP(base), offset)) || NEUTER (DECONST_CAST(OffsetType,*this,0), 0); } inline bool sanitize (SANITIZE_ARG_DEF, const void *base, const void *base2) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; unsigned int offset = *this; if (HB_UNLIKELY (!offset)) return true; return SANITIZE_BASE (CAST(Type, *DECONST_CHARP(base), offset), base2) || NEUTER (DECONST_CAST(OffsetType,*this,0), 0); } inline bool sanitize (SANITIZE_ARG_DEF, const void *base, unsigned int user_data) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; unsigned int offset = *this; if (HB_UNLIKELY (!offset)) return true; @@ -514,7 +514,7 @@ struct GenericArrayOf { return sizeof (len) + len * sizeof (array[0]); } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_GET_SIZE()) return false; /* Note: * for non-recursive types, this is not much needed. @@ -528,7 +528,7 @@ struct GenericArrayOf return true; } inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_GET_SIZE()) return false; unsigned int count = len; for (unsigned int i = 0; i < count; i++) @@ -537,7 +537,7 @@ struct GenericArrayOf return true; } inline bool sanitize (SANITIZE_ARG_DEF, const void *base, const void *base2) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_GET_SIZE()) return false; unsigned int count = len; for (unsigned int i = 0; i < count; i++) @@ -546,7 +546,7 @@ struct GenericArrayOf return true; } inline bool sanitize (SANITIZE_ARG_DEF, const void *base, unsigned int user_data) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_GET_SIZE()) return false; unsigned int count = len; for (unsigned int i = 0; i < count; i++) @@ -590,11 +590,11 @@ struct OffsetListOf : OffsetArrayOf } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return OffsetArrayOf::sanitize (SANITIZE_ARG, CONST_CHARP(this)); } inline bool sanitize (SANITIZE_ARG_DEF, unsigned int user_data) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return OffsetArrayOf::sanitize (SANITIZE_ARG, CONST_CHARP(this), user_data); } }; @@ -614,7 +614,7 @@ struct HeadlessArrayOf { return sizeof (len) + (len ? len - 1 : 0) * sizeof (array[0]); } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_GET_SIZE()) return false; /* Note: * for non-recursive types, this is not much needed. diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 38b5fc1d0..0d0a2db53 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -52,7 +52,7 @@ template struct Record { inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE (tag) && SANITIZE_BASE (offset, base); } @@ -104,7 +104,7 @@ struct RecordListOf : RecordArrayOf { return this+RecordArrayOf::operator[](i).offset; } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return RecordArrayOf::sanitize (SANITIZE_ARG, CONST_CHARP(this)); } }; @@ -155,7 +155,7 @@ struct LangSys } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE (featureIndex); } @@ -190,7 +190,7 @@ struct Script inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (defaultLangSys) && SANITIZE_THIS (langSys); } @@ -219,7 +219,7 @@ struct Feature { return lookupIndex.get_indexes (lookup_count, lookup_tags); } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE (lookupIndex); } @@ -254,7 +254,7 @@ ASSERT_SIZE (LookupFlag, 2); struct LookupSubTable { inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -281,7 +281,7 @@ struct Lookup } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!(SANITIZE_SELF () && SANITIZE_THIS (subTable))) return false; if (HB_UNLIKELY (lookupFlag & LookupFlag::UseMarkFilteringSet)) { @@ -329,7 +329,7 @@ struct CoverageFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE (glyphArray); } @@ -354,7 +354,7 @@ struct CoverageRangeRecord public: inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -385,7 +385,7 @@ struct CoverageFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE (rangeRecord); } @@ -412,7 +412,7 @@ struct Coverage } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -448,7 +448,7 @@ struct ClassDefFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE (classValue); } @@ -473,7 +473,7 @@ struct ClassRangeRecord public: inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -503,7 +503,7 @@ struct ClassDefFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE (rangeRecord); } @@ -528,7 +528,7 @@ struct ClassDef } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -586,7 +586,7 @@ struct Device } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_GET_SIZE (); } diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh index e4e0417b0..1eb96c0d0 100644 --- a/src/hb-ot-layout-gdef-private.hh +++ b/src/hb-ot-layout-gdef-private.hh @@ -64,7 +64,7 @@ struct AttachList } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, attachPoint); } @@ -94,7 +94,7 @@ struct CaretValueFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -115,7 +115,7 @@ struct CaretValueFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -137,7 +137,7 @@ struct CaretValueFormat3 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS (deviceTable); } @@ -164,7 +164,7 @@ struct CaretValue } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -200,7 +200,7 @@ struct LigGlyph } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (carets); } @@ -231,7 +231,7 @@ struct LigCaretList } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, ligGlyph); } @@ -252,7 +252,7 @@ struct MarkGlyphSetsFormat1 { return (this+coverage[set_index]).get_coverage (glyph_id) != NOT_COVERED; } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (coverage); } @@ -275,7 +275,7 @@ struct MarkGlyphSets } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -336,7 +336,7 @@ struct GDEF { return version >= 0x00010002 && (this+markGlyphSetsDef[0]).covers (set_index, glyph_id); } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (version)) return false; if (version.major != 1) return true; return SANITIZE_THIS2 (glyphClassDef, attachList) && diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index 07f5c8ef7..609ebe783 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -157,7 +157,7 @@ struct AnchorFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -182,7 +182,7 @@ struct AnchorFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -212,7 +212,7 @@ struct AnchorFormat3 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS2 (xDeviceTable, yDeviceTable); } @@ -246,7 +246,7 @@ struct Anchor } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -275,7 +275,7 @@ struct AnchorMatrix } inline bool sanitize (SANITIZE_ARG_DEF, unsigned int cols) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; unsigned int count = rows * cols; if (!SANITIZE_ARRAY (matrix, sizeof (matrix[0]), count)) return false; @@ -298,7 +298,7 @@ struct MarkRecord friend struct MarkArray; inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_BASE (markAnchor, base); } @@ -317,7 +317,7 @@ struct MarkArray const AnchorMatrix &anchors, unsigned int class_count, unsigned int glyph_pos) const { - APPLY_DEBUG (); + TRACE_APPLY (); const MarkRecord &record = markRecord[mark_index]; unsigned int mark_class = record.klass; @@ -341,7 +341,7 @@ struct MarkArray } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (markRecord); } @@ -361,7 +361,7 @@ struct SinglePosFormat1 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) return false; @@ -373,7 +373,7 @@ struct SinglePosFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS (coverage) && SANITIZE_MEM (values, valueFormat.get_size ()); } @@ -398,7 +398,7 @@ struct SinglePosFormat2 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) return false; @@ -415,7 +415,7 @@ struct SinglePosFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS (coverage) && SANITIZE_MEM (values, valueFormat.get_size () * valueCount); } @@ -440,7 +440,7 @@ struct SinglePos private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); case 2: return u.format2->apply (APPLY_ARG); @@ -449,7 +449,7 @@ struct SinglePos } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -486,7 +486,7 @@ struct PairSet friend struct PairPosFormat1; inline bool sanitize (SANITIZE_ARG_DEF, unsigned int format_len) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; unsigned int count = (1 + format_len) * len; return SANITIZE_MEM (array, sizeof (array[0]) * count); @@ -507,7 +507,7 @@ struct PairPosFormat1 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int end = MIN (buffer->in_length, buffer->in_pos + context_length); if (HB_UNLIKELY (buffer->in_pos + 2 > end)) return false; @@ -550,7 +550,7 @@ struct PairPosFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS (coverage) && pairSet.sanitize (SANITIZE_ARG, CONST_CHARP(this), valueFormat1.get_len () + valueFormat2.get_len ()); @@ -580,7 +580,7 @@ struct PairPosFormat2 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int end = MIN (buffer->in_length, buffer->in_pos + context_length); if (HB_UNLIKELY (buffer->in_pos + 2 > end)) return false; @@ -618,7 +618,7 @@ struct PairPosFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) && SANITIZE_THIS2 (classDef1, classDef2))) return false; @@ -663,7 +663,7 @@ struct PairPos private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); case 2: return u.format2->apply (APPLY_ARG); @@ -672,7 +672,7 @@ struct PairPos } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -694,7 +694,7 @@ ASSERT_SIZE (PairPos, 2); struct EntryExitRecord { inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_BASE2 (entryAnchor, exitAnchor, base); } @@ -716,7 +716,7 @@ struct CursivePosFormat1 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); /* Now comes the messiest part of the whole OpenType specification. At first glance, cursive connections seem easy to understand, but there are pitfalls! The reason is that @@ -890,7 +890,7 @@ struct CursivePosFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, entryExitRecord); } @@ -912,7 +912,7 @@ struct CursivePos private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); default:return false; @@ -920,7 +920,7 @@ struct CursivePos } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -950,7 +950,7 @@ struct MarkBasePosFormat1 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int mark_index = (this+markCoverage) (IN_CURGLYPH ()); if (HB_LIKELY (mark_index == NOT_COVERED)) return false; @@ -978,7 +978,7 @@ struct MarkBasePosFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS2 (markCoverage, baseCoverage) && SANITIZE_THIS (markArray) && baseArray.sanitize (SANITIZE_ARG, CONST_CHARP(this), classCount); } @@ -1008,7 +1008,7 @@ struct MarkBasePos private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); default:return false; @@ -1016,7 +1016,7 @@ struct MarkBasePos } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -1052,7 +1052,7 @@ struct MarkLigPosFormat1 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int mark_index = (this+markCoverage) (IN_CURGLYPH ()); if (HB_LIKELY (mark_index == NOT_COVERED)) return false; @@ -1101,7 +1101,7 @@ struct MarkLigPosFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS2 (markCoverage, ligatureCoverage) && SANITIZE_THIS (markArray) && ligatureArray.sanitize (SANITIZE_ARG, CONST_CHARP(this), classCount); @@ -1133,7 +1133,7 @@ struct MarkLigPos private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); default:return false; @@ -1141,7 +1141,7 @@ struct MarkLigPos } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -1171,7 +1171,7 @@ struct MarkMarkPosFormat1 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int mark1_index = (this+mark1Coverage) (IN_CURGLYPH ()); if (HB_LIKELY (mark1_index == NOT_COVERED)) return false; @@ -1202,7 +1202,7 @@ struct MarkMarkPosFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS2 (mark1Coverage, mark2Coverage) && SANITIZE_THIS (mark1Array) && mark2Array.sanitize (SANITIZE_ARG, CONST_CHARP(this), classCount); } @@ -1234,7 +1234,7 @@ struct MarkMarkPos private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); default:return false; @@ -1242,7 +1242,7 @@ struct MarkMarkPos } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -1268,7 +1268,7 @@ struct ContextPos : Context private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); return Context::apply (APPLY_ARG, position_lookup); } }; @@ -1281,7 +1281,7 @@ struct ChainContextPos : ChainContext private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); return ChainContext::apply (APPLY_ARG, position_lookup); } }; @@ -1327,7 +1327,7 @@ struct PosLookupSubTable inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (lookup_type) { case Single: return u.single->apply (APPLY_ARG); case Pair: return u.pair->apply (APPLY_ARG); @@ -1343,7 +1343,7 @@ struct PosLookupSubTable } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case Single: return u.single->sanitize (SANITIZE_ARG); @@ -1456,7 +1456,7 @@ struct PosLookup : Lookup } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!Lookup::sanitize (SANITIZE_ARG)) return false; OffsetArrayOf &list = (OffsetArrayOf &) subTable; return SANITIZE_THIS (list); @@ -1488,7 +1488,7 @@ struct GPOS : GSUBGPOS { return get_lookup (lookup_index).apply_string (context, buffer, mask); } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!GSUBGPOS::sanitize (SANITIZE_ARG)) return false; OffsetTo &list = CAST(OffsetTo, lookupList, 0); return SANITIZE_THIS (list); @@ -1501,7 +1501,7 @@ ASSERT_SIZE (GPOS, 10); inline bool ExtensionPos::apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int lookup_type = get_type (); if (HB_UNLIKELY (lookup_type == PosLookupSubTable::Extension)) @@ -1512,7 +1512,7 @@ inline bool ExtensionPos::apply (APPLY_ARG_DEF) const inline bool ExtensionPos::sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return Extension::sanitize (SANITIZE_ARG) && (&(Extension::get_subtable ()) == &Null(LookupSubTable) || get_type () == PosLookupSubTable::Extension || diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index 992f4532e..bd29cf74c 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -38,7 +38,7 @@ struct SingleSubstFormat1 inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); hb_codepoint_t glyph_id = IN_CURGLYPH (); unsigned int index = (this+coverage) (glyph_id); if (HB_LIKELY (index == NOT_COVERED)) @@ -55,7 +55,7 @@ struct SingleSubstFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (coverage) && SANITIZE (deltaGlyphID); } @@ -77,7 +77,7 @@ struct SingleSubstFormat2 inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); hb_codepoint_t glyph_id = IN_CURGLYPH (); unsigned int index = (this+coverage) (glyph_id); if (HB_LIKELY (index == NOT_COVERED)) @@ -97,7 +97,7 @@ struct SingleSubstFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (coverage) && SANITIZE (substitute); } @@ -120,7 +120,7 @@ struct SingleSubst inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); case 2: return u.format2->apply (APPLY_ARG); @@ -129,7 +129,7 @@ struct SingleSubst } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -155,7 +155,7 @@ struct Sequence private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); if (HB_UNLIKELY (!substitute.len)) return false; @@ -179,7 +179,7 @@ struct Sequence public: inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE (substitute); } @@ -197,7 +197,7 @@ struct MultipleSubstFormat1 inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) @@ -207,7 +207,7 @@ struct MultipleSubstFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, sequence); } @@ -230,7 +230,7 @@ struct MultipleSubst inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); default:return false; @@ -238,7 +238,7 @@ struct MultipleSubst } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -267,7 +267,7 @@ struct AlternateSubstFormat1 inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); hb_codepoint_t glyph_id = IN_CURGLYPH (); unsigned int index = (this+coverage) (glyph_id); @@ -303,7 +303,7 @@ struct AlternateSubstFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, alternateSet); } @@ -326,7 +326,7 @@ struct AlternateSubst inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); default:return false; @@ -334,7 +334,7 @@ struct AlternateSubst } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -358,7 +358,7 @@ struct Ligature private: inline bool apply (APPLY_ARG_DEF, bool is_mark) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int i, j; unsigned int count = component.len; unsigned int end = MIN (buffer->in_length, buffer->in_pos + context_length); @@ -424,7 +424,7 @@ struct Ligature public: inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE2 (ligGlyph, component); } @@ -444,7 +444,7 @@ struct LigatureSet private: inline bool apply (APPLY_ARG_DEF, bool is_mark) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int num_ligs = ligature.len; for (unsigned int i = 0; i < num_ligs; i++) { @@ -458,7 +458,7 @@ struct LigatureSet public: inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (ligature); } @@ -476,7 +476,7 @@ struct LigatureSubstFormat1 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); hb_codepoint_t glyph_id = IN_CURGLYPH (); bool first_is_mark = !!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK); @@ -490,7 +490,7 @@ struct LigatureSubstFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, ligatureSet); } @@ -512,7 +512,7 @@ struct LigatureSubst private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); default:return false; @@ -520,7 +520,7 @@ struct LigatureSubst } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -547,7 +547,7 @@ struct ContextSubst : Context private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); return Context::apply (APPLY_ARG, substitute_lookup); } }; @@ -560,7 +560,7 @@ struct ChainContextSubst : ChainContext private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); return ChainContext::apply (APPLY_ARG, substitute_lookup); } }; @@ -589,7 +589,7 @@ struct ReverseChainSingleSubstFormat1 private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); if (HB_UNLIKELY (context_length != NO_CONTEXT)) return false; /* No chaining to this type */ @@ -617,7 +617,7 @@ struct ReverseChainSingleSubstFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_THIS2 (coverage, backtrack)) return false; OffsetArrayOf &lookahead = NEXT (OffsetArrayOf, backtrack); @@ -653,7 +653,7 @@ struct ReverseChainSingleSubst private: inline bool apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG); default:return false; @@ -661,7 +661,7 @@ struct ReverseChainSingleSubst } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -700,7 +700,7 @@ struct SubstLookupSubTable inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (lookup_type) { case Single: return u.single->apply (APPLY_ARG); case Multiple: return u.multiple->apply (APPLY_ARG); @@ -715,7 +715,7 @@ struct SubstLookupSubTable } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case Single: return u.single->sanitize (SANITIZE_ARG); @@ -840,7 +840,7 @@ struct SubstLookup : Lookup } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!Lookup::sanitize (SANITIZE_ARG)) return false; OffsetArrayOf &list = (OffsetArrayOf &) subTable; return SANITIZE_THIS (list); @@ -873,7 +873,7 @@ struct GSUB : GSUBGPOS inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!GSUBGPOS::sanitize (SANITIZE_ARG)) return false; OffsetTo &list = CAST(OffsetTo, lookupList, 0); return SANITIZE_THIS (list); @@ -886,7 +886,7 @@ ASSERT_SIZE (GSUB, 10); inline bool ExtensionSubst::apply (APPLY_ARG_DEF) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int lookup_type = get_type (); if (HB_UNLIKELY (lookup_type == SubstLookupSubTable::Extension)) @@ -897,7 +897,7 @@ inline bool ExtensionSubst::apply (APPLY_ARG_DEF) const inline bool ExtensionSubst::sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return Extension::sanitize (SANITIZE_ARG) && (&(Extension::get_subtable ()) == &Null(LookupSubTable) || get_type () == SubstLookupSubTable::Extension || diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 0dadbe871..b21939ac0 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -36,10 +36,10 @@ #endif #if HB_DEBUG_APPLY -#define APPLY_DEBUG_ARG_DEF , unsigned int apply_depth -#define APPLY_DEBUG_ARG , apply_depth + 1 -#define APPLY_DEBUG_ARG_INIT , 1 -#define APPLY_DEBUG() \ +#define TRACE_APPLY_ARG_DEF , unsigned int apply_depth +#define TRACE_APPLY_ARG , apply_depth + 1 +#define TRACE_APPLY_ARG_INIT , 1 +#define TRACE_APPLY() \ HB_STMT_START { \ if (apply_depth < HB_DEBUG_APPLY) \ fprintf (stderr, "APPLY(%p) %-*d-> %s\n", \ @@ -48,10 +48,10 @@ __PRETTY_FUNCTION__); \ } HB_STMT_END #else -#define APPLY_DEBUG_ARG_DEF -#define APPLY_DEBUG_ARG -#define APPLY_DEBUG_ARG_INIT -#define APPLY_DEBUG() HB_STMT_START {} HB_STMT_END +#define TRACE_APPLY_ARG_DEF +#define TRACE_APPLY_ARG +#define TRACE_APPLY_ARG_INIT +#define TRACE_APPLY() HB_STMT_START {} HB_STMT_END #endif #define APPLY_ARG_DEF \ @@ -61,7 +61,7 @@ unsigned int nesting_level_left HB_GNUC_UNUSED, \ unsigned int lookup_flag, \ unsigned int property HB_GNUC_UNUSED /* propety of first glyph */ \ - APPLY_DEBUG_ARG_DEF + TRACE_APPLY_ARG_DEF #define APPLY_ARG \ context, \ buffer, \ @@ -69,7 +69,7 @@ nesting_level_left, \ lookup_flag, \ property \ - APPLY_DEBUG_ARG + TRACE_APPLY_ARG #define APPLY_ARG_INIT \ context, \ buffer, \ @@ -77,7 +77,7 @@ nesting_level_left, \ lookup_flag, \ property \ - APPLY_DEBUG_ARG_INIT + TRACE_APPLY_ARG_INIT typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, char *data); @@ -196,7 +196,7 @@ struct LookupRecord { public: inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -290,7 +290,7 @@ struct Rule private: inline bool apply (APPLY_ARG_DEF, ContextLookupContext &lookup_context) const { - APPLY_DEBUG (); + TRACE_APPLY (); const LookupRecord *lookupRecord = &CONST_CAST (LookupRecord, input, sizeof (input[0]) * (inputCount ? inputCount - 1 : 0)); return context_lookup (APPLY_ARG, inputCount, input, @@ -300,7 +300,7 @@ struct Rule public: inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; return SANITIZE_MEM (input, sizeof (input[0]) * inputCount + @@ -323,7 +323,7 @@ struct RuleSet { inline bool apply (APPLY_ARG_DEF, ContextLookupContext &lookup_context) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int num_rules = rule.len; for (unsigned int i = 0; i < num_rules; i++) { @@ -335,7 +335,7 @@ struct RuleSet } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (rule); } @@ -353,7 +353,7 @@ struct ContextFormat1 private: inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) return false; @@ -367,7 +367,7 @@ struct ContextFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, ruleSet); } @@ -390,7 +390,7 @@ struct ContextFormat2 private: inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) return false; @@ -409,7 +409,7 @@ struct ContextFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS3 (coverage, classDef, ruleSet); } @@ -435,7 +435,7 @@ struct ContextFormat3 private: inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int index = (this+coverage[0]) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) return false; @@ -452,7 +452,7 @@ struct ContextFormat3 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; unsigned int count = glyphCount; for (unsigned int i = 0; i < count; i++) @@ -479,7 +479,7 @@ struct Context protected: inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG, apply_func); case 2: return u.format2->apply (APPLY_ARG, apply_func); @@ -489,7 +489,7 @@ struct Context } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -561,7 +561,7 @@ struct ChainRule private: inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &lookup_context) const { - APPLY_DEBUG (); + TRACE_APPLY (); const HeadlessArrayOf &input = CONST_NEXT (HeadlessArrayOf, backtrack); const ArrayOf &lookahead = CONST_NEXT (ArrayOf, input); const ArrayOf &lookup = CONST_NEXT (ArrayOf, lookahead); @@ -576,7 +576,7 @@ struct ChainRule public: inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (backtrack)) return false; HeadlessArrayOf &input = NEXT (HeadlessArrayOf, backtrack); if (!SANITIZE (input)) return false; @@ -607,7 +607,7 @@ struct ChainRuleSet { inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &lookup_context) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int num_rules = rule.len; for (unsigned int i = 0; i < num_rules; i++) { @@ -619,7 +619,7 @@ struct ChainRuleSet } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS (rule); } @@ -637,7 +637,7 @@ struct ChainContextFormat1 private: inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) return false; @@ -651,7 +651,7 @@ struct ChainContextFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, ruleSet); } @@ -673,7 +673,7 @@ struct ChainContextFormat2 private: inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { - APPLY_DEBUG (); + TRACE_APPLY (); unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) return false; @@ -697,7 +697,7 @@ struct ChainContextFormat2 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_THIS2 (coverage, backtrackClassDef) && SANITIZE_THIS2 (inputClassDef, lookaheadClassDef) && SANITIZE_THIS (ruleSet); @@ -734,7 +734,7 @@ struct ChainContextFormat3 inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { - APPLY_DEBUG (); + TRACE_APPLY (); const OffsetArrayOf &input = CONST_NEXT (OffsetArrayOf, backtrack); unsigned int index = (this+input[0]) (IN_CURGLYPH ()); @@ -757,7 +757,7 @@ struct ChainContextFormat3 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE_THIS (backtrack)) return false; OffsetArrayOf &input = NEXT (OffsetArrayOf, backtrack); if (!SANITIZE_THIS (input)) return false; @@ -792,7 +792,7 @@ struct ChainContext protected: inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { - APPLY_DEBUG (); + TRACE_APPLY (); switch (u.format) { case 1: return u.format1->apply (APPLY_ARG, apply_func); case 2: return u.format2->apply (APPLY_ARG, apply_func); @@ -802,7 +802,7 @@ struct ChainContext } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -838,7 +838,7 @@ struct ExtensionFormat1 } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); return SANITIZE_SELF (); } @@ -872,7 +872,7 @@ struct Extension } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (u.format)) return false; switch (u.format) { case 1: return u.format1->sanitize (SANITIZE_ARG); @@ -930,7 +930,7 @@ struct GSUBGPOS { return (this+lookupList)[i]; } inline bool sanitize (SANITIZE_ARG_DEF) { - SANITIZE_DEBUG (); + TRACE_SANITIZE (); if (!SANITIZE (version)) return false; if (version.major != 1) return true; return SANITIZE_THIS3 (scriptList, featureList, lookupList);