summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-01-23 14:36:17 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2004-01-23 14:36:17 (GMT)
commitd210a5bed26f219da2844f8e7355b63a8789186a (patch)
tree8527ad43f68bf3d94e8d0b74dfeacdd7d46314ed /Modules
parent0d8da3a62230b1e0c14e0e7decee408ed1ffd6c8 (diff)
downloadcpython-d210a5bed26f219da2844f8e7355b63a8789186a.zip
cpython-d210a5bed26f219da2844f8e7355b63a8789186a.tar.gz
cpython-d210a5bed26f219da2844f8e7355b63a8789186a.tar.bz2
Fix MSVC6 warnings. (spotted by Tim Peters)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cjkcodecs/_big5.c2
-rw-r--r--Modules/cjkcodecs/_cp932.c2
-rw-r--r--Modules/cjkcodecs/_cp949.c2
-rw-r--r--Modules/cjkcodecs/_cp950.c2
-rw-r--r--Modules/cjkcodecs/_euc_jisx0213.c12
-rw-r--r--Modules/cjkcodecs/_euc_jp.c2
-rw-r--r--Modules/cjkcodecs/_euc_kr.c2
-rw-r--r--Modules/cjkcodecs/_gb2312.c2
-rw-r--r--Modules/cjkcodecs/_gbk.c2
-rw-r--r--Modules/cjkcodecs/_hz.c4
-rw-r--r--Modules/cjkcodecs/_iso2022_jp.c8
-rw-r--r--Modules/cjkcodecs/_iso2022_jp_1.c8
-rw-r--r--Modules/cjkcodecs/_iso2022_jp_2.c8
-rw-r--r--Modules/cjkcodecs/_iso2022_jp_3.c10
-rw-r--r--Modules/cjkcodecs/_iso2022_jp_ext.c8
-rw-r--r--Modules/cjkcodecs/_iso2022_kr.c4
-rw-r--r--Modules/cjkcodecs/_johab.c2
-rw-r--r--Modules/cjkcodecs/_shift_jis.c2
-rw-r--r--Modules/cjkcodecs/_shift_jisx0213.c12
-rw-r--r--Modules/cjkcodecs/iso2022common.h2
20 files changed, 48 insertions, 48 deletions
diff --git a/Modules/cjkcodecs/_big5.c b/Modules/cjkcodecs/_big5.c
index 8f9a290..2ba0bc5 100644
--- a/Modules/cjkcodecs/_big5.c
+++ b/Modules/cjkcodecs/_big5.c
@@ -18,7 +18,7 @@ ENCODER(big5)
if (c < 0x80) {
RESERVE_OUTBUF(1)
- **outbuf = c;
+ **outbuf = (unsigned char)c;
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_cp932.c b/Modules/cjkcodecs/_cp932.c
index 0f21b12..870c1c6 100644
--- a/Modules/cjkcodecs/_cp932.c
+++ b/Modules/cjkcodecs/_cp932.c
@@ -20,7 +20,7 @@ ENCODER(cp932)
unsigned char c1, c2;
if (c <= 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
} else if (c >= 0xff61 && c <= 0xff9f) {
diff --git a/Modules/cjkcodecs/_cp949.c b/Modules/cjkcodecs/_cp949.c
index f2fa38c..17f51c5 100644
--- a/Modules/cjkcodecs/_cp949.c
+++ b/Modules/cjkcodecs/_cp949.c
@@ -18,7 +18,7 @@ ENCODER(cp949)
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_cp950.c b/Modules/cjkcodecs/_cp950.c
index b0644f0..dcb56f1 100644
--- a/Modules/cjkcodecs/_cp950.c
+++ b/Modules/cjkcodecs/_cp950.c
@@ -19,7 +19,7 @@ ENCODER(cp950)
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_euc_jisx0213.c b/Modules/cjkcodecs/_euc_jisx0213.c
index 3f7fbd7..8f59aca 100644
--- a/Modules/cjkcodecs/_euc_jisx0213.c
+++ b/Modules/cjkcodecs/_euc_jisx0213.c
@@ -43,18 +43,18 @@ ENCODER(euc_jisx0213)
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
diff --git a/Modules/cjkcodecs/_euc_jp.c b/Modules/cjkcodecs/_euc_jp.c
index 0392133..72a4b20 100644
--- a/Modules/cjkcodecs/_euc_jp.c
+++ b/Modules/cjkcodecs/_euc_jp.c
@@ -18,7 +18,7 @@ ENCODER(euc_jp)
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_euc_kr.c b/Modules/cjkcodecs/_euc_kr.c
index 96cd3d4..fa97890 100644
--- a/Modules/cjkcodecs/_euc_kr.c
+++ b/Modules/cjkcodecs/_euc_kr.c
@@ -17,7 +17,7 @@ ENCODER(euc_kr)
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_gb2312.c b/Modules/cjkcodecs/_gb2312.c
index 388f0b8..7659860 100644
--- a/Modules/cjkcodecs/_gb2312.c
+++ b/Modules/cjkcodecs/_gb2312.c
@@ -17,7 +17,7 @@ ENCODER(gb2312)
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_gbk.c b/Modules/cjkcodecs/_gbk.c
index b5d058a..246b5c6 100644
--- a/Modules/cjkcodecs/_gbk.c
+++ b/Modules/cjkcodecs/_gbk.c
@@ -19,7 +19,7 @@ ENCODER(gbk)
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_hz.c b/Modules/cjkcodecs/_hz.c
index 50805b1..19f910c 100644
--- a/Modules/cjkcodecs/_hz.c
+++ b/Modules/cjkcodecs/_hz.c
@@ -36,10 +36,10 @@ ENCODER(hz)
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;
}
diff --git a/Modules/cjkcodecs/_iso2022_jp.c b/Modules/cjkcodecs/_iso2022_jp.c
index d0b3b1f..486fe99 100644
--- a/Modules/cjkcodecs/_iso2022_jp.c
+++ b/Modules/cjkcodecs/_iso2022_jp.c
@@ -49,7 +49,7 @@ ENCODER(iso2022_jp)
if (c < 0x80) {
switch (STATE_GETG0(state)) {
case CHARSET_ASCII:
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
break;
case CHARSET_JISX0201_R:
@@ -61,7 +61,7 @@ ENCODER(iso2022_jp)
STATE_SETG0(state, CHARSET_ASCII)
code = c;
}
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
break;
}
@@ -77,7 +77,7 @@ ENCODER(iso2022_jp)
code = DBCINV;
JISX0201_R_ENCODE(c, code)
if (code != DBCINV) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
@@ -101,7 +101,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) {
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)
}
diff --git a/Modules/cjkcodecs/_iso2022_jp_1.c b/Modules/cjkcodecs/_iso2022_jp_1.c
index 2cf04ad..3464af4 100644
--- a/Modules/cjkcodecs/_iso2022_jp_1.c
+++ b/Modules/cjkcodecs/_iso2022_jp_1.c
@@ -51,7 +51,7 @@ ENCODER(iso2022_jp_1)
if (c < 0x80) {
switch (STATE_GETG0(state)) {
case CHARSET_ASCII:
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
break;
case CHARSET_JISX0201_R:
@@ -63,7 +63,7 @@ ENCODER(iso2022_jp_1)
STATE_SETG0(state, CHARSET_ASCII)
code = c;
}
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
break;
}
@@ -79,7 +79,7 @@ ENCODER(iso2022_jp_1)
code = DBCINV;
JISX0201_R_ENCODE(c, code)
if (code != DBCINV) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
@@ -110,7 +110,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) {
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)
}
diff --git a/Modules/cjkcodecs/_iso2022_jp_2.c b/Modules/cjkcodecs/_iso2022_jp_2.c
index d16aa67..c2ec012 100644
--- a/Modules/cjkcodecs/_iso2022_jp_2.c
+++ b/Modules/cjkcodecs/_iso2022_jp_2.c
@@ -57,7 +57,7 @@ ENCODER(iso2022_jp_2)
if (c < 0x80) {
switch (STATE_GETG0(state)) {
case CHARSET_ASCII:
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
break;
case CHARSET_JISX0201_R:
@@ -69,7 +69,7 @@ ENCODER(iso2022_jp_2)
STATE_SETG0(state, CHARSET_ASCII)
code = c;
}
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
break;
}
@@ -85,7 +85,7 @@ ENCODER(iso2022_jp_2)
code = DBCINV;
JISX0201_R_ENCODE(c, code)
if (code != DBCINV) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
@@ -140,7 +140,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) {
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)
}
diff --git a/Modules/cjkcodecs/_iso2022_jp_3.c b/Modules/cjkcodecs/_iso2022_jp_3.c
index 00a90fd..5d3242d 100644
--- a/Modules/cjkcodecs/_iso2022_jp_3.c
+++ b/Modules/cjkcodecs/_iso2022_jp_3.c
@@ -80,18 +80,18 @@ ENCODER(iso2022_jp_3)
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
diff --git a/Modules/cjkcodecs/_iso2022_jp_ext.c b/Modules/cjkcodecs/_iso2022_jp_ext.c
index 5cd0d94..8225911 100644
--- a/Modules/cjkcodecs/_iso2022_jp_ext.c
+++ b/Modules/cjkcodecs/_iso2022_jp_ext.c
@@ -49,7 +49,7 @@ ENCODER(iso2022_jp_ext)
if (c < 0x80) {
switch (STATE_GETG0(state)) {
case CHARSET_ASCII:
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
break;
case CHARSET_JISX0201_R:
@@ -61,7 +61,7 @@ ENCODER(iso2022_jp_ext)
STATE_SETG0(state, CHARSET_ASCII)
code = c;
}
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
break;
}
@@ -77,7 +77,7 @@ ENCODER(iso2022_jp_ext)
code = DBCINV;
JISX0201_R_ENCODE(c, code)
if (code != DBCINV) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
@@ -110,7 +110,7 @@ jisx0208encode: if (charset != CHARSET_JISX0208) {
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 */
diff --git a/Modules/cjkcodecs/_iso2022_kr.c b/Modules/cjkcodecs/_iso2022_kr.c
index f890cd3..3fbe1df 100644
--- a/Modules/cjkcodecs/_iso2022_kr.c
+++ b/Modules/cjkcodecs/_iso2022_kr.c
@@ -43,11 +43,11 @@ ENCODER(iso2022_kr)
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')
diff --git a/Modules/cjkcodecs/_johab.c b/Modules/cjkcodecs/_johab.c
index 3aeb500..3199704 100644
--- a/Modules/cjkcodecs/_johab.c
+++ b/Modules/cjkcodecs/_johab.c
@@ -44,7 +44,7 @@ ENCODER(johab)
DBCHAR code;
if (c < 0x80) {
- WRITE1(c)
+ WRITE1((unsigned char)c)
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_shift_jis.c b/Modules/cjkcodecs/_shift_jis.c
index 0bdee3f..3619a3a 100644
--- a/Modules/cjkcodecs/_shift_jis.c
+++ b/Modules/cjkcodecs/_shift_jis.c
@@ -32,7 +32,7 @@ ENCODER(shift_jis)
if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
RESERVE_OUTBUF(1)
- OUT1(code)
+ OUT1((unsigned char)code)
NEXT(1, 1)
continue;
}
diff --git a/Modules/cjkcodecs/_shift_jisx0213.c b/Modules/cjkcodecs/_shift_jisx0213.c
index fd622b0..0b24fec 100644
--- a/Modules/cjkcodecs/_shift_jisx0213.c
+++ b/Modules/cjkcodecs/_shift_jisx0213.c
@@ -33,7 +33,7 @@ ENCODER(shift_jisx0213)
else DECODE_SURROGATE(c)
if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
- WRITE1(code)
+ WRITE1((unsigned char)code)
NEXT(1, 1)
continue;
}
@@ -47,18 +47,18 @@ ENCODER(shift_jisx0213)
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
diff --git a/Modules/cjkcodecs/iso2022common.h b/Modules/cjkcodecs/iso2022common.h
index cb8a159..e042d80 100644
--- a/Modules/cjkcodecs/iso2022common.h
+++ b/Modules/cjkcodecs/iso2022common.h
@@ -183,7 +183,7 @@ iso2022processesc(MultibyteCodec_State *state,
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)