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

* include/ruby/encoding.h (ENC_CODERANGE_VALID): rename from

ENC_CODERANGE_8BIT.

* string.c (rb_enc_str_coderange): follow the renaming.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-12-17 05:07:37 +00:00
parent 5a41626dea
commit 3f07e548fc
3 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,10 @@
Mon Dec 17 14:03:39 2007 Tanaka Akira <akr@fsij.org>
* include/ruby/encoding.h (ENC_CODERANGE_VALID): rename from
ENC_CODERANGE_8BIT.
* string.c (rb_enc_str_coderange): follow the renaming.
Mon Dec 17 13:56:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (tr_find): wrong condition fixed.

View file

@ -27,7 +27,7 @@
#define ENC_CODERANGE_MASK (FL_USER12|FL_USER13)
#define ENC_CODERANGE_UNKNOWN 0
#define ENC_CODERANGE_7BIT FL_USER12
#define ENC_CODERANGE_8BIT FL_USER13
#define ENC_CODERANGE_VALID FL_USER13
#define ENC_CODERANGE_BROKEN (FL_USER12|FL_USER13)
#define ENC_CODERANGE(obj) (RBASIC(obj)->flags & ENC_CODERANGE_MASK)
#define ENC_CODERANGE_ASCIIONLY(obj) (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)

View file

@ -106,7 +106,7 @@ rb_enc_str_coderange(VALUE str)
rb_encoding *enc = rb_enc_get(str);
if (!rb_enc_asciicompat(enc)) {
cr = ENC_CODERANGE_8BIT;
cr = ENC_CODERANGE_VALID;
ENC_CODERANGE_SET(str, cr);
return cr;
}
@ -119,7 +119,7 @@ rb_enc_str_coderange(VALUE str)
int c = (unsigned char)*p;
if (!rb_enc_isascii(c, enc)) {
cr = ENC_CODERANGE_8BIT;
cr = ENC_CODERANGE_VALID;
break;
}
p++;