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

* eval.c (block_pass): chain previous block to the pushing block.

* time.c (time_cmp): does not compare with numbers for
  interchangeability. (ruby-bugs-ja PR#458)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-05-16 05:13:17 +00:00
parent c601cf5318
commit 6cbcafb9b9
3 changed files with 19 additions and 16 deletions

View file

@ -1,3 +1,10 @@
Fri May 16 12:40:40 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (block_pass): chain previous block to the pushing block.
* time.c (time_cmp): does not compare with numbers for
interchangeability. (ruby-bugs-ja PR#458)
Thu May 15 21:55:54 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
* lib/gram.c: fixes to one-line documents and end of stream documents.

1
eval.c
View file

@ -6984,6 +6984,7 @@ block_pass(self, node)
/* PUSH BLOCK from data */
old_block = ruby_block;
_block = *data;
_block.prev = old_block;
ruby_block = &_block;
PUSH_ITER(ITER_PRE);
ruby_frame->iter = ITER_PRE;

27
time.c
View file

@ -716,26 +716,21 @@ time_cmp(time1, time2)
}
if (tobj1->tv.tv_sec > i) return INT2FIX(1);
return INT2FIX(-1);
case T_FLOAT:
return rb_dbl_cmp((double)tobj1->tv.tv_sec + (double)tobj1->tv.tv_usec*1e-6,
RFLOAT(time2)->value);
case T_BIGNUM:
return rb_dbl_cmp((double)tobj1->tv.tv_sec + (double)tobj1->tv.tv_usec*1e-6,
rb_big2dbl(time2));
}
if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) {
GetTimeval(time2, tobj2);
if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) {
if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return INT2FIX(0);
if (tobj1->tv.tv_usec > tobj2->tv.tv_usec) return INT2FIX(1);
case T_DATA:
if (RDATA(time2)->dfree == time_free) {
GetTimeval(time2, tobj2);
if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) {
if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return INT2FIX(0);
if (tobj1->tv.tv_usec > tobj2->tv.tv_usec) return INT2FIX(1);
return INT2FIX(-1);
}
if (tobj1->tv.tv_sec > tobj2->tv.tv_sec) return INT2FIX(1);
return INT2FIX(-1);
}
if (tobj1->tv.tv_sec > tobj2->tv.tv_sec) return INT2FIX(1);
return INT2FIX(-1);
break;
}
return Qnil;
}