diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-03 15:55:04 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-03 15:55:04 +0000 |
commit | 52ed8c4edd880e9b9482748e9692b1e22917bf92 (patch) | |
tree | c329bf309196494f598e017a21f9a819a34fc6be /enc/sjis.c | |
parent | 1aaf8b171373f6862fa8c523923b98ef6feb1c65 (diff) |
* include/ruby/oniguruma.h: Oniguruma 1.9.1 merged.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/sjis.c')
-rw-r--r-- | enc/sjis.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/enc/sjis.c b/enc/sjis.c index 6d64acd02b..d526f66865 100644 --- a/enc/sjis.c +++ b/enc/sjis.c @@ -141,7 +141,7 @@ sjis_code_to_mbclen(OnigCodePoint code, OnigEncoding enc) return 2; } else - return 0; + return ONIGERR_INVALID_CODE_POINT_VALUE; } static OnigCodePoint @@ -150,7 +150,7 @@ sjis_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc) int c, i, len; OnigCodePoint n; - len = enc_len(ONIG_ENCODING_SJIS, p, end); + len = enclen(ONIG_ENCODING_SJIS, p, end); c = *p++; n = c; if (len == 1) return n; @@ -172,8 +172,8 @@ sjis_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) *p++ = (UChar )(code & 0xff); #if 0 - if (enc_len(ONIG_ENCODING_SJIS, buf) != (p - buf)) - return REGERR_INVALID_WIDE_CHAR_VALUE; + if (enclen(ONIG_ENCODING_SJIS, buf) != (p - buf)) + return REGERR_INVALID_CODE_POINT_VALUE; #endif return p - buf; } @@ -192,7 +192,7 @@ sjis_mbc_case_fold(OnigCaseFoldType flag, } else { int i; - int len = enc_len(ONIG_ENCODING_SJIS, p, end); + int len = enclen(ONIG_ENCODING_SJIS, p, end); for (i = 0; i < len; i++) { *lower++ = *p++; @@ -245,7 +245,7 @@ sjis_left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc) } } } - len = enc_len(ONIG_ENCODING_SJIS, p, s); + len = enclen(ONIG_ENCODING_SJIS, p, s); if (p + len > s) return (UChar* )p; p += len; return (UChar* )(p + ((s - p) & ~1)); @@ -322,7 +322,7 @@ sjis_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc) ctype -= (ONIGENC_MAX_STD_CTYPE + 1); if (ctype >= (unsigned int )PropertyListNum) - return ONIGENC_ERR_TYPE_BUG; + return ONIGERR_TYPE_BUG; return onig_is_in_code_range((UChar* )PropertyList[ctype], code); } @@ -331,7 +331,7 @@ sjis_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc) } static int -sjis_get_ctype_code_range(int ctype, OnigCodePoint* sb_out, +sjis_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc) { if (ctype <= ONIGENC_MAX_STD_CTYPE) { @@ -343,8 +343,8 @@ sjis_get_ctype_code_range(int ctype, OnigCodePoint* sb_out, PROPERTY_LIST_INIT_CHECK; ctype -= (ONIGENC_MAX_STD_CTYPE + 1); - if (ctype >= PropertyListNum) - return ONIGENC_ERR_TYPE_BUG; + if (ctype >= (OnigCtype )PropertyListNum) + return ONIGERR_TYPE_BUG; *ranges = PropertyList[ctype]; return 0; |