[pango/harfbuzz-ng] [GPOS] Remove apply_value() return value



commit 361cdf36b00a7e4632de45a8ad9697d3cb1b8670
Author: Behdad Esfahbod <behdad behdad org>
Date:   Thu May 21 04:49:04 2009 -0400

    [GPOS] Remove apply_value() return value
---
 pango/opentype/hb-ot-layout-gpos-private.h |   75 +++++++++++++---------------
 1 files changed, 34 insertions(+), 41 deletions(-)

diff --git a/pango/opentype/hb-ot-layout-gpos-private.h b/pango/opentype/hb-ot-layout-gpos-private.h
index 4ef0219..a769004 100644
--- a/pango/opentype/hb-ot-layout-gpos-private.h
+++ b/pango/opentype/hb-ot-layout-gpos-private.h
@@ -35,33 +35,6 @@
 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]