* lib/gen-uni-tables.c (SIZEOF): New macro.
(output_numeric): Increase the maximum number of fractions from
128 to 160. Increase the level3 value width from 7 bits to 8
bits. Use SIZEOF instead of a hard-coded integer.
(output_blocks): Decrease the cut-off threshold from 0x3 to
0x28000.
(fill_blocks): Increase the maximum number of blocks from 256 to
384. Use SIZEOF instead of a hard-coded integer.
(get_lbp): Adjust to new characters added in Unicode 8.0.0.
* lib/unictype/numeric.c (uc_numeric_value): Adjust the level3
value width.
* lib/unilbrk/lbrktables.c (unilbrk_table): Implement LBP21b and
a new case added to LBP22.
* lib/uniwidth/width.c (nonspacing_table_data): Add U+08E3,
U+A69E, U+FE2E..U+FE2F, U+111CA..U+111CC, U+11300,
U+115DC..U+115DD, U+1171D..U+1171F, U+11722..U+11725,
U+11727..U+1172B, U+1DA00..U+1DA36, U+1DA3B..U+1DA6C, U+1DA75,
U+1DA84, U+1DA9B..U+1DA9F, and U+1DAA1..U+1DAAF.
* tests/uniwidth/test-uc_width2.sh: Same updates as in
lib/uniwidth/width.c.
* all generated files under lib/uni* and tests/uni*: Regenerate.
---
ChangeLog| 25 +++
lib/gen-uni-tables.c | 69 ++--
lib/unictype/numeric.c | 6 ++--
lib/unilbrk/lbrktables.c | 4 +--
lib/uniwidth/width.c | 29 +++--
tests/uniwidth/test-uc_width2.sh | 45 +++---
6 files changed, 127 insertions(+), 51 deletions(-)
Due to the size limitation, I'm sending manually adjusted files only.
Generated files have been already committed too.
diff --git a/ChangeLog b/ChangeLog
index 53fc032..8cd1336 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2015-06-18 Daiki Ueno
+
+ libunistring: update to Unicode 8.0.0
+ * lib/gen-uni-tables.c (SIZEOF): New macro.
+ (output_numeric): Increase the maximum number of fractions from
+ 128 to 160. Increase the level3 value width from 7 bits to 8
+ bits. Use SIZEOF instead of a hard-coded integer.
+ (output_blocks): Decrease the cut-off threshold from 0x3 to
+ 0x28000.
+ (fill_blocks): Increase the maximum number of blocks from 256 to
+ 384. Use SIZEOF instead of a hard-coded integer.
+ (get_lbp): Adjust to new characters added in Unicode 8.0.0.
+ * lib/unictype/numeric.c (uc_numeric_value): Adjust the level3
+ value width.
+ * lib/unilbrk/lbrktables.c (unilbrk_table): Implement LBP21b and
+ a new case added to LBP22.
+ * lib/uniwidth/width.c (nonspacing_table_data): Add U+08E3,
+ U+A69E, U+FE2E..U+FE2F, U+111CA..U+111CC, U+11300,
+ U+115DC..U+115DD, U+1171D..U+1171F, U+11722..U+11725,
+ U+11727..U+1172B, U+1DA00..U+1DA36, U+1DA3B..U+1DA6C, U+1DA75,
+ U+1DA84, U+1DA9B..U+1DA9F, and U+1DAA1..U+1DAAF.
+ * tests/uniwidth/test-uc_width2.sh: Same updates as in
+ lib/uniwidth/width.c.
+ * all generated files under lib/uni* and tests/uni*: Regenerate.
+
2015-06-16 Pádraig Brady
gnu-web-doc-update: add --mirror to remove stale files
diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c
index 03fac9f..b69229f 100644
--- a/lib/gen-uni-tables.c
+++ b/lib/gen-uni-tables.c
@@ -43,6 +43,8 @@
#include
#include
+#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
+
/* = */
/* Reading UnicodeData.txt. */
@@ -2130,7 +2132,7 @@ static void
output_numeric (const char *filename, const char *version)
{
FILE *stream;
- uc_fraction_t fractions[128];
+ uc_fraction_t fractions[160];
unsigned int nfractions;
unsigned int ch, i, j;
struct numeric_table t;
@@ -2161,7 +2163,7 @@ output_numeric (const char *filename, const char *version)
break;
if (i == nfractions)
{
- assert (nfractions != 128);
+ assert (nfractions != SIZEOF (fractions));
for (i = 0; i < nfractions; i++)
if (value.denominator < fractions[i].denominator
|| (value.denominator == fractions[i].denominator
@@ -2226,7 +2228,7 @@ output_numeric (const char *filename, const char *version)
fprintf (stream, "int level1[%zu];\n", t.level1_size);
fprintf (stream, "short level2[%zu << %d];\n", t.level2_size, t.q);
fprintf (stream, "unsigned short level3[%zu * %d + 1];\n", t.level3_size,
- (1 << t.p) * 7 / 16);
+ (1 << t.p) * 8 / 16);
fprintf (stream, " }\n");
fprintf (stream, "u_numeric =\n");
fprintf (stream, "{\n");
@@ -2270,32 +2272,32 @@ output_numeric (const char *filename, const char
*version)
if (t.level2_size << t.q > 8)
fprintf (stream, "\n ");
fprintf (stream, " },\n");
- /* Pack the level3 array. Each entry needs 7 bits only. Use 16-bit units,
+ /* Pack the level3 array. Each entry needs 8 bits only. Use 16-bit units,
not 32-bit units, in order to make the lookup function easier. */
level3_packed =
(uint