Remove IN_INFO() and IN_NEXTGLYPH() macros

This commit is contained in:
Behdad Esfahbod 2010-05-14 21:34:22 -04:00
parent 6e489cdf76
commit 281f59b4fb
5 changed files with 10 additions and 12 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);