From 77b6466912a321237e0331d182b896e683060020 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 30 Nov 2009 01:46:42 +0000 Subject: [PATCH] (OTF_drive_gsub_internal): Fix previous change. (OTF_drive_gpos_internal): Likewise. --- src/otfdrive.c | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/src/otfdrive.c b/src/otfdrive.c index 4443221..3dd3c16 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -1763,7 +1763,6 @@ OTF_drive_gsub_internal (OTF *otf, OTF_GlyphString *gstring, for (i = 0; i < gsub->LookupList.LookupCount; i++) { int gidx; - int j; if (! lookup_flags[i]) continue; @@ -1777,12 +1776,10 @@ OTF_drive_gsub_internal (OTF *otf, OTF_GlyphString *gstring, if (result < 0) return errret; if (gidx < result) - { - for (j = gidx; j < result; j++) - gstring->glyphs[j].positioning_type - = with_log ? (lookup_flags[i] << 4) : 0; - gidx = result; - } + for (; gidx < result; gidx++) + gstring->glyphs[gidx].positioning_type + = ((with_log && gstring->glyphs[gidx].positioning_type) + ? (lookup_flags[i] << 4) : 0); else gidx++; } @@ -1797,12 +1794,10 @@ OTF_drive_gsub_internal (OTF *otf, OTF_GlyphString *gstring, if (result < 0) return errret; if (gidx > result) - { - for (j = gidx; j > result; j--) - gstring->glyphs[j].positioning_type - = with_log ? (lookup_flags[i] << 4) : 0; - gidx = result; - } + for (; gidx > result; gidx--) + gstring->glyphs[gidx].positioning_type + = ((with_log && gstring->glyphs[gidx].positioning_type) + ? (lookup_flags[i] << 4) : 0); else gidx--; } @@ -1869,7 +1864,6 @@ OTF_drive_gpos_internal (OTF *otf, OTF_GlyphString *gstring, for (i = 0; i < gpos->LookupList.LookupCount; i++) { int gidx = 0; - int j; if (! lookup_flags[i]) continue; @@ -1880,18 +1874,15 @@ OTF_drive_gpos_internal (OTF *otf, OTF_GlyphString *gstring, if (result < 0) return errret; if (gidx < result) - { - for (j = gidx; j < result; j++) - { - int positioning_type - = gstring->glyphs[j].positioning_type & 0xF; + for (; gidx < result; gidx++) + { + int positioning_type + = gstring->glyphs[gidx].positioning_type & 0xF; - if (with_log && positioning_type) - gstring->glyphs[j].positioning_type - = positioning_type | (lookup_flags[i] << 4); - } - gidx = result; - } + if (with_log && positioning_type) + gstring->glyphs[gidx].positioning_type + = positioning_type | (lookup_flags[i] << 4); + } else gidx++; } -- 1.7.10.4