From 3e0814cd9862b89c7a39672672937477bd87ddfb Mon Sep 17 00:00:00 2001 From: Andreas Rottmann Date: Thu, 27 May 2010 18:23:15 +0200 Subject: Imported Upstream version 0.9.3 --- lib/unictype/categ_of.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lib/unictype/categ_of.c') diff --git a/lib/unictype/categ_of.c b/lib/unictype/categ_of.c index 85b694f..66cca8d 100644 --- a/lib/unictype/categ_of.c +++ b/lib/unictype/categ_of.c @@ -1,5 +1,5 @@ /* Categories of Unicode characters. - Copyright (C) 2002, 2006-2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2010 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This program is free software: you can redistribute it and/or modify it @@ -31,22 +31,22 @@ lookup_withtable (ucs4_t uc) { int lookup1 = u_category.level1[index1]; if (lookup1 >= 0) - { - unsigned int index2 = (uc >> category_header_2) & category_header_3; - int lookup2 = u_category.level2[lookup1 + index2]; - if (lookup2 >= 0) - { - unsigned int index3 = ((uc & category_header_4) + lookup2) * 5; - /* level3 contains 5-bit values, packed into 16-bit words. */ - unsigned int lookup3 = - ((u_category.level3[index3>>4] - | (u_category.level3[(index3>>4)+1] << 16)) - >> (index3 % 16)) - & 0x1f; + { + unsigned int index2 = (uc >> category_header_2) & category_header_3; + int lookup2 = u_category.level2[lookup1 + index2]; + if (lookup2 >= 0) + { + unsigned int index3 = ((uc & category_header_4) + lookup2) * 5; + /* level3 contains 5-bit values, packed into 16-bit words. */ + unsigned int lookup3 = + ((u_category.level3[index3>>4] + | (u_category.level3[(index3>>4)+1] << 16)) + >> (index3 % 16)) + & 0x1f; - return lookup3; - } - } + return lookup3; + } + } return 29; /* = log2(UC_CATEGORY_MASK_Cn) */ } return -1; -- cgit v1.2.3