From 15d9d0b528387242011cdcc6190c9e598cfe3a07 Mon Sep 17 00:00:00 2001 From: yy154373 Date: Wed, 13 Feb 2008 22:04:09 -0800 Subject: 6614991 CJK kiconv modules (kiconv phase 2) --- usr/src/common/unicode/uconv.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'usr/src/common/unicode') diff --git a/usr/src/common/unicode/uconv.c b/usr/src/common/unicode/uconv.c index f4e634a952..fd65fc99b5 100644 --- a/usr/src/common/unicode/uconv.c +++ b/usr/src/common/unicode/uconv.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -140,7 +140,11 @@ static const uchar_t remaining_bytes_tbl[0x100] = { * the first byte of a UTF-8 character. Index is remaining bytes at above of * the character. */ -static const uchar_t masks_tbl[6] = { 0x00, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; +#ifdef _KERNEL +const uchar_t u8_masks_tbl[6] = { 0x00, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; +#else +static const uchar_t u8_masks_tbl[6] = { 0x00, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; +#endif /* _KERNEL */ /* * The following two vectors are to provide valid minimum and @@ -716,7 +720,7 @@ uconv_u8tou16(const uchar_t *u8s, size_t *utf8len, return (EILSEQ); first_b = hi; - hi = hi & masks_tbl[remaining_bytes]; + hi = hi & u8_masks_tbl[remaining_bytes]; for (; remaining_bytes > 0; remaining_bytes--) { /* @@ -816,7 +820,7 @@ uconv_u8tou32(const uchar_t *u8s, size_t *utf8len, return (EILSEQ); first_b = hi; - hi = hi & masks_tbl[remaining_bytes]; + hi = hi & u8_masks_tbl[remaining_bytes]; for (; remaining_bytes > 0; remaining_bytes--) { if (u8l >= *utf8len) -- cgit v1.2.3