From 75554ef2a8adf7aaf6a5d0b285dd11c272b46aa7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 18:17:41 +0400 Subject: uca-dump.c: Better variable names in dump. Dump tertiary weight in reverse order, to sort upper letters before their lower counterparts. strings/uca-dump.c: Better variable names in dump. Dump tertiary weight in reverse order, to sort upper letters before their lower counterparts. --- strings/uca-dump.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'strings/uca-dump.c') diff --git a/strings/uca-dump.c b/strings/uca-dump.c index c9642598c3c..db5cb7e999a 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -218,7 +218,6 @@ int main(int ac, char **av) */ if (ndefs == MY_UCA_NCHARS) { - printf("/* Don't dump w=%d pg=%3X: ndefs=%d */\n",w, page, ndefs); continue; } switch (maxnum) @@ -263,7 +262,17 @@ int main(int ac, char **av) for (i=0; i < maxnum; i++) { - printf("0x%04X",(int)weight[i]); + /* + Invert weights for secondary level to + sort upper case letters before their + lower case counter part. + */ + int tmp= weight[i]; + if (w == 2 && tmp) + tmp= (int)(0x100 - weight[i]); + + + printf("0x%04X", tmp); if ((offs+1 != MY_UCA_NCHARS) || (i+1!=maxnum)) printf(","); nchars++; @@ -281,7 +290,7 @@ int main(int ac, char **av) printf("};\n\n"); } - printf("uchar ucal%s[%d]={\n", pname[w], MY_UCA_NPAGES); + printf("uchar uca_length%s[%d]={\n", pname[w], MY_UCA_NPAGES); for (page=0; page < MY_UCA_NPAGES; page++) { printf("%d%s%s",pagemaxlen[page],page