Commit graph

135 commits

Author SHA1 Message Date
usa
21b3c77441 * time.c (time_asctime): workaround for MSVCRT's bug.
backported from trunk (r18871).  ref [ruby-core:26992]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-02 02:22:19 +00:00
marcandre
ea1b7a9577 * time.c: rdoc fix for <=>
* array.c: ditto

* bignum.c: ditto

* compar.c: ditto

* file.c: ditto

* numeric.c: ditto

* string.c: rdoc fix for <=> and casecmp

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-28 05:01:29 +00:00
nobu
3f0d0b9398 * *.[chy]: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-22 01:00:18 +00:00
akr
b661aa0cc8 * time.c (NUM2TIMET): defined because some platforms, such as
NetBSD5/amd64 and NetBSD6/i386, has time_t which size is different
  from long.  (NetBSD 5 uses 32bit time_t for all, including 64bit,
  platforms.  NetBSD 6 uses 64bit time_t for all, including 32bit,
  platforms.)
  (TIMET2NUM): defined.
  (time_timeval): use NUM2TIMET.
  (time_s_at): ditto.
  (time_to_i): use TIMET2NUM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-06 23:14:32 +00:00
nobu
4e94c36f3d * time.c (time_timeval): rounds subsecond toward zero.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-12 16:18:51 +00:00
nobu
6f1eeb267c * time.c (time_mload): initializes a variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-22 15:19:52 +00:00
nobu
f90333a77a * time.c (time_timeval): check out-of-range. [ruby-core:23282]
[Bug #1396]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-22 11:24:03 +00:00
nahi
49ff3955a7 * time.c: RDoc typo fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 14:48:37 +00:00
nobu
1584d7a7f1 * time.c (time_mdump, time_mload): preserves GMT status.
[ruby-core:19252]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@19742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-10 02:34:02 +00:00
akr
1ef7022310 * time.c: fix rounding negative float.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-27 16:10:46 +00:00
nobu
9ed3d64d1d * suppress warnings on cygwin, mingw and mswin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 19:55:25 +00:00
nobu
1378795e08 * suppress warnings with -Wwrite-string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 09:28:20 +00:00
usa
e412278fdc * time.c: should include <errno.h> to refer errno.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21 01:17:41 +00:00
usa
d369f0671b * time.c (rb_strftime): check errno to detect strftime(3)'s error.
this is workaround for recent version of MSVCRT.
	  [ruby-dev:34456]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21 01:01:50 +00:00
nobu
636089ddbe * time.c (time_arg): use converted object. [ruby-core:14759]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-04 14:08:50 +00:00
matz
0b0046dc2e * time.c (time_succ): Time#succ should return a time object in the
same timezone mode to the original.  [ruby-talk:260256]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-17 23:53:01 +00:00
knu
ddeae36d8e * time.c (time_to_s): Back out the format changes; discussed
in [ruby-dev:30495].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-06 09:36:29 +00:00
knu
4f46294b7d * time.c (time_to_s): Correct the wrong format which did not
really conform to RFC 2822; pointed out by: OHARA Shigeki <os at
  iij.ad.jp> in [ruby-dev:30487].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-05 11:22:47 +00:00
matz
5f66e09590 * time.c (time_dup): duplicate the class of original time.
[ruby-core:09357]

* lib/time.rb (Time::make_time, Time::rfc2822, Time::httpdate):
  should respect subclasses.  [ruby-core:09357]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-31 08:08:46 +00:00
nobu
1252a1e4c3 * time.c (time_to_s): variable declaration after an execution
statement.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 21:48:47 +00:00
matz
60f40519f0 * time.c (time_to_s): make it conform to RFC2822 date format.
[ruby-dev:29467]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 17:32:30 +00:00
nobu
522f83001d * time.c (time_strftime): include nul character. fixed: [ruby-dev:29422]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 12:14:47 +00:00
nobu
b5e187c5f7 * time.c (time_to_s): fixed format mismatch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-27 13:23:18 +00:00
eban
fb7064975a * time.c: need to declare time_utc_offset.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-27 09:14:38 +00:00
matz
e40f75048a * time.c (time_to_s): use +0900 style timezone string for local time.
[ruby-dev:29143]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-27 07:53:18 +00:00
matz
7ee6680318 * time.c (time_mload): a patch from Daniel Berger
<Daniel.Berger at qwest.com>.  [ruby-core:08128]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-06 15:34:04 +00:00
matz
3326cc9e05 * time.c (time_timeval): should round for usec floating
number.  [ruby-core:07896]

* time.c (time_add): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-18 08:54:01 +00:00
usa
d23d055d47 * time.c (time_new_internal): add prototype to tell the compiler
arugments types.

* win32/win32.c (NtInitialize): need to set a handler for VC++8.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-24 02:22:33 +00:00
usa
4b7ecb15d1 * time.c (search_time_t): support non 32bit time_t environments.
* win32/Makefile.sub (config.h): VC++8 has ``long long'' type.

* win32/Makefile.sub (config.h): VC++8's time_t is 64bit value.

* win32/win32.c (rb_w32_utime): drop read-only attribute before
  changing file time.

  all changes are backported from CVS HEAD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-14 05:03:16 +00:00
nobu
e85b4d45a2 * time.c (rb_strftime): removed meaningless volatile modifiers, and
concatenate successive nul characters at once.  [ruby-dev:27472]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-22 04:27:48 +00:00
ocean
b1880a408d * time.c: should use LONG_LONG instead of `long long'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-21 06:33:00 +00:00
nobu
fa50f60316 * eval.c, gc.c, time.c: made internal symbols static. [ruby-dev:27435]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-18 17:36:20 +00:00
nobu
e594bf57d8 * class.c (rb_mod_init_copy, rb_class_init_copy), file.c (rb_stat_init_copy),
numeric.c (num_init_copy), object.c (rb_obj_init_copy, Init_Object),
  re.c (match_init_copy, rb_reg_init_copy), time.c (time_init_copy):
  undocumented.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-28 14:42:46 +00:00
matz
dcd87b140c * string.c (rb_str_new4): should propagate taintedness.
* struct.c (rb_struct_set): use original method name, not callee
  name, to retrieve member slot.  [ruby-core:04268]

* time.c (time_strftime): protect from format modification from GC
  finalizers.

* gc.c (rb_data_object_alloc): klass may be NULL.
  [ruby-list:40498]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-20 09:34:36 +00:00
matz
0cf6e773be * eval.c (eval): warning during eval should not cause deadlock.
[ruby-talk:98651]

* eval.c (rb_eval): raise TypeError exception for superclass
  mismatch.  [ruby-dev:39567]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-14 12:26:22 +00:00
eban
765a1a05dd * time.c (SIZEOF_TIME_T): support SIZEOF_TIME_T == SIZEOF_INT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-30 11:10:51 +00:00
akr
efa746c6bd * configure.in: check the size of time_t.
* time.c (time_add): new function.
  (time_plus): use time_add.
  (time_minus): use time_add.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-06 08:02:56 +00:00
matz
849bc0234a * eval.c (top_include): include in the wrapped load is done for
the wrapper, not for a singleton class for wrapped main.
  [ruby-dev:23305]

* bignum.c (rb_big_eq): use temporary double variable to save the
  result (internal float register may be bigger than 64 bits, for
  example, 80 bits on x86).  [ruby-dev:23311]

* eval.c (block_pass): should generate unique identifier of the
  pushing block.  [ruby-talk:96363]

* ext/socket/socket.c (make_hostent): fix memory leak, based on
  the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-05 07:45:32 +00:00
akr
86203a88ae * time.c (year_leap_p): new function.
(timegm_noleapsecond): ditto.
  (search_time_t): use timegm_noleapsecond instead of
  mktime for first guess.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-31 10:27:58 +00:00
akr
bbf04edb38 * time.c (search_time_t): limit guess range by mktime if it is
available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-30 11:41:39 +00:00
akira
19365eb157 * io.c, re.c, string.c, time.c: fixed up positions of RDocs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-19 12:54:21 +00:00
dave
e8c8800740 Add RDoc for kernel functions, and tidy up
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-30 16:38:32 +00:00
dave
d37aa4ecb5 Add RDoc comments for Time
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-27 06:33:45 +00:00
matz
5eaf7e5816 * gc.c (gc_mark): explicitly check mark recursion levels, instead
of unreliable stack length.

* file.c (path_check_1): honor sticky bits always.
  [ruby-talk:86273]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-28 14:23:33 +00:00
matz
90a88ab9a0 * marshal.c (r_object0): remove unnecessary iv restoration for
USRMARSHAL. [ruby-dev:21582]

* marshal.c (w_object): dump generic instance variables from
  a string from '_dump'.

* variable.c (rb_generic_ivar_table): return 0 if obj's FL_EXIVAR
  is not set.

* time.c (time_dump): copy instance variables to dumped string, to
  be included in the marshaled data.

* bignum.c (rb_big2ulong): add range check to ensure round trip.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-09 17:45:53 +00:00
matz
0b2e94b2ab * pack.c (uv_to_utf8): change message to "out of range", since
negative values are not "too big". [ruby-dev21567]

* marshal.c (w_object): should pass the value of "weak" to
  w_object().  [ruby-dev:21555] and [ruby-dev:21561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-09 06:46:40 +00:00
nobu
38d1922038 * time.c (Init_Time): define initialize. [ruby-dev:21469]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-02 09:20:31 +00:00
matz
10c4bb29b2 * time.c (time_load): restore instance variables (if any) before
loading from marshaled data.

* time.c (time_mdump): new marshal dumper. _dump is still
  available for compatibility.

* time.c (time_mload): new marshal loader.

* marshal.c (w_object): preserve instance variables for objects
  with marshal_dump.

* marshal.c (r_object0): restore instance variables before calling
  marshal_load.

* error.c (rb_warn_m): always return nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-02 08:25:00 +00:00
nobu
8695612caf * marshal.c (w_symbol, w_object): get rid of warnings.
* re.c (rb_memsearch): ditto.

* time.c (time_dump): ditto.

* ext/extmk.rb (extmake): not continue making when extconf.rb
  failed.

* ext/openssl/extconf.rb: check __VA_ARGS__ macro more precisely.

* ext/openssl/ossl.h: remove version.h dependency.

* ext/openssl/ruby_missing.h: ditto.

* lib/mkmf.rb (pkg_config): use --libs output except with
  only-L for other options.  [ruby-list:38099]

* lib/mkmf.rb (create_makefile): separate rule for static
  library from shared object.

* win32/Makefile.sub, bcc32/Makefile.sub, wince/Makefile.sub:
  define exec_prefix and libdir.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-16 14:58:34 +00:00
matz
5dd2b7102c * gcc -Wall clean-up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 18:33:50 +00:00