From: Patrick Lam Date: Thu, 9 Feb 2006 15:25:57 +0000 (+0000) Subject: Fix problem with missing 'en' due to euro.patch: change cache file format X-Git-Tag: fc-2_3_94~27 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a8c425301aeb8e417b0fa35567b2f8f64b450657;p=fontconfig.git Fix problem with missing 'en' due to euro.patch: change cache file format slightly to coincide with that generated by fc-lang. --- diff --git a/ChangeLog b/ChangeLog index 0881999..df5b0ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-02-09 Patrick Lam + * src/fccharset.c (FcCharSetNeededBytes, FcCharSetSerialize, + FcCharSetGetLeaf): + + Fix problem with missing 'en' due to euro.patch: change + cache file format slightly to coincide with that generated + by fc-lang. + 2006-02-07 Patrick Lam * src/fccache.c (FcCacheReadDirs): diff --git a/src/fccharset.c b/src/fccharset.c index e42b82d..4607892 100644 --- a/src/fccharset.c +++ b/src/fccharset.c @@ -1323,11 +1323,11 @@ FcCharSetNeededBytes (const FcCharSet *c) { /* yes, there's redundancy */ charset_count++; - charset_leaf_idx_count++; + charset_leaf_idx_count += c->num; charset_leaf_count += c->num; charset_numbers_count += c->num; return sizeof (FcCharSet) + - sizeof (int) + /* leaf_idx */ + sizeof (int) * c->num + /* leaf_idx */ sizeof (FcCharLeaf) * c->num + /* leaf */ sizeof (FcChar16) * c->num; /* number */ } @@ -1421,9 +1421,9 @@ FcCharSetSerialize(int bank, FcCharSet *c) charsets[bi][charset_ptr++] = new; - leaf_idx[bi][charset_leaf_idx_ptr++] = charset_leaf_ptr; for (i = 0; i < c->num; i++) { + leaf_idx[bi][charset_leaf_idx_ptr++] = charset_leaf_ptr; memcpy (&leaves[bi][charset_leaf_ptr++], c->u.dyn.leaves[i], sizeof(FcCharLeaf)); numbers[bi][charset_numbers_ptr++] = c->u.dyn.numbers[i]; @@ -1467,7 +1467,7 @@ FcCharSetGetLeaf(const FcCharSet *c, int i) return c->u.dyn.leaves[i]; bi = FcCacheBankToIndex(c->bank); - return &leaves[bi][leaf_idx[bi][c->u.stat.leafidx_offset]+i]; + return &leaves[bi][leaf_idx[bi][c->u.stat.leafidx_offset+i]]; } FcChar16 *