ruby-changes:22802
From: tadf <ko1@a...>
Date: Wed, 29 Feb 2012 06:18:05 +0900 (JST)
Subject: [ruby-changes:22802] tadf:r34851 (trunk): * ext/date/date_core.c: reverted r34825.
tadf 2012-02-29 06:17:49 +0900 (Wed, 29 Feb 2012) New Revision: 34851 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34851 Log: * ext/date/date_core.c: reverted r34825. Modified files: trunk/ChangeLog trunk/ext/date/date_core.c Index: ChangeLog =================================================================== --- ChangeLog (revision 34850) +++ ChangeLog (revision 34851) @@ -1,3 +1,7 @@ +Wed Feb 29 06:14:51 2012 Tadayoshi Funaba <tadf@d...> + + * ext/date/date_core.c: reverted r34825. + Tue Feb 28 23:20:01 2012 Hiroshi Shirosaki <h.shirosaki@g...> * Makefile.in (PLATFORM_DIR): add a variable for `win32` directory. Index: ext/date/date_core.c =================================================================== --- ext/date/date_core.c (revision 34850) +++ ext/date/date_core.c (revision 34851) @@ -6587,7 +6587,7 @@ #include "date_tmx.h" static void set_tmx(VALUE, struct tmx *); -static VALUE strftimev(VALUE, const char *, VALUE, +static VALUE strftimev(const char *, VALUE, void (*)(VALUE, struct tmx *)); /* @@ -6604,7 +6604,7 @@ static VALUE d_lite_to_s(VALUE self) { - return strftimev(Qnil, "%Y-%m-%d", self, set_tmx); + return strftimev("%Y-%m-%d", self, set_tmx); } #ifndef NDEBUG @@ -6729,7 +6729,7 @@ #define SMALLBUF 100 static size_t -date_strftime_alloc(char **buf, VALUE formatv, const char *format, +date_strftime_alloc(char **buf, const char *format, struct tmx *tmx) { size_t size, len, flen; @@ -6756,7 +6756,6 @@ if (len > 0) break; xfree(*buf); if (size >= 1024 * flen) { - if (!NIL_P(formatv)) rb_sys_fail_str(formatv); rb_sys_fail(format); break; } @@ -6869,7 +6868,7 @@ str = rb_str_new(0, 0); while (p < pe) { - len = date_strftime_alloc(&buf, vfmt, p, &tmx); + len = date_strftime_alloc(&buf, p, &tmx); rb_str_cat(str, buf, len); p += strlen(p); if (buf != buffer) { @@ -6884,7 +6883,7 @@ return str; } else - len = date_strftime_alloc(&buf, vfmt, fmt, &tmx); + len = date_strftime_alloc(&buf, fmt, &tmx); str = rb_str_new(buf, len); if (buf != buffer) xfree(buf); @@ -7078,7 +7077,7 @@ } static VALUE -strftimev(VALUE vfmt, const char *fmt, VALUE self, +strftimev(const char *fmt, VALUE self, void (*func)(VALUE, struct tmx *)) { char buffer[SMALLBUF], *buf = buffer; @@ -7087,7 +7086,7 @@ VALUE str; (*func)(self, &tmx); - len = date_strftime_alloc(&buf, vfmt, fmt, &tmx); + len = date_strftime_alloc(&buf, fmt, &tmx); str = rb_usascii_str_new(buf, len); if (buf != buffer) xfree(buf); return str; @@ -7106,7 +7105,7 @@ static VALUE d_lite_asctime(VALUE self) { - return strftimev(Qnil, "%a %b %e %H:%M:%S %Y", self, set_tmx); + return strftimev("%a %b %e %H:%M:%S %Y", self, set_tmx); } /* @@ -7119,7 +7118,7 @@ static VALUE d_lite_iso8601(VALUE self) { - return strftimev(Qnil, "%Y-%m-%d", self, set_tmx); + return strftimev("%Y-%m-%d", self, set_tmx); } /* @@ -7131,7 +7130,7 @@ static VALUE d_lite_rfc3339(VALUE self) { - return strftimev(Qnil, "%Y-%m-%dT%H:%M:%S%:z", self, set_tmx); + return strftimev("%Y-%m-%dT%H:%M:%S%:z", self, set_tmx); } /* @@ -7144,7 +7143,7 @@ static VALUE d_lite_rfc2822(VALUE self) { - return strftimev(Qnil, "%a, %-d %b %Y %T %z", self, set_tmx); + return strftimev("%a, %-d %b %Y %T %z", self, set_tmx); } /* @@ -7158,7 +7157,7 @@ d_lite_httpdate(VALUE self) { volatile VALUE dup = dup_obj_with_new_offset(self, 0); - return strftimev(Qnil, "%a, %d %b %Y %T GMT", dup, set_tmx); + return strftimev("%a, %d %b %Y %T GMT", dup, set_tmx); } static VALUE @@ -7205,7 +7204,7 @@ get_d1(self); s = jisx0301_date(m_real_local_jd(dat), m_real_year(dat)); - return strftimev(s, RSTRING_PTR(s), self, set_tmx); + return strftimev(RSTRING_PTR(s), self, set_tmx); } #ifndef NDEBUG @@ -8295,7 +8294,7 @@ static VALUE dt_lite_to_s(VALUE self) { - return strftimev(Qnil, "%Y-%m-%dT%H:%M:%S%:z", self, set_tmx); + return strftimev("%Y-%m-%dT%H:%M:%S%:z", self, set_tmx); } /* @@ -8502,7 +8501,7 @@ rb_str_append(fmt, rb_f_sprintf(3, argv)); } rb_str_append(fmt, rb_usascii_str_new2("%:z")); - return strftimev(fmt, RSTRING_PTR(fmt), self, set_tmx); + return strftimev(RSTRING_PTR(fmt), self, set_tmx); } /* @@ -8528,7 +8527,7 @@ if (argc < 1) n = INT2FIX(0); - return f_add(strftimev(Qnil, "%Y-%m-%d", self, set_tmx), + return f_add(strftimev("%Y-%m-%d", self, set_tmx), iso8601_timediv(self, n)); } @@ -8576,7 +8575,7 @@ get_d1(self); s = jisx0301_date(m_real_local_jd(dat), m_real_year(dat)); - return rb_str_append(strftimev(s, RSTRING_PTR(s), self, set_tmx), + return rb_str_append(strftimev(RSTRING_PTR(s), self, set_tmx), iso8601_timediv(self, n)); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/