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

* proc.c (proc_to_s): suppress warning, and reduced duplicated code.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-06-24 07:10:46 +00:00
parent 3aa45744ab
commit a5c9bf7d63
2 changed files with 8 additions and 4 deletions

View file

@ -1,3 +1,7 @@
Sun Jun 24 16:10:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* proc.c (proc_to_s): suppress warning, and reduced duplicated code.
Sun Jun 24 15:33:47 2007 Koichi Sasada <ko1@atdot.net>
* bootstraptest/runner.rb: set default directory to

8
proc.c
View file

@ -542,6 +542,7 @@ proc_to_s(VALUE self)
rb_proc_t *proc;
char *cname = rb_obj_classname(self);
rb_iseq_t *iseq;
const char *is_lambda = proc->is_lambda ? " (lambda)" : "";
GetProcPtr(self, proc);
iseq = proc->block.iseq;
@ -552,14 +553,13 @@ proc_to_s(VALUE self)
if (iseq->insn_info_tbl) {
line_no = iseq->insn_info_tbl[0].line_no;
}
str = rb_sprintf("#<%s:%p@%s:%d%s>", cname, self,
str = rb_sprintf("#<%s:%p@%s:%d%s>", cname, (void *)self,
RSTRING_PTR(iseq->filename),
line_no,
proc->is_lambda ? " (lambda)" : "");
line_no, is_lambda);
}
else {
str = rb_sprintf("#<%s:%p%s>", cname, proc->block.iseq,
proc->is_lambda ? " (lambda)" : "");
is_lambda);
}
if (OBJ_TAINTED(self)) {