[前][次][番号順一覧][スレッド一覧]

ruby-changes:52742

From: k0kubun <ko1@a...>
Date: Mon, 8 Oct 2018 11:55:11 +0900 (JST)
Subject: [ruby-changes:52742] k0kubun:r64954 (trunk): partially revert r64953

k0kubun	2018-10-08 11:55:06 +0900 (Mon, 08 Oct 2018)

  New Revision: 64954

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64954

  Log:
    partially revert r64953
    
    "expand tabs" is not intended to be applied to strftime.c, because its
    c-file-style is "linux", not "ruby".
    
    It's explicitly excluded to expand tabs
    https://git.ruby-lang.org/ruby-commit-hook.git/tree/svn-utils/bin/auto-style.rb#n195
    but it didn't work.
    I fixed the issue in
    https://git.ruby-lang.org/ruby-commit-hook.git/commit/svn-utils/bin/auto-style.rb?id=844e0d42de11ad4c549bfbdd752a21df2823c18c
    so let me try to revert the strftime.c change to keep the tabs.

  Modified files:
    trunk/strftime.c
Index: strftime.c
===================================================================
--- strftime.c	(revision 64953)
+++ strftime.c	(revision 64954)
@@ -226,8 +226,8 @@ format_value(VALUE val, int base) https://github.com/ruby/ruby/blob/trunk/strftime.c#L226
  */
 static VALUE
 rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
-                          rb_encoding *enc, VALUE time, const struct vtm *vtm,
-                          VALUE timev, struct timespec *ts, int gmt, size_t maxsize)
+			  rb_encoding *enc, VALUE time, const struct vtm *vtm,
+			  VALUE timev, struct timespec *ts, int gmt, size_t maxsize)
 {
 	size_t len = RSTRING_LEN(ftime);
 	char *s = RSTRING_PTR(ftime);
@@ -246,7 +246,7 @@ rb_strftime_with_timespec(VALUE ftime, c https://github.com/ruby/ruby/blob/trunk/strftime.c#L246
 #ifdef MAILHEADER_EXT
 	int sign;
 #endif
-        VALUE zone = Qnil;
+	VALUE zone = Qnil;
 
 	/* various tables, useful in North America */
 	static const char days_l[][10] = {
@@ -318,7 +318,7 @@ rb_strftime_with_timespec(VALUE ftime, c https://github.com/ruby/ruby/blob/trunk/strftime.c#L318
 			len = s - start; \
 			rb_str_set_len(ftime, len); \
 			if (!rb_strftime_with_timespec(ftime, (fmt), rb_strlen_lit(fmt), \
-                                                       enc, time, vtm, timev, ts, gmt, maxsize)) \
+						       enc, time, vtm, timev, ts, gmt, maxsize)) \
 				return 0; \
 			s = RSTRING_PTR(ftime); \
 			i = RSTRING_LEN(ftime) - len; \
@@ -624,10 +624,10 @@ rb_strftime_with_timespec(VALUE ftime, c https://github.com/ruby/ruby/blob/trunk/strftime.c#L624
 			    i = 0;
 			}
 			else {
-                            if (NIL_P(zone)) {
-                                zone = rb_time_zone_abbreviation(vtm->zone, time);
-                            }
-                            tp = RSTRING_PTR(zone);
+			    if (NIL_P(zone)) {
+				zone = rb_time_zone_abbreviation(vtm->zone, time);
+			    }
+			    tp = RSTRING_PTR(zone);
 			    if (enc) {
 				for (i = 0; i < TBUFSIZE && tp[i]; i++) {
 				    if ((unsigned char)tp[i] > 0x7F) {
@@ -917,33 +917,33 @@ strftime_size_limit(size_t format_len) https://github.com/ruby/ruby/blob/trunk/strftime.c#L917
 
 VALUE
 rb_strftime(const char *format, size_t format_len, rb_encoding *enc,
-            VALUE time, const struct vtm *vtm, VALUE timev, int gmt)
+	    VALUE time, const struct vtm *vtm, VALUE timev, int gmt)
 {
 	VALUE result = rb_enc_str_new(0, 0, enc);
 	return rb_strftime_with_timespec(result, format, format_len, enc,
-                                         time, vtm, timev, NULL, gmt,
+					 time, vtm, timev, NULL, gmt,
 					 strftime_size_limit(format_len));
 }
 
 VALUE
 rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc,
-                     VALUE time, const struct vtm *vtm, struct timespec *ts, int gmt)
+		     VALUE time, const struct vtm *vtm, struct timespec *ts, int gmt)
 {
 	VALUE result = rb_enc_str_new(0, 0, enc);
 	return rb_strftime_with_timespec(result, format, format_len, enc,
-                                         time, vtm, Qnil, ts, gmt,
+					 time, vtm, Qnil, ts, gmt,
 					 strftime_size_limit(format_len));
 }
 
 #if 0
 VALUE
 rb_strftime_limit(const char *format, size_t format_len, rb_encoding *enc,
-                  VALUE time, const struct vtm *vtm, struct timespec *ts,
+		  VALUE time, const struct vtm *vtm, struct timespec *ts,
 		  int gmt, size_t maxsize)
 {
 	VALUE result = rb_enc_str_new(0, 0, enc);
 	return rb_strftime_with_timespec(result, format, format_len, enc,
-                                         time, vtm, Qnil, ts, gmt, maxsize);
+					 time, vtm, Qnil, ts, gmt, maxsize);
 }
 #endif
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]