version 1.1.1.1, 2012/02/21 22:57:48
|
version 1.1.1.2, 2021/03/17 13:38:46
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (C) 1999-2001 Free Software Foundation, Inc. | * Copyright (C) 1999-2001, 2012, 2016 Free Software Foundation, Inc. |
* This file is part of the GNU LIBICONV Library. |
* This file is part of the GNU LIBICONV Library. |
* |
* |
* The GNU LIBICONV Library is free software; you can redistribute it |
* The GNU LIBICONV Library is free software; you can redistribute it |
Line 14
|
Line 14
|
* |
* |
* You should have received a copy of the GNU Library General Public |
* You should have received a copy of the GNU Library General Public |
* License along with the GNU LIBICONV Library; see the file COPYING.LIB. |
* License along with the GNU LIBICONV Library; see the file COPYING.LIB. |
* If not, write to the Free Software Foundation, Inc., 51 Franklin Street, | * If not, see <https://www.gnu.org/licenses/>. |
* Fifth Floor, Boston, MA 02110-1301, USA. | |
*/ |
*/ |
|
|
/* |
/* |
Line 911 static const unsigned short jisx0212_2uni_page30[5801]
|
Line 910 static const unsigned short jisx0212_2uni_page30[5801]
|
}; |
}; |
|
|
static int |
static int |
jisx0212_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n) | jisx0212_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) |
{ |
{ |
unsigned char c1 = s[0]; |
unsigned char c1 = s[0]; |
if ((c1 == 0x22) || (c1 >= 0x26 && c1 <= 0x27) || (c1 >= 0x29 && c1 <= 0x2b) || (c1 >= 0x30 && c1 <= 0x6d)) { |
if ((c1 == 0x22) || (c1 >= 0x26 && c1 <= 0x27) || (c1 >= 0x29 && c1 <= 0x2b) || (c1 >= 0x30 && c1 <= 0x6d)) { |
Line 2154 static const Summary16 jisx0212_uni2indx_pageff[6] = {
|
Line 2153 static const Summary16 jisx0212_uni2indx_pageff[6] = {
|
}; |
}; |
|
|
static int |
static int |
jisx0212_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) | jisx0212_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) |
{ |
{ |
if (n >= 2) { |
if (n >= 2) { |
const Summary16 *summary = NULL; |
const Summary16 *summary = NULL; |
Line 2171 jisx0212_wctomb (conv_t conv, unsigned char *r, ucs4_t
|
Line 2170 jisx0212_wctomb (conv_t conv, unsigned char *r, ucs4_t
|
unsigned int i = wc & 0x0f; |
unsigned int i = wc & 0x0f; |
if (used & ((unsigned short) 1 << i)) { |
if (used & ((unsigned short) 1 << i)) { |
unsigned short c; |
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; |
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 & 0x5555) + ((used & 0xaaaa) >> 1); |
used = (used & 0x3333) + ((used & 0xcccc) >> 2); |
used = (used & 0x3333) + ((used & 0xcccc) >> 2); |
used = (used & 0x0f0f) + ((used & 0xf0f0) >> 4); |
used = (used & 0x0f0f) + ((used & 0xf0f0) >> 4); |