[GPOS] Remove apply_value() return value
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 21 May 2009 08:49:04 +0000 (04:49 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 2 Nov 2009 19:40:15 +0000 (14:40 -0500)
src/hb-ot-layout-gpos-private.h

index 4ef0219..a769004 100644 (file)
 typedef SHORT Value;
 typedef Value ValueRecord[];
 
-#if 0
-struct ValueRecord {
-  SHORT                xPlacement;             /* Horizontal adjustment for
-                                        * placement--in design units */
-  SHORT                yPlacement;             /* Vertical adjustment for
-                                        * placement--in design units */
-  SHORT                xAdvance;               /* Horizontal adjustment for
-                                        * advance--in design units (only used
-                                        * for horizontal writing) */
-  SHORT                yAdvance;               /* Vertical adjustment for advance--in
-                                        * design units (only used for vertical
-                                        * writing) */
-  Offset       xPlaDevice;             /* Offset to Device table for
-                                        * horizontal placement--measured from
-                                        * beginning of PosTable (may be NULL) */
-  Offset       yPlaDevice;             /* Offset to Device table for vertical
-                                        * placement--measured from beginning
-                                        * of PosTable (may be NULL) */
-  Offset       xAdvDevice;             /* Offset to Device table for
-                                        * horizontal advance--measured from
-                                        * beginning of PosTable (may be NULL) */
-  Offset       yAdvDevice;             /* Offset to Device table for vertical
-                                        * advance--measured from beginning of
-                                        * PosTable (may be NULL) */
-};
-#endif
-
 struct ValueFormat : USHORT
 {
   enum
@@ -82,10 +55,10 @@ struct ValueFormat : USHORT
     return _hb_popcount32 ((unsigned int) *this);
   }
 
-  const Value* apply_value (hb_ot_layout_t *layout,
-                           const char     *base,
-                           const Value    *values,
-                           HB_Position     glyph_pos) const
+  const void apply_value (hb_ot_layout_t *layout,
+                         const char     *base,
+                         const Value    *values,
+                         HB_Position     glyph_pos) const
   {
     unsigned int x_ppem, y_ppem;
     hb_16dot16_t x_scale, y_scale;
@@ -93,7 +66,36 @@ struct ValueFormat : USHORT
     unsigned int format = *this;
 
     if (!format)
-      return values;
+      return;
+
+    /* All fields are options.  Only those available advance the value
+     * pointer. */
+#if 0
+struct ValueRecord {
+  SHORT                xPlacement;             /* Horizontal adjustment for
+                                        * placement--in design units */
+  SHORT                yPlacement;             /* Vertical adjustment for
+                                        * placement--in design units */
+  SHORT                xAdvance;               /* Horizontal adjustment for
+                                        * advance--in design units (only used
+                                        * for horizontal writing) */
+  SHORT                yAdvance;               /* Vertical adjustment for advance--in
+                                        * design units (only used for vertical
+                                        * writing) */
+  Offset       xPlaDevice;             /* Offset to Device table for
+                                        * horizontal placement--measured from
+                                        * beginning of PosTable (may be NULL) */
+  Offset       yPlaDevice;             /* Offset to Device table for vertical
+                                        * placement--measured from beginning
+                                        * of PosTable (may be NULL) */
+  Offset       xAdvDevice;             /* Offset to Device table for
+                                        * horizontal advance--measured from
+                                        * beginning of PosTable (may be NULL) */
+  Offset       yAdvDevice;             /* Offset to Device table for vertical
+                                        * advance--measured from beginning of
+                                        * PosTable (may be NULL) */
+};
+#endif
 
     x_scale = layout->gpos_info.x_scale;
     y_scale = layout->gpos_info.y_scale;
@@ -121,15 +123,6 @@ struct ValueFormat : USHORT
       if (format & yAdvDevice)
        glyph_pos->y_advance += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 6;
     }
-    else
-    {
-      if (format & xPlaDevice) values++;
-      if (format & yPlaDevice) values++;
-      if (format & xAdvDevice) values++;
-      if (format & yAdvDevice) values++;
-    }
-
-    return values;
   }
 };
 ASSERT_SIZE (ValueFormat, 2);