Move buffer var allocation local
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 28 Oct 2010 03:09:10 +0000 (23:09 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 2 Nov 2010 23:12:59 +0000 (19:12 -0400)
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-private.hh

index 4903709..782df5f 100644 (file)
 HB_BEGIN_DECLS
 
 
+/* buffer var allocations */
+#define attach_lookback() var.u16[0] /* number of glyphs to go back to attach this glyph to its base */
+#define cursive_chain() var.i16[1] /* character to which this connects, may be positive or negative */
+
+
 /* Shared Tables: ValueRecord, Anchor Table, and MarkArray */
 
 typedef USHORT Value;
@@ -402,9 +407,9 @@ struct MarkArray : ArrayOf<MarkRecord>      /* Array of MarkRecords--in Coverage orde
     glyph_anchor.get_anchor (c->layout, c->buffer->info[glyph_pos].codepoint, &base_x, &base_y);
 
     hb_glyph_position_t &o = c->buffer->pos[c->buffer->i];
-    o.x_offset  = base_x - mark_x;
-    o.y_offset  = base_y - mark_y;
-    o.back()    = c->buffer->i - glyph_pos;
+    o.x_offset = base_x - mark_x;
+    o.y_offset = base_y - mark_y;
+    o.attach_lookback() = c->buffer->i - glyph_pos;
 
     c->buffer->i++;
     return true;
@@ -1522,9 +1527,9 @@ GPOS::position_finish (hb_buffer_t *buffer)
 
   /* Handle attachments */
   for (i = 0; i < len; i++)
-    if (pos[i].back())
+    if (pos[i].attach_lookback())
     {
-      unsigned int back = i - pos[i].back();
+      unsigned int back = i - pos[i].attach_lookback();
       pos[i].x_offset += pos[back].x_offset;
       pos[i].y_offset += pos[back].y_offset;
 
@@ -1574,6 +1579,10 @@ static inline bool position_lookup (hb_apply_context_t *c, unsigned int lookup_i
 }
 
 
+#undef attach_lookback
+#undef cursive_chain
+
+
 HB_END_DECLS
 
 #endif /* HB_OT_LAYOUT_GPOS_PRIVATE_HH */
index 4513676..8b475b4 100644 (file)
@@ -42,8 +42,6 @@ HB_BEGIN_DECLS
 #define component() var1.u16[0]
 #define lig_id() var1.u16[1]
 #define gproperty() var2.u32
-#define back() var.u16[0] /* number of glyphs to go back for drawing current glyph */
-#define cursive_chain() var.i16[1] /* character to which this connects, may be positive or negative */
 
 typedef enum {
   HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED        = 0x0001,