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
This commit is contained in:
parent
8f2a807810
commit
a151acedc0
12
ChangeLog
12
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>
|
2005-11-18 Frederic Crozat <fcrozat@mandriva.com>
|
||||||
reviewed by: plam
|
reviewed by: plam
|
||||||
|
|
||||||
|
|
|
@ -227,16 +227,18 @@ main (int argc, char **argv)
|
||||||
char *files[MAX_LANG];
|
char *files[MAX_LANG];
|
||||||
FcCharSet *sets[MAX_LANG];
|
FcCharSet *sets[MAX_LANG];
|
||||||
int duplicate[MAX_LANG];
|
int duplicate[MAX_LANG];
|
||||||
|
int offsets[MAX_LANG];
|
||||||
int country[MAX_LANG];
|
int country[MAX_LANG];
|
||||||
char *names[MAX_LANG];
|
char *names[MAX_LANG];
|
||||||
char *langs[MAX_LANG];
|
char *langs[MAX_LANG];
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
int offset = 0;
|
||||||
int ncountry = 0;
|
int ncountry = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int argi;
|
int argi;
|
||||||
FcCharLeaf **leaves;
|
FcCharLeaf **leaves;
|
||||||
int total_leaves = 0;
|
int total_leaves = 0;
|
||||||
int leafidx_count = 0, numbers_count = 0, numbers_ptr = 0;
|
int offset_count = 0;
|
||||||
int l, sl, tl;
|
int l, sl, tl;
|
||||||
int c;
|
int c;
|
||||||
char line[1024];
|
char line[1024];
|
||||||
|
@ -374,13 +376,14 @@ main (int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
if (l == tl)
|
if (l == tl)
|
||||||
fatal (names[i], 0, "can't find leaf");
|
fatal (names[i], 0, "can't find leaf");
|
||||||
leafidx_count++;
|
offset_count++;
|
||||||
numbers_count += sets[i]->num;
|
|
||||||
}
|
}
|
||||||
|
offsets[i] = offset;
|
||||||
|
offset += sets[i]->num;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("const int langBankLeafIdx[%d] = {\n",
|
printf ("const int langBankLeafIdx[%d] = {\n",
|
||||||
leafidx_count);
|
offset_count);
|
||||||
for (i = 0; sets[i]; i++)
|
for (i = 0; sets[i]; i++)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
@ -406,11 +409,14 @@ main (int argc, char **argv)
|
||||||
printf ("};\n\n");
|
printf ("};\n\n");
|
||||||
|
|
||||||
printf ("const FcChar16 langBankNumbers[%d] = {\n",
|
printf ("const FcChar16 langBankNumbers[%d] = {\n",
|
||||||
numbers_count);
|
offset_count);
|
||||||
|
|
||||||
for (i = 0; sets[i]; i++)
|
for (i = 0; sets[i]; i++)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
if (duplicate[i] >= 0)
|
||||||
|
continue;
|
||||||
for (n = 0; n < sets[i]->num; n++)
|
for (n = 0; n < sets[i]->num; n++)
|
||||||
{
|
{
|
||||||
if (n % 8 == 0)
|
if (n % 8 == 0)
|
||||||
|
@ -438,10 +444,9 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
printf (" { (FcChar8 *) \"%s\",\n"
|
printf (" { (FcChar8 *) \"%s\",\n"
|
||||||
" { FC_REF_CONSTANT, %d, FC_BANK_LANGS, "
|
" { FC_REF_CONSTANT, %d, FC_BANK_LANGS, "
|
||||||
"{ .stat = { %d, %d } } } },\n",
|
"{ .stat = { %d, %d } } } }, /* %d */\n",
|
||||||
langs[i],
|
langs[i],
|
||||||
sets[j]->num, j, numbers_ptr);
|
sets[j]->num, offsets[j], offsets[j], j);
|
||||||
numbers_ptr += sets[i]->num;
|
|
||||||
}
|
}
|
||||||
printf ("};\n\n");
|
printf ("};\n\n");
|
||||||
printf ("#define NUM_LANG_CHAR_SET %d\n", i);
|
printf ("#define NUM_LANG_CHAR_SET %d\n", i);
|
||||||
|
|
Loading…
Reference in New Issue