--- embedaddon/libiconv/lib/hkscs1999.h 2012/02/21 22:57:48 1.1.1.1 +++ embedaddon/libiconv/lib/hkscs1999.h 2021/03/17 13:38:46 1.1.1.2 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2006 Free Software Foundation, Inc. + * Copyright (C) 1999-2006, 2012, 2016 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV Library is free software; you can redistribute it @@ -14,8 +14,7 @@ * * You should have received a copy of the GNU Library General Public * License along with the GNU LIBICONV Library; see the file COPYING.LIB. - * If not, write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301, USA. + * If not, see . */ /* @@ -850,7 +849,7 @@ static const ucs4_t hkscs1999_2uni_upages[973] = { }; static int -hkscs1999_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n) +hkscs1999_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) { unsigned char c1 = s[0]; if ((c1 >= 0x88 && c1 <= 0x8b) || (c1 >= 0x8d && c1 <= 0xa0) || (c1 >= 0xc6 && c1 <= 0xc8) || (c1 >= 0xf9 && c1 <= 0xfe)) { @@ -2950,7 +2949,7 @@ static const Summary16 hkscs1999_uni2indx_page2f8[30] }; static int -hkscs1999_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) +hkscs1999_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) { if (n >= 2) { const Summary16 *summary = NULL; @@ -2987,9 +2986,9 @@ hkscs1999_wctomb (conv_t conv, unsigned char *r, ucs4_ unsigned int i = wc & 0x0f; if (used & ((unsigned short) 1 << i)) { unsigned short c; - /* Keep in `used' only the bits 0..i-1. */ + /* Keep in 'used' only the bits 0..i-1. */ used &= ((unsigned short) 1 << i) - 1; - /* Add `summary->indx' and the number of bits set in `used'. */ + /* Add 'summary->indx' and the number of bits set in 'used'. */ used = (used & 0x5555) + ((used & 0xaaaa) >> 1); used = (used & 0x3333) + ((used & 0xcccc) >> 2); used = (used & 0x0f0f) + ((used & 0xf0f0) >> 4);