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);
}
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++)
}
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
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!SANITIZE_SELF ()) return false;
switch (tag) {
default: return true;
#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", \
__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
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]; \
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]; \
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
inline operator uint32_t (void) const { return (major << 16) + minor; }
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
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;
{ 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.
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++)
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++)
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++)
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return OffsetArrayOf<Type>::sanitize (SANITIZE_ARG, CONST_CHARP(this));
}
inline bool sanitize (SANITIZE_ARG_DEF, unsigned int user_data) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return OffsetArrayOf<Type>::sanitize (SANITIZE_ARG, CONST_CHARP(this), user_data);
}
};
{ 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.
struct Record
{
inline bool sanitize (SANITIZE_ARG_DEF, const void *base) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE (tag) && SANITIZE_BASE (offset, base);
}
{ return this+RecordArrayOf<Type>::operator[](i).offset; }
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return RecordArrayOf<Type>::sanitize (SANITIZE_ARG, CONST_CHARP(this));
}
};
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF () && SANITIZE (featureIndex);
}
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);
}
{ return lookupIndex.get_indexes (lookup_count, lookup_tags); }
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF () && SANITIZE (lookupIndex);
}
struct LookupSubTable
{
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!(SANITIZE_SELF () && SANITIZE_THIS (subTable))) return false;
if (HB_UNLIKELY (lookupFlag & LookupFlag::UseMarkFilteringSet))
{
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE (glyphArray);
}
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE (rangeRecord);
}
}
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);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF () && SANITIZE (classValue);
}
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE (rangeRecord);
}
}
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);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_GET_SIZE ();
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, attachPoint);
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF () && SANITIZE_THIS (deviceTable);
}
}
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);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS (carets);
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, ligGlyph);
}
{ 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);
}
}
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);
{ 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) &&
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF () && SANITIZE_THIS2 (xDeviceTable, yDeviceTable);
}
}
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);
}
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;
friend struct MarkArray;
inline bool sanitize (SANITIZE_ARG_DEF, const void *base) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF () && SANITIZE_BASE (markAnchor, base);
}
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;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS (markRecord);
}
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;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
SANITIZE_MEM (values, valueFormat.get_size ());
}
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;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
SANITIZE_MEM (values, valueFormat.get_size () * valueCount);
}
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);
}
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);
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);
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;
}
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 ());
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;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
SANITIZE_THIS2 (classDef1, classDef2))) return false;
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);
}
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);
struct EntryExitRecord
{
inline bool sanitize (SANITIZE_ARG_DEF, const void *base) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_BASE2 (entryAnchor, exitAnchor, base);
}
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
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, entryExitRecord);
}
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;
}
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);
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;
}
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);
}
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;
}
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);
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;
}
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);
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;
}
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);
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;
}
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);
}
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;
}
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);
private:
inline bool apply (APPLY_ARG_DEF) const
{
- APPLY_DEBUG ();
+ TRACE_APPLY ();
return Context::apply (APPLY_ARG, position_lookup);
}
};
private:
inline bool apply (APPLY_ARG_DEF) const
{
- APPLY_DEBUG ();
+ TRACE_APPLY ();
return ChainContext::apply (APPLY_ARG, position_lookup);
}
};
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);
}
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);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!Lookup::sanitize (SANITIZE_ARG)) return false;
OffsetArrayOf<PosLookupSubTable> &list = (OffsetArrayOf<PosLookupSubTable> &) subTable;
return SANITIZE_THIS (list);
{ 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<PosLookupList> &list = CAST(OffsetTo<PosLookupList>, lookupList, 0);
return SANITIZE_THIS (list);
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))
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 ||
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))
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS (coverage) && SANITIZE (deltaGlyphID);
}
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))
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS (coverage) && SANITIZE (substitute);
}
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);
}
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);
private:
inline bool apply (APPLY_ARG_DEF) const
{
- APPLY_DEBUG ();
+ TRACE_APPLY ();
if (HB_UNLIKELY (!substitute.len))
return false;
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE (substitute);
}
inline bool apply (APPLY_ARG_DEF) const
{
- APPLY_DEBUG ();
+ TRACE_APPLY ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, sequence);
}
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;
}
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);
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);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, alternateSet);
}
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;
}
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);
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);
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE2 (ligGlyph, component);
}
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++)
{
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS (ligature);
}
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);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, ligatureSet);
}
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;
}
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);
private:
inline bool apply (APPLY_ARG_DEF) const
{
- APPLY_DEBUG ();
+ TRACE_APPLY ();
return Context::apply (APPLY_ARG, substitute_lookup);
}
};
private:
inline bool apply (APPLY_ARG_DEF) const
{
- APPLY_DEBUG ();
+ TRACE_APPLY ();
return ChainContext::apply (APPLY_ARG, substitute_lookup);
}
};
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 */
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!SANITIZE_THIS2 (coverage, backtrack))
return false;
OffsetArrayOf<Coverage> &lookahead = NEXT (OffsetArrayOf<Coverage>, backtrack);
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;
}
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);
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);
}
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);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!Lookup::sanitize (SANITIZE_ARG)) return false;
OffsetArrayOf<SubstLookupSubTable> &list = (OffsetArrayOf<SubstLookupSubTable> &) subTable;
return SANITIZE_THIS (list);
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!GSUBGPOS::sanitize (SANITIZE_ARG)) return false;
OffsetTo<SubstLookupList> &list = CAST(OffsetTo<SubstLookupList>, lookupList, 0);
return SANITIZE_THIS (list);
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))
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 ||
#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", \
__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 \
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, \
nesting_level_left, \
lookup_flag, \
property \
- APPLY_DEBUG_ARG
+ TRACE_APPLY_ARG
#define APPLY_ARG_INIT \
context, \
buffer, \
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);
{
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
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,
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!SANITIZE_SELF ()) return false;
return SANITIZE_MEM (input,
sizeof (input[0]) * inputCount +
{
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++)
{
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS (rule);
}
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;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, ruleSet);
}
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;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS3 (coverage, classDef, ruleSet);
}
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;
}
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++)
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);
}
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);
private:
inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &lookup_context) const
{
- APPLY_DEBUG ();
+ TRACE_APPLY ();
const HeadlessArrayOf<USHORT> &input = CONST_NEXT (HeadlessArrayOf<USHORT>, backtrack);
const ArrayOf<USHORT> &lookahead = CONST_NEXT (ArrayOf<USHORT>, input);
const ArrayOf<LookupRecord> &lookup = CONST_NEXT (ArrayOf<LookupRecord>, lookahead);
public:
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!SANITIZE (backtrack)) return false;
HeadlessArrayOf<USHORT> &input = NEXT (HeadlessArrayOf<USHORT>, backtrack);
if (!SANITIZE (input)) return false;
{
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++)
{
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS (rule);
}
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;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, ruleSet);
}
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;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_THIS2 (coverage, backtrackClassDef) &&
SANITIZE_THIS2 (inputClassDef, lookaheadClassDef) &&
SANITIZE_THIS (ruleSet);
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
- APPLY_DEBUG ();
+ TRACE_APPLY ();
const OffsetArrayOf<Coverage> &input = CONST_NEXT (OffsetArrayOf<Coverage>, backtrack);
unsigned int index = (this+input[0]) (IN_CURGLYPH ());
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
if (!SANITIZE_THIS (backtrack)) return false;
OffsetArrayOf<Coverage> &input = NEXT (OffsetArrayOf<Coverage>, backtrack);
if (!SANITIZE_THIS (input)) return false;
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);
}
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);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
- SANITIZE_DEBUG ();
+ TRACE_SANITIZE ();
return SANITIZE_SELF ();
}
}
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);
{ 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);