diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh index 178bc7ccb..152230a0e 100644 --- a/src/hb-open-file-private.hh +++ b/src/hb-open-file-private.hh @@ -56,7 +56,7 @@ typedef struct TableRecord inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this)); + return_trace (c->check_struct (this)); } Tag tag; /* 4-byte identifier. */ @@ -106,7 +106,7 @@ typedef struct OffsetTable inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables)); + return_trace (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables)); } protected: @@ -135,7 +135,7 @@ struct TTCHeaderVersion1 inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (table.sanitize (c, this)); + return_trace (table.sanitize (c, this)); } protected: @@ -175,11 +175,11 @@ struct TTCHeader inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (unlikely (!u.header.version.sanitize (c))) return TRACE_RETURN (false); + if (unlikely (!u.header.version.sanitize (c))) return_trace (false); switch (u.header.version.major) { case 2: /* version 2 is compatible with version 1 */ - case 1: return TRACE_RETURN (u.version1.sanitize (c)); - default:return TRACE_RETURN (true); + case 1: return_trace (u.version1.sanitize (c)); + default:return_trace (true); } } @@ -240,14 +240,14 @@ struct OpenTypeFontFile inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (unlikely (!u.tag.sanitize (c))) return TRACE_RETURN (false); + if (unlikely (!u.tag.sanitize (c))) return_trace (false); switch (u.tag) { case CFFTag: /* All the non-collection tags */ case TrueTag: case Typ1Tag: - case TrueTypeTag: return TRACE_RETURN (u.fontFace.sanitize (c)); - case TTCTag: return TRACE_RETURN (u.ttcHeader.sanitize (c)); - default: return TRACE_RETURN (true); + case TrueTypeTag: return_trace (u.fontFace.sanitize (c)); + case TTCTag: return_trace (u.ttcHeader.sanitize (c)); + default: return_trace (true); } } diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 294889a83..79e70b8cc 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -624,7 +624,7 @@ struct IntType inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (likely (c->check_struct (this))); + return_trace (likely (c->check_struct (this))); } protected: BEInt v; @@ -652,7 +652,7 @@ struct LONGDATETIME inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (likely (c->check_struct (this))); + return_trace (likely (c->check_struct (this))); } protected: LONG major; @@ -729,7 +729,7 @@ struct FixedVersion inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this)); + return_trace (c->check_struct (this)); } USHORT major; @@ -765,21 +765,21 @@ struct OffsetTo : Offset inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false); + if (unlikely (!c->check_struct (this))) return_trace (false); unsigned int offset = *this; - if (unlikely (!offset)) return TRACE_RETURN (true); + if (unlikely (!offset)) return_trace (true); const Type &obj = StructAtOffset (base, offset); - return TRACE_RETURN (likely (obj.sanitize (c)) || neuter (c)); + return_trace (likely (obj.sanitize (c)) || neuter (c)); } template inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const { TRACE_SANITIZE (this); - if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false); + if (unlikely (!c->check_struct (this))) return_trace (false); unsigned int offset = *this; - if (unlikely (!offset)) return TRACE_RETURN (true); + if (unlikely (!offset)) return_trace (true); const Type &obj = StructAtOffset (base, offset); - return TRACE_RETURN (likely (obj.sanitize (c, user_data)) || neuter (c)); + return_trace (likely (obj.sanitize (c, user_data)) || neuter (c)); } /* Set the offset to Null */ @@ -830,10 +830,10 @@ struct ArrayOf unsigned int items_len) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false); + if (unlikely (!c->extend_min (*this))) return_trace (false); len.set (items_len); /* TODO(serialize) Overflow? */ - if (unlikely (!c->extend (*this))) return TRACE_RETURN (false); - return TRACE_RETURN (true); + if (unlikely (!c->extend (*this))) return_trace (false); + return_trace (true); } inline bool serialize (hb_serialize_context_t *c, @@ -841,17 +841,17 @@ struct ArrayOf unsigned int items_len) { TRACE_SERIALIZE (this); - if (unlikely (!serialize (c, items_len))) return TRACE_RETURN (false); + if (unlikely (!serialize (c, items_len))) return_trace (false); for (unsigned int i = 0; i < items_len; i++) array[i] = items[i]; items.advance (items_len); - return TRACE_RETURN (true); + return_trace (true); } inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false); + if (unlikely (!sanitize_shallow (c))) return_trace (false); /* Note: for structs that do not reference other structs, * we do not need to call their sanitize() as we already did @@ -862,28 +862,28 @@ struct ArrayOf */ (void) (false && array[0].sanitize (c)); - return TRACE_RETURN (true); + return_trace (true); } inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false); + if (unlikely (!sanitize_shallow (c))) return_trace (false); unsigned int count = len; for (unsigned int i = 0; i < count; i++) if (unlikely (!array[i].sanitize (c, base))) - return TRACE_RETURN (false); - return TRACE_RETURN (true); + return_trace (false); + return_trace (true); } template inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const { TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false); + if (unlikely (!sanitize_shallow (c))) return_trace (false); unsigned int count = len; for (unsigned int i = 0; i < count; i++) if (unlikely (!array[i].sanitize (c, base, user_data))) - return TRACE_RETURN (false); - return TRACE_RETURN (true); + return_trace (false); + return_trace (true); } template @@ -900,7 +900,7 @@ struct ArrayOf inline bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && c->check_array (this, Type::static_size, len)); + return_trace (c->check_struct (this) && c->check_array (this, Type::static_size, len)); } public: @@ -927,13 +927,13 @@ struct OffsetListOf : OffsetArrayOf inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (OffsetArrayOf::sanitize (c, this)); + return_trace (OffsetArrayOf::sanitize (c, this)); } template inline bool sanitize (hb_sanitize_context_t *c, T user_data) const { TRACE_SANITIZE (this); - return TRACE_RETURN (OffsetArrayOf::sanitize (c, this, user_data)); + return_trace (OffsetArrayOf::sanitize (c, this, user_data)); } }; @@ -955,14 +955,14 @@ struct HeadlessArrayOf unsigned int items_len) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false); + if (unlikely (!c->extend_min (*this))) return_trace (false); len.set (items_len); /* TODO(serialize) Overflow? */ - if (unlikely (!items_len)) return TRACE_RETURN (true); - if (unlikely (!c->extend (*this))) return TRACE_RETURN (false); + if (unlikely (!items_len)) return_trace (true); + if (unlikely (!c->extend (*this))) return_trace (false); for (unsigned int i = 0; i < items_len - 1; i++) array[i] = items[i]; items.advance (items_len - 1); - return TRACE_RETURN (true); + return_trace (true); } inline bool sanitize_shallow (hb_sanitize_context_t *c) const @@ -974,7 +974,7 @@ struct HeadlessArrayOf inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false); + if (unlikely (!sanitize_shallow (c))) return_trace (false); /* Note: for structs that do not reference other structs, * we do not need to call their sanitize() as we already did @@ -985,7 +985,7 @@ struct HeadlessArrayOf */ (void) (false && array[0].sanitize (c)); - return TRACE_RETURN (true); + return_trace (true); } LenType len; diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 048231255..c9161f0ef 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -54,7 +54,7 @@ struct CmapSubtableFormat0 inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this)); + return_trace (c->check_struct (this)); } protected: @@ -130,7 +130,7 @@ struct CmapSubtableFormat4 { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) - return TRACE_RETURN (false); + return_trace (false); if (unlikely (!c->check_range (this, length))) { @@ -141,10 +141,10 @@ struct CmapSubtableFormat4 (uintptr_t) (c->end - (char *) this)); if (!c->try_set (&length, new_length)) - return TRACE_RETURN (false); + return_trace (false); } - return TRACE_RETURN (16 + 4 * (unsigned int) segCountX2 <= length); + return_trace (16 + 4 * (unsigned int) segCountX2 <= length); } protected: @@ -187,7 +187,7 @@ struct CmapSubtableLongGroup inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this)); + return_trace (c->check_struct (this)); } private: @@ -215,7 +215,7 @@ struct CmapSubtableTrimmed inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && glyphIdArray.sanitize (c)); + return_trace (c->check_struct (this) && glyphIdArray.sanitize (c)); } protected: @@ -248,7 +248,7 @@ struct CmapSubtableLongSegmented inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && groups.sanitize (c)); + return_trace (c->check_struct (this) && groups.sanitize (c)); } protected: @@ -295,7 +295,7 @@ struct UnicodeValueRange inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this)); + return_trace (c->check_struct (this)); } UINT24 startUnicodeValue; /* First value in this range. */ @@ -317,7 +317,7 @@ struct UVSMapping inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this)); + return_trace (c->check_struct (this)); } UINT24 unicodeValue; /* Base Unicode value of the UVS */ @@ -357,9 +357,9 @@ struct VariationSelectorRecord inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && - defaultUVS.sanitize (c, base) && - nonDefaultUVS.sanitize (c, base)); + return_trace (c->check_struct (this) && + defaultUVS.sanitize (c, base) && + nonDefaultUVS.sanitize (c, base)); } UINT24 varSelector; /* Variation selector. */ @@ -383,8 +383,8 @@ struct CmapSubtableFormat14 inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && - record.sanitize (c, this)); + return_trace (c->check_struct (this) && + record.sanitize (c, this)); } protected: @@ -429,16 +429,16 @@ struct CmapSubtable inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (!u.format.sanitize (c)) return TRACE_RETURN (false); + if (!u.format.sanitize (c)) return_trace (false); switch (u.format) { - case 0: return TRACE_RETURN (u.format0 .sanitize (c)); - case 4: return TRACE_RETURN (u.format4 .sanitize (c)); - case 6: return TRACE_RETURN (u.format6 .sanitize (c)); - case 10: return TRACE_RETURN (u.format10.sanitize (c)); - case 12: return TRACE_RETURN (u.format12.sanitize (c)); - case 13: return TRACE_RETURN (u.format13.sanitize (c)); - case 14: return TRACE_RETURN (u.format14.sanitize (c)); - default:return TRACE_RETURN (true); + case 0: return_trace (u.format0 .sanitize (c)); + case 4: return_trace (u.format4 .sanitize (c)); + case 6: return_trace (u.format6 .sanitize (c)); + case 10: return_trace (u.format10.sanitize (c)); + case 12: return_trace (u.format12.sanitize (c)); + case 13: return_trace (u.format13.sanitize (c)); + case 14: return_trace (u.format14.sanitize (c)); + default:return_trace (true); } } @@ -473,8 +473,8 @@ struct EncodingRecord inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && - subtable.sanitize (c, base)); + return_trace (c->check_struct (this) && + subtable.sanitize (c, base)); } USHORT platformID; /* Platform ID. */ @@ -509,9 +509,9 @@ struct cmap inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && - likely (version == 0) && - encodingRecord.sanitize (c, this)); + return_trace (c->check_struct (this) && + likely (version == 0) && + encodingRecord.sanitize (c, this)); } USHORT version; /* Table version number (0). */ diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index 40b54fdee..9e5af6d10 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -47,7 +47,7 @@ struct loca inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (true); + return_trace (true); } public: @@ -75,7 +75,7 @@ struct glyf TRACE_SANITIZE (this); /* We don't check for anything specific here. The users of the * struct do all the hard work... */ - return TRACE_RETURN (true); + return_trace (true); } public: diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh index 157961cf9..fc351cfb4 100644 --- a/src/hb-ot-head-table.hh +++ b/src/hb-ot-head-table.hh @@ -55,7 +55,7 @@ struct head inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1)); + return_trace (c->check_struct (this) && likely (version.major == 1)); } protected: diff --git a/src/hb-ot-hhea-table.hh b/src/hb-ot-hhea-table.hh index 992fe5520..24114534a 100644 --- a/src/hb-ot-hhea-table.hh +++ b/src/hb-ot-hhea-table.hh @@ -52,7 +52,7 @@ struct _hea inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1)); + return_trace (c->check_struct (this) && likely (version.major == 1)); } public: diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index a0e3855a8..49056e676 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -62,7 +62,7 @@ struct _mtx TRACE_SANITIZE (this); /* We don't check for anything specific here. The users of the * struct do all the hard work... */ - return TRACE_RETURN (true); + return_trace (true); } public: diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 3db7f57ab..6f818cb13 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -75,7 +75,7 @@ struct Record { TRACE_SANITIZE (this); const sanitize_closure_t closure = {tag, base}; - return TRACE_RETURN (c->check_struct (this) && offset.sanitize (c, base, &closure)); + return_trace (c->check_struct (this) && offset.sanitize (c, base, &closure)); } Tag tag; /* 4-byte Tag identifier */ @@ -131,7 +131,7 @@ struct RecordListOf : RecordArrayOf inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (RecordArrayOf::sanitize (c, this)); + return_trace (RecordArrayOf::sanitize (c, this)); } }; @@ -145,7 +145,7 @@ struct RangeRecord inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this)); + return_trace (c->check_struct (this)); } inline bool intersects (const hb_set_t *glyphs) const { @@ -211,7 +211,7 @@ struct LangSys const Record::sanitize_closure_t * = NULL) const { TRACE_SANITIZE (this); - return TRACE_RETURN (c->check_struct (this) && featureIndex.sanitize (c)); + return_trace (c->check_struct (this) && featureIndex.sanitize (c)); } Offset<> lookupOrderZ; /* = Null (reserved for an offset to a @@ -251,7 +251,7 @@ struct Script const Record