mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* marshal.c (w_object): module inclusion using extend() should
also be detected. * eval.c (rb_eval_cmd): cbase should not be NULL; it should be either ruby_wrapper or Object. * enum.c (enum_each_with_index): should return self. * process.c (proc_setpgrp): should return value for non-void function. * process.c (proc_getpgid): should raise exception if getpgid() return -1. * string.c (rb_str_ljust): should return a duplicated string. * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
81930da895
commit
86c6af5873
10 changed files with 65 additions and 28 deletions
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,25 @@
|
||||||
|
Mon Mar 11 14:44:38 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (w_object): module inclusion using extend() should
|
||||||
|
also be detected.
|
||||||
|
|
||||||
|
* eval.c (rb_eval_cmd): cbase should not be NULL; it should be
|
||||||
|
either ruby_wrapper or Object.
|
||||||
|
|
||||||
|
Sun Mar 10 02:18:22 2002 Koji Arai <jca02266@nifty.ne.jp>
|
||||||
|
|
||||||
|
* enum.c (enum_each_with_index): should return self.
|
||||||
|
|
||||||
|
* process.c (proc_setpgrp): should return value for non-void function.
|
||||||
|
|
||||||
|
* process.c (proc_getpgid): should raise exception if getpgid() return -1.
|
||||||
|
|
||||||
|
* string.c (rb_str_ljust): should return a duplicated string.
|
||||||
|
|
||||||
|
* string.c (rb_str_rjust): ditto.
|
||||||
|
|
||||||
|
* string.c (rb_str_center): ditto.
|
||||||
|
|
||||||
Sat Mar 9 08:45:58 2002 Tanaka Akira <akr@m17n.org>
|
Sat Mar 9 08:45:58 2002 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* ext/socket/extconf.rb (have_struct_member): don't print checked
|
* ext/socket/extconf.rb (have_struct_member): don't print checked
|
||||||
|
@ -52,7 +74,7 @@ Wed Mar 6 16:50:37 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
* class.c (rb_mod_clone): should not call rb_obj_clone(), since
|
* class.c (rb_mod_clone): should not call rb_obj_clone(), since
|
||||||
Module does not provide "allocate".
|
Module does not provide "allocate".
|
||||||
|
|
||||||
* class.c (rb_singleton_class): should crate new singleton class
|
* class.c (rb_singleton_class): should create new singleton class
|
||||||
if obj is a class or module and attached object is different,
|
if obj is a class or module and attached object is different,
|
||||||
which means metaclass of singleton class is sought.
|
which means metaclass of singleton class is sought.
|
||||||
|
|
||||||
|
|
|
@ -109,20 +109,23 @@ install: rbconfig.rb
|
||||||
|
|
||||||
clean-ext:; @-@MINIRUBY@ -Cext extmk.rb clean 2> /dev/null || true
|
clean-ext:; @-@MINIRUBY@ -Cext extmk.rb clean 2> /dev/null || true
|
||||||
|
|
||||||
clean: clean-ext
|
clean-local:
|
||||||
@rm -f $(OBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES)
|
@rm -f $(OBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES)
|
||||||
@rm -f ext/extinit.c ext/extinit.@OBJEXT@ dmyext.@OBJEXT@
|
@rm -f ext/extinit.c ext/extinit.@OBJEXT@ dmyext.@OBJEXT@
|
||||||
@-@MINIRUBY@ -Cext extmk.rb clean 2> /dev/null || true
|
|
||||||
@rm -f $(PROGRAM) miniruby$(EXEEXT)
|
@rm -f $(PROGRAM) miniruby$(EXEEXT)
|
||||||
|
|
||||||
|
clean: clean-ext clean-local
|
||||||
|
|
||||||
distclean-ext:
|
distclean-ext:
|
||||||
@-@MINIRUBY@ -Cext extmk.rb distclean 2> /dev/null || true
|
@-@MINIRUBY@ -Cext extmk.rb distclean 2> /dev/null || true
|
||||||
|
|
||||||
distclean: distclean-ext clean
|
distclean-local: clean-local
|
||||||
@rm -f Makefile ext/extmk.rb config.h rbconfig.rb
|
@rm -f Makefile ext/extmk.rb config.h rbconfig.rb
|
||||||
@rm -f ext/config.cache config.cache config.log config.status
|
@rm -f ext/config.cache config.cache config.log config.status
|
||||||
@rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp
|
@rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp
|
||||||
|
|
||||||
|
distclean: distclean-ext distclean-local
|
||||||
|
|
||||||
realclean: distclean
|
realclean: distclean
|
||||||
@rm -f parse.c
|
@rm -f parse.c
|
||||||
@rm -f lex.c
|
@rm -f lex.c
|
||||||
|
|
2
enum.c
2
enum.c
|
@ -427,7 +427,7 @@ enum_each_with_index(obj)
|
||||||
|
|
||||||
rb_iterate(rb_each, obj, each_with_index_i, (VALUE)memo);
|
rb_iterate(rb_each, obj, each_with_index_i, (VALUE)memo);
|
||||||
rb_gc_force_recycle((VALUE)memo);
|
rb_gc_force_recycle((VALUE)memo);
|
||||||
return Qnil;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
3
eval.c
3
eval.c
|
@ -1382,7 +1382,8 @@ rb_eval_cmd(cmd, arg, tcheck)
|
||||||
ruby_frame->last_func = 0;
|
ruby_frame->last_func = 0;
|
||||||
ruby_frame->last_class = 0;
|
ruby_frame->last_class = 0;
|
||||||
ruby_frame->self = ruby_top_self;
|
ruby_frame->self = ruby_top_self;
|
||||||
ruby_frame->cbase = (VALUE)rb_node_newnode(NODE_CREF,ruby_wrapper,0,0);
|
ruby_frame->cbase = (VALUE)rb_node_newnode(NODE_CREF,0,0,0);
|
||||||
|
RNODE(ruby_frame->cbase)->nd_clss = ruby_wrapper ? ruby_wrapper : rb_cObject;
|
||||||
|
|
||||||
if (tcheck && OBJ_TAINTED(cmd)) {
|
if (tcheck && OBJ_TAINTED(cmd)) {
|
||||||
ruby_safe_level = 4;
|
ruby_safe_level = 4;
|
||||||
|
|
|
@ -945,8 +945,8 @@ module Tk
|
||||||
def sizefrom(*args)
|
def sizefrom(*args)
|
||||||
tk_call('wm', 'sizefrom', path, *args)
|
tk_call('wm', 'sizefrom', path, *args)
|
||||||
end
|
end
|
||||||
def state
|
def state(state=None)
|
||||||
tk_call 'wm', 'state', path
|
tk_call 'wm', 'state', path, state
|
||||||
end
|
end
|
||||||
def title(*args)
|
def title(*args)
|
||||||
tk_call 'wm', 'title', path, *args
|
tk_call 'wm', 'title', path, *args
|
||||||
|
|
|
@ -485,11 +485,12 @@ w_object(obj, arg, limit)
|
||||||
VALUE klass = CLASS_OF(obj);
|
VALUE klass = CLASS_OF(obj);
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
if (FL_TEST(klass, FL_SINGLETON)) {
|
while (FL_TEST(klass, FL_SINGLETON) || BUILTIN_TYPE(klass) == T_ICLASS) {
|
||||||
if (RCLASS(klass)->m_tbl->num_entries > 0 ||
|
if (RCLASS(klass)->m_tbl->num_entries > 0 ||
|
||||||
RCLASS(klass)->iv_tbl->num_entries > 1) {
|
RCLASS(klass)->iv_tbl->num_entries > 1) {
|
||||||
rb_raise(rb_eTypeError, "singleton can't be dumped");
|
rb_raise(rb_eTypeError, "singleton can't be dumped");
|
||||||
}
|
}
|
||||||
|
klass = RCLASS(klass)->super;
|
||||||
}
|
}
|
||||||
path = rb_class2name(klass);
|
path = rb_class2name(klass);
|
||||||
w_unique(path, arg);
|
w_unique(path, arg);
|
||||||
|
|
|
@ -998,6 +998,7 @@ proc_setpgrp()
|
||||||
rb_notimplement();
|
rb_notimplement();
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
return INT2FIX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -1008,6 +1009,7 @@ proc_getpgid(obj, pid)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = getpgid(NUM2INT(pid));
|
i = getpgid(NUM2INT(pid));
|
||||||
|
if (i < 0) rb_sys_fail(0);
|
||||||
return INT2NUM(i);
|
return INT2NUM(i);
|
||||||
#else
|
#else
|
||||||
rb_notimplement();
|
rb_notimplement();
|
||||||
|
|
39
signal.c
39
signal.c
|
@ -217,26 +217,33 @@ rb_f_kill(argc, argv)
|
||||||
goto str_signal;
|
goto str_signal;
|
||||||
|
|
||||||
case T_STRING:
|
case T_STRING:
|
||||||
{
|
s = RSTRING(argv[0])->ptr;
|
||||||
s = RSTRING(argv[0])->ptr;
|
if (s[0] == '-') {
|
||||||
if (s[0] == '-') {
|
negative++;
|
||||||
negative++;
|
s++;
|
||||||
s++;
|
|
||||||
}
|
|
||||||
str_signal:
|
|
||||||
if (strncmp("SIG", s, 3) == 0)
|
|
||||||
s += 3;
|
|
||||||
if((sig = signm2signo(s)) == 0)
|
|
||||||
rb_raise(rb_eArgError, "unrecognized signal name `%s'", s);
|
|
||||||
|
|
||||||
if (negative)
|
|
||||||
sig = -sig;
|
|
||||||
}
|
}
|
||||||
|
str_signal:
|
||||||
|
if (strncmp("SIG", s, 3) == 0)
|
||||||
|
s += 3;
|
||||||
|
if((sig = signm2signo(s)) == 0)
|
||||||
|
rb_raise(rb_eArgError, "unsupported name `SIG%s'", s);
|
||||||
|
|
||||||
|
if (negative)
|
||||||
|
sig = -sig;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rb_raise(rb_eArgError, "bad signal type %s",
|
{
|
||||||
rb_class2name(CLASS_OF(argv[0])));
|
VALUE str;
|
||||||
|
|
||||||
|
str = rb_check_convert_type(argv[0], T_STRING, "String", "to_str");
|
||||||
|
if (!NIL_P(str)) {
|
||||||
|
s = RSTRING(str)->ptr;
|
||||||
|
goto str_signal;
|
||||||
|
}
|
||||||
|
rb_raise(rb_eArgError, "bad signal type %s",
|
||||||
|
rb_class2name(CLASS_OF(argv[0])));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
6
string.c
6
string.c
|
@ -3050,7 +3050,7 @@ rb_str_ljust(str, w)
|
||||||
VALUE res;
|
VALUE res;
|
||||||
char *p, *pend;
|
char *p, *pend;
|
||||||
|
|
||||||
if (width < 0 || RSTRING(str)->len >= width) return str;
|
if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str);
|
||||||
res = rb_str_new5(str, 0, width);
|
res = rb_str_new5(str, 0, width);
|
||||||
memcpy(RSTRING(res)->ptr, RSTRING(str)->ptr, RSTRING(str)->len);
|
memcpy(RSTRING(res)->ptr, RSTRING(str)->ptr, RSTRING(str)->len);
|
||||||
p = RSTRING(res)->ptr + RSTRING(str)->len; pend = RSTRING(res)->ptr + width;
|
p = RSTRING(res)->ptr + RSTRING(str)->len; pend = RSTRING(res)->ptr + width;
|
||||||
|
@ -3070,7 +3070,7 @@ rb_str_rjust(str, w)
|
||||||
VALUE res;
|
VALUE res;
|
||||||
char *p, *pend;
|
char *p, *pend;
|
||||||
|
|
||||||
if (width < 0 || RSTRING(str)->len >= width) return str;
|
if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str);
|
||||||
res = rb_str_new5(str, 0, width);
|
res = rb_str_new5(str, 0, width);
|
||||||
p = RSTRING(res)->ptr; pend = p + width - RSTRING(str)->len;
|
p = RSTRING(res)->ptr; pend = p + width - RSTRING(str)->len;
|
||||||
while (p < pend) {
|
while (p < pend) {
|
||||||
|
@ -3091,7 +3091,7 @@ rb_str_center(str, w)
|
||||||
char *p, *pend;
|
char *p, *pend;
|
||||||
long n;
|
long n;
|
||||||
|
|
||||||
if (width < 0 || RSTRING(str)->len >= width) return str;
|
if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str);
|
||||||
res = rb_str_new5(str, 0, width);
|
res = rb_str_new5(str, 0, width);
|
||||||
n = (width - RSTRING(str)->len)/2;
|
n = (width - RSTRING(str)->len)/2;
|
||||||
p = RSTRING(res)->ptr; pend = p + n;
|
p = RSTRING(res)->ptr; pend = p + n;
|
||||||
|
|
|
@ -1148,6 +1148,7 @@ rb_const_get(klass, id)
|
||||||
RSTRING(rb_class_path(klass))->ptr);
|
RSTRING(rb_class_path(klass))->ptr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
global_uninitialized:
|
||||||
rb_name_error(id, "uninitialized constant %s",rb_id2name(id));
|
rb_name_error(id, "uninitialized constant %s",rb_id2name(id));
|
||||||
}
|
}
|
||||||
return Qnil; /* not reached */
|
return Qnil; /* not reached */
|
||||||
|
|
Loading…
Add table
Reference in a new issue