diff options
| author | fukachan <fukachan> | 2002-04-14 08:20:37 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-04-14 08:20:37 +0000 |
| commit | 3403ab4f986f211ac0342778080ef21bae409e43 (patch) | |
| tree | 0ad5dbc52c620c0453ff86ec168e8b9f64e5cb22 /cpan/dist/Jcode/Unicode | |
| parent | b9cb387d093c2435a928bddb36d624ffb358cc69 (diff) | |
| download | fml8-Jcode-0-79.tar.gz fml8-Jcode-0-79.tar.bz2 fml8-Jcode-0-79.zip | |
Jcode-0.79Jcode-0-79
Diffstat (limited to 'cpan/dist/Jcode/Unicode')
| -rw-r--r-- | cpan/dist/Jcode/Unicode/Unicode.xs | 8 | ||||
| -rw-r--r-- | cpan/dist/Jcode/Unicode/table.h | 2 | ||||
| -rw-r--r-- | cpan/dist/Jcode/Unicode/uni.c | 30 |
3 files changed, 20 insertions, 20 deletions
diff --git a/cpan/dist/Jcode/Unicode/Unicode.xs b/cpan/dist/Jcode/Unicode/Unicode.xs index 97c49ae8..7ed3fda1 100644 --- a/cpan/dist/Jcode/Unicode/Unicode.xs +++ b/cpan/dist/Jcode/Unicode/Unicode.xs @@ -29,7 +29,7 @@ euc_ucs2(src, ...) if (items > 1) { pedantic = SvIV(ST(1)); }; dstlen = srclen * 3 + 10; /* large enough? */ ST(0) = sv_2mortal(newSV(dstlen)); - dstlen = _euc_ucs2(SvPVX(ST(0)), s, pedantic); + dstlen = _euc_ucs2((unsigned char *)SvPVX(ST(0)), (unsigned char *)s, pedantic); SvCUR_set(ST(0), dstlen); SvPOK_only(ST(0)); if (SvROK(src)) { sv_setsv(SvRV(src), ST(0)); } @@ -46,7 +46,7 @@ ucs2_euc(src, ...) if (items > 1) { pedantic = SvIV(ST(1)); }; dstlen = srclen * 3 + 10; /* large enough? */ ST(0) = sv_2mortal(newSV(dstlen)); - dstlen = _ucs2_euc(SvPVX(ST(0)), s, srclen, pedantic); + dstlen = _ucs2_euc((unsigned char *)SvPVX(ST(0)), (unsigned char *)s, srclen, pedantic); SvCUR_set(ST(0), dstlen); SvPOK_only(ST(0)); if (SvROK(src)) { sv_setsv(SvRV(src), ST(0)); } @@ -61,7 +61,7 @@ utf8_ucs2(src, ...) char *s = SvROK(src) ? SvPV(SvRV(src), srclen) :SvPV(src, srclen); dstlen = srclen * 3 + 10; /* large enough? */ ST(0) = sv_2mortal(newSV(dstlen)); - dstlen = _utf8_ucs2(SvPVX(ST(0)), s); + dstlen = _utf8_ucs2((unsigned char *)SvPVX(ST(0)), (unsigned char *)s); SvCUR_set(ST(0), dstlen); SvPOK_only(ST(0)); if (SvROK(src)) { sv_setsv(SvRV(src), ST(0)); } @@ -76,7 +76,7 @@ ucs2_utf8(src, ...) char *s = SvROK(src) ? SvPV(SvRV(src), srclen) :SvPV(src, srclen); dstlen = srclen * 3 + 10; /* large enough? */ ST(0) = sv_2mortal(newSV(dstlen)); - dstlen = _ucs2_utf8(SvPVX(ST(0)), s, srclen); + dstlen = _ucs2_utf8((unsigned char *)SvPVX(ST(0)), (unsigned char *)s, srclen); SvCUR_set(ST(0), dstlen); SvPOK_only(ST(0)); if (SvROK(src)) { sv_setsv(SvRV(src), ST(0)); } diff --git a/cpan/dist/Jcode/Unicode/table.h b/cpan/dist/Jcode/Unicode/table.h index d4c8be77..954b9c92 100644 --- a/cpan/dist/Jcode/Unicode/table.h +++ b/cpan/dist/Jcode/Unicode/table.h @@ -1,5 +1,5 @@ /* - * $Id: table.h,v 0.70 2001/05/15 19:35:59 dankogai Exp $ + * $Id: table.h,v 0.77 2002/01/14 11:06:55 dankogai Exp $ * (c) 1999 Dan Kogai <dankogai@dan.co.jp> */ diff --git a/cpan/dist/Jcode/Unicode/uni.c b/cpan/dist/Jcode/Unicode/uni.c index e2aeb48c..f045a708 100644 --- a/cpan/dist/Jcode/Unicode/uni.c +++ b/cpan/dist/Jcode/Unicode/uni.c @@ -1,5 +1,5 @@ /* - * $Id: uni.c,v 0.70 2001/05/15 19:35:59 dankogai Exp $ + * $Id: uni.c,v 0.79 2002/01/16 02:18:49 dankogai Exp dankogai $ * (c) 1999 Dan Kogai <dankogai@dan.co.jp> */ @@ -59,7 +59,7 @@ Octet *u2e(Quad *qp, int pedantic){ if (t != NULL){ return q2o(t->euc); }else{ - return "\xa2\xae"; /* во */ + return (unsigned char *)"\xa2\xae"; /* во */ } } @@ -72,10 +72,10 @@ size_t _ucs2_euc(Octet *dst, Octet *src, int nchar, int pedantic){ for (nchar /= 2; nchar > 0; nchar--, src += 2) { q = o2q(src, 2); - strcpy(ebuf, u2e(&q, pedantic)); - strcpy(dst, ebuf); - dst += strlen(ebuf); - result += strlen(ebuf); + strcpy((char *)ebuf, (char *)u2e(&q, pedantic)); + strcpy((char *)dst, (char *)ebuf); + dst += strlen((char *)ebuf); + result += strlen((char *)ebuf); } return result; } @@ -101,17 +101,17 @@ Octet *e2u(Quad *qp, int pedantic){ static Octet buf[4]; if (IS_ASCII(*qp)){ if (!pedantic || not_iso646_jp(*qp)){ - sprintf(buf, "%c%c", '\0', *qp); + sprintf((char *)buf, "%c%c", '\0', *qp); return buf; } } t = (Table_t *)bsearch(qp, E2U, TABLE_SIZE, sizeof(Table_t), e_match); if (t != NULL){ - sprintf(buf, "%c%c", + sprintf((char *)buf, "%c%c", ((t->ucs2 & 0xff00) >> 8), (t->ucs2 & 0xff)); return buf; }else{ - return "\x30\x13"; /* во */ + return (unsigned char *)"\x30\x13"; /* во */ } } @@ -161,23 +161,23 @@ size_t _ucs2_utf8(Octet *dst, Octet *src, int nchar){ { ucs2 = o2q(src, 2); if (ucs2 < 0x80){ /* 1 byte */ - sprintf(ebuf, "%c", ucs2); + sprintf((char *)ebuf, "%c", ucs2); } else if(ucs2 < 0x800){ /* 2 bytes */ - sprintf(ebuf, "%c%c", + sprintf((char *)ebuf, "%c%c", (0xC0 | (ucs2 >> 6)), (0x80 | (ucs2 & 0x3F)) ); }else{ /* 3 bytes */ - sprintf(ebuf, "%c%c%c", + sprintf((char *)ebuf, "%c%c%c", (0xE0 | (ucs2 >> 12)), (0x80 | ((ucs2 >> 6) & 0x3F)), (0x80 | (ucs2 & 0x3F)) ); } - strcpy(dst, ebuf); - dst += strlen(ebuf); - result += strlen(ebuf); + strcpy((char *)dst, (char *)ebuf); + dst += strlen((char *)ebuf); + result += strlen((char *)ebuf); } return result; } |
