From: Behdad Esfahbod Date: Sat, 15 May 2010 01:34:22 +0000 (-0400) Subject: Remove IN_INFO() and IN_NEXTGLYPH() macros X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=281f59b4fb16f7c73767eb042a91f70f4c109b3a;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Remove IN_INFO() and IN_NEXTGLYPH() macros --- diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index 6f05767..223f935 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -156,9 +156,7 @@ struct _hb_buffer_t { #endif /* convenience macros */ -#define IN_INFO(pos) (&BUFFER->in_string[(pos)]) #define IN_CURGLYPH() (BUFFER->in_string[BUFFER->in_pos].codepoint) -#define IN_NEXTGLYPH() (BUFFER->in_string[BUFFER->in_pos + 1].codepoint) #define IN_CURINFO() (&BUFFER->in_string[BUFFER->in_pos]) HB_END_DECLS diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index 56be98f..d0a01da 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -632,7 +632,7 @@ struct PairPosFormat1 return false; unsigned int j = c->buffer->in_pos + 1; - while (_hb_ot_layout_skip_mark (c->layout->face, IN_INFO (j), c->lookup_flag, NULL)) + while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, NULL)) { if (unlikely (j == end)) return false; @@ -694,7 +694,7 @@ struct PairPosFormat2 return false; unsigned int j = c->buffer->in_pos + 1; - while (_hb_ot_layout_skip_mark (c->layout->face, IN_INFO (j), c->lookup_flag, NULL)) + while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, NULL)) { if (unlikely (j == end)) return false; @@ -1079,7 +1079,7 @@ struct MarkBasePosFormat1 if (unlikely (!j)) return false; j--; - } while (_hb_ot_layout_skip_mark (c->layout->face, IN_INFO (j), LookupFlag::IgnoreMarks, &property)); + } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], LookupFlag::IgnoreMarks, &property)); /* The following assertion is too strong, so we've disabled it. */ if (false && !(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH)) @@ -1181,7 +1181,7 @@ struct MarkLigPosFormat1 if (unlikely (!j)) return false; j--; - } while (_hb_ot_layout_skip_mark (c->layout->face, IN_INFO (j), LookupFlag::IgnoreMarks, &property)); + } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], LookupFlag::IgnoreMarks, &property)); /* The following assertion is too strong, so we've disabled it. */ if (false && !(property & HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE)) @@ -1300,7 +1300,7 @@ struct MarkMarkPosFormat1 if (unlikely (!j)) return false; j--; - } while (_hb_ot_layout_skip_mark (c->layout->face, IN_INFO (j), c->lookup_flag, &property)); + } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, &property)); if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK)) return false; diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index 51892aa..ff3a82e 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -378,7 +378,7 @@ struct Ligature for (i = 1, j = c->buffer->in_pos + 1; i < count; i++, j++) { unsigned int property; - while (_hb_ot_layout_skip_mark (c->layout->face, IN_INFO (j), c->lookup_flag, &property)) + while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, &property)) { if (unlikely (j + count - i == end)) return false; diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 59a2d20..7340206 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -99,7 +99,7 @@ static inline bool match_input (hb_apply_context_t *c, for (i = 1, j = c->buffer->in_pos + 1; i < count; i++, j++) { - while (_hb_ot_layout_skip_mark (c->layout->face, IN_INFO (j), c->lookup_flag, NULL)) + while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, NULL)) { if (unlikely (j + count - i == end)) return false; @@ -154,7 +154,7 @@ static inline bool match_lookahead (hb_apply_context_t *c, for (i = 0, j = c->buffer->in_pos + offset; i < count; i++, j++) { - while (_hb_ot_layout_skip_mark (c->layout->face, IN_INFO (j), c->lookup_flag, NULL)) + while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, NULL)) { if (unlikely (j + count - i == end)) return false; diff --git a/src/hb-shape.cc b/src/hb-shape.cc index ef2b0ac..df49e60 100644 --- a/src/hb-shape.cc +++ b/src/hb-shape.cc @@ -99,8 +99,8 @@ hb_map_glyphs (hb_font_t *font, return; count = buffer->in_length - 1; for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) { - if (unlikely (is_variation_selector (IN_NEXTGLYPH()))) { - IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), IN_NEXTGLYPH()); + if (unlikely (is_variation_selector (buffer->in_string[buffer->in_pos + 1].codepoint))) { + IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), buffer->in_string[buffer->in_pos + 1].codepoint); buffer->in_pos++; } else { IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), 0);