aboutsummaryrefslogtreecommitdiffstats
path: root/time.c
Commit message (Collapse)AuthorAgeFilesLines
* Unused variable removed.akr2013-06-111-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (validate_integer_pack_format): Don't require a word orderakr2013-06-111-2/+2
| | | | | | | | | | | | | | flag if numwords is 1 or less. (absint_numwords_generic): Don't specify a word order for rb_integer_pack. * hash.c (rb_hash): Ditto. * time.c (v2w_bignum): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_integer_pack): Returns sign instead of words.akr2013-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | (absint_numwords_generic): Follow the above change. (big2str_base_powerof2): Follow the above change. * internal.h: Ditto. * hash.c (rb_hash): Ditto. * pack.c (pack_pack): Ditto. * random.c (int_pair_to_real_inclusive): Ditto. (rand_init): Ditto. (random_load): Ditto. (limited_big_rand): Ditto. * time.c (v2w_bignum): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_integer_pack): numwords_allocated argument removed.akr2013-06-091-1/+1
| | | | | | | | | | | | | | | | | | * internal.h (rb_integer_pack): Follow the above change. * hash.c (rb_hash): Ditto. * time.c (v2w_bignum): Ditto. * pack.c (pack_pack): Ditto. * random.c (int_pair_to_real_inclusive): Ditto. (rand_init): Ditto. (random_load): Ditto. (limited_big_rand): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (v2w): Use rb_absint_size instead of RBIGNUM_LEN.akr2013-06-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (v2w_bignum): Simplified using rb_integer_pack.akr2013-06-081-37/+14
| | | | | | | | (rb_big_abs_find_maxbit): Removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_absint_singlebit_p): New function.akr2013-06-081-21/+1
| | | | | | | | | | | | * internal.h (rb_absint_singlebit_p): Declared. * time.c (v2w_bignum): Use rb_absint_singlebit_p instead of rb_big_abs_find_minbit. (rb_big_abs_find_minbit): Removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (rb_big_abs_find_maxbit): Use rb_absint_size.akr2013-06-081-36/+9
| | | | | | | | (bdigit_find_maxbit): Removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos. Patch by k_takata.ktsj2013-05-191-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (localtime_with_gmtoff_zone): musl libc may return NULL forakr2013-05-011-1/+4
| | | | | | | | tm_zone. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_strftime): Describe %L and %N truncates digits underakr2013-04-041-0/+3
| | | | | | | | the specified length. [ruby-core:52130] [Bug #7829] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timev.h: move time_t stuffsnobu2013-03-301-21/+0
| | | | | | | | * timev.h (TYPEOF_TIMEVAL_TV_SEC, unsigned_time_t): move from time.c. * thread.c: use definitions in timev.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: format specifiers for time_tnobu2013-03-301-1/+1
| | | | | | | | * thread.c (sleep_timeval): fix format specifiers for time_t. * time.c (DEBUG_REPORT_GUESSRANGE): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (num_exact): use to_r method only if to_int method isakr2013-03-271-1/+3
| | | | | | | | | available. [ruby-core:53764] [Bug #8173] reported by Hiro Asari. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: Define TIMET_MAX and TIMET_MIN here.akr2013-03-261-3/+0
| | | | | | | | | | | | | | * time.c: Remove TIMET_MAX and TIMET_MIN definitions. * thread.c: Ditto. * thread_pthread.c: Remove TIMET_MAX definition. * thread_win32.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2013-03-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check struct timeval exist or not.kosaki2013-03-161-0/+4
| | | | | | | | | | | | | * include/ruby/missing.h (struct timeval): check HAVE_STRUCT_TIMEVAL properly. and don't include sys/time.h if struct timeval exist. * file.c: include sys/time.h explicitly. * random.c: ditto. * thread_pthread.c: ditto. * time.c: ditto. * ext/date/date_strftime.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: check re-initializenobu2013-03-151-7/+35
| | | | | | | | | * time.c (GetTimeval): check if already initialized instance. * time.c (GetNewTimeval): check if newly created instance. * time.c (time_init_0, time_init_1, time_init_copy, time_mload): must be newly created instance. [ruby-core:53436] [Bug #8099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Document #<=> return values and formattingzzak2013-02-231-4/+6
| | | | | | | | | | | | | * bignum.c: ditto * file.c: ditto * object.c: ditto * numeric.c: ditto * rational.c: ditto * string.c: ditto * time.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compar.c: inversed comarison without infinite recursionnobu2013-02-171-6/+1
| | | | | | | | | * compar.c (rb_invcmp): compare by inversed comarison, with preventing from infinite recursion. [ruby-core:52305] [Bug #7870] * string.c (rb_str_cmp_m), time.c (time_cmp): get rid of infinite recursion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: st_updatenobu2012-12-121-10/+16
| | | | | | * time.c (zone_str): lookup or insert by using st_update() at once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_mdump): dump timezone string to private instance variablenaruse2012-12-071-2/+10
| | | | | | | | | on marshaling. * time.c (time_mload): load timezone string from private instance variable named 'zone'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c, vm_method.c: update rdocnobu2012-12-011-22/+4
| | | | | | | | * time.c (time_{mdump,dump,mload,load): update rdoc. * vm_method.c (obj_respond_to_missing): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c, time.c: make marshal methods privatenobu2012-12-011-4/+4
| | | | | | | | * complex.c (Init_Complex), time.c (Init_Time): make marshal methods private. [Feature #6539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: Documentation improvements, grammar and formattingzzak2012-11-301-149/+157
| | | | | | | Patch by Bernd Homuth [ruby-core:49203] [Bug #7326] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_sec): Remove extra wording about leap seconds and referdrbrain2012-07-301-5/+4
| | | | | | | | directly to Wikipedia's leap second page for further information. [Bug #6749] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_sec): Updated description of leap seconds for accuracy.drbrain2012-07-231-4/+6
| | | | | | | Based on patch by Marcus Stollsteimer. [Bug #6749] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (timew_out_of_timet_range): specialization forakr2012-07-021-0/+13
| | | | | | | | SIZEOF_TIME_T == SIZEOF_INT64_T. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (init_leap_second_info): fix non-ANSI function declaration.kosaki2012-06-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* obj_init_copynobu2012-06-051-2/+1
| | | | | | * object.c (rb_obj_init_copy): should check if trusted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* utc offset in secondsnobu2012-05-301-10/+19
| | | | | | | | * time.c (utc_offset_arg): utc offset can be precision in seconds. e.g. old Europe/Lisbon (c.f. [ruby-dev:40066]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* re-modifiedtadf2012-05-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: modified doc.tadf2012-05-261-1/+1
| | | | | | | * ext/date/date_core.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_init_1): Time.new will accept seconds as string ornobu2012-03-241-8/+2
| | | | | | int. [ruby-core:43569][Bug #6193] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* typo fix.akr2012-03-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2012-03-091-4/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c, process.c, time.c, ext: use rb_sys_fail_str instead ofnobu2012-02-271-4/+6
| | | | | | | rb_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2012-02-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2012-02-111-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2011-11-191-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too.akr2011-11-191-1/+4
| | | | | | | | | patch by Tomoyuki Chikanaga. [ruby-dev:44827] [Bug #5586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * whitespace cleanup.nobu2011-11-041-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (Init_Time): Remove editorial comments from Timedrbrain2011-10-061-8/+7
| | | | | | | documentation, fix link. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (Init_Time): Improve Time documentation. Patch by Shanedrbrain2011-10-061-14/+78
| | | | | | | | | Emmons. [Ruby 1.9 - Bug #5404] * lib/time.rb: Improve time.rb documentation including Time.strptime. Patch by Shane Emmons. [Ruby 1.9 - Bug #5402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-16/+16
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2011-09-091-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_strftime_timespec): moved from time.c and define onlynaruse2011-08-271-7/+0
| | | | | | | | if ruby/encoding.h is included. * internal.h (rb_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_strftime_timespec): move to time.c because it dependsnaruse2011-08-271-0/+3
| | | | | | encoding.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c (rb_strftime_with_timespec): get enc argument to specifynaruse2011-08-271-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | the encoding of the format. On Windows (at least Japanese Windows), Time#strftime("%Z") includes non ASCII in locale encoding (CP932). So convert locale to default internal. [ruby-core:39092] [Bug #5226] * strftime.c (rb_strftime): ditto. * strftime.c (rb_strftime_timespec): ditto. * internal.h (rb_strftime_timespec): follow above. * time.c (rb_strftime_alloc): ditto. * time.c (strftimev): ditto. * time.c (time_strftime): ditto. * time.c (time_to_s): the resulted string of Time#to_s is always ascii only, so this should be US-ASCII. * time.c (time_asctime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (strftimev): Make Time#to_s default to US-ASCII encoding buttenderlove2011-08-251-0/+2
| | | | | | | respect Encoding.default_internal. [ruby-core:39092] * test/ruby/test_time.rb (class TestTime): Corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e