ProcRenderAddGlyphs: Take advantage of the for loops to simplify the code a bit

This commit is contained in:
Carl Worth 2007-07-30 15:10:11 -07:00
parent dc8a528cd6
commit 363d764ea3

View File

@ -1134,7 +1134,7 @@ ProcRenderAddGlyphs (ClientPtr client)
remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs; remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
for (i = 0; i < nglyphs; i++) for (i = 0; i < nglyphs; i++)
{ {
glyph = AllocateGlyph (gi, glyphSet->fdepth); glyph = AllocateGlyph (&gi[i], glyphSet->fdepth);
if (!glyph) if (!glyph)
{ {
err = BadAlloc; err = BadAlloc;
@ -1142,7 +1142,7 @@ ProcRenderAddGlyphs (ClientPtr client)
} }
glyphs->glyph = glyph; glyphs->glyph = glyph;
glyphs->id = *gids; glyphs->id = gids[i];
size = glyph->size - sizeof (xGlyphInfo); size = glyph->size - sizeof (xGlyphInfo);
if (remain < size) if (remain < size)
@ -1153,8 +1153,6 @@ ProcRenderAddGlyphs (ClientPtr client)
size += 4 - (size & 3); size += 4 - (size & 3);
bits += size; bits += size;
remain -= size; remain -= size;
gi++;
gids++;
glyphs++; glyphs++;
} }
if (remain || i < nglyphs) if (remain || i < nglyphs)
@ -1168,10 +1166,8 @@ ProcRenderAddGlyphs (ClientPtr client)
goto bail; goto bail;
} }
glyphs = glyphsBase; glyphs = glyphsBase;
for (i = 0; i < nglyphs; i++) { for (i = 0; i < nglyphs; i++)
AddGlyph (glyphSet, glyphs->glyph, glyphs->id); AddGlyph (glyphSet, glyphs[i].glyph, glyphs[i].id);
glyphs++;
}
if (glyphsBase != glyphsLocal) if (glyphsBase != glyphsLocal)
Xfree (glyphsBase); Xfree (glyphsBase);