ruby-changes:3012
From: ko1@a...
Date: 23 Dec 2007 08:47:35 +0900
Subject: [ruby-changes:3012] akr - Ruby:r14504 (trunk): * include/ruby/encoding.h, encoding.c, re.c, io.c, parse.y, numeric.c,
akr 2007-12-23 08:47:18 +0900 (Sun, 23 Dec 2007) New Revision: 14504 Modified files: trunk/ChangeLog trunk/encoding.c trunk/include/ruby/encoding.h trunk/io.c trunk/numeric.c trunk/parse.y trunk/re.c trunk/ruby.c trunk/transcode.c Log: * 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. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/numeric.c?r1=14504&r2=14503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ruby.c?r1=14504&r2=14503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=14504&r2=14503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14504&r2=14503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/transcode.c?r1=14504&r2=14503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=14504&r2=14503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/encoding.h?r1=14504&r2=14503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/re.c?r1=14504&r2=14503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=14504&r2=14503 Index: encoding.c =================================================================== --- encoding.c (revision 14503) +++ encoding.c (revision 14504) @@ -236,7 +236,7 @@ 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 @@ } rb_encoding * -rb_ascii_encoding(void) +rb_ascii8bit_encoding(void) { if (!enc_table) { rb_enc_init(); Index: include/ruby/encoding.h =================================================================== --- include/ruby/encoding.h (revision 14503) +++ include/ruby/encoding.h (revision 14504) @@ -115,7 +115,7 @@ 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); Index: re.c =================================================================== --- re.c (revision 14503) +++ re.c (revision 14504) @@ -954,7 +954,7 @@ 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 @@ 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"); Index: ChangeLog =================================================================== --- ChangeLog (revision 14503) +++ ChangeLog (revision 14504) @@ -1,3 +1,10 @@ +Sun Dec 23 08:42:51 2007 Tanaka Akira <akr@f...> + + * 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@r...> * version.h: use patchlevel if revision is not set. Index: io.c =================================================================== --- io.c (revision 14503) +++ io.c (revision 14504) @@ -350,7 +350,7 @@ if (!fptr->enc) { fptr->enc = (fptr->fd == 0) ? rb_default_external_encoding() - : rb_ascii_encoding(); + : rb_ascii8bit_encoding(); } } @@ -2892,7 +2892,7 @@ #endif fptr->mode |= FMODE_BINMODE; - fptr->enc = rb_ascii_encoding(); + fptr->enc = rb_ascii8bit_encoding(); return io; } Index: parse.y =================================================================== --- parse.y (revision 14503) +++ parse.y (revision 14504) @@ -4844,7 +4844,7 @@ 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 @@ } } 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 @@ for (; m <= name + len; ++m) { if (!ISASCII(*m)) goto mbstr; } - enc = rb_ascii_encoding(); + enc = rb_ascii8bit_encoding(); } mbstr:; } Index: numeric.c =================================================================== --- numeric.c (revision 14503) +++ numeric.c (revision 14504) @@ -1860,7 +1860,7 @@ 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); Index: ruby.c =================================================================== --- ruby.c (revision 14503) +++ ruby.c (revision 14504) @@ -144,12 +144,12 @@ 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); } Index: transcode.c =================================================================== --- transcode.c (revision 14503) +++ transcode.c (revision 14504) @@ -357,7 +357,7 @@ } /* 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml