ruby-changes:19323
From: tadf <ko1@a...>
Date: Wed, 27 Apr 2011 01:28:24 +0900 (JST)
Subject: [ruby-changes:19323] Ruby:r31363 (trunk): * ext/date/date_core.c (date_zone_to_diff): renamed.
tadf 2011-04-27 01:23:05 +0900 (Wed, 27 Apr 2011) New Revision: 31363 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31363 Log: * ext/date/date_core.c (date_zone_to_diff): renamed. * ext/date/date_parse.c: ditto. * ext/date/date_strptime.c: ditto. Modified files: trunk/ChangeLog trunk/ext/date/date_core.c trunk/ext/date/date_parse.c trunk/ext/date/date_strptime.c Index: ChangeLog =================================================================== --- ChangeLog (revision 31362) +++ ChangeLog (revision 31363) @@ -1,3 +1,9 @@ +Wed Apr 27 01:20:59 2011 Tadayoshi Funaba <tadf@d...> + + * ext/date/date_core.c (date_zone_to_diff): renamed. + * ext/date/date_parse.c: ditto. + * ext/date/date_strptime.c: ditto. + Wed Apr 27 01:16:59 2011 Nobuyoshi Nakada <nobu@r...> * encoding.c (enc_find): accept Encoding objects. Index: ext/date/date_strptime.c =================================================================== --- ext/date/date_strptime.c (revision 31362) +++ ext/date/date_strptime.c (revision 31363) @@ -150,6 +150,8 @@ si += l; \ } +VALUE date_zone_to_diff(VALUE); + static size_t date__strptime_internal(const char *str, size_t slen, const char *fmt, size_t flen, VALUE hash) @@ -567,7 +569,6 @@ ")"; static VALUE pat = Qnil; VALUE m, b; - VALUE zone_to_diff(VALUE s); if (NIL_P(pat)) { pat = rb_reg_new(pat_source, sizeof pat_source - 1, @@ -584,7 +585,7 @@ s = f_aref(m, INT2FIX(1)); l = f_end(m, INT2FIX(0)); - o = zone_to_diff(s); + o = date_zone_to_diff(s); si += NUM2LONG(l); set_hash("zone", s); set_hash("offset", o); Index: ext/date/date_core.c =================================================================== --- ext/date/date_core.c (revision 31362) +++ ext/date/date_core.c (revision 31363) @@ -591,6 +591,12 @@ return (int)MOD(jd + 1, 7); } +VALUE +date_zone_to_diff(VALUE s) +{ + return rb_funcall(cDate, rb_intern("zone_to_diff"), 1, s); +} + static int daydiff_to_sec(VALUE vof, int *rof) { @@ -635,7 +641,7 @@ } case T_STRING: { - VALUE vs = rb_funcall(cDate, rb_intern("zone_to_diff"), 1, vof); + VALUE vs = date_zone_to_diff(vof); int n; if (!FIXNUM_P(vs)) @@ -1472,12 +1478,6 @@ } VALUE -zone_to_diff(VALUE s) -{ - return rb_funcall(cDate, rb_intern("zone_to_diff"), 1, s); -} - -VALUE date__strptime(const char *str, size_t slen, const char *fmt, size_t flen, VALUE hash); Index: ext/date/date_parse.c =================================================================== --- ext/date/date_parse.c (revision 31362) +++ ext/date/date_parse.c (revision 31363) @@ -914,6 +914,8 @@ return v; } +VALUE date_zone_to_diff(VALUE); + static int parse_ddd_cb(VALUE m, VALUE hash) { @@ -1080,7 +1082,6 @@ f_expt(INT2FIX(10), LONG2NUM(l4)))); } if (!NIL_P(s5)) { - VALUE zone_to_diff(VALUE s); cs5 = RSTRING_PTR(s5); l5 = RSTRING_LEN(s5); @@ -1108,7 +1109,7 @@ set_hash("zone", zone); if (isdigit(*s1)) *--s1 = '+'; - set_hash("offset", zone_to_diff(rb_str_new2(s1))); + set_hash("offset", date_zone_to_diff(rb_str_new2(s1))); } } @@ -1231,7 +1232,6 @@ VALUE date__parse(VALUE str, VALUE comp) { - VALUE zone_to_diff(VALUE s); VALUE backref, hash; backref = rb_backref_get(); @@ -1325,7 +1325,7 @@ { VALUE zone = ref_hash("zone"); if (!NIL_P(zone) && NIL_P(ref_hash("offset"))) - set_hash("offset", zone_to_diff(zone)); + set_hash("offset", date_zone_to_diff(zone)); } rb_backref_set(backref); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/