1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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:
ksaito 2004-03-16 15:20:15 +00:00
parent e1124ffa21
commit c2253d31cd
6 changed files with 19 additions and 20 deletions

View file

@ -45,20 +45,20 @@ eucjp_code_to_mbc_first(OnigCodePoint code)
first = (code >> 16) & 0xff; first = (code >> 16) & 0xff;
/* /*
if (enc_len(ONIG_ENCODING_EUC_JP, first) != 3) 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) { else if ((code & 0xff00) != 0) {
first = (code >> 8) & 0xff; first = (code >> 8) & 0xff;
/* /*
if (enc_len(ONIG_ENCODING_EUC_JP, first) != 2) if (enc_len(ONIG_ENCODING_EUC_JP, first) != 2)
return ONIGERR_INVALID_WIDE_CHAR_VALUE; return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
*/ */
} }
else { else {
/* /*
if (enc_len(ONIG_ENCODING_EUC_JP, code) != 1) if (enc_len(ONIG_ENCODING_EUC_JP, code) != 1)
return ONIGERR_INVALID_WIDE_CHAR_VALUE; return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
*/ */
return (int )code; return (int )code;
} }
@ -76,7 +76,7 @@ eucjp_code_to_mbc(OnigCodePoint code, UChar *buf)
#if 1 #if 1
if (enc_len(ONIG_ENCODING_EUC_JP, buf[0]) != (p - buf)) if (enc_len(ONIG_ENCODING_EUC_JP, buf[0]) != (p - buf))
return ONIGERR_INVALID_WIDE_CHAR_VALUE; return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
#endif #endif
return p - buf; return p - buf;
} }
@ -127,8 +127,8 @@ eucjp_code_is_ctype(OnigCodePoint code, unsigned int ctype)
static UChar* static UChar*
eucjp_left_adjust_char_head(UChar* start, UChar* s) eucjp_left_adjust_char_head(UChar* start, UChar* s)
{ {
/* Assumed in this encoding, /* In this encoding
mb-trail bytes don't mix with single bytes. mb-trail bytes doesn't mix with single bytes.
*/ */
UChar *p; UChar *p;
int len; int len;

View file

@ -361,7 +361,7 @@ onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
#if 1 #if 1
if (enc_len(enc, buf[0]) != (p - buf)) if (enc_len(enc, buf[0]) != (p - buf))
return ONIGERR_INVALID_WIDE_CHAR_VALUE; return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
#endif #endif
return p - buf; return p - buf;
} }
@ -384,7 +384,7 @@ onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
#if 1 #if 1
if (enc_len(enc, buf[0]) != (p - buf)) if (enc_len(enc, buf[0]) != (p - buf))
return ONIGERR_INVALID_WIDE_CHAR_VALUE; return ONIGENCERR_INVALID_WIDE_CHAR_VALUE;
#endif #endif
return p - buf; return p - buf;
} }

View file

@ -26,12 +26,10 @@
#endif #endif
/* error codes */ /* error codes */
/* internal error */ #define ONIGENCERR_MEMORY -5
#define ONIGERR_MEMORY -5 #define ONIGENCERR_TYPE_BUG -6
#define ONIGERR_TYPE_BUG -6 #define ONIGENCERR_INVALID_WIDE_CHAR_VALUE -400
/* syntax error [-400, -999] */ #define ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE -401
#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
#define ONIG_NEWLINE '\n' #define ONIG_NEWLINE '\n'
#define ONIG_IS_NEWLINE(c) ((c) == ONIG_NEWLINE) #define ONIG_IS_NEWLINE(c) ((c) == ONIG_NEWLINE)

View file

@ -145,7 +145,7 @@ onig_error_code_to_format(int code)
case ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY: case ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY:
p = "group number is too big for capture history"; break; p = "group number is too big for capture history"; break;
case ONIGERR_INVALID_CHAR_PROPERTY_NAME: 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: case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT:
p = "over thread pass limit count"; break; 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_MULTIPLEX_DEFINITION_NAME_CALL:
case ONIGERR_INVALID_GROUP_NAME: case ONIGERR_INVALID_GROUP_NAME:
case ONIGERR_INVALID_CHAR_IN_GROUP_NAME: case ONIGERR_INVALID_CHAR_IN_GROUP_NAME:
case ONIGERR_INVALID_CHAR_PROPERTY_NAME:
einfo = va_arg(vargs, OnigErrorInfo*); einfo = va_arg(vargs, OnigErrorInfo*);
len = einfo->par_end - einfo->par; len = einfo->par_end - einfo->par;
q = onig_error_code_to_format(code); q = onig_error_code_to_format(code);

View file

@ -85,7 +85,7 @@
#define xmemset memset #define xmemset memset
#define xmemcpy memcpy #define xmemcpy memcpy
#define xmemmove memmove #define xmemmove memmove
#if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__GNUC__)
#define xalloca _alloca #define xalloca _alloca
#ifdef NOT_RUBY #ifdef NOT_RUBY
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf

8
utf8.c
View file

@ -82,7 +82,7 @@ utf8_code_to_mbclen(OnigCodePoint code)
else if ((code & 0xfc000000) == 0) return 5; else if ((code & 0xfc000000) == 0) return 5;
else if ((code & 0x80000000) == 0) return 6; else if ((code & 0x80000000) == 0) return 6;
else else
return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
} }
#if 0 #if 0
@ -103,7 +103,7 @@ utf8_code_to_mbc_first(OnigCodePoint code)
else if ((code & 0x80000000) == 0) else if ((code & 0x80000000) == 0)
return ((code>>30) & 0x01) | 0xfc; return ((code>>30) & 0x01) | 0xfc;
else { 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); *p++ = UTF8_TRAILS(code, 6);
} }
else { else {
return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
} }
*p++ = UTF8_TRAIL0(code); *p++ = UTF8_TRAIL0(code);
@ -417,7 +417,7 @@ utf8_get_ctype_code_range(int ctype, int* nsb, int* nmb,
break; break;
default: default:
return ONIGERR_TYPE_BUG; return ONIGENCERR_TYPE_BUG;
break; break;
} }