diff options
author | Stephen Kitt <skitt@debian.org> | 2016-05-27 10:11:04 +0200 |
---|---|---|
committer | Manuel A. Fernandez Montecelo <manuel.montezelo@gmail.com> | 2016-05-27 14:28:33 +0100 |
commit | 752fd7247bc223bcea35bd89cf56d1c08ead9ba6 (patch) | |
tree | b4a428f847a963738faaf24c8eff070fdb03a3a5 /lib/uninorm/composition.c | |
parent | 9f7d4fa477ff2a51d7c932b13d57ac22dc033105 (diff) | |
parent | a9a31b1de5776a3b08a82101a4fa711294f0dd1d (diff) |
Imported Debian patch 0.9.6+really0.9.3-0.1debian/0.9.6+really0.9.3-0.1
Diffstat (limited to 'lib/uninorm/composition.c')
-rw-r--r-- | lib/uninorm/composition.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/uninorm/composition.c b/lib/uninorm/composition.c index f98d698..c9cddbe 100644 --- a/lib/uninorm/composition.c +++ b/lib/uninorm/composition.c @@ -1,5 +1,5 @@ /* Canonical composition of Unicode characters. - Copyright (C) 2002, 2006, 2009, 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2010 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it @@ -22,14 +22,14 @@ #include <string.h> -struct composition_rule { char codes[6]; unsigned int combined; }; +struct composition_rule { char codes[4]; unsigned short combined; }; #include "composition-table.h" ucs4_t uc_composition (ucs4_t uc1, ucs4_t uc2) { - if (uc1 < 0x12000 && uc2 < 0x12000) + if (uc1 < 0x10000 && uc2 < 0x10000) { if (uc2 >= 0x1161 && uc2 < 0x1161 + 21 && uc1 >= 0x1100 && uc1 < 0x1100 + 19) @@ -67,17 +67,15 @@ uc_composition (ucs4_t uc1, ucs4_t uc2) } } #else - char codes[6]; + char codes[4]; const struct composition_rule *rule; - codes[0] = (uc1 >> 16) & 0xff; - codes[1] = (uc1 >> 8) & 0xff; - codes[2] = uc1 & 0xff; - codes[3] = (uc2 >> 16) & 0xff; - codes[4] = (uc2 >> 8) & 0xff; - codes[5] = uc2 & 0xff; + codes[0] = (uc1 >> 8) & 0xff; + codes[1] = uc1 & 0xff; + codes[2] = (uc2 >> 8) & 0xff; + codes[3] = uc2 & 0xff; - rule = gl_uninorm_compose_lookup (codes, 6); + rule = gl_uninorm_compose_lookup (codes, 4); if (rule != NULL) return rule->combined; #endif |