Граф коммитов

33 Коммитов

Автор SHA1 Сообщение Дата
akr f64e076260 * time.c: support fixed UTC offset. [ruby-dev:38326]
(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
2009-05-12 12:07:49 +00:00
nobu d5704eb61a * time.c (localtime_with_gmtoff): fixed cross function jump.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-22 00:27:33 +00:00
akr 3bc16f62c1 * time.c: remove time_t restriction from Time class.
* 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
2009-04-21 14:56:59 +00:00
nobu 22cde7b682 * dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
  instead of strcpy, strncpy and sprintf.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 01:29:17 +00:00
nobu d1abc53721 * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c,
  transcode_data.h, util.c, variable.c, vm_dump.c,
  include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c:
  suppress VC type warnings.  [ruby-core:22726]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-12 09:16:15 +00:00
nobu 12d2c8ba41 stripped trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 14:23:33 +00:00
akr 6fcaf92943 * strftime.c (rb_strftime): use locale insensitive functions for tr_TR
locale.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 10:13:11 +00:00
tadf 24a6416355 * strftime.c (rb_strftime): should add padding for %%.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 12:43:05 +00:00
matz b0f3bd5d25 * strftime.c (STRFTIME): use rb_strftime() recursively, instead of
platform's strftime().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-26 14:30:25 +00:00
matz 6099790621 * strftime.c (STRFTIME): should add padding for %[xXrR] etc.
[ruby-dev:37185] fix: #792

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-25 15:28:22 +00:00
matz 446ea127c3 * strftime.c (rb_strftime): should not swallow incomplete
formatter, e.g. "%E".  [ruby-dev:37170] fix: #787

* strftime.c (rb_strftime): clear flags before processing unknown
  formatter, e.g. "%i".  [ruby-dev:37180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-25 14:24:47 +00:00
matz a689e57283 * strftime.c (rb_strftime): "%^P" should convert to upper case.
[ruby-dev:37180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-25 04:42:11 +00:00
matz 15b183c218 * strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
[ruby-dev:37168]  fix: #768

* strftime.c (rb_strftime): %s to use zero padding by default.
  [ruby-dev:37180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-25 00:24:01 +00:00
shugo 361a713f96 * strftime.c (rb_strftime): The # flag should work with %a, %A, %b,
%B, and %h.  [ruby-dev:37162]
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 14:29:37 +00:00
shugo bf1d53e2e0 * strftime.c (rb_strftime): A width specifier for %t and %n should
work.  [ruby-dev:37160]
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 14:01:47 +00:00
shugo aa498028b2 * strftime.c (rb_strftime): The precision of %0N should be 9.
[ruby-dev:37156]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 13:10:07 +00:00
shugo 32aed81046 * strftime.c (rb_strftime): The default precision should be 1, not
0.  [ruby-dev:37155]
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 12:42:45 +00:00
nobu 893af1e3b6 * strftime.c (rb_strftime): suppressed warnings on cygwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-12 00:46:59 +00:00
yugui a8c3540b32 * dln.c: Ruby no longer supports Windows CE.
* eval.c: ditto.

* include/ruby/defines.h: ditto.

* include/ruby/win32.h: ditto.

* ruby.c: ditto.

* strftime.c: ditto.

* win32/Makefile.sub: ditto.

* win32/win32.c: ditto.

* ext/tk/extconf.rb: ditto.

* lib/fileutils.rb: ditto.

* test/fileutils/test_fileutils.rb: ditto.

* wince/*: removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:48:20 +00:00
yugui ae7ea3332b * dln.c: Ruby no longer supports MS-DOS.
* ext/sdbm/_sdbm.c: ditto.

* ext/sdbm/sdbm.h: ditto.

* gc.c: ditto.

* hash.c: ditto.

* include/ruby/defines.h: ditto.

* include/ruby/util.h: ditto.

* io.c: ditto.

* process.c: ditto.

* ruby.c: ditto.

* strftime.c: ditto.

* util.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:33:22 +00:00
usa d4c5212794 * strftime.c (rb_strftime): calc timezone offset by myself if system
doesn't provide timezone info.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31 17:58:13 +00:00
shugo 63846d48a9 * strftime.c (rb_strftime): supported %s and %P.
* time.c (time_strftime): ditto.
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28 17:06:20 +00:00
shugo 77d7a80f97 * strftime.c (rb_strftime): fixed a bug of padding.
* test/ruby/test_time.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28 15:54:44 +00:00
shugo 6a7481c38d * strftime.c (rb_strftime): Time.mktime(2000).strftime("%-S") should
return "0", not "".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28 15:01:07 +00:00
nobu e6770d9407 * strftime.c (daylight, timezone): not provied as dllexport on cygwin,
right now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 23:03:44 +00:00
nobu 5378f8e5b1 * strftime.c (rb_strftime): support more flags.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 08:06:59 +00:00
nobu ce2b7d3a58 * strftime.c (rb_strftime): supported flags and precision for most
conversions.  [ruby-dev:35906]

* lib/date/format.rb (Date#strftime): left-justifies %L and %N.
  [ruby-dev:35909]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 05:28:08 +00:00
shugo a0cc5b19b7 * strftime.c (rb_strftime): supported %F and %<precision>N.
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 14:57:35 +00:00
shugo a0e3fe5d7c * strftime.c: include ruby/config.h instead of ruby/ruby.h.
* common.mk: removed the old rule for missing/strftime.c.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 05:28:25 +00:00
shugo 9b4d4a8a48 * strftime.c (rb_strftime): return "UTC" instead of "GMT".
* test/ruby/test_time.rb (test_strftime): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 00:30:28 +00:00
shugo 65337c5b2d * configure.in: always check timezone().
* strftime.c (rb_strftime): prefer timezone/altzone rather than
  gettimeofday().  The second argument to gettimeofday() is ignored
  on Solaris.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 17:08:36 +00:00
usa 22c4bdcd18 * strftime.c: win32 support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 15:50:21 +00:00
shugo 1fd1e0ac04 * strftime.c: new file.
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 15:30:28 +00:00