Граф коммитов

279 Коммитов

Автор SHA1 Сообщение Дата
akr 8c7786bf58 * time.c (init_leap_second_info): check the result of
gmtime_with_leapsecond.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-11 14:26:57 +00:00
akr 22ce9f81c3 * time.c (find_time_t): test the result of LOCALTIME.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-10 22:37:40 +00:00
akr cb962c5ae5 * time.c (rb_localtime_r2): fix localtime overflow check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-10 15:45:34 +00:00
akr 094ca0281e * time.c (rb_localtime_r2): refine localtime overflow check for
FreeBSD 6.4.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-10 14:10:25 +00:00
akr 82e646ea7a * time.c (find_time_t): always outerpolate from past.
[ruby-core:30672] reported by Benoit Daloze.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-09 13:54:03 +00:00
akr 2a1d97cc1f * time.c (calc_tm_yday): extracted from timegmw_noleapsecond.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-09 13:13:44 +00:00
nobu 45f6fbf339 * removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 18:51:39 +00:00
marcandre 914efd0b60 * proc.c (proc_lambda, unnamed_parameters): Small documentation fixes.
* re.c: ditto

* string.c: ditto

* time.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:07:46 +00:00
marcandre 7729de4d91 * array.c: Documentation: change => in call-seq to ->.
Harmonize "#=>" in examples. [ruby-core:30206]

* bignum.c: ditto

* class.c: ditto

* compar.c: ditto

* cont.c: ditto

* dir.c: ditto

* encoding.c: ditto

* enum.c: ditto

* enumerator.c: ditto

* error.c: ditto

* eval.c: ditto

* file.c: ditto

* gc.c: ditto

* io.c: ditto

* load.c: ditto

* marshal.c: ditto

* math.c: ditto

* numeric.c: ditto

* object.c: ditto

* pack.c: ditto

* proc.c: ditto

* process.c: ditto

* random.c: ditto

* range.c: ditto

* re.c: ditto

* ruby.c: ditto

* signal.c: ditto

* sprintf.c: ditto

* string.c: ditto

* struct.c: ditto

* thread.c: ditto

* time.c: ditto

* transcode.c: ditto

* variable.c: ditto

* vm_eval.c: ditto

* vm_method.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:07:33 +00:00
akr a00247f57a * time.c (rb_big_abs_find_minbit): use ffs().
* configure.in: check ffs().

* missing/ffs.c: new file.

* include/ruby/missing.h (ffs): declared.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-12 13:23:20 +00:00
usa c76b8fcac1 * time.c (rb_big_abs_find_minbit): get rid of a warning of VC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-10 05:13:56 +00:00
nobu fadc3a8bbc * time.c (rb_localtime_r2): get rid of infinite loop bug of
localtime() on x86_64-darwin.  [ruby-core:30031]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-06 08:16:45 +00:00
usa f6a5c0fae2 * time.c (TIMET_MAX): should be time_t, not unsigned_time_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-29 19:10:00 +00:00
usa 3543491916 * time.c (rb_time_unmagnify_to_float): should cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-29 18:59:18 +00:00
nobu f510d9f3c4 * time.c (time_timespec): use rb_check_funcall.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28 09:04:51 +00:00
akr 8f8e4e5ab5 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-11 06:56:28 +00:00
akr 082480dfe4 * time.c (ASCTIME): unused macro removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-07 12:45:02 +00:00
akr 2bbeb4c0ad * configure.in: test localtime(3) overflow. [ruby-dev:40910]
* time.c (rb_gmtime_r): renamed from rb_gmtime.
  (rb_localtime_r): renamed from rb_localtime.
  (rb_localtime_r2): call rb_localtime_r and validate the result if
  there is overflow problem.
  (rb_gmtime_r2): call rb_gmtime_r and validate the result if there
  is overflow problem.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-06 13:03:43 +00:00
akr 782e379f29 * time.c (cmp): optimize for fixnums.
(lt): use cmp.
  (gt): ditto.
  (le): ditto.
  (ge): ditto.
  (wlt): use wcmp.
  (wgt): ditto.
  (wle): ditto.
  (wge): ditto.
  (time_subsec): use wmod.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-04 13:20:29 +00:00
