diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-22 23:47:18 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-22 23:47:18 +0000 |
commit | 5b809a28f825015661e7f51f0ecb5ecdfa7b77bd (patch) | |
tree | b2c58515f13f04df8820eaeee5470262ee7c6d61 | |
parent | cd42707d86eca75e22d7ac8053a0981ed8b1a90f (diff) | |
download | ruby-5b809a28f825015661e7f51f0ecb5ecdfa7b77bd.tar.gz |
* include/ruby/encoding.h, encoding.c, re.c, io.c, parse.y, numeric.c,
ruby.c, transcode.c: rename rb_ascii_encoding. to
rb_ascii8bit_encoding. rb_ascii_encoding is ambiguous with
ASCII-8BIT and US-ASCII.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | encoding.c | 4 | ||||
-rw-r--r-- | include/ruby/encoding.h | 2 | ||||
-rw-r--r-- | io.c | 4 | ||||
-rw-r--r-- | numeric.c | 2 | ||||
-rw-r--r-- | parse.y | 6 | ||||
-rw-r--r-- | re.c | 4 | ||||
-rw-r--r-- | ruby.c | 4 | ||||
-rw-r--r-- | transcode.c | 2 |
9 files changed, 21 insertions, 14 deletions
@@ -1,3 +1,10 @@ +Sun Dec 23 08:42:51 2007 Tanaka Akira <akr@fsij.org> + + * include/ruby/encoding.h, encoding.c, re.c, io.c, parse.y, numeric.c, + ruby.c, transcode.c: rename rb_ascii_encoding. to + rb_ascii8bit_encoding. rb_ascii_encoding is ambiguous with + ASCII-8BIT and US-ASCII. + Sun Dec 23 03:35:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * version.h: use patchlevel if revision is not set. diff --git a/encoding.c b/encoding.c index cab82de514..130b1612e1 100644 --- a/encoding.c +++ b/encoding.c @@ -236,7 +236,7 @@ rb_define_dummy_encoding(const char *name) enc_check_duplication(name); if (index < ENCODING_INLINE_MAX) index = ENCODING_INLINE_MAX; if (enc_table_expand(index + 1) < 0) return -1; - encoding = rb_ascii_encoding(); + encoding = rb_ascii8bit_encoding(); enc_register_at(index, name, encoding); enc = set_based_encoding(index, encoding); FL_SET(enc, ENC_DUMMY); @@ -821,7 +821,7 @@ enc_load(VALUE klass, VALUE str) } rb_encoding * -rb_ascii_encoding(void) +rb_ascii8bit_encoding(void) { if (!enc_table) { rb_enc_init(); diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index db19ee9d70..8b245e05a8 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -115,7 +115,7 @@ int rb_enc_str_coderange(VALUE); int rb_enc_str_asciionly_p(VALUE); #define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str)) VALUE rb_enc_from_encoding(rb_encoding *enc); -rb_encoding *rb_ascii_encoding(void); +rb_encoding *rb_ascii8bit_encoding(void); rb_encoding *rb_utf8_encoding(void); rb_encoding *rb_default_external_encoding(void); VALUE rb_enc_default_external(void); @@ -350,7 +350,7 @@ rb_io_check_readable(rb_io_t *fptr) if (!fptr->enc) { fptr->enc = (fptr->fd == 0) ? rb_default_external_encoding() - : rb_ascii_encoding(); + : rb_ascii8bit_encoding(); } } @@ -2892,7 +2892,7 @@ rb_io_binmode(VALUE io) #endif fptr->mode |= FMODE_BINMODE; - fptr->enc = rb_ascii_encoding(); + fptr->enc = rb_ascii8bit_encoding(); return io; } @@ -1860,7 +1860,7 @@ int_chr(int argc, VALUE *argv, VALUE num) break; } enc = rb_to_encoding(argv[0]); - if (!enc) enc = rb_ascii_encoding(); + if (!enc) enc = rb_ascii8bit_encoding(); if (i < 0 || (n = rb_enc_codelen(i, enc)) <= 0) goto out_of_range; str = rb_enc_str_new(0, n, enc); rb_enc_mbcput(i, RSTRING_PTR(str), enc); @@ -4844,7 +4844,7 @@ parser_str_new(const char *p, long n, rb_encoding *enc, int func) if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc) && rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) { - rb_enc_associate(str, rb_ascii_encoding()); + rb_enc_associate(str, rb_ascii8bit_encoding()); } return str; @@ -8968,7 +8968,7 @@ rb_intern3(const char *name, long len, rb_encoding *enc) } } if (m - name < len) id = ID_JUNK; - if (enc != rb_ascii_encoding()) { + if (enc != rb_ascii8bit_encoding()) { /* * this clause makes sense only when called from other than * rb_intern_str() taking care of code-range. @@ -8977,7 +8977,7 @@ rb_intern3(const char *name, long len, rb_encoding *enc) for (; m <= name + len; ++m) { if (!ISASCII(*m)) goto mbstr; } - enc = rb_ascii_encoding(); + enc = rb_ascii8bit_encoding(); } mbstr:; } @@ -954,7 +954,7 @@ rb_reg_prepare_re(VALUE re, VALUE str) need_recompile = 1; } if ((RBASIC(re)->flags & REG_ENCODING_NONE) && - enc != rb_ascii_encoding() && + enc != rb_ascii8bit_encoding() && rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) { rb_warn("regexp match /.../n against to %s string", rb_enc_name(enc)); @@ -1964,7 +1964,7 @@ rb_reg_initialize(VALUE obj, const char *s, int len, rb_encoding *enc, struct RRegexp *re = RREGEXP(obj); VALUE unescaped; rb_encoding *fixed_enc = 0; - rb_encoding *a_enc = rb_ascii_encoding(); + rb_encoding *a_enc = rb_ascii8bit_encoding(); if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4) rb_raise(rb_eSecurityError, "Insecure: can't modify regexp"); @@ -144,12 +144,12 @@ locale_encoding(void) int idx; if (codeset == Qnil) - return rb_ascii_encoding(); + return rb_ascii8bit_encoding(); name = StringValueCStr(codeset); idx = rb_enc_find_index(name); if (idx < 0) - return rb_ascii_encoding(); + return rb_ascii8bit_encoding(); return rb_enc_from_index(idx); } diff --git a/transcode.c b/transcode.c index a4cf6b3492..95e4ef3def 100644 --- a/transcode.c +++ b/transcode.c @@ -357,7 +357,7 @@ str_transcode(int argc, VALUE *argv, VALUE *self) } /* set encoding */ if (!to_enc) { - to_encidx = rb_enc_replicate(to_e, rb_ascii_encoding()); + to_encidx = rb_enc_replicate(to_e, rb_ascii8bit_encoding()); } *self = dest; |