From 56155b25f1e6c15c70bb0b566f2bf9b1757d98e7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 2 Jun 2004 02:17:04 +0000 Subject: [PATCH] Fix for greater than 4-digit CompositionExclusions --- libraries/liblunicode/ucdata/ucgendat.c | 12 +++++++----- libraries/liblunicode/ucdata/uctable.h | 15 ++------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/libraries/liblunicode/ucdata/ucgendat.c b/libraries/liblunicode/ucdata/ucgendat.c index 7403a1dd81..8c2690be25 100644 --- a/libraries/liblunicode/ucdata/ucgendat.c +++ b/libraries/liblunicode/ucdata/ucgendat.c @@ -140,7 +140,7 @@ static ac_uint4 kdecomps_size; */ #define COMPEX_SET(c) (compexs[(c) >> 5] |= (1 << ((c) & 31))) #define COMPEX_TEST(c) (compexs[(c) >> 5] & (1 << ((c) & 31))) -static ac_uint4 compexs[2048]; +static ac_uint4 compexs[8192]; /* * Struct for holding a composition pair, and array of composition pairs @@ -1204,10 +1204,11 @@ cmpcomps(const void *v_comp1, const void *v_comp2) static void read_compexdata(FILE *in) { - ac_uint2 i, code; + ac_uint2 i; + ac_uint4 code; char line[512], *s; - (void) memset((char *) compexs, 0, sizeof(ac_uint4) << 11); + (void) memset((char *) compexs, 0, sizeof(compexs)); while (fgets(line, sizeof(line), in)) { if( (s=strchr(line, '\n')) ) *s = '\0'; @@ -1218,10 +1219,11 @@ read_compexdata(FILE *in) continue; /* - * Collect the code. Assume max 4 digits + * Collect the code. Assume max 6 digits */ - for (s = line, i = code = 0; *s != '#' && i < 4; i++, s++) { + for (s = line, i = code = 0; *s != '#' && i < 6; i++, s++) { + if (isspace(*s)) break; code <<= 4; if (*s >= '0' && *s <= '9') code += *s - '0'; diff --git a/libraries/liblunicode/ucdata/uctable.h b/libraries/liblunicode/ucdata/uctable.h index b6d0098bb5..6aef2322f2 100644 --- a/libraries/liblunicode/ucdata/uctable.h +++ b/libraries/liblunicode/ucdata/uctable.h @@ -3004,7 +3004,7 @@ static const ac_uint4 _uccase_map[] = { 0x000001f2, 0x000001f1, 0x000001f3 }; -static const ac_uint4 _uccomp_size = 3728; +static const ac_uint4 _uccomp_size = 3684; static const ac_uint4 _uccomp_data[] = { 0x0000226e, 0x00000002, 0x0000003c, 0x00000338, @@ -3927,18 +3927,7 @@ static const ac_uint4 _uccomp_data[] = { 0x000030f8, 0x00000002, 0x000030f0, 0x00003099, 0x000030f9, 0x00000002, 0x000030f1, 0x00003099, 0x000030fa, 0x00000002, 0x000030f2, 0x00003099, - 0x000030fe, 0x00000002, 0x000030fd, 0x00003099, - 0x0001d15e, 0x00000002, 0x0001d157, 0x0001d165, - 0x0001d15f, 0x00000002, 0x0001d158, 0x0001d165, - 0x0001d160, 0x00000002, 0x0001d15f, 0x0001d16e, - 0x0001d161, 0x00000002, 0x0001d15f, 0x0001d16f, - 0x0001d162, 0x00000002, 0x0001d15f, 0x0001d170, - 0x0001d163, 0x00000002, 0x0001d15f, 0x0001d171, - 0x0001d1bb, 0x00000002, 0x0001d1b9, 0x0001d165, - 0x0001d1bc, 0x00000002, 0x0001d1ba, 0x0001d165, - 0x0001d1bd, 0x00000002, 0x0001d1bb, 0x0001d16e, - 0x0001d1bf, 0x00000002, 0x0001d1bb, 0x0001d16f, - 0x0001d1be, 0x00000002, 0x0001d1bc, 0x0001d16e + 0x000030fe, 0x00000002, 0x000030fd, 0x00003099 }; static const ac_uint4 _ucdcmp_size = 3848; -- 2.39.5