ruby-changes:12364
From: shyouhei <ko1@a...>
Date: Mon, 13 Jul 2009 01:42:39 +0900 (JST)
Subject: [ruby-changes:12364] Ruby:r24060 (ruby_1_8_7): merge revision(s) 23259,24059:
shyouhei 2009-07-13 01:42:27 +0900 (Mon, 13 Jul 2009) New Revision: 24060 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24060 Log: merge revision(s) 23259,24059: * time.c (time_timeval): check out-of-range. [ruby-core:23282] [Bug #1396] * time.c (time_timeval): rounds subsecond toward zero. Modified files: branches/ruby_1_8_7/ChangeLog branches/ruby_1_8_7/time.c branches/ruby_1_8_7/version.h Index: ruby_1_8_7/time.c =================================================================== --- ruby_1_8_7/time.c (revision 24059) +++ ruby_1_8_7/time.c (revision 24060) @@ -192,15 +192,17 @@ double f, d; d = modf(RFLOAT(time)->value, &f); - if (d < 0) { - d += 1; - f -= 1; - } + if (d >= 0) { + t.tv_usec = (int)(d*1e6+0.5); + } + else if ((t.tv_usec = (int)(-d*1e6+0.5)) > 0) { + t.tv_usec = 1000000 - t.tv_usec; + f -= 1; + } t.tv_sec = (time_t)f; if (f != t.tv_sec) { rb_raise(rb_eRangeError, "%f out of Time range", RFLOAT(time)->value); } - t.tv_usec = (time_t)(d*1e6+0.5); } break; Index: ruby_1_8_7/ChangeLog =================================================================== --- ruby_1_8_7/ChangeLog (revision 24059) +++ ruby_1_8_7/ChangeLog (revision 24060) @@ -1,3 +1,12 @@ +Mon Jul 13 01:36:54 2009 Nobuyoshi Nakada <nobu@r...> + + * time.c (time_timeval): rounds subsecond toward zero. + +Mon Jul 13 01:36:54 2009 Nobuyoshi Nakada <nobu@r...> + + * time.c (time_timeval): check out-of-range. [ruby-core:23282] + [Bug #1396] + Thu Jul 9 17:58:03 2009 Nobuyoshi Nakada <nobu@r...> * eval.c (proc_invoke): shares dmethod scope local variables. Index: ruby_1_8_7/version.h =================================================================== --- ruby_1_8_7/version.h (revision 24059) +++ ruby_1_8_7/version.h (revision 24060) @@ -1,15 +1,15 @@ #define RUBY_VERSION "1.8.7" -#define RUBY_RELEASE_DATE "2009-07-09" +#define RUBY_RELEASE_DATE "2009-07-13" #define RUBY_VERSION_CODE 187 -#define RUBY_RELEASE_CODE 20090709 -#define RUBY_PATCHLEVEL 181 +#define RUBY_RELEASE_CODE 20090713 +#define RUBY_PATCHLEVEL 182 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_TEENY 7 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 7 -#define RUBY_RELEASE_DAY 9 +#define RUBY_RELEASE_DAY 13 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/