summaryrefslogtreecommitdiff
path: root/time.c
AgeCommit message (Collapse)Author
2016-12-24time.c: fix type of usec2subsecxnobu
* time.c (usec2subsecx): fix return type, which is a numeric object but not a long int. [ruby-dev:49912] [Bug #13066] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-24time.c: remove debug codenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-24time.c: fix typo in value_insane_pnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-23time.c: inquire suspicious valuesnobu
* time.c (time_arg): dump sec and subsec arguments if subsecx is insane. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-22time.c: inquire suspicious valuesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-21time.c: debug printnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-21time.c: refine num_exact error messagenobu
* time.c (num_exact): show the original argument when conversion failed, instead of intermediate nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-21time.c: use RB_TYPE_Pnobu
* time.c (time_timespec): use RB_TYPE_P instead of switching by TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-19time.c: refine error messagenobu
* time.c (validate_vtm): separate validation failure messages for each members. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05fix vtm_add_offset yday on last day of year.akr
* time.c (vtm_add_offset): Fix yday on last day of year. [ruby-core:72878] [Bug #11994] Fixed by Andrew White. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-12* time.c (time_arg): guard for mswin64 CI.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-08replace fixnum by integer in documents.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-06* time.c (obj2subsecx): subsec might be GC'ed. try to get rid of SEGV on mswinusa
CI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-15* time.c (time_arg): revert r55688 beause it had no effect. retry...usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-15* time.c (time_arg): it seems that this function sometimes causes SEGVusa
on mswin CI, then force to prevent `vtm->subsecx` from GC. this is experimental. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27* time.c: define _DEFAULT_SOURCE because glibc 2.20 depracatesnaruse
_BSD_SOURCE. https://sourceware.org/glibc/wiki/Release/2.20 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-22time.c: add example [ci skip]nobu
* time.c (time_asctime): [DOC] add ctime example, not only asctime. [ruby-core:75126] [Bug #12310] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-23strftime.c: format in Stringnobu
* strftime.c (rb_strftime_with_timespec): append formatted results to the given string with expanding, and also deal with NUL chars. * strftime.c (rb_strftime, rb_strftime_timespec): return formatted string, not the length put in the given buffer. * time.c (rb_strftime_alloc): no longer needs to retry with reallocating buffers. * time.c (time_strftime): no longer needs to split by NUL chars. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-22* time.c (wmul): wrong condition.usa
fixed many test failures on 32bit and LLP64 platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-22* time.c (wdiv, wmod): wdivmod0() assumes the 3rd and the 4th argumentsusa
are valid pointers. maybe checking them in wdivmod0() is better manner, but I guess that passing real dummy pointers may be faster than checking and branching in wdivmod0(). this commit fixes SEGV on 32bit and LLP64 platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-22* time.c (divmodv): void function never returns any value.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21fix typonaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21* time.c (MUL_OVERFLOW_FIXWV_P): defined for FIXWV.naruse
* time.c (wmul): use MUL_OVERFLOW_FIXWV_P and only switch. * time.c (wmul): use mul which has Fixnum optimization. * time.c (rb_time_magnify): If WIDEVALUE_IS_WIDER, wmul() has the same optimized logic, else mul() has also the similar logic for Fixnum. * time.c (rb_time_unmagnify): almost ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21fix typonaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21* time.c (divmodv): add the case both arguments are Fixnum.naruse
* time.c (wquo): use quo which has Fixnum optimization. * time.c (wdivmod0): added for WIDEVALUE_IS_WIDER. * time.c (wdivmod): use wdivmod0 and divmodv. divmodv has Fixnum optimization. * time.c (wdiv): use wdivmod0 and div to avoid the use of divmodv which calls id_quo whose return value is array. * time.c (wmod): use wdivmod0 and mod to avoid the use of divmodv which calls id_quo whose return value is array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21* internal.h (rb_fix_divmod_fix): like r54213, use FIX2NUM only ifnaruse
x == FIXNUM_MIN && y == -1. This must be a rare case and it is expected compiler to handle well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21time.c (quo): fix missing returnnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21fix commit missnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-21* time.c (mod): Add Fixnum case.naruse
* time.c (quo): c can be Fixnum except a == FIXNUM_MIN && b == -1. Such case can be optimized out because quo()'s argument is constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-20time.c (mul): fix missing return.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-20* internal.h (DLONG): defined if long is 32bit (and LONG_LONG is 64bit;naruse
but LONG_LONG is always defined as 64bit), or there's int128_t. * internal.h (DL2NUM): defined if DLONG is defined. * internal.h (rb_fix_mul_fix): defined for `Fixnum * Fixnum`. * insns.def (opt_mul): use rb_fix_mul_fix(). * numeric.c (fix_mul): ditto. * time.c (mul): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-20* time.c (add): remove FIXABLE() which is in LONG2NUM().naruse
* time.c (sub): ditto. * time.c (mul): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-18* time.c (LOCALTIME): organize #ifdefs.naruse
* time.c (GMTIME): define only ifndef HAVE_STRUCT_TM_TM_GMTOFF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-18* configure.in (rb_cv_member_struct_tm_tm_gmtoff): For Linux (glibc)naruse
define _BSD_SOURCE for time.h to define struct tm.tm_gmtoff. * time.c: define _BSD_SOURCE at the top. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-15* time.c: Minor typo in Time#dst? documentation.hsbt
[ci skip][fix GH-1290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-10* time.c (rb_time_timespec_new): swap utc and localtimenaruse
to generate gmt flag by INT_MAX - gmtoff. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-10* time.c (rb_timespec_now): added.naruse
* time.c (rb_time_timespec_new): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-09fix comment: tobj->gmt is 0:localtime 1:utc 2:fixoff 3:initnaruse
see also TIME_UTC_P and TIME_LOCALTIME_P git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28preserve encodings in error messagesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14* time.c (time_getlocaltime): [DOC] Add examples of valid utc_offsetakr
formats. [ruby-core:68306] [Misc #10905] Patch by Charles Korn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-30variable.c: avoid compatibility table with generic ivarsnormal
This recovers and improves performance of Marshal.dump/load on Time objects compared to when we implemented generic ivars entirely using st_table. This also recovers some performance on other generic ivar objects, but does not bring bring Marshal.dump/load performance up to previous speeds. benchmark results: minimum results in each 10 measurements. Execution time (sec) name trunk geniv after marshal_dump_flo 0.343 0.334 0.335 marshal_dump_load_geniv 0.487 0.527 0.495 marshal_dump_load_time 1.262 1.401 1.257 Speedup ratio: compare with the result of `trunk' (greater is better) name geniv after marshal_dump_flo 1.026 1.023 marshal_dump_load_geniv 0.925 0.985 marshal_dump_load_time 0.901 1.004 * include/ruby/intern.h (rb_generic_ivar_table): deprecate * internal.h (rb_attr_delete): declare * marshal.c (has_ivars): use rb_ivar_foreach (w_ivar): ditto (w_object): update for new interface * time.c (time_mload): use rb_attr_delete * variable.c (generic_ivar_delete): implement (rb_ivar_delete): ditto (rb_attr_delete): ditto [ruby-core:69323] [Feature #11170] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23* win32/Makefile.sub: MSVC14 have struct timespec.naruse
* win32/rtname.cmd: support vcruntime140.dll. * time.c (localtime_with_gmtoff_zone): MSVC14 doesn't have tzname and daylight but have _tzname and _daylight. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-24time.c: locale time zone namenobu
* time.c (time_zone_name): should be US-ASCII only if all 7-bits, otherwise locale encoding. [ruby-core:68230] [Bug #10887] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-23zone may be ASCII-8BIT on Windows [Bug #10887]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-22* time.c: zone encoding should be US-ASCII if all 7-bits. Fix r46907.eregon
* test/ruby/test_time.rb, test/ruby/test_time_tz.rb: Update tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-06* time.c (timelocalw): Set tm_isdst field -1 if vtm->isdst isakr
VTM_ISDST_INITVAL. This bug is introduced at packing struct vtm (r45155). [ruby-core:67345] [Bug #10698] Reported by Boris Ruf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01use 0 for reservednobu
use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-27time.c: indentnobu
* time.c (find_time_t): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-27* time.c (time_s_mkutc): [DOC] Time.utc's 10 arguments formakr
doesn't examine wday, yday, isdst and tz. (time_s_mktime): [DOC] Time.mktime's 10 arguments form doesn't examine wday, yday and tz. Suggested by naruse. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e