summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2005-11-19 16:24:53 +0000
committerPatrick Lam <plam@MIT.EDU>2005-11-19 16:24:53 +0000
commita151acedc056783957f9875b1a21f13d0bb8bfe2 (patch)
tree05d0bdb51cc33ac9d192ead99491671bd6a6d4c4
parent8f2a807810c006e771c0f7429ba218a1ffb1e6de (diff)
Further fix of patch from 2005-11-04: miscounted numbers count
(numbers_count); didn't strip duplicate numbers (langBankNumbers); and leafidx_offset and numbers_offset in fcLangCharSets are wrong. Removed leafidx_count and numbers_count since they are the same and replaced them with offset_count. reviewed by: plam
-rw-r--r--ChangeLog12
-rw-r--r--fc-lang/fc-lang.c21
2 files changed, 25 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 27f97b1..c14d063 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-11-19 Jinghua Luo <sunmoon1997@gmail.com>
+ reviewed by: plam
+
+ * fc-lang/fc-lang.c (main):
+
+ Further fix of patch from 2005-11-04: miscounted numbers count
+ (numbers_count); didn't strip duplicate numbers (langBankNumbers);
+ and leafidx_offset and numbers_offset in fcLangCharSets are wrong.
+
+ Removed leafidx_count and numbers_count since they are the same
+ and replaced them with offset_count.
+
2005-11-18 Frederic Crozat <fcrozat@mandriva.com>
reviewed by: plam
diff --git a/fc-lang/fc-lang.c b/fc-lang/fc-lang.c
index 8d71cf8..ab20fd0 100644
--- a/fc-lang/fc-lang.c
+++ b/fc-lang/fc-lang.c
@@ -227,16 +227,18 @@ main (int argc, char **argv)
char *files[MAX_LANG];
FcCharSet *sets[MAX_LANG];
int duplicate[MAX_LANG];
+ int offsets[MAX_LANG];
int country[MAX_LANG];
char *names[MAX_LANG];
char *langs[MAX_LANG];
FILE *f;
+ int offset = 0;
int ncountry = 0;
int i = 0;
int argi;
FcCharLeaf **leaves;
int total_leaves = 0;
- int leafidx_count = 0, numbers_count = 0, numbers_ptr = 0;
+ int offset_count = 0;
int l, sl, tl;
int c;
char line[1024];
@@ -374,13 +376,14 @@ main (int argc, char **argv)
break;
if (l == tl)
fatal (names[i], 0, "can't find leaf");
- leafidx_count++;
- numbers_count += sets[i]->num;
+ offset_count++;
}
+ offsets[i] = offset;
+ offset += sets[i]->num;
}
printf ("const int langBankLeafIdx[%d] = {\n",
- leafidx_count);
+ offset_count);
for (i = 0; sets[i]; i++)
{
int n;
@@ -406,11 +409,14 @@ main (int argc, char **argv)
printf ("};\n\n");
printf ("const FcChar16 langBankNumbers[%d] = {\n",
- numbers_count);
+ offset_count);
for (i = 0; sets[i]; i++)
{
int n;
+
+ if (duplicate[i] >= 0)
+ continue;
for (n = 0; n < sets[i]->num; n++)
{
if (n % 8 == 0)
@@ -438,10 +444,9 @@ main (int argc, char **argv)
printf (" { (FcChar8 *) \"%s\",\n"
" { FC_REF_CONSTANT, %d, FC_BANK_LANGS, "
- "{ .stat = { %d, %d } } } },\n",
+ "{ .stat = { %d, %d } } } }, /* %d */\n",
langs[i],
- sets[j]->num, j, numbers_ptr);
- numbers_ptr += sets[i]->num;
+ sets[j]->num, offsets[j], offsets[j], j);
}
printf ("};\n\n");
printf ("#define NUM_LANG_CHAR_SET %d\n", i);