This commit is contained in:
Ebrahim Byagowi 2020-07-18 22:14:52 +04:30
parent 7e3edfa454
commit d0e2addd43
17 changed files with 87 additions and 80 deletions

View File

@ -101,7 +101,7 @@ struct BaselineTableFormat3Part
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && lookupTable.sanitize (c));
return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c)));
}
protected:

View File

@ -493,9 +493,7 @@ struct KerxSubTableFormat4
bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
const Entry<EntryData> &entry)
{
return entry.data.ankrActionIndex != 0xFFFF;
}
{ return entry.data.ankrActionIndex != 0xFFFF; }
void transition (StateTableDriver<Types, EntryData> *driver,
const Entry<EntryData> &entry)
{

View File

@ -317,7 +317,7 @@ struct CmapSubtableFormat4
HBUINT16 last;
};
const HBUINT16 *found =hb_bsearch (codepoint,
const HBUINT16 *found = hb_bsearch (codepoint,
this->endCount,
this->segCount,
2,

View File

@ -1297,9 +1297,9 @@ struct CoverageFormat2
unsigned int get_coverage (hb_codepoint_t glyph_id) const
{
const RangeRecord &range = rangeRecord.bsearch (glyph_id);
return likely (range.first <= range.last) ?
(unsigned int) range.value + (glyph_id - range.first) :
NOT_COVERED;
return likely (range.first <= range.last)
? (unsigned int) range.value + (glyph_id - range.first)
: NOT_COVERED;
}
template <typename Iterator,

View File

@ -1816,8 +1816,10 @@ static void Markclass_closure_and_remap_indexes (const Coverage &mark_coverage,
struct MarkBasePosFormat1
{
bool intersects (const hb_set_t *glyphs) const
{ return (this+markCoverage).intersects (glyphs) &&
(this+baseCoverage).intersects (glyphs); }
{
return (this+markCoverage).intersects (glyphs) &&
(this+baseCoverage).intersects (glyphs);
}
void closure_lookups (hb_closure_lookups_context_t *c) const {}
@ -2031,8 +2033,10 @@ typedef OffsetListOf<LigatureAttach> LigatureArray;
struct MarkLigPosFormat1
{
bool intersects (const hb_set_t *glyphs) const
{ return (this+markCoverage).intersects (glyphs) &&
(this+ligatureCoverage).intersects (glyphs); }
{
return (this+markCoverage).intersects (glyphs) &&
(this+ligatureCoverage).intersects (glyphs);
}
void closure_lookups (hb_closure_lookups_context_t *c) const {}
@ -2189,8 +2193,10 @@ typedef AnchorMatrix Mark2Array; /* mark2-major--
struct MarkMarkPosFormat1
{
bool intersects (const hb_set_t *glyphs) const
{ return (this+mark1Coverage).intersects (glyphs) &&
(this+mark2Coverage).intersects (glyphs); }
{
return (this+mark1Coverage).intersects (glyphs) &&
(this+mark2Coverage).intersects (glyphs);
}
void closure_lookups (hb_closure_lookups_context_t *c) const {}
@ -2254,12 +2260,15 @@ struct MarkMarkPosFormat1
unsigned int comp1 = _hb_glyph_info_get_lig_comp (&buffer->cur());
unsigned int comp2 = _hb_glyph_info_get_lig_comp (&buffer->info[j]);
if (likely (id1 == id2)) {
if (likely (id1 == id2))
{
if (id1 == 0) /* Marks belonging to the same base. */
goto good;
else if (comp1 == comp2) /* Marks belonging to the same ligature component. */
goto good;
} else {
}
else
{
/* If ligature ids don't match, it may be the case that one of the marks
* itself is a ligature. In which case match. */
if ((id1 > 0 && !comp1) || (id2 > 0 && !comp2))