summaryrefslogtreecommitdiffstats
path: root/time.c
Commit message (Collapse)AuthorAgeFilesLines
* * time.c (time_init_1): unused variable removed.akr2009-05-121-2/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_arg): unused variable removed.akr2009-04-261-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_mload): use TIME_SET_UTC.akr2009-04-251-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add comment.akr2009-04-211-0/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2009-04-211-7/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (find_time_t): constified.nobu2009-04-211-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (leap_year_v_p): removed.akr2009-04-211-7/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@22880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-79/+79
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@22053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz2008-09-051-2/+2
| | | | | | | a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c (rb_strftime): supported %s and %P.shugo2008-08-281-0/+2
| | | | | | | | * time.c (time_strftime): ditto. * test/ruby/test_time.rb (test_strftime): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_asctime): workaround for MSVCRT's bug.usa2008-08-261-0/+4
| | | | | | | | | | | based on a patch from wanabe <s.wanabe AT gmail.com> at [ruby-dev:35831] and a suggestion by KIMURA Koichi <kbk AT kt.rim.or.jp> at [ruby-dev:35832] fixed [ruby-dev:35555] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (gmtime_r): check if reentrant versions are available.nobu2008-08-221-17/+37
| | | | | | | | * time.c (IF_HAVE_GMTIME_R, ASCTIME, GMTIME, LOCALTIME): use reentrant versions if available. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c (rb_strftime): supported %F and %<precision>N.shugo2008-08-211-1/+5
| | | | | | | | | | reverted config.h to ruby.h for Windows. * test/ruby/test_time.rb (TestTime::test_strftime): added tests for %F and %N. * time.c: documented %F and %N. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: removed strftime from AC_REPLACE_FUNCS().shugo2008-08-201-21/+10
| | | | | | | | | | * include/ruby/missing.h: removed prototype for strftime(). * missing/strftime.c: removed. * time.c (time_to_s): use rb_strftime() instead of strftime(3). (time_zone): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c: new file.shugo2008-08-201-5/+13
| | | | | | | | | | * common.mk (COMMONOBJS): added strftime.$(OBJEXT). * time.c (time_strftime): do not use strftime(3). supported %L(millisecond) and %N(nanosecond). * test/ruby/test_time.rb: added tests for %L and %N. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu2008-08-161-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_untrusted): new method Object#untrusted?.shugo2008-08-131-1/+1
| | | | | | | | | | | | | | | (rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_cmp): retry with right hand operand if its not amatz2008-08-131-1/+11
| | | | | | time object. [ruby-dev:35011] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (COMPILE_OPTION_FALSE), time.c (timegm_noleapsecond),nobu2008-07-011-2/+2
| | | | | | | | thread.c (eKillSignal, eTerminateSignal), missing/vsnprintf.c (BSD_vfprintf): constified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: fix rounding negative float.akr2008-06-271-0/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-0/+2
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko12008-06-081-4/+4
| | | | | | | | | | | | | | | | | | | enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings on cygwin, mingw and mswin.nobu2008-06-011-2/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings with -Wwrite-string.nobu2008-05-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (obj2nsec): fix string argument.akr2008-05-041-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_timespec): raise TypeError for nil and other objectsakr2008-05-031-9/+15
| | | | | | | which has no divmod method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (builtin_types), signal.c (siglist), st.c (primes),nobu2008-04-261-1/+1
| | | | | | | struct.c (ref_func), time.c (months): constified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: should include <errno.h> to refer errno.matz2008-04-211-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (rb_strftime): check errno to detect strftime(3)'s error.usa2008-04-211-1/+2
| | | | | | | | | this is workaround for recent version of MSVCRT. [ruby-dev:34456] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix doc.akr2008-03-091-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_strftime): format should be ascii compatible.matz2008-02-291-0/+4
| | | | | | | | | | | | * parse.y (rb_intern3): non ASCII compatible symbols. * re.c (rb_reg_regsub): add encoding check. * string.c (rb_str_chomp_bang): ditto. * test/ruby/test_utf16.rb (TestUTF16::test_chomp): raises exception. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_cmp): Time.<=> no longer supports comparison withnaruse2008-02-021-4/+1
| | | | | | | numeric. [ruby-core#15332] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e