Commit e8690f6f authored by Hye-Shik Chang's avatar Hye-Shik Chang

Fix MSVC6 warnings. (spotted by Tim Peters)

parent 44147fae
...@@ -18,7 +18,7 @@ ENCODER(big5) ...@@ -18,7 +18,7 @@ ENCODER(big5)
if (c < 0x80) { if (c < 0x80) {
RESERVE_OUTBUF(1) RESERVE_OUTBUF(1)
**outbuf = c; **outbuf = (unsigned char)c;
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -20,7 +20,7 @@ ENCODER(cp932) ...@@ -20,7 +20,7 @@ ENCODER(cp932)
unsigned char c1, c2; unsigned char c1, c2;
if (c <= 0x80) { if (c <= 0x80) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} else if (c >= 0xff61 && c <= 0xff9f) { } else if (c >= 0xff61 && c <= 0xff9f) {
......
...@@ -18,7 +18,7 @@ ENCODER(cp949) ...@@ -18,7 +18,7 @@ ENCODER(cp949)
DBCHAR code; DBCHAR code;
if (c < 0x80) { if (c < 0x80) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -19,7 +19,7 @@ ENCODER(cp950) ...@@ -19,7 +19,7 @@ ENCODER(cp950)
DBCHAR code; DBCHAR code;
if (c < 0x80) { if (c < 0x80) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -43,18 +43,18 @@ ENCODER(euc_jisx0213) ...@@ -43,18 +43,18 @@ ENCODER(euc_jisx0213)
if (code == MULTIC) { if (code == MULTIC) {
if (inleft < 2) { if (inleft < 2) {
if (flags & MBENC_FLUSH) { if (flags & MBENC_FLUSH) {
code = find_pairencmap(c, 0, jisx0213_pairencmap, code = find_pairencmap((ucs2_t)c, 0,
JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) if (code == DBCINV)
return 1; return 1;
} else } else
return MBERR_TOOFEW; return MBERR_TOOFEW;
} else { } else {
code = find_pairencmap(c, (*inbuf)[1], code = find_pairencmap((ucs2_t)c, (*inbuf)[1],
jisx0213_pairencmap, JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) { if (code == DBCINV) {
code = find_pairencmap(c, 0, jisx0213_pairencmap, code = find_pairencmap((ucs2_t)c, 0,
JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) if (code == DBCINV)
return 1; return 1;
} else } else
......
...@@ -18,7 +18,7 @@ ENCODER(euc_jp) ...@@ -18,7 +18,7 @@ ENCODER(euc_jp)
DBCHAR code; DBCHAR code;
if (c < 0x80) { if (c < 0x80) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -17,7 +17,7 @@ ENCODER(euc_kr) ...@@ -17,7 +17,7 @@ ENCODER(euc_kr)
DBCHAR code; DBCHAR code;
if (c < 0x80) { if (c < 0x80) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -17,7 +17,7 @@ ENCODER(gb2312) ...@@ -17,7 +17,7 @@ ENCODER(gb2312)
DBCHAR code; DBCHAR code;
if (c < 0x80) { if (c < 0x80) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -19,7 +19,7 @@ ENCODER(gbk) ...@@ -19,7 +19,7 @@ ENCODER(gbk)
DBCHAR code; DBCHAR code;
if (c < 0x80) { if (c < 0x80) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -36,10 +36,10 @@ ENCODER(hz) ...@@ -36,10 +36,10 @@ ENCODER(hz)
if (c < 0x80) { if (c < 0x80) {
if (state->i == 0) { if (state->i == 0) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
} else { } else {
WRITE3('~', '}', c) WRITE3('~', '}', (unsigned char)c)
NEXT(1, 3) NEXT(1, 3)
state->i = 0; state->i = 0;
} }
......
...@@ -49,7 +49,7 @@ ENCODER(iso2022_jp) ...@@ -49,7 +49,7 @@ ENCODER(iso2022_jp)
if (c < 0x80) { if (c < 0x80) {
switch (STATE_GETG0(state)) { switch (STATE_GETG0(state)) {
case CHARSET_ASCII: case CHARSET_ASCII:
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
break; break;
case CHARSET_JISX0201_R: case CHARSET_JISX0201_R:
...@@ -61,7 +61,7 @@ ENCODER(iso2022_jp) ...@@ -61,7 +61,7 @@ ENCODER(iso2022_jp)
STATE_SETG0(state, CHARSET_ASCII) STATE_SETG0(state, CHARSET_ASCII)
code = c; code = c;
} }
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
break; break;
} }
...@@ -77,7 +77,7 @@ ENCODER(iso2022_jp) ...@@ -77,7 +77,7 @@ ENCODER(iso2022_jp)
code = DBCINV; code = DBCINV;
JISX0201_R_ENCODE(c, code) JISX0201_R_ENCODE(c, code)
if (code != DBCINV) { if (code != DBCINV) {
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
...@@ -101,7 +101,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) { ...@@ -101,7 +101,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) {
else else
return 1; return 1;
/* if (charset == CHARSET_JISX0201_R) : already checked */ /* if (charset == CHARSET_JISX0201_R) : already checked */
WRITE4(ESC, '(', 'J', code) WRITE4(ESC, '(', 'J', (unsigned char)code)
STATE_SETG0(state, CHARSET_JISX0201_R) STATE_SETG0(state, CHARSET_JISX0201_R)
NEXT(1, 4) NEXT(1, 4)
} }
......
...@@ -51,7 +51,7 @@ ENCODER(iso2022_jp_1) ...@@ -51,7 +51,7 @@ ENCODER(iso2022_jp_1)
if (c < 0x80) { if (c < 0x80) {
switch (STATE_GETG0(state)) { switch (STATE_GETG0(state)) {
case CHARSET_ASCII: case CHARSET_ASCII:
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
break; break;
case CHARSET_JISX0201_R: case CHARSET_JISX0201_R:
...@@ -63,7 +63,7 @@ ENCODER(iso2022_jp_1) ...@@ -63,7 +63,7 @@ ENCODER(iso2022_jp_1)
STATE_SETG0(state, CHARSET_ASCII) STATE_SETG0(state, CHARSET_ASCII)
code = c; code = c;
} }
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
break; break;
} }
...@@ -79,7 +79,7 @@ ENCODER(iso2022_jp_1) ...@@ -79,7 +79,7 @@ ENCODER(iso2022_jp_1)
code = DBCINV; code = DBCINV;
JISX0201_R_ENCODE(c, code) JISX0201_R_ENCODE(c, code)
if (code != DBCINV) { if (code != DBCINV) {
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
...@@ -110,7 +110,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) { ...@@ -110,7 +110,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) {
else else
return 1; return 1;
/* if (charset == CHARSET_JISX0201_R) : already checked */ /* if (charset == CHARSET_JISX0201_R) : already checked */
WRITE4(ESC, '(', 'J', code) WRITE4(ESC, '(', 'J', (unsigned char)code)
STATE_SETG0(state, CHARSET_JISX0201_R) STATE_SETG0(state, CHARSET_JISX0201_R)
NEXT(1, 4) NEXT(1, 4)
} }
......
...@@ -57,7 +57,7 @@ ENCODER(iso2022_jp_2) ...@@ -57,7 +57,7 @@ ENCODER(iso2022_jp_2)
if (c < 0x80) { if (c < 0x80) {
switch (STATE_GETG0(state)) { switch (STATE_GETG0(state)) {
case CHARSET_ASCII: case CHARSET_ASCII:
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
break; break;
case CHARSET_JISX0201_R: case CHARSET_JISX0201_R:
...@@ -69,7 +69,7 @@ ENCODER(iso2022_jp_2) ...@@ -69,7 +69,7 @@ ENCODER(iso2022_jp_2)
STATE_SETG0(state, CHARSET_ASCII) STATE_SETG0(state, CHARSET_ASCII)
code = c; code = c;
} }
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
break; break;
} }
...@@ -85,7 +85,7 @@ ENCODER(iso2022_jp_2) ...@@ -85,7 +85,7 @@ ENCODER(iso2022_jp_2)
code = DBCINV; code = DBCINV;
JISX0201_R_ENCODE(c, code) JISX0201_R_ENCODE(c, code)
if (code != DBCINV) { if (code != DBCINV) {
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
...@@ -140,7 +140,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) { ...@@ -140,7 +140,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) {
return 1; return 1;
} }
/* if (charset == CHARSET_JISX0201_R) : already checked */ /* if (charset == CHARSET_JISX0201_R) : already checked */
WRITE4(ESC, '(', 'J', code) WRITE4(ESC, '(', 'J', (unsigned char)code)
STATE_SETG0(state, CHARSET_JISX0201_R) STATE_SETG0(state, CHARSET_JISX0201_R)
NEXT(1, 4) NEXT(1, 4)
} }
......
...@@ -80,18 +80,18 @@ ENCODER(iso2022_jp_3) ...@@ -80,18 +80,18 @@ ENCODER(iso2022_jp_3)
if (code == MULTIC) { if (code == MULTIC) {
if (inleft < 2) { if (inleft < 2) {
if (flags & MBENC_FLUSH) { if (flags & MBENC_FLUSH) {
code = find_pairencmap(c, 0, jisx0213_pairencmap, code = find_pairencmap((ucs2_t)c, 0,
JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) if (code == DBCINV)
return 1; return 1;
} else } else
return MBERR_TOOFEW; return MBERR_TOOFEW;
} else { } else {
code = find_pairencmap(c, IN2, code = find_pairencmap((ucs2_t)c, IN2,
jisx0213_pairencmap, JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) { if (code == DBCINV) {
code = find_pairencmap(c, 0, jisx0213_pairencmap, code = find_pairencmap((ucs2_t)c, 0,
JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) if (code == DBCINV)
return 1; return 1;
} else } else
......
...@@ -49,7 +49,7 @@ ENCODER(iso2022_jp_ext) ...@@ -49,7 +49,7 @@ ENCODER(iso2022_jp_ext)
if (c < 0x80) { if (c < 0x80) {
switch (STATE_GETG0(state)) { switch (STATE_GETG0(state)) {
case CHARSET_ASCII: case CHARSET_ASCII:
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
break; break;
case CHARSET_JISX0201_R: case CHARSET_JISX0201_R:
...@@ -61,7 +61,7 @@ ENCODER(iso2022_jp_ext) ...@@ -61,7 +61,7 @@ ENCODER(iso2022_jp_ext)
STATE_SETG0(state, CHARSET_ASCII) STATE_SETG0(state, CHARSET_ASCII)
code = c; code = c;
} }
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
break; break;
} }
...@@ -77,7 +77,7 @@ ENCODER(iso2022_jp_ext) ...@@ -77,7 +77,7 @@ ENCODER(iso2022_jp_ext)
code = DBCINV; code = DBCINV;
JISX0201_R_ENCODE(c, code) JISX0201_R_ENCODE(c, code)
if (code != DBCINV) { if (code != DBCINV) {
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
...@@ -110,7 +110,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) { ...@@ -110,7 +110,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) {
if (code < 0x80) { /* JIS X 0201 Roman */ if (code < 0x80) { /* JIS X 0201 Roman */
/* if (charset == CHARSET_JISX0201_R) : already checked */ /* if (charset == CHARSET_JISX0201_R) : already checked */
WRITE4(ESC, '(', 'J', code) WRITE4(ESC, '(', 'J', (unsigned char)code)
STATE_SETG0(state, CHARSET_JISX0201_R) STATE_SETG0(state, CHARSET_JISX0201_R)
NEXT(1, 4) NEXT(1, 4)
} else { /* JIS X 0201 Katakana */ } else { /* JIS X 0201 Katakana */
......
...@@ -43,11 +43,11 @@ ENCODER(iso2022_kr) ...@@ -43,11 +43,11 @@ ENCODER(iso2022_kr)
if (c < 0x80) { if (c < 0x80) {
if (STATE_GETFLAG(state, F_SHIFTED)) { if (STATE_GETFLAG(state, F_SHIFTED)) {
WRITE2(SI, c) WRITE2(SI, (unsigned char)c)
STATE_CLEARFLAG(state, F_SHIFTED) STATE_CLEARFLAG(state, F_SHIFTED)
NEXT(1, 2) NEXT(1, 2)
} else { } else {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
} }
if (c == '\n') if (c == '\n')
......
...@@ -44,7 +44,7 @@ ENCODER(johab) ...@@ -44,7 +44,7 @@ ENCODER(johab)
DBCHAR code; DBCHAR code;
if (c < 0x80) { if (c < 0x80) {
WRITE1(c) WRITE1((unsigned char)c)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -32,7 +32,7 @@ ENCODER(shift_jis) ...@@ -32,7 +32,7 @@ ENCODER(shift_jis)
if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) { if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
RESERVE_OUTBUF(1) RESERVE_OUTBUF(1)
OUT1(code) OUT1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
......
...@@ -33,7 +33,7 @@ ENCODER(shift_jisx0213) ...@@ -33,7 +33,7 @@ ENCODER(shift_jisx0213)
else DECODE_SURROGATE(c) else DECODE_SURROGATE(c)
if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) { if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
WRITE1(code) WRITE1((unsigned char)code)
NEXT(1, 1) NEXT(1, 1)
continue; continue;
} }
...@@ -47,18 +47,18 @@ ENCODER(shift_jisx0213) ...@@ -47,18 +47,18 @@ ENCODER(shift_jisx0213)
if (code == MULTIC) { if (code == MULTIC) {
if (inleft < 2) { if (inleft < 2) {
if (flags & MBENC_FLUSH) { if (flags & MBENC_FLUSH) {
code = find_pairencmap(c, 0, jisx0213_pairencmap, code = find_pairencmap((ucs2_t)c, 0,
JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) if (code == DBCINV)
return 1; return 1;
} else } else
return MBERR_TOOFEW; return MBERR_TOOFEW;
} else { } else {
code = find_pairencmap(c, IN2, code = find_pairencmap((ucs2_t)c, IN2,
jisx0213_pairencmap, JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) { if (code == DBCINV) {
code = find_pairencmap(c, 0, jisx0213_pairencmap, code = find_pairencmap((ucs2_t)c, 0,
JISX0213_ENCPAIRS); jisx0213_pairencmap, JISX0213_ENCPAIRS);
if (code == DBCINV) if (code == DBCINV)
return 1; return 1;
} else } else
......
...@@ -183,7 +183,7 @@ iso2022processesc(MultibyteCodec_State *state, ...@@ -183,7 +183,7 @@ iso2022processesc(MultibyteCodec_State *state,
const unsigned char **inbuf, size_t *inleft) const unsigned char **inbuf, size_t *inleft)
{ {
unsigned char charset, designation; unsigned char charset, designation;
int i, esclen; size_t i, esclen;
for (i = 1;i < MAX_ESCSEQLEN;i++) { for (i = 1;i < MAX_ESCSEQLEN;i++) {
if (i >= *inleft) if (i >= *inleft)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment