зеркало из https://github.com/github/ruby.git
This commit was generated by cvs2svn to compensate for changes in r5960,
which included commits to RCS files with non-trunk default branches. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e1124ffa21
Коммит
c2253d31cd
12
euc_jp.c
12
euc_jp.c
|
@ -45,20 +45,20 @@ eucjp_code_to_mbc_first(OnigCodePoint code)
|
|||
first = (code >> 16) & 0xff;
|
||||
/*
|
||||
if (enc_len(ONIG_ENCODING_EUC_JP, first) != 3)
|
||||
return ONIGERR_INVALID_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
|
||||
*/
|
||||
}
|
||||
else if ((code & 0xff00) != 0) {
|
||||
first = (code >> 8) & 0xff;
|
||||
/*
|
||||
if (enc_len(ONIG_ENCODING_EUC_JP, first) != 2)
|
||||
return ONIGERR_INVALID_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
|
||||
*/
|
||||
}
|
||||
else {
|
||||
/*
|
||||
if (enc_len(ONIG_ENCODING_EUC_JP, code) != 1)
|
||||
return ONIGERR_INVALID_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
|
||||
*/
|
||||
return (int )code;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ eucjp_code_to_mbc(OnigCodePoint code, UChar *buf)
|
|||
|
||||
#if 1
|
||||
if (enc_len(ONIG_ENCODING_EUC_JP, buf[0]) != (p - buf))
|
||||
return ONIGERR_INVALID_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
|
||||
#endif
|
||||
return p - buf;
|
||||
}
|
||||
|
@ -127,8 +127,8 @@ eucjp_code_is_ctype(OnigCodePoint code, unsigned int ctype)
|
|||
static UChar*
|
||||
eucjp_left_adjust_char_head(UChar* start, UChar* s)
|
||||
{
|
||||
/* Assumed in this encoding,
|
||||
mb-trail bytes don't mix with single bytes.
|
||||
/* In this encoding
|
||||
mb-trail bytes doesn't mix with single bytes.
|
||||
*/
|
||||
UChar *p;
|
||||
int len;
|
||||
|
|
4
regenc.c
4
regenc.c
|
@ -361,7 +361,7 @@ onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
|
|||
|
||||
#if 1
|
||||
if (enc_len(enc, buf[0]) != (p - buf))
|
||||
return ONIGERR_INVALID_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
|
||||
#endif
|
||||
return p - buf;
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
|
|||
|
||||
#if 1
|
||||
if (enc_len(enc, buf[0]) != (p - buf))
|
||||
return ONIGERR_INVALID_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
|
||||
#endif
|
||||
return p - buf;
|
||||
}
|
||||
|
|
10
regenc.h
10
regenc.h
|
@ -26,12 +26,10 @@
|
|||
#endif
|
||||
|
||||
/* error codes */
|
||||
/* internal error */
|
||||
#define ONIGERR_MEMORY -5
|
||||
#define ONIGERR_TYPE_BUG -6
|
||||
/* syntax error [-400, -999] */
|
||||
#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
|
||||
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
|
||||
#define ONIGENCERR_MEMORY -5
|
||||
#define ONIGENCERR_TYPE_BUG -6
|
||||
#define ONIGENCERR_INVALID_WIDE_CHAR_VALUE -400
|
||||
#define ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE -401
|
||||
|
||||
#define ONIG_NEWLINE '\n'
|
||||
#define ONIG_IS_NEWLINE(c) ((c) == ONIG_NEWLINE)
|
||||
|
|
|
@ -145,7 +145,7 @@ onig_error_code_to_format(int code)
|
|||
case ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY:
|
||||
p = "group number is too big for capture history"; break;
|
||||
case ONIGERR_INVALID_CHAR_PROPERTY_NAME:
|
||||
p = "invalid character property name"; break;
|
||||
p = "invalid character property name {%n}"; break;
|
||||
case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT:
|
||||
p = "over thread pass limit count"; break;
|
||||
|
||||
|
@ -184,6 +184,7 @@ onig_error_code_to_str(s, code, va_alist)
|
|||
case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL:
|
||||
case ONIGERR_INVALID_GROUP_NAME:
|
||||
case ONIGERR_INVALID_CHAR_IN_GROUP_NAME:
|
||||
case ONIGERR_INVALID_CHAR_PROPERTY_NAME:
|
||||
einfo = va_arg(vargs, OnigErrorInfo*);
|
||||
len = einfo->par_end - einfo->par;
|
||||
q = onig_error_code_to_format(code);
|
||||
|
|
2
regint.h
2
regint.h
|
@ -85,7 +85,7 @@
|
|||
#define xmemset memset
|
||||
#define xmemcpy memcpy
|
||||
#define xmemmove memmove
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__GNUC__)
|
||||
#define xalloca _alloca
|
||||
#ifdef NOT_RUBY
|
||||
#define vsnprintf _vsnprintf
|
||||
|
|
8
utf8.c
8
utf8.c
|
@ -82,7 +82,7 @@ utf8_code_to_mbclen(OnigCodePoint code)
|
|||
else if ((code & 0xfc000000) == 0) return 5;
|
||||
else if ((code & 0x80000000) == 0) return 6;
|
||||
else
|
||||
return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -103,7 +103,7 @@ utf8_code_to_mbc_first(OnigCodePoint code)
|
|||
else if ((code & 0x80000000) == 0)
|
||||
return ((code>>30) & 0x01) | 0xfc;
|
||||
else {
|
||||
return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ utf8_code_to_mbc(OnigCodePoint code, UChar *buf)
|
|||
*p++ = UTF8_TRAILS(code, 6);
|
||||
}
|
||||
else {
|
||||
return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
|
||||
return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
|
||||
}
|
||||
|
||||
*p++ = UTF8_TRAIL0(code);
|
||||
|
@ -417,7 +417,7 @@ utf8_get_ctype_code_range(int ctype, int* nsb, int* nmb,
|
|||
break;
|
||||
|
||||
default:
|
||||
return ONIGERR_TYPE_BUG;
|
||||
return ONIGENCERR_TYPE_BUG;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче