From: handa Date: Mon, 30 Nov 2009 01:46:42 +0000 (+0000) Subject: (OTF_drive_gsub_internal): Fix previous change. X-Git-Tag: REL-0-9-11~13 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77b6466912a321237e0331d182b896e683060020;p=m17n%2Flibotf.git (OTF_drive_gsub_internal): Fix previous change. (OTF_drive_gpos_internal): Likewise. --- 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++; }