提交 4acaffd7 编写于 作者: B Behdad Esfahbod

[HB] Don't use G_LIKELY!

上级 3dcb12f1
......@@ -49,7 +49,7 @@ struct SingleSubstFormat1 {
inline bool single_substitute (hb_codepoint_t &glyph_id) const {
unsigned int index = (this+coverage) (glyph_id);
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
glyph_id += deltaGlyphID;
......@@ -76,10 +76,10 @@ struct SingleSubstFormat2 {
inline bool single_substitute (hb_codepoint_t &glyph_id) const {
unsigned int index = (this+coverage) (glyph_id);
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
if (G_UNLIKELY (index >= substitute.len))
if (HB_UNLIKELY (index >= substitute.len))
return false;
glyph_id = substitute[index];
......@@ -189,7 +189,7 @@ struct MultipleSubstFormat1 {
inline bool substitute (LOOKUP_ARGS_DEF) const {
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
return (this+sequence[index]).substitute_sequence (LOOKUP_ARGS);
......@@ -243,7 +243,7 @@ struct AlternateSubstFormat1 {
hb_codepoint_t glyph_id = IN_CURGLYPH ();
unsigned int index = (this+coverage) (glyph_id);
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
const AlternateSet &alt_set = this+alternateSet[index];
......@@ -426,7 +426,7 @@ struct LigatureSubstFormat1 {
property & LookupFlag::MarkAttachmentType);
unsigned int index = (this+coverage) (glyph_id);
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
const LigatureSet &lig_set = this+ligatureSet[index];
......
......@@ -293,7 +293,7 @@ struct ContextFormat1 {
inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const {
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
const RuleSet &rule_set = this+ruleSet[index];
......@@ -324,7 +324,7 @@ struct ContextFormat2 {
inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const {
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
const ClassDef &class_def = this+classDef;
......@@ -363,7 +363,7 @@ struct ContextFormat3 {
inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const {
unsigned int index = (this+coverage[0]) (IN_CURGLYPH ());
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
const LookupRecord *lookupRecord = (const LookupRecord *)
......@@ -531,7 +531,7 @@ struct ChainContextFormat1 {
inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const {
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
const ChainRuleSet &rule_set = this+ruleSet[index];
......@@ -560,7 +560,7 @@ struct ChainContextFormat2 {
inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const {
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
const ClassDef &backtrack_class_def = this+backtrackClassDef;
......@@ -619,7 +619,7 @@ struct ChainContextFormat3 {
((const char *) &backtrack + backtrack.get_size ());
unsigned int index = (this+input[0]) (IN_CURGLYPH ());
if (G_LIKELY (index == NOT_COVERED))
if (HB_LIKELY (index == NOT_COVERED))
return false;
const OffsetArrayOf<Coverage> &lookahead = * (const OffsetArrayOf<Coverage> *)
......
......@@ -490,11 +490,11 @@ struct OpenTypeFontFile {
private:
inline const char* operator[] (const OpenTypeTable& table) const {
if (G_UNLIKELY (table.offset == 0)) return NULL;
if (HB_UNLIKELY (table.offset == 0)) return NULL;
return ((const char*)this) + table.offset;
}
inline char* operator[] (const OpenTypeTable& table) {
if (G_UNLIKELY (table.offset == 0)) return NULL;
if (HB_UNLIKELY (table.offset == 0)) return NULL;
return ((char*)this) + table.offset;
}
......
......@@ -216,7 +216,7 @@ hb_ot_layout_set_glyph_class (hb_ot_layout_t *layout,
hb_ot_layout_class_t gdef_klass;
int len = layout->new_gdef.len;
if (G_UNLIKELY (glyph > 65535))
if (HB_UNLIKELY (glyph > 65535))
return;
if (glyph >= len) {
......@@ -228,7 +228,7 @@ hb_ot_layout_set_glyph_class (hb_ot_layout_t *layout,
new_len = 65535;
new_klasses = (unsigned char *) realloc (layout->new_gdef.klasses, new_len * sizeof (unsigned char));
if (G_UNLIKELY (!new_klasses))
if (HB_UNLIKELY (!new_klasses))
return;
memset (new_klasses + len, 0, new_len - len);
......@@ -257,7 +257,7 @@ hb_ot_layout_build_glyph_classes (hb_ot_layout_t *layout,
unsigned char *klasses,
uint16_t count)
{
if (G_UNLIKELY (!count || !glyphs || !klasses))
if (HB_UNLIKELY (!count || !glyphs || !klasses))
return;
if (layout->new_gdef.len == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册