summaryrefslogtreecommitdiff
path: root/src/gxvalid/gxvmorx1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gxvalid/gxvmorx1.c')
-rw-r--r--src/gxvalid/gxvmorx1.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gxvalid/gxvmorx1.c b/src/gxvalid/gxvmorx1.c
index 689e4a78a..e2caddc0b 100644
--- a/src/gxvalid/gxvmorx1.c
+++ b/src/gxvalid/gxvmorx1.c
@@ -122,11 +122,11 @@
FT_UNUSED( limit );
- setMark = flags / 0x8000U;
- dontAdvance = ( flags & 0x4000 ) / 0x4000;
- reserved = flags & 0x3FFF;
- markIndex = GXV_USHORT_TO_SHORT( glyphOffset.ul / 0x00010000UL );
- currentIndex = GXV_USHORT_TO_SHORT( glyphOffset.ul & 0x0000FFFFUL );
+ setMark = (FT_UShort)( (flags >> 15) & 1 );
+ dontAdvance = (FT_UShort)( (flags >> 14) & 1 );
+ reserved = (FT_UShort)( flags & 0x3FFF );
+ markIndex = (FT_Short)( glyphOffset.ul >> 16 );
+ currentIndex = (FT_Short)( glyphOffset.ul );
GXV_TRACE(( " setMark=%01d dontAdvance=%01d\n",
setMark, dontAdvance ));
@@ -142,10 +142,10 @@
markIndex, currentIndex ));
if ( optdata->substitutionTable_num_lookupTables < markIndex + 1 )
- optdata->substitutionTable_num_lookupTables = markIndex + 1;
+ optdata->substitutionTable_num_lookupTables = (FT_Short)(markIndex + 1);
if ( optdata->substitutionTable_num_lookupTables < currentIndex + 1 )
- optdata->substitutionTable_num_lookupTables = currentIndex + 1;
+ optdata->substitutionTable_num_lookupTables = (FT_Short)(currentIndex + 1);
}
@@ -155,6 +155,9 @@
GXV_Validator valid )
{
GXV_TRACE(( "morx subtable type1 subst.: %d -> %d\n", glyph, value.u ));
+
+ FT_UNUSED( glyph );
+
if ( value.u > valid->face->num_glyphs )
FT_INVALID_GLYPH_ID;
}
@@ -172,8 +175,8 @@
FT_UShort offset;
GXV_LookupValueDesc value;
-
- offset = base_value.u + relative_gindex * sizeof ( FT_UShort );
+ /* XXX: check range ? */
+ offset = (FT_UShort)(base_value.u + relative_gindex * sizeof ( FT_UShort ));
p = valid->lookuptbl_head + offset;
limit = lookuptbl_limit;