summaryrefslogtreecommitdiff
path: root/time.c
Commit message (Collapse)AuthorAgeFilesLines
* * time.c (time_mdump): error message refined.akr2009-09-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (rb_time_timeval, rb_time_timespec): typed.nobu2009-09-091-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_data_type): typed.nobu2009-09-091-10/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (find_time_t): use mktime for the first guess.akr2009-08-301-0/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (add): shortcut implemented for fixnums.akr2009-08-301-9/+27
| | | | | | | | (sub): ditto. (mul): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (eq): apply RTEST.akr2009-08-301-6/+40
| | | | | | | | | | | (ne): ditto. (add): avoid method dispatch for bignums. (sub): ditto. (mul): ditto. (mod): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * timev.h (TIME_SCALE): defined as 1000000000.akr2009-08-291-145/+164
| | | | | | | | | | | | | (struct vtm): subsec is replaced by subsecx. subsec * TIME_SCALE == subsecx. * time.c: avoid rational in most cases. (struct time_object): timev is replaced by timexv. timev * TIME_SCALE == timexv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (init_leap_second_info): use TIMET_MAX.akr2009-08-291-11/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (init_leap_second_info): checks the result of gmtime tonobu2009-07-221-0/+1
| | | | | | | suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_timespec): rounds subsecond toward zero.nobu2009-07-121-12/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (find_time_t): fix Time.local(2009,2,31) failure on 64bitakr2009-07-051-10/+58
| | | | | | | time_t environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (find_time_t): less number of guesses for hh:mm:60.akr2009-07-031-2/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (find_time_t): time guess strategy refined again.akr2009-07-021-115/+45
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress a warning.akr2009-07-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (find_time_t): time guess strategy refined.akr2009-07-021-109/+140
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (num_exact): rb_check_to_integer() can deal with both ofnobu2009-07-011-5/+2
| | | | | | | Fixnum and Bignum together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (num_exact): use to_r for T_FLOAT.akr2009-07-011-48/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (quo): return an integer if possible.akr2009-07-011-1/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* unused variable removed.akr2009-07-011-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_time_num_new): declared.akr2009-07-011-7/+29
| | | | | | | | | | | | | | * time.c (nsec2timev): extracted from time_new_internal. (time_new_internal): change argument to VALUE. (rb_time_new): follow the argument change. (rb_time_nano_new): ditto. (rb_time_num_new): new function. * ext/socket/ancdata.c (ancillary_timestamp): use rb_time_num_new to represent struct bintime preciously. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_s_now): new function. Time.now don't take arguments.akr2009-06-241-1/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_strftime): update RDoc according to info frommatz2009-05-271-0/+15
| | | | | | Marc-Andre Lafortune in [ruby-core:23575]. [ruby-core:23564] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (rb_gmtime, rb_localtime): gmtime and localtime returnnobu2009-05-251-2/+18
| | | | | | | NULL on error. [ruby-core:23551] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_minus): always return a Float. [ruby-dev:38446]mame2009-05-191-1/+26
| | | | | | | * time.c (time_to_r): new method. [ruby-dev:38461] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_init_1): unused variable removed.akr2009-05-121-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: support fixed UTC offset. [ruby-dev:38326]akr2009-05-121-39/+405
| | | | | | | | | | | | | | | | | | | | | | | | (leap_year_v_p): new macro. (TIME_FIXOFF_P): new macro. (TIME_SET_FIXOFF): new macro. (time_init_0): renamed from time_init. (time_set_utc_offset): new function. (vtm_add_offset): new function. (utc_offset_arg): new function. (time_init_1): new function. (time_init): call time_init_0 or time_init_1 according argc. (validate_utc_offset): new function. (time_localtime_m): new function. (time_fixoff): new function. (time_getlocaltime): take optional UTC offset argument. (time_get_tm): support fixed UTC offset time. (Init_Time): make Time#{initialize,localtime,getlocal} varargs. * strftime.c (rb_strftime): vtm->zone can be NULL now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_arg): unused variable removed.akr2009-04-261-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (month_arg): extracted from time_arg.akr2009-04-251-30/+44
| | | | | | | (validate_vtm): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (TIME_COPY_GMT): new macro.akr2009-04-251-2/+4
| | | | | | | | (time_s_at): use TIME_COPY_GMT. (time_succ): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_mload): use TIME_SET_UTC.akr2009-04-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_get_tm): take time_object instead of gmt.akr2009-04-251-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_succ): refactored to avoid gmt variable.akr2009-04-251-7/+6
| | | | | | | | | (strftimev): use TIME_UTC_P. (time_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (TIME_UTC_P): new macro..akr2009-04-251-63/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (TIME_SET_UTC): ditto. (TIME_LOCALTIME_P): ditto. (TIME_SET_LOCALTIME): ditto. (time_utc_p): use the above macro. (time_localtime): ditto. (time_localtime): ditto. (time_gmtime): ditto. (time_to_s): ditto. (time_add): ditto. (time_sec): ditto. (time_min): ditto. (time_hour): ditto. (time_mday): ditto. (time_mon): ditto. (time_year): ditto. (time_wday): ditto. (wday_p): ditto. (time_yday): ditto. (time_isdst): ditto. (time_zone): ditto. (time_utc_offset): ditto. (time_to_a): ditto. (strftimev): ditto. (time_strftime): ditto. (time_mdump): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_timespec): check out-of-range. [ruby-core:23282]nobu2009-04-221-1/+8
| | | | | | | [Bug #1396] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (GMTIME, LOCALTIME): should set result if not have *_r().usa2009-04-221-3/+3
| | | | | | | | * time.c (localtime_with_gmtoff): now always needed tmbuf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (glob_helper): C99(gcc)-ism.usa2009-04-221-1/+1
| | | | | | | | | * time.c (find_time_t): GUESS macro needs the variable named ``result'' always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (localtime_with_gmtoff): fixed cross function jump.nobu2009-04-221-10/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add comment.akr2009-04-211-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2009-04-211-7/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_arg): use the year argument as-is. [ruby-dev:38194]akr2009-04-211-16/+1
| | | | | | | | * lib/time.rb (Time.parse): interpret small year 0..99 as 1950..2049. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (find_time_t): constified.nobu2009-04-211-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (leap_year_v_p): removed.akr2009-04-211-7/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: remove time_t restriction from Time class.akr2009-04-211-445/+1366
| | | | | | | | | | | | | | * timev.h: new file to define struct vtm. * strftime.c: format struct vtm instead of struct tm. * ext/syck/rubyext.c (mktime_do): don't use time_t; [ruby-dev:38191] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_cmp): negate the result of reverse comparison.akr2009-03-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_timespec): use NUM2TIMET.akr2009-03-231-4/+4
| | | | | | | | (time_s_at): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_mload): don't clear tm_mday.akr2009-03-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_to_i, time_hash): time_t may be bigger than longnobu2009-03-101-8/+19
| | | | | | | | | | | | and int. * time.c (time_timeval, rb_time_timeval, obj2nsec, time_strftime), (time_mdump, time_mload): suppress warnings. * win32/Makefile.sub (config.h): added TIMET2NUM and NUM2TIMET. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-79/+79
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame2009-02-141-1/+1
| | | | | | | | | | | | include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784] * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash), string.c (rb_str_hsah), object.c (rb_obj_hash), range.c (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash), rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (LOCALTIME): should call tzset() before localtime_r().matz2009-02-041-1/+1
| | | | | | [ruby-dev:37896] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e