From cc6ff8ce49da6b071825e6f16754a117fde1b7eb Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sun, 13 May 2007 15:32:46 +0200 Subject: [PATCH] Replace remaining static arrays with dynamic ones. --- lily/ttf.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lily/ttf.cc b/lily/ttf.cc index 0514a8a0aa..5f0484b3f1 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -117,7 +117,7 @@ void t42_write_table (void *out, FT_Face face, unsigned char const *buffer, size_t s, bool is_glyf, FT_ULong head_length, FT_ULong loca_length) { - vector chunks; /* FIXME: use dynamic array */ + vector chunks; if (is_glyf) { @@ -156,9 +156,7 @@ void t42_write_table (void *out, FT_Face face, unsigned char const *buffer, if (offset > last_offset + CHUNKSIZE) { if (last_chunk != last_offset) - { - chunks.push_back (last_offset - last_chunk); - } + chunks.push_back (last_offset - last_chunk); /* a single glyph with more than 64k data is a pathological case but... @@ -242,7 +240,7 @@ print_body (void *out, FT_Face face) FT_UInt idx = 0; FT_ULong head_length = 0, loca_length = 0; FT_ULong tag, length; - FT_ULong lengths[100], tags[100]; /* FIXME: use dynamic arrays */ + vector lengths, tags; /* we must build our own TTF header -- the original font @@ -252,13 +250,13 @@ print_body (void *out, FT_Face face) while (FT_Sfnt_Table_Info (face, idx, &tag, &length) != FT_Err_Table_Missing) { - assert (idx < 100); /* FIXME: only for static arrays */ - lengths[idx] = length; - tags[idx ++] = tag; + lengths.push_back (length); + tags.push_back (tag); if (tag == head_tag) head_length = length; else if (tag == loca_tag) loca_length = length; + idx ++; } FT_ULong hlength = 12 + 16 * idx; -- 2.39.5