diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-16 05:13:17 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-16 05:13:17 +0000 |
commit | 6cbcafb9b953308f62c9d54ed3283fe4ddf002d5 (patch) | |
tree | 5ea92dbea11d370ca1b8ee8ed65a2f47c4f4ca8a | |
parent | c601cf5318c035460250284057a62b7eddcb79fc (diff) | |
download | ruby-6cbcafb9b953308f62c9d54ed3283fe4ddf002d5.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | eval.c | 1 | ||||
-rw-r--r-- | time.c | 27 |
3 files changed, 19 insertions, 16 deletions
@@ -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. @@ -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; @@ -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; } |