if (c < 0x80) {
RESERVE_OUTBUF(1)
- **outbuf = c;
+ **outbuf = (unsigned char)c;
NEXT(1, 1)
continue;
}
unsigned char c1, c2;
if (c <= 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
} else if (c >= 0xff61 && c <= 0xff9f) {
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
if (code == MULTIC) {
if (inleft < 2) {
if (flags & MBENC_FLUSH) {
- code = find_pairencmap(c, 0, jisx0213_pairencmap,
- JISX0213_ENCPAIRS);
+ code = find_pairencmap((ucs2_t)c, 0,
+ jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV)
return 1;
} else
return MBERR_TOOFEW;
} else {
- code = find_pairencmap(c, (*inbuf)[1],
- jisx0213_pairencmap, JISX0213_ENCPAIRS);
+ code = find_pairencmap((ucs2_t)c, (*inbuf)[1],
+ jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) {
- code = find_pairencmap(c, 0, jisx0213_pairencmap,
- JISX0213_ENCPAIRS);
+ code = find_pairencmap((ucs2_t)c, 0,
+ jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV)
return 1;
} else
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
if (c < 0x80) {
if (state->i == 0) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
} else {
- WRITE3('~', '}', c)
+ WRITE3('~', '}', (unsigned char)c)
NEXT(1, 3)
state->i = 0;
}
if (c < 0x80) {
switch (STATE_GETG0(state)) {
case CHARSET_ASCII:
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
break;
case CHARSET_JISX0201_R:
STATE_SETG0(state, CHARSET_ASCII)
code = c;
}
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
break;
}
code = DBCINV;
JISX0201_R_ENCODE(c, code)
if (code != DBCINV) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
else
return 1;
/* if (charset == CHARSET_JISX0201_R) : already checked */
- WRITE4(ESC, '(', 'J', code)
+ WRITE4(ESC, '(', 'J', (unsigned char)code)
STATE_SETG0(state, CHARSET_JISX0201_R)
NEXT(1, 4)
}
if (c < 0x80) {
switch (STATE_GETG0(state)) {
case CHARSET_ASCII:
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
break;
case CHARSET_JISX0201_R:
STATE_SETG0(state, CHARSET_ASCII)
code = c;
}
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
break;
}
code = DBCINV;
JISX0201_R_ENCODE(c, code)
if (code != DBCINV) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
else
return 1;
/* if (charset == CHARSET_JISX0201_R) : already checked */
- WRITE4(ESC, '(', 'J', code)
+ WRITE4(ESC, '(', 'J', (unsigned char)code)
STATE_SETG0(state, CHARSET_JISX0201_R)
NEXT(1, 4)
}
if (c < 0x80) {
switch (STATE_GETG0(state)) {
case CHARSET_ASCII:
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
break;
case CHARSET_JISX0201_R:
STATE_SETG0(state, CHARSET_ASCII)
code = c;
}
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
break;
}
code = DBCINV;
JISX0201_R_ENCODE(c, code)
if (code != DBCINV) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
return 1;
}
/* if (charset == CHARSET_JISX0201_R) : already checked */
- WRITE4(ESC, '(', 'J', code)
+ WRITE4(ESC, '(', 'J', (unsigned char)code)
STATE_SETG0(state, CHARSET_JISX0201_R)
NEXT(1, 4)
}
if (code == MULTIC) {
if (inleft < 2) {
if (flags & MBENC_FLUSH) {
- code = find_pairencmap(c, 0, jisx0213_pairencmap,
- JISX0213_ENCPAIRS);
+ code = find_pairencmap((ucs2_t)c, 0,
+ jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV)
return 1;
} else
return MBERR_TOOFEW;
} else {
- code = find_pairencmap(c, IN2,
+ code = find_pairencmap((ucs2_t)c, IN2,
jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) {
- code = find_pairencmap(c, 0, jisx0213_pairencmap,
- JISX0213_ENCPAIRS);
+ code = find_pairencmap((ucs2_t)c, 0,
+ jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV)
return 1;
} else
if (c < 0x80) {
switch (STATE_GETG0(state)) {
case CHARSET_ASCII:
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
break;
case CHARSET_JISX0201_R:
STATE_SETG0(state, CHARSET_ASCII)
code = c;
}
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
break;
}
code = DBCINV;
JISX0201_R_ENCODE(c, code)
if (code != DBCINV) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
if (code < 0x80) { /* JIS X 0201 Roman */
/* if (charset == CHARSET_JISX0201_R) : already checked */
- WRITE4(ESC, '(', 'J', code)
+ WRITE4(ESC, '(', 'J', (unsigned char)code)
STATE_SETG0(state, CHARSET_JISX0201_R)
NEXT(1, 4)
} else { /* JIS X 0201 Katakana */
if (c < 0x80) {
if (STATE_GETFLAG(state, F_SHIFTED)) {
- WRITE2(SI, c)
+ WRITE2(SI, (unsigned char)c)
STATE_CLEARFLAG(state, F_SHIFTED)
NEXT(1, 2)
} else {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
}
if (c == '\n')
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
RESERVE_OUTBUF(1)
- OUT1(code)
+ OUT1((unsigned char)code)
NEXT(1, 1)
continue;
}
else DECODE_SURROGATE(c)
if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
if (code == MULTIC) {
if (inleft < 2) {
if (flags & MBENC_FLUSH) {
- code = find_pairencmap(c, 0, jisx0213_pairencmap,
- JISX0213_ENCPAIRS);
+ code = find_pairencmap((ucs2_t)c, 0,
+ jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV)
return 1;
} else
return MBERR_TOOFEW;
} else {
- code = find_pairencmap(c, IN2,
+ code = find_pairencmap((ucs2_t)c, IN2,
jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) {
- code = find_pairencmap(c, 0, jisx0213_pairencmap,
- JISX0213_ENCPAIRS);
+ code = find_pairencmap((ucs2_t)c, 0,
+ jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV)
return 1;
} else
const unsigned char **inbuf, size_t *inleft)
{
unsigned char charset, designation;
- int i, esclen;
+ size_t i, esclen;
for (i = 1;i < MAX_ESCSEQLEN;i++) {
if (i >= *inleft)