mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* include/ruby/encoding.h (rb_str_coderange_scan_restartable): added
prototype. * string.c (rb_str_coderange_scan_restartable, rb_str_times): removed unsed variables. * string.c (rb_enc_str_copy): unused now. may be used in future? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
343a1504e3
commit
c015c6fa8e
4 changed files with 20 additions and 10 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Thu Feb 28 11:13:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/encoding.h (rb_str_coderange_scan_restartable): added
|
||||
prototype.
|
||||
|
||||
* string.c (rb_str_coderange_scan_restartable, rb_str_times): removed
|
||||
unsed variables.
|
||||
|
||||
* string.c (rb_enc_str_copy): unused now. may be used in future?
|
||||
|
||||
Thu Feb 28 03:03:32 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* ext/tk/lib/tk.rb, ext/tk/lib/*: make default widget set
|
||||
|
|
|
@ -163,6 +163,7 @@ ID rb_intern3(const char*, long, rb_encoding*);
|
|||
ID rb_interned_id_p(const char *, long, rb_encoding *);
|
||||
int rb_enc_symname_p(const char*, rb_encoding*);
|
||||
int rb_enc_str_coderange(VALUE);
|
||||
long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
|
||||
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);
|
||||
|
|
17
string.c
17
string.c
|
@ -204,10 +204,7 @@ coderange_scan(const char *p, long len, rb_encoding *enc)
|
|||
long
|
||||
rb_str_coderange_scan_restartable(const char *s, const char *e, rb_encoding *enc, int *cr)
|
||||
{
|
||||
long c;
|
||||
const char *p;
|
||||
int ret;
|
||||
p = s;
|
||||
const char *p = s;
|
||||
|
||||
if (*cr == ENC_CODERANGE_BROKEN)
|
||||
return e - s;
|
||||
|
@ -256,6 +253,7 @@ rb_str_coderange_scan_restartable(const char *s, const char *e, rb_encoding *enc
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
rb_enc_str_copy(VALUE dest, VALUE src)
|
||||
{
|
||||
|
@ -265,6 +263,7 @@ rb_enc_str_copy(VALUE dest, VALUE src)
|
|||
ENC_CODERANGE_SET(dest, ENC_CODERANGE(src));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
rb_enc_cr_str_copy_for_substr(VALUE dest, VALUE src)
|
||||
|
@ -274,17 +273,17 @@ rb_enc_cr_str_copy_for_substr(VALUE dest, VALUE src)
|
|||
*/
|
||||
rb_enc_copy(dest, src);
|
||||
switch (ENC_CODERANGE(src)) {
|
||||
case ENC_CODERANGE_7BIT:
|
||||
case ENC_CODERANGE_7BIT:
|
||||
ENC_CODERANGE_SET(dest, ENC_CODERANGE_7BIT);
|
||||
break;
|
||||
case ENC_CODERANGE_VALID:
|
||||
case ENC_CODERANGE_VALID:
|
||||
if (!rb_enc_asciicompat(STR_ENC_GET(src)) ||
|
||||
search_nonascii(RSTRING_PTR(dest), RSTRING_END(dest)))
|
||||
ENC_CODERANGE_SET(dest, ENC_CODERANGE_VALID);
|
||||
else
|
||||
ENC_CODERANGE_SET(dest, ENC_CODERANGE_7BIT);
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
if (RSTRING_LEN(dest) == 0) {
|
||||
if (!rb_enc_asciicompat(STR_ENC_GET(src)))
|
||||
ENC_CODERANGE_SET(dest, ENC_CODERANGE_VALID);
|
||||
|
@ -315,7 +314,8 @@ rb_enc_str_coderange(VALUE str)
|
|||
return cr;
|
||||
}
|
||||
|
||||
int rb_enc_str_asciionly_p(VALUE str)
|
||||
int
|
||||
rb_enc_str_asciionly_p(VALUE str)
|
||||
{
|
||||
rb_encoding *enc = STR_ENC_GET(str);
|
||||
|
||||
|
@ -914,7 +914,6 @@ rb_str_times(VALUE str, VALUE times)
|
|||
{
|
||||
VALUE str2;
|
||||
long n, len;
|
||||
int cr;
|
||||
|
||||
len = NUM2LONG(times);
|
||||
if (len < 0) {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_YEAR 2008
|
||||
#define RUBY_RELEASE_MONTH 2
|
||||
#define RUBY_RELEASE_DAY 27
|
||||
#define RUBY_RELEASE_DAY 28
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
Loading…
Reference in a new issue