akr 9c50406bd5 * time.c (lt): call <=> instead of <.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-04 00:45:02 +00:00
akr 8587c246e9 * time.c: don't define STRUCT_WIDEVAL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-03 13:48:37 +00:00
akr c97f5f514a * time.c (rb_big_abs_find_minbit): fix handling the last word.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-31 19:56:04 +00:00
akr e758c3fbce * time.c (long_mul): overflow condition changed.
(wi_mul): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-31 19:31:08 +00:00
akr 6024074540 * time.c (long_mul): extracted from mul and avoid integer overflow.
(wi_mul): extracted from wmul and avoid integer overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-31 14:35:13 +00:00
akr fbc42054e8 * time.c: less bignum allocations.
* strftime.c (rb_strftime_timespec): defined to avoid rational for
  nano second resolution time.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-31 12:34:31 +00:00
akr 0da3fc65db * time.c (timew2timespec): fix previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 21:57:53 +00:00
akr 7b83aa4f3c * time.c (wdivmod): renamed from wdivmodv. fix neg/pos and pos/neg.
(split_second): return number of seconds as wideval_t.
  (timet2wv): new function.
  (wv2timet): new function.
  (timet2wideval): removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 15:34:33 +00:00
akr 39146c6b6b * time.c: use more polymorphic operations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 13:25:57 +00:00
akr c4845fdf36 * time.c: reorder wide value implementation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 13:07:48 +00:00
akr 08f828002b * time.c: make wide value more polymorphic.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 12:58:34 +00:00
akr 0cf5d3fa96 fix previous commit for LP64.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 12:00:31 +00:00
akr a00c1c00c1 * time.c (w2v): renamed from w2xv.
(v2w): renamed from xv2w.
  (rb_time_magnify): takes wideval_t.
  (rb_time_unmagnify): returns wideval_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 11:57:03 +00:00
akr 6c7edcb00a update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 00:12:21 +00:00
akr 33d1647252 * time.c: wide value condition changed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-29 10:47:00 +00:00
akr d8cc6ccb56 * time.c (rb_time_magnify): fix for LP64.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-28 01:13:00 +00:00
akr c08277c62d * time.c: rename small integer specialization related identifiers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-28 00:54:29 +00:00
akr 86aa8f3f0f * time.c (weq): optimize for small integer.
(wne): ditto.
  (wlt): ditto.
  (wgt): ditto.
  (wle): ditto.
  (wge): ditto.
  (rb_time_magnify): ditto.
  (rb_time_unmagnify): ditto.
  (rb_time_unmagnify_to_float): new function to avoid rational for
  Time#to_f and Time#-.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27 23:24:20 +00:00
akr 075cbd2ad6 * time.c (mul): condition refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27 22:14:23 +00:00
akr f0aa9838a2 * time.c: fix previos commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27 17:14:13 +00:00
akr cea57f8fff * time.c: use 64bit arithmetic even on platforms with 32bit VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27 14:18:08 +00:00
akr 7c269e72ef * time.c (time_round): new method Time#round. [ruby-dev:40595]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-11 13:39:12 +00:00
akr 795b03c71c * time.c (time_add): propagate fixed time offset.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-15 13:21:10 +00:00
nobu b3085ba508 * time.c (time_mdump, time_mload): dump/load utc_offset.
[ruby-dev:40063]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 15:37:45 +00:00
nobu 572c266e05 * time.c (quo, time_mdump): use RRATIONAL().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 15:29:15 +00:00
akr 85518db978 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 14:51:39 +00:00
akr 1d674dc547 * time.c (time_mload): add submicro into vtm.subsecx. [ruby-dev:40133]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-22 12:08:02 +00:00
akr 4bf4ddb693 * time.c (time_to_r): convert to rational if internal representation
is not rational.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13 23:51:16 +00:00
akr 49ab7b4238 update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13 19:49:39 +00:00
akr d5a96ece85 * time.c (time_mdump): use nano_num and nano_den instead of subnano to
avoid Rational class in marshaled data which prevent unmarshal by
  Ruby 1.8.
  (time_mload): use nano_num and nano_den.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13 19:04:17 +00:00
matz 2c2cf71b04 * time.c (num_exact): should not accept strings as operands, even
though they respond to #to_r.  ideally, strict rational
  conversion should be done by a method like #to_rational, not #to_r.
  [ruby-core:23729]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-04 07:37:10 +00:00