(OTF_drive_gsub_internal): Fix previous change.
authorhanda <handa>
Mon, 30 Nov 2009 01:46:42 +0000 (01:46 +0000)
committerhanda <handa>
Mon, 30 Nov 2009 01:46:42 +0000 (01:46 +0000)
(OTF_drive_gpos_internal): Likewise.

src/otfdrive.c

index 4443221..3dd3c16 100644 (file)
@@ -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++;
        }