From fca6a0d158b847181dcf67a13f34499177df899b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 21 May 2009 04:49:04 -0400 Subject: [PATCH] [GPOS] Remove apply_value() return value --- src/hb-ot-layout-gpos-private.h | 75 +++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/src/hb-ot-layout-gpos-private.h b/src/hb-ot-layout-gpos-private.h index 4ef0219..a769004 100644 --- a/src/hb-ot-layout-gpos-private.h +++ b/src/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*)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); -- 2.7.4