for (i = 0; i < gsub->LookupList.LookupCount; i++)
{
int gidx;
- int j;
if (! lookup_flags[i]) continue;
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++;
}
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--;
}
for (i = 0; i < gpos->LookupList.LookupCount; i++)
{
int gidx = 0;
- int j;
if (! lookup_flags[i]) continue;
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++;
